3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sub = substr('abcdef', 4, -4); if ($sub === false) { echo 'fail'; } else { echo 'do somthing with $sub'; }
Output for 8.0.0 - 8.0.22, 8.1.0 - 8.1.9
do somthing with $sub
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.30
fail

preferences:
52.08 ms | 410 KiB | 5 Q