3v4l.org

run code in 300+ 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
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:
326.4 ms | 407 KiB | 5 Q