3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "miauw\xe1\x8e\xa3"; $result = preg_replace('/./uD', '', $string, -1, $count); var_dump( $string, $result, $count );
Output for 5.1.3 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(8) "miauwᎣ" string(0) "" int(6)
Output for 5.1.0 - 5.1.2
Notice: Undefined variable: count in /in/QgHbm on line 5 Notice: Undefined variable: count in /in/QgHbm on line 11 string(8) "miauwᎣ" string(0) "" NULL
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: count in /in/QgHbm on line 5 Warning: Wrong parameter count for preg_replace() in /in/QgHbm on line 5 Notice: Undefined variable: count in /in/QgHbm on line 10 string(8) "miauwᎣ" NULL NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: count in /in/QgHbm on line 5 Warning: Wrong parameter count for preg_replace() in /in/QgHbm on line 5 Notice: Undefined variable: count in /in/QgHbm on line 10 string(8) "miauwᎣ" NULL NULL