<?php
spl_autoload_register(function($name){
if($name == 'C') {
spl_autoload_register(function($name){
if($name == 'C') {
class C {
function __construct(){
echo "I'm C.\n";
}
}
}
});
}
});
$c = new C();
- Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.0.3 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- I'm C.
- Output for 7.0.0 - 7.0.2
- Fatal error: Uncaught Error: Class 'C' not found in /in/f1njG:16
Stack trace:
#0 {main}
thrown in /in/f1njG on line 16
Process exited with code 255.
preferences:
163.92 ms | 401 KiB | 242 Q