note 96952 modified in function.spl-autoload-register by danbrown

From: Date: Wed, 24 Mar 2010 22:07:47 +0000
Subject: note 96952 modified in function.spl-autoload-register by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-167366@lists.php.net to get a copy of this message
It seems, that spl_autoload tests, if the class exists, after calling every registered loader. So it breaks the chain, if the class exists and will not call the other loaders <?php function a ($c) { echo "a\n"; class Bla {} // Usually "include 'path/to/file.php';" } function b ($c) { echo "b\n"; } spl_autoload_register('a'); spl_autoload_register('b'); $c = new Bla(); ?> --was-- It seems, that spl_autoload tests, if the class exists, after calling every registered loader. So it breaks the chain, if the class exists and will not call the other loaders <?php function a ($c) { echo "a\n"; class Bla {} // Usually "include 'path/to/file.php';" } function b ($c) { echo "b\n"; } spl_autoload_register('a'); spl_autoload_register('b'); $c = new Bla(); http://php.net/manual/en/function.spl-autoload-register.php

« previous php.notes (#167366) next »