3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function(){}; var_dump('' == $a and 'a' == $a); var_dump('' === (string)$a and 'a' === (string)$a);
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
bool(false) Fatal error: Uncaught Error: Object of class Closure could not be converted to string in /in/lRsM9:4 Stack trace: #0 {main} thrown in /in/lRsM9 on line 4
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
bool(false) Recoverable fatal error: Object of class Closure could not be converted to string in /in/lRsM9 on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.31
bool(false) Catchable fatal error: Object of class Closure could not be converted to string in /in/lRsM9 on line 4
Process exited with code 255.

preferences:
260.52 ms | 402 KiB | 361 Q