3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $filenameOld = 'PX20170713_103320_2651093_00001.xml'; var_dump(implode(array_slice(explode('_', rtrim(basename($fileToProcess), ".xml" )), 0, 2)));
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.1
Notice: Undefined variable: fileToProcess in /in/NHOTU on line 5 string(0) ""
Output for hhvm-3.15.4
Notice: Undefined variable: fileToProcess in /in/NHOTU on line 5 Warning: basename() expects parameter 1 to be string, null given in /in/NHOTU on line 5 Warning: rtrim() expects parameter 1 to be string, null given in /in/NHOTU on line 5 Warning: explode() expects parameter 2 to be string, null given in /in/NHOTU on line 5 Warning: Invalid operand type was used: array_slice expects an array or collection as argument 1 in /in/NHOTU on line 5 Warning: Invalid operand type was used: implode() expects a container as one of the arguments in /in/NHOTU on line 5 NULL