3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Stringable { function __toString() { return "A"; } } $str = new Stringable(); var_dump($str == "A", $str === "A");
Output for 5.2.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(false)
Output for 5.1.0 - 5.1.6
Notice: Object of class Stringable could not be converted to int in /in/gZi2P on line 11 bool(false) bool(false)
Output for 4.3.0 - 5.0.5
bool(false) bool(false)