3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = null; $c = 1; $r = preg_replace_callback('\/(<p( [^>]+)?>)/i\', function ($res) { global $c; return '<p'.$res[2].' id="'.intval($c++).'">'; }, $text); $r = preg_replace('/(<p.*?)id="'.($c-1).'"(>)/i', '\1id="Last"\2', $r); $text = $r; echo $text;
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected ''.$res[2].'' (T_CONSTANT_ENCAPSED_STRING) in /in/WPZh4 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/WPZh4 on line 6
Process exited with code 255.