3v4l.org

run code in 200+ PHP versions simultaneously
<?php mb_ereg_search_init('foo'); var_dump(mb_ereg_search('\A')); var_dump(mb_ereg_search_getpos()); var_dump(mb_ereg_search('\s*')); var_dump(mb_ereg_search_getpos()); var_dump(mb_ereg_search('\w+')); var_dump(mb_ereg_search_getpos()); var_dump(mb_ereg_search_getregs()); var_dump(mb_ereg_search('\s*')); var_dump(mb_ereg_search_getpos()); var_dump(mb_ereg_search('\Z')); var_dump(mb_ereg_search_getpos());
Output for 5.6.25 - 5.6.38, 7.0.10 - 7.4.0
bool(true) int(0) bool(true) int(0) bool(true) int(3) array(1) { [0]=> string(3) "foo" } bool(true) int(3) bool(true) int(3)
Output for 5.6.0 - 5.6.24, 7.0.0 - 7.0.9
Warning: mb_ereg_search(): Empty regular expression in /in/NMmr1 on line 5 bool(true) int(1) Warning: mb_ereg_search(): Empty regular expression in /in/NMmr1 on line 8 bool(true) int(2) bool(true) int(3) array(1) { [0]=> string(1) "o" } Warning: mb_ereg_search(): Empty regular expression in /in/NMmr1 on line 15 bool(true) int(4) bool(false) int(3)