3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringToReplace = "opening-ceremony-600x450.d20140220-u162540.jpg"; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $example_1 = substr_replace($stringToReplace, "jpg",$removeTimestamp); echo $example_1\n; $stringToReplace = "marc-by-marc-jacobs-13-black-136831_3-90x90.d20140220-u071915.jpg"; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $example_2 = substr_replace($stringToReplace, "jpg",$removeTimestamp); echo $example_2;
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting ',' or ';' in /in/ZaL75 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting ',' or ';' in /in/ZaL75 on line 6
Process exited with code 255.

preferences:
184.42 ms | 1395 KiB | 63 Q