3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $anon2 = new class {}; var_dump($anon2); debug_zval_dump($anon2); $reflection = new ReflectionClass($anon2); var_dump($reflection->getName()); var_dump($reflection->isAnonymous()); echo PHP_EOL; $cls = get_class($anon2); var_dump($cls); $anon2 = null; var_dump(new $cls());
Output for 7.2.0
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7fe9ebabf01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7fe9ebabf01b" object(class@anonymous)#1 (0) { }
Output for 7.1.10
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f913adb001b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f913adb001b" object(class@anonymous)#1 (0) { }
Output for 7.1.7
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f8d42ad701b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f8d42ad701b" object(class@anonymous)#1 (0) { }
Output for 7.1.6
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f3f0242f01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f3f0242f01b" object(class@anonymous)#1 (0) { }
Output for 7.1.5
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f1c5d43601b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f1c5d43601b" object(class@anonymous)#1 (0) { }
Output for 7.1.0
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f8d6715101b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f8d6715101b" object(class@anonymous)#1 (0) { }
Output for 7.0.20
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f0200dac01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f0200dac01b" object(class@anonymous)#1 (0) { }
Output for 7.0.6
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7fb311e1d01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7fb311e1d01b" object(class@anonymous)#1 (0) { }
Output for 7.0.5
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f6a0d8e901b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f6a0d8e901b" object(class@anonymous)#1 (0) { }
Output for 7.0.4
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f4fec72a01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f4fec72a01b" object(class@anonymous)#1 (0) { }
Output for 7.0.3
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f8aeac9101b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f8aeac9101b" object(class@anonymous)#1 (0) { }
Output for 7.0.2
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f8ce222e01b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f8ce222e01b" object(class@anonymous)#1 (0) { }
Output for 7.0.1
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f8e3a7f901b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f8e3a7f901b" object(class@anonymous)#1 (0) { }
Output for 7.0.0
object(class@anonymous)#1 (0) { } object(class@anonymous)#1 (0) refcount(2){ } string(39) "class@anonymous/in/gKYJc0x7f85a7ca701b" bool(true) string(39) "class@anonymous/in/gKYJc0x7f85a7ca701b" object(class@anonymous)#1 (0) { }
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/gKYJc on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/gKYJc on line 3
Process exited with code 255.