3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Stringable{ public function __toString() { return 'hi';} } class NotStringable{ public function __toString(){}} $stringable = new Stringable(); $notStringable = new NotStringable(); var_dump((string) $stringable); var_dump(is_string((string) $stringable));
based on QYKQi
Output for 5.3.23 - 7.3.0beta1
string(2) "hi" bool(true)