@@ -122,7 +122,11 @@ public function testGrapheme_strpos()
122122 $ this ->assertSame (false , grapheme_strpos ('abc ' , '' ));
123123 $ this ->assertSame (false , grapheme_strpos ('abc ' , 'd ' ));
124124 $ this ->assertSame (false , grapheme_strpos ('abc ' , 'a ' , 3 ));
125- $ this ->assertSame (0 , grapheme_strpos ('abc ' , 'a ' , 0 ));
125+ if (defined ('HHVM_VERSION_ID ' ) || PHP_VERSION_ID < 50535 || (PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50621 ) || (PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70006 )) {
126+ $ this ->assertSame (0 , grapheme_strpos ('abc ' , 'a ' , -1 ));
127+ } else {
128+ $ this ->assertFalse (grapheme_strpos ('abc ' , 'a ' , -1 ));
129+ }
126130 $ this ->assertSame (1 , grapheme_strpos ('한국어 ' , '국 ' ));
127131 $ this ->assertSame (3 , grapheme_stripos ('DÉJÀ ' , 'à ' ));
128132 $ this ->assertSame (false , grapheme_strrpos ('한국어 ' , '' ));
@@ -132,7 +136,11 @@ public function testGrapheme_strpos()
132136 $ this ->assertSame (false , p::grapheme_strpos ('abc ' , '' ));
133137 $ this ->assertSame (false , p::grapheme_strpos ('abc ' , 'd ' ));
134138 $ this ->assertSame (false , p::grapheme_strpos ('abc ' , 'a ' , 3 ));
135- $ this ->assertSame (0 , p::grapheme_strpos ('abc ' , 'a ' , -1 ));
139+ if (defined ('HHVM_VERSION_ID ' ) || PHP_VERSION_ID < 50535 || (50600 <= PHP_VERSION_ID && PHP_VERSION_ID < 50621 ) || (70000 <= PHP_VERSION_ID && PHP_VERSION_ID < 70006 )) {
140+ $ this ->assertSame (0 , p::grapheme_strpos ('abc ' , 'a ' , -1 ));
141+ } else {
142+ $ this ->assertFalse (p::grapheme_strpos ('abc ' , 'a ' , -1 ));
143+ }
136144 $ this ->assertSame (1 , p::grapheme_strpos ('한국어 ' , '국 ' ));
137145 $ this ->assertSame (3 , p::grapheme_stripos ('DÉJÀ ' , 'à ' ));
138146 $ this ->assertSame (false , p::grapheme_strrpos ('한국어 ' , '' ));
0 commit comments