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
859 B

--TEST--
Test strstr() 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( bin2hex( strstr($string, chr(128) ) ) );
echo bin2hex( chr(255) ) ." => ";
var_dump( bin2hex( strstr($string, chr(255) ) ) );
echo bin2hex( chr(0) ) ." => ";
var_dump( bin2hex( strstr($string, chr(0) ) ) );
?>
DONE
?>
--EXPECT--
-- Positions of some chars in the string '008081eaebfeff' are as follows --
80 => string(12) "8081eaebfeff"
ff => string(2) "ff"
00 => string(14) "008081eaebfeff"
DONE