3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ($t = true) { // 入る echo 'true assignment '.PHP_EOL; } if ($f = false) { echo 'false assignment'.PHP_EOL; } if ($zeroString = '0') { echo 'string "0" letter '.PHP_EOL; } if ($zeroAStringCastToInt = (int)'0a') { echo 'cast to int witch string "0a"'.PHP_EOL; } if ($zeroA = '0a') { // 入る echo 'string "0a" letters'.PHP_EOL; } if ($oneAStringCastToInt = (int)'1a') { // 入る echo 'cast to int witch string "1a"'.PHP_EOL; }
Output for 5.6.0 - 5.6.23, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
true assignment string "0a" letters cast to int witch string "1a"

preferences:
122.02 ms | 404 KiB | 211 Q