mirror of
https://github.com/php/php-src.git
synced 2026-10-28 17:56:50 +08:00
For `is_a()` and `is_subclass_of()`, emit deprecation warnings when calling with a string as the first argument but with `$allow_string` being false. The two functions share implementation code and so are updated together. https://wiki.php.net/rfc/deprecations_php_8_6
19 lines
379 B
PHP
19 lines
379 B
PHP
--TEST--
|
|
is_subclass_of() with $allow_string false and a string
|
|
--FILE--
|
|
<?php
|
|
|
|
class Demo {}
|
|
|
|
class Child extends Demo {}
|
|
|
|
var_dump(is_subclass_of(Child::class, Demo::class, true));
|
|
var_dump(is_subclass_of(Child::class, Demo::class, false));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
|
|
Deprecated: Calling is_subclass_of() with a string when $allow_string is false in %s on line %d
|
|
bool(false)
|