3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $subject = array('1', 'a', '2', 'b', '3', 'A', 'B', '4'); $pattern = array('/\d/', '/[a-z]/', '/[1a]/'); $replace = array('A:$0', 'B:$0', 'C:$0'); echo "preg_filter returns\n"; print_r(preg_filter($pattern, $replace, $subject));
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
preg_filter returns Array ( [0] => A:C:1 [1] => B:C:a [2] => A:2 [3] => B:b [4] => A:3 [7] => A:4 )
Output for 5.0.0 - 5.2.17
preg_filter returns Fatal error: Call to undefined function preg_filter() in /in/Y9Fsj on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
preg_filter returns Fatal error: Call to undefined function: preg_filter() in /in/Y9Fsj on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.4
preg_filter returns Fatal error: Call to undefined function: preg_filter() in /in/Y9Fsj on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
preg_filter returns Fatal error: Call to undefined function: preg_filter() in /in/Y9Fsj on line 8