3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $replacement = "1"; $final = substr($string, 0, 1).$replacement; echo $final;
based on Fg3JN
Output for 5.6.0 - 5.6.30, hhvm-3.21.3, 7.0.0 - 7.3.0beta1
Notice: Undefined variable: string in /in/MpumJ on line 4 1
Output for hhvm-3.22.0
Notice: Undefined variable: string in /in/MpumJ on line -1 1
Output for hhvm-3.18.5
Notice: Undefined variable: string in /in/MpumJ on line 4 Warning: substr() expects parameter 1 to be string, null given in /in/MpumJ on line 4 1