3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $subject = <<<EOL 1. first 2. second 3. third EOL; preg_match('/^.{1,20}?$/i', $subject, $matches); var_dump($matches); $subject = "qasd\nasdasd\nasda"; preg_match('/^.{1,20}?$/gim', $subject, $matches); var_dump($matches);
Output for 5.2.3 - 7.1.0
array(0) { } Warning: preg_match(): Unknown modifier 'g' in /in/2gPsA on line 12 array(0) { }
Output for 4.4.3 - 5.1.1, 5.1.3 - 5.2.2
array(0) { } <br /> <b>Warning</b>: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier 'g' in <b>/in/2gPsA</b> on line <b>12</b><br /> array(0) { }
Output for 5.1.2
array(0) { } <br /> <b>Warning</b>: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier 'g' in <b>/in/2gPsA</b> on line <b>13</b><br /> array(0) { }
Output for 4.4.2
array(0) { } <br /> <b>Warning</b>: preg_match(): Unknown modifier 'g' in <b>/in/2gPsA</b> on line <b>13</b><br /> array(0) { }
Output for 4.3.11 - 4.4.1
array(0) { } <br /> <b>Warning</b>: preg_match(): Unknown modifier 'g' in <b>/in/2gPsA</b> on line <b>12</b><br /> array(0) { }
Output for 4.3.0 - 4.3.10
array(0) { } <br /> <b>Warning</b>: Unknown modifier 'g' in <b>/in/2gPsA</b> on line <b>12</b><br /> array(0) { }