3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php for($i=0;$i<10;$i++) { $c = new class { function foo() { var_dump(__CLASS__); } }; $c->foo(); var_dump($c); }
based on FfPfc
Output for 7.2.0
string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f47b0104076" object(class@anonymous)#2 (0) { }
Output for 7.1.10
string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f745d704076" object(class@anonymous)#2 (0) { }
Output for 7.1.7
string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f5691215076" object(class@anonymous)#2 (0) { }
Output for 7.1.6
string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f2ad043d076" object(class@anonymous)#2 (0) { }
Output for 7.1.5
string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fc017871076" object(class@anonymous)#2 (0) { }
Output for 7.1.0
string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f9c69bbc076" object(class@anonymous)#2 (0) { }
Output for 7.0.20
string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fac6529e076" object(class@anonymous)#2 (0) { }
Output for 7.0.6
string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f8663ef5076" object(class@anonymous)#2 (0) { }
Output for 7.0.5
string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f0a0d59c076" object(class@anonymous)#2 (0) { }
Output for 7.0.4
string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7faf11294076" object(class@anonymous)#2 (0) { }
Output for 7.0.3
string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f679d050076" object(class@anonymous)#2 (0) { }
Output for 7.0.2
string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7feef6a3b076" object(class@anonymous)#2 (0) { }
Output for 7.0.1
string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7fbdd4493076" object(class@anonymous)#2 (0) { }
Output for 7.0.0
string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#2 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#1 (0) { } string(39) "class@anonymous/in/cCUlM0x7f43b4580076" object(class@anonymous)#2 (0) { }
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/cCUlM on line 4
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/cCUlM on line 4
Process exited with code 255.