3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = strrpos('test/bild.jpg','/'); $x = ''; $x = $x? $x++ : ''; $folder = substr('test/bild.jpg',0,$x); $oldname = substr('test/bild.jpg',$x); echo 'folder: '.$folder.' oldname:'.$oldname.' newname: '.$newname;
Output for hhvm-3.10.0, 7.0.0 - 7.1.0
Warning: substr() expects parameter 3 to be integer, string given in /in/B3bqY on line 5 Warning: substr() expects parameter 2 to be integer, string given in /in/B3bqY on line 6 Notice: Undefined variable: newname in /in/B3bqY on line 7 folder: oldname: newname:
Output for hhvm-3.12.0
Warning: substr() expects parameter 3 to be integer, string given in /in/B3bqY on line -1 Warning: substr() expects parameter 2 to be integer, string given in /in/B3bqY on line -1 Notice: Undefined variable: newname in /in/B3bqY on line -1 folder: oldname: newname:
Output for 5.3.0 - 5.6.28
Warning: substr() expects parameter 3 to be long, string given in /in/B3bqY on line 5 Warning: substr() expects parameter 2 to be long, string given in /in/B3bqY on line 6 Notice: Undefined variable: newname in /in/B3bqY on line 7 folder: oldname: newname:
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: newname in /in/B3bqY on line 7 folder: oldname:test/bild.jpg newname:
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: newname in /in/B3bqY on line 7 folder: oldname:test/bild.jpg newname: