3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Event {} $event = (new class() extends Event { public function getName() { return 'anonyme !'; } }); var_dump(get_class($event)); $event = (new class() { public function getName() { return 'anonyme !'; } }); var_dump(get_class($event));
based on Pl7pN
Output for 7.3.0rc2
string(39) "class@anonymous/in/RGc7E0x7f1e92808077" string(39) "class@anonymous/in/RGc7E0x7f1e928080ec"
Output for 7.3.0beta1
string(39) "class@anonymous/in/RGc7E0x7f56a48a8077" string(39) "class@anonymous/in/RGc7E0x7f56a48a80ec"
Output for 7.3.0alpha1
string(39) "class@anonymous/in/RGc7E0x7fabac42d077" string(39) "class@anonymous/in/RGc7E0x7fabac42d0ec"
Output for 7.2.11
string(39) "class@anonymous/in/RGc7E0x7f483be25077" string(39) "class@anonymous/in/RGc7E0x7f483be250ec"
Output for 7.2.6
string(39) "class@anonymous/in/RGc7E0x7fb52fbf6077" string(39) "class@anonymous/in/RGc7E0x7fb52fbf60ec"
Output for 7.2.0
string(39) "class@anonymous/in/RGc7E0x7f75f70bc077" string(39) "class@anonymous/in/RGc7E0x7f75f70bc0ec"
Output for 7.1.20
string(39) "class@anonymous/in/RGc7E0x7f9cbaea6077" string(39) "class@anonymous/in/RGc7E0x7f9cbaea60ec"
Output for 7.1.10
string(39) "class@anonymous/in/RGc7E0x7f313fe16077" string(39) "class@anonymous/in/RGc7E0x7f313fe160ec"
Output for 7.1.7
string(39) "class@anonymous/in/RGc7E0x7fe64cc52077" string(39) "class@anonymous/in/RGc7E0x7fe64cc520ec"
Output for 7.1.6
string(39) "class@anonymous/in/RGc7E0x7f2cb8a77077" string(39) "class@anonymous/in/RGc7E0x7f2cb8a770ec"
Output for 7.1.5
string(39) "class@anonymous/in/RGc7E0x7fc1d0efb077" string(39) "class@anonymous/in/RGc7E0x7fc1d0efb0ec"
Output for 7.1.0
string(39) "class@anonymous/in/RGc7E0x7ff709b65077" string(39) "class@anonymous/in/RGc7E0x7ff709b650ec"
Output for 7.0.20
string(39) "class@anonymous/in/RGc7E0x7fde0d940077" string(39) "class@anonymous/in/RGc7E0x7fde0d9400ec"
Output for 7.0.6
string(39) "class@anonymous/in/RGc7E0x7fce15062077" string(39) "class@anonymous/in/RGc7E0x7fce150620ec"
Output for 7.0.5
string(39) "class@anonymous/in/RGc7E0x7f81fc756077" string(39) "class@anonymous/in/RGc7E0x7f81fc7560ec"
Output for 7.0.4
string(39) "class@anonymous/in/RGc7E0x7f3bd342c077" string(39) "class@anonymous/in/RGc7E0x7f3bd342c0ec"
Output for 7.0.3
string(39) "class@anonymous/in/RGc7E0x7ff1dd0a7077" string(39) "class@anonymous/in/RGc7E0x7ff1dd0a70ec"
Output for 7.0.2
string(39) "class@anonymous/in/RGc7E0x7f8e097ec077" string(39) "class@anonymous/in/RGc7E0x7f8e097ec0ec"
Output for 7.0.1
string(39) "class@anonymous/in/RGc7E0x7fe786fcf077" string(39) "class@anonymous/in/RGc7E0x7fe786fcf0ec"
Output for 7.0.0
string(39) "class@anonymous/in/RGc7E0x7f0c5176e077" string(39) "class@anonymous/in/RGc7E0x7f0c5176e0ec"
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/RGc7E on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/RGc7E on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /in/RGc7E on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /in/RGc7E on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in /in/RGc7E on line 5
Process exited with code 255.