[wp-trac] [WordPress Trac] #13436: WordPress class_exists() conflicts with __autoload() and php_auto_prepend

WordPress Trac noreply at wordpress.org
Mon Jun 23 04:00:07 UTC 2014


#13436: WordPress class_exists() conflicts with __autoload() and php_auto_prepend
-------------------------------+-----------------------
 Reporter:  galbus             |       Owner:
     Type:  enhancement        |      Status:  reopened
 Priority:  normal             |   Milestone:  4.0
Component:  Bootstrap/Load     |     Version:  3.0
 Severity:  minor              |  Resolution:
 Keywords:  needs-patch close  |     Focuses:
-------------------------------+-----------------------

Comment (by jcjcc):

 Try this

 {{{
 spl_autoload_extensions('.php');
 spl_autoload_register();

 var_dump(class_exists('Testing'));
 var_dump(class_exists('\\Testing\\Foo'));
 }}}

 I agree that at this point, it seems like a PHP bug.

 Apologies for claiming that class_exists was documented to throw an
 exception -- I did remember reading about the exception-throwing behavior
 in the docs, but it was in a comment, and not in the doc itself.

 If it doesn't throw any errors when you call
 {{{
 spl_autoload_register('spl_autoload');
 }}}
 but it does when you call
 {{{
 spl_autoload_register();
 }}}
 then this is strange behavior to me as well. Can you get back to me on
 whether that happens? Let's leave it at that then after that.

 Thanks rmccue, Denis-de-Bernardy, and SergeyBiryukov for your responses!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/13436#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list