php-src/Zend/tests/attributes/deprecated/functions/magic_call.phpt
Tim Düsterhus f37b165403
Fix #[\Deprecated] for __call() and __callStatic() (#17592)
* Fix `#[\Deprecated]` for `__call()` and `__callStatic()`

Fixes php/php-src#17597.

* Do not duplicate the `attributes` table in `zend_get_call_trampoline_func()`
2025-01-27 13:41:41 +01:00

24 lines
461 B
PHP

--TEST--
#[\Deprecated]: __call() and __callStatic()
--FILE--
<?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();
?>
--EXPECTF--
Deprecated: Method Clazz::test() is deprecated in %s
Deprecated: Method Clazz::test2() is deprecated, due to some reason in %s on line %d