3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bigKml = "<br><img src='files/bagel.png'><br><br>"; $pattern = "/<img src=.*?>/"; preg_match($pattern, $bigKml, $imageTags); print_r($imageTags); foreach($imageTags as $imageTag) { $pattern = "/'([^']*)'/"; preg_match($urlPattern, $imageTag, $oldUrls); $oldUrl = $oldUrls[0]; print_r($oldUrl); } ?>
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
Array ( [0] => <img src='files/bagel.png'> ) Notice: Undefined variable: urlPattern in /in/8RW6V on line 8 Warning: preg_match(): Empty regular expression in /in/8RW6V on line 8
Output for hhvm-3.10.0 - 3.12.0
Array ( [0] => <img src='files/bagel.png'> ) Notice: Undefined variable: urlPattern in /in/8RW6V on line 8 Warning: Empty regular expression in /in/8RW6V on line 8
Output for 5.0.4 - 5.1.6
Array ( [0] => <img src='files/bagel.png'> ) Notice: Undefined variable: urlPattern in /in/8RW6V on line 8 Warning: preg_match(): Empty regular expression in /in/8RW6V on line 8 Notice: Undefined offset: 0 in /in/8RW6V on line 9
Output for 4.3.11 - 5.0.3
Array ( [0] => <img src='files/bagel.png'> ) Notice: Undefined variable: urlPattern in /in/8RW6V on line 8 Warning: preg_match(): Empty regular expression in /in/8RW6V on line 8 Notice: Undefined offset: 0 in /in/8RW6V on line 9
Output for 4.3.0 - 4.3.10
Array ( [0] => <img src='files/bagel.png'> ) Notice: Undefined variable: urlPattern in /in/8RW6V on line 8 Warning: Empty regular expression in /in/8RW6V on line 8 Notice: Undefined offset: 0 in /in/8RW6V on line 9