3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar; } $foo = new Foo; $arr = array("", " ", FALSE, TRUE, array(), NULL, "0", 0, 0.0, new stdClass, $foo, $foo->bar, "\0"); foreach($arr as $val){ settype($val, 'string') ? "TRUE" : "FALSE"; echo "\n"; }
based on rs0dX
Output for 7.1.0 - 7.2.0
Notice: Array to string conversion in /in/tB1oi on line 7 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/tB1oi on line 7
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Notice: Array to string conversion in /in/tB1oi on line 7 Catchable fatal error: Object of class stdClass could not be converted to string in /in/tB1oi on line 7
Process exited with code 255.