3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match_all('/(?:&lt;|&gt;|&amp;)/i', '&lt;tomato&gt; has this &amp; that powers', $matches, PREG_OFFSET_CAPTURE); var_dump($matches);
based on eMIjB
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
array(1) { [0]=> array(3) { [0]=> array(2) { [0]=> string(4) "&lt;" [1]=> int(0) } [1]=> array(2) { [0]=> string(4) "&gt;" [1]=> int(10) } [2]=> array(2) { [0]=> string(5) "&amp;" [1]=> int(24) } } }