Bug #61526 [Nab->Csd]: is_subclass_of(string, string, false) always returns false

From: Date: Fri, 07 Feb 2020 06:08:30 +0000
Subject: Bug #61526 [Nab->Csd]: is_subclass_of(string, string, false) always returns false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225408@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61526&edit=1 ID: 61526 Updated by: phpdocbot@php.net Reported by: gtisza at gmail dot com Summary: is_subclass_of(string, string, false) always returns false -Status: Not a bug +Status: Closed Type: Bug Package: Class/Object related Operating System: Debian PHP Version: 5.3.10 Block user comment: N Private report: N New Comment: Automatic comment on behalf of yohgaki Revision: http://git.php.net/?p=doc/en.git;a=commit;h=321e62884a4c0cc708517c428ba2232e9a6c7227 Log: Fix #61526 Improve doc. Previous Comments: ------------------------------------------------------------------------ [2012-03-31 09:48:16] yohgaki@php.net Automatic comment from SVN on behalf of yohgaki Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=324663 Log: Fix #61526 Improve doc. ------------------------------------------------------------------------ [2012-03-31 08:29:37] yohgaki@php.net I committed doc improvement. ------------------------------------------------------------------------ [2012-03-31 08:29:09] yohgaki@php.net Automatic comment from SVN on behalf of yohgaki Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=324657 Log: Fix #61526 Improve doc. ------------------------------------------------------------------------ [2012-03-31 08:04:17] stas@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected behavior. Please see bug #55475 for more info. ------------------------------------------------------------------------ [2012-03-29 02:37:04] yohgaki@php.net The same behavior in PHP 5.4.1RC. Is this a doc problem or bug in PHP? From http://php.net/manual/en/function.is-subclass-of.php ---- allow_string Whether to call autoloader if the class doesn't exist. ---- ---- 5.3.9 Added allow_string parameter 5.0.3 You may also specify the object parameter as a string (the name of the class) ---- I'm not sure, but is this a bug introduced by is_a() fix? I didn't follow the discussion, so I hope someone could address this issue. BTW, correct PoC would be following code. <?php class Super {} class Sub extends Super {} var_dump(is_subclass_of('Sub', 'Super')); // true var_dump(is_subclass_of('Sub', 'Super', true)); // true var_dump(is_subclass_of('Sub', 'Super', false)); // false ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61526 -- Edit this bug report at https://bugs.php.net/bug.php?id=61526&edit=1

« previous php.bugs (#225408) next »