|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-13 06:08 UTC] savinger at sc dot rr dot com
[2013-02-13 06:08 UTC] savinger at sc dot rr dot com
-Package: Dynamic loading
+Package: *General Issues
[2013-02-13 14:33 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
[2013-02-13 14:33 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 19:00:01 2025 UTC |
Description: ------------ Is there any way for me to differentiate between traits and classes in my autoload function? Say I have a folder of classes and a folder of traits; it would be nice to be able to do something like... Test script: --------------- spl_autoload_register(function($resource) { if ( /* $resource is class */ ) { include 'classes/'.$resource.'.php'; } if ( /* $resource is trait */ ) { include 'traits/'.$resource.'.php'; } });