3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function x($str) { // tvCoerceParamToStringInPlace return fb_htmlspecialchars($str, ENT_FB_UTF8, 'UTF-8', null); } class Foo { // will throw an exception function __toString() { return 2; } } var_dump(x(new Foo));
based on 21cpR
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function fb_htmlspecialchars() in /in/Nv1NL:5 Stack trace: #0 /in/Nv1NL(15): x(Object(Foo)) #1 {main} thrown in /in/Nv1NL on line 5
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
Fatal error: Uncaught Error: Method Foo::__toString() must return a string value in /in/Nv1NL:5 Stack trace: #0 /in/Nv1NL(15): x() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Catchable fatal error: Method Foo::__toString() must return a string value in /in/Nv1NL on line 5
Process exited with code 255.
Output for 5.0.0 - 5.6.25
Fatal error: Call to undefined function fb_htmlspecialchars() in /in/Nv1NL on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: fb_htmlspecialchars() in /in/Nv1NL on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: fb_htmlspecialchars() in /in/Nv1NL on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: fb_htmlspecialchars() in /in/Nv1NL on line 5