3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $matches = preg_split( '/\R/', "match\nany\\n\rline\r\nending\r"); var_dump($matches);
based on eaXTl
Output for 4.4.6 - 4.4.9, 5.2.2 - 7.2.0
array(5) { [0]=> string(5) "match" [1]=> string(5) "any\n" [2]=> string(4) "line" [3]=> string(6) "ending" [4]=> string(0) "" }
Output for 4.3.0 - 4.4.5, 5.0.0 - 5.2.1
array(1) { [0]=> string(25) "match any\n line ending " }