3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $hit = []; $str = '/answer 56 this is my sample text'; preg_match('/^\/answer ([1-9][0-9]*) (.{1,512})$/', $str, $hit, PREG_OFFSET_CAPTURE); echo'<pre>',print_r($hit),'</pre>'; // TODO
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
<pre>Array ( [0] => Array ( [0] => /answer 56 this is my sample text [1] => 0 ) [1] => Array ( [0] => 56 [1] => 8 ) [2] => Array ( [0] => this is my sample text [1] => 11 ) ) 1</pre>