TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
778 B

--TEST--
Test strpos() function : usage variations - complex strings containing other than 7-bit chars
--SKIPIF--
<?php
echo 'skip chr(0) null bytes in compile-time constant strings are not supported in C++';
?>
--FILE--
<?php
$string = chr(0).chr(128).chr(129).chr(234).chr(235).chr(254).chr(255);
$stringAsHex = bin2hex($string);
echo "-- Positions of some chars in the string '$stringAsHex' are as follows --\n";
echo bin2hex( chr(128) ) ." => ";
var_dump( strpos($string, chr(128)) );
echo bin2hex( chr(255) ) ." => ";
var_dump( strpos($string, chr(255), 3) );
echo bin2hex( chr(0) ) ." => ";
var_dump( strpos($string, chr(0)) );
?>
DONE
?>
--EXPECT--
-- Positions of some chars in the string '008081eaebfeff' are as follows --
80 => int(1)
ff => int(6)
00 => int(0)
DONE