Skip to content

#[\Deprecated] does not work for __call() and __callStatic() #17597

@TimWolla

Description

@TimWolla

Description

The following code:

<?php

class Clazz {
	#[\Deprecated]
	function __call(string $name, array $params) {
	}

	#[\Deprecated("due to some reason")]
	static function __callStatic(string $name, array $params) {
	}
}

$cls = new Clazz();
$cls->test();
Clazz::test2();

?>

Resulted in this output:

But I expected this output instead:

Deprecated: Method Clazz::test() is deprecated in %s

Deprecated: Method Clazz::test2() is deprecated, due to some reason in %s on line %d

PHP Version

PHP 8.4.3

Operating System

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions