3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is the total 98+84+67"; preg_match_all("/\d+/",$string,$matches); print_r($matches); $sum = array_sum($matches[0]); print preg_replace("/[\d+]+/",$sum,$string)
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected end of file in /in/HjH8j on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/HjH8j on line 7
Process exited with code 255.

preferences:
183.31 ms | 1395 KiB | 67 Q