3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $re = '/^--\w+$/m'; $str = '--0000000000000fb2ad0575bf8f28 Content-Type: text/plain; charset="UTF-8" <body> Content. </body> --0000000000000fb2ad0575bf8f28 Content-Type: text/html; charset="UTF-8" <div dir="ltr">&lt;body&gt;<br>Content.<br>&lt;/body&gt;</div> --0000000000000fb2ad0575bf8f28--'; preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0); // Print the entire match result var_dump($matches);
Output for 4.3.3 - 5.6.30, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.0beta3
array(1) { [0]=> array(2) { [0]=> string(30) "--0000000000000fb2ad0575bf8f28" [1]=> int(0) } }
Output for 4.3.0 - 4.3.2
Warning: Wrong parameter count for preg_match() in /in/7YdKS on line 18 NULL