3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 'yo'; for( $i = 0; $i <= 3; $i++ ) { echo "substr( '$x', $i ) is: ", var_export(substr( $x, $i ),true), "\n"; } echo "\n\n"; $x = ''; echo "substr( '$x', 0 ) is: ", var_export(substr( $x, 0 ),true), "\n"; echo "substr( '$x', 1 ) is: ", var_export(substr( $x, 1 ),true), "\n";

preferences:
58.67 ms | 402 KiB | 5 Q