3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <p>She was like: " <i data-note="Oh, dear this may go haywire">I can't believe it! <img src='crookedface.gif'><br> Watch this video <iframe src="somwhere"></iframe><br> Are you getting all of this?</i> </p> HTML; $el = 'i'; var_export(preg_match_all('/(<'.$el.'(.*?)>)((\n*?.*?\n*?)<\/'.$el.'>|)/', $html, $out, PREG_SET_ORDER) ? $out : []);
Output for 7.1.25 - 7.1.31, 7.2.0 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.21, 8.0.0 - 8.0.8
array ( 0 => array ( 0 => '<i data-note="Oh, dear this may go haywire">', 1 => '<i data-note="Oh, dear this may go haywire">', 2 => ' data-note="Oh, dear this may go haywire"', 3 => '', ), 1 => array ( 0 => '<img src=\'crookedface.gif\'>', 1 => '<img src=\'crookedface.gif\'>', 2 => 'mg src=\'crookedface.gif\'', 3 => '', ), 2 => array ( 0 => '<iframe src="somwhere">', 1 => '<iframe src="somwhere">', 2 => 'frame src="somwhere"', 3 => '', ), )

preferences:
173.32 ms | 534 KiB | 16 Q