3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $headers = "Server: lolcatplus\nContent-Type: many/lolcats\n"; $regex1 = '/^(.+): (.+)$/m'; $regex2 = '/^(.+): (.+)$/'; $matches = array(); preg_match($regex1, $headers, $matches); var_dump($matches); $matches = array(); preg_match($regex2, $headers, $matches); var_dump($matches);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(3) { [0]=> string(18) "Server: lolcatplus" [1]=> string(6) "Server" [2]=> string(10) "lolcatplus" } array(0) { }