Bug #75943 [NEW]: autoload trying load existing class when it extends not existing class

From: Date: Fri, 09 Feb 2018 08:22:54 +0000
Subject: Bug #75943 [NEW]: autoload trying load existing class when it extends not existing class
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213882@lists.php.net to get a copy of this message
From: akademic at hub dot sknt dot ru Operating system: Ubuntu 16.04.3 LTS PHP version: 7.2.2 Package: Class/Object related Bug Type: Bug Bug description:autoload trying load existing class when it extends not existing class Description: ------------ In example below I expect that autoload call back will try to load class_two. But it try to load existing class_one. If you comment out 'extends class_two', autoload callback will not start. Test script: --------------- spl_autoload_register(function($class) { var_dump('autoload '.$class); }); test(); function test() { $m = new class_one(); } class class_one extends class_two { function __construct() { var_dump('I am '.__CLASS__); } } Expected result: ---------------- string(18) "autoload class_two" Actual result: -------------- string(18) "autoload class_one" -- Edit bug report at https://bugs.php.net/bug.php?id=75943&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75943&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75943&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75943&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75943&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75943&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75943&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75943&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75943&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75943&r=support Expected behavior: https://bugs.php.net/fix.php?id=75943&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75943&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75943&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75943&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75943&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75943&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75943&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75943&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75943&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75943&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75943&r=mysqlcfg

« previous php.bugs (#213882) next »