3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public $bar = 1; } $o = new Foo(); $s = '1'; $b = true; $i = 1; $f = 1.0; var_dump($o == $s); var_dump($o == $b); var_dump($o == $i); var_dump($o == $f);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
bool(false) bool(true) Notice: Object of class Foo could not be converted to int in /in/8esOY on line 16 bool(true) Notice: Object of class Foo could not be converted to float in /in/8esOY on line 17 bool(true)

preferences:
97.07 ms | 1274 KiB | 4 Q