3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $article = '<img src="http://php.net/images/logo.php">'; $match = preg_match( // Match the src attribute with the opening quote. '/src=(?\'quote\'["\'])' // Match the URL for the image. . '([\S\s]+?)\.(png|gif|jpeg)' // Re-use the opening quote as closing quote. . '(?P=quote)/m', $article, $matches ); var_dump($match, $matches);
Output for 4.4.6 - 4.4.9, 5.2.2 - 7.2.0
int(0) array(0) { }
Output for 5.2.0 - 5.2.1
Warning: preg_match(): Compilation failed: unrecognized character after (? at offset 6 in /in/W1HRk on line 13 bool(false) NULL
Output for 4.3.11 - 4.4.5, 5.0.0 - 5.1.6
Warning: preg_match(): Compilation failed: unrecognized character after (? at offset 6 in /in/W1HRk on line 13 bool(false) array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unrecognized character after (? at offset 6 in /in/W1HRk on line 13 bool(false) array(0) { }