Arquivos
hhvm/hphp/test/vm/autoload6.php
T
andrewparoski 34ba5330d5 Fix bug involving autoload with interfaces and traits
This fixes an old bug with autoloading interfaces and traits where the
runtime erroneously continued to call autoload handlers even though the
requested interface/trait had already been loaded.

This also rips out some dead autoload helpers and removes the 'declared'
parameter from invokeHandler() since it is null for all callsites.
2013-03-08 17:52:30 -08:00

31 linhas
636 B
PHP

<?php
function my_autoload_func1($cls) {
echo "my_autoload_func1 $cls\n";
}
function my_autoload_func2($cls) {
echo "my_autoload_func2 $cls\n";
$cls = strtolower($cls);
if ($cls === 'i') {
interface I {
public function foo();
}
}
}
function my_autoload_func3($cls) {
echo "my_autoload_func3 $cls\n";
$cls = strtolower($cls);
if ($cls === 'i') {
interface I {
public function bar();
}
}
}
function main() {
spl_autoload_register('my_autoload_func1');
spl_autoload_register('my_autoload_func2');
spl_autoload_register('my_autoload_func3');
var_dump(interface_exists('I'));
}
main();