3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const TEST = 1; class Foo { function __toString() { return "1"; } } $foo = new Foo(); var_dump( '1' == TEST, '1' == $foo, '1' == 1, $foo == TEST, $foo == 1 );
based on 3ttKH
Output for 7.0.0 - 7.2.0
Notice: Object of class Foo could not be converted to int in /in/ga4cj on line 15 Notice: Object of class Foo could not be converted to int in /in/ga4cj on line 16 bool(true) bool(true) bool(true) bool(true) bool(true)
Output for 5.3.22 - 5.6.28
Notice: Object of class Foo could not be converted to int in /in/ga4cj on line 15 Notice: Object of class Foo could not be converted to int in /in/ga4cj on line 17 bool(true) bool(true) bool(true) bool(true) bool(true)