3v4l.org

run code in 300+ PHP versions simultaneously
<?php $line = str_repeat(' ',20); $value ='03'; $pos=0; $len='2'; $line = substr_replace($line,$value,$pos,$len); echo "[$line]\n"; ?>
Output for 4.3.1 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.36, 5.6.0 - 5.6.28, 7.0.6 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.32, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.1rc1 - rc3
[03 ]
Output for 7.0.0 - 7.0.5
Warning: substr_replace(): 'from' and 'len' should be of same type - numerical or array in /in/svDrE on line 3 [ ]

preferences:
38.9 ms | 460 KiB | 5 Q