3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(string $bar) { echo "I got $bar!", PHP_EOL; } foo(new class { public function __toString() { return self::class; } });
based on f5d8p
Output for 7.2.0
I got class@anonymous/in/RrtJr0x7fa3e6f7d087!
Output for 7.1.10
I got class@anonymous/in/RrtJr0x7f753850c087!
Output for 7.1.7
I got class@anonymous/in/RrtJr0x7f813071a087!
Output for 7.1.6
I got class@anonymous/in/RrtJr0x7f5da069e087!
Output for 7.1.5
I got class@anonymous/in/RrtJr0x7f768f4b8087!
Output for 7.1.0
I got class@anonymous/in/RrtJr0x7fd9739fb087!
Output for 7.0.20
I got class@anonymous/in/RrtJr0x7f37bc9ae087!
Output for 7.0.6
I got class@anonymous/in/RrtJr0x7ff6f1b6f087!
Output for 7.0.5
I got class@anonymous/in/RrtJr0x7fdc33f80087!
Output for 7.0.4
I got class@anonymous/in/RrtJr0x7fe75df8a087!
Output for 7.0.3
I got class@anonymous/in/RrtJr0x7fa742663087!
Output for 7.0.2
I got class@anonymous/in/RrtJr0x7f95429f1087!
Output for 7.0.1
I got class@anonymous/in/RrtJr0x7f83ef045087!
Output for 7.0.0
I got class@anonymous/in/RrtJr0x7fbb87e56087!
Output for 5.4.1 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/RrtJr on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/RrtJr on line 3
Process exited with code 255.