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.
 
 

22 lines
550 B

--TEST--
string_method: 0
--FILE--
<?php
function main()
{
require __DIR__ . '/../../../src/Assert.php';
$string = 'hello world, this is a test string';
Assert::false($string->isEmpty());
Assert::eq($string->length(), strlen($string));
Assert::eq($string->substr(0, 5), 'hello');
Assert::eq($string->contains('world'), true);
Assert::eq($string->indexOf('test'), strpos($string, 'test'));
Assert::eq($string->split(' '), explode(' ', $string));
$empty = '';
Assert::true($empty->isEmpty());
}
?>
--EXPECT--