1--TEST-- 2Bug #72693 (mb_ereg_search increments search position when a match zero-width) 3--SKIPIF-- 4<?php 5if (!extension_loaded('mbstring')) die('skip ext/mbstring required'); 6?> 7--FILE-- 8<?php 9mb_ereg_search_init('foo'); 10 11var_dump(mb_ereg_search('\A')); 12var_dump(mb_ereg_search_getpos()); 13 14var_dump(mb_ereg_search('\s*')); 15var_dump(mb_ereg_search_getpos()); 16 17var_dump(mb_ereg_search('\w+')); 18var_dump(mb_ereg_search_getpos()); 19var_dump(mb_ereg_search_getregs()); 20 21var_dump(mb_ereg_search('\s*')); 22var_dump(mb_ereg_search_getpos()); 23 24var_dump(mb_ereg_search('\Z')); 25var_dump(mb_ereg_search_getpos()); 26?> 27--EXPECT-- 28bool(true) 29int(0) 30bool(true) 31int(0) 32bool(true) 33int(3) 34array(1) { 35 [0]=> 36 string(3) "foo" 37} 38bool(true) 39int(3) 40bool(true) 41int(3) 42