mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Always treat needles as strings
This is part of https://wiki.php.net/rfc/deprecations_php_7_3.
This commit is contained in:
parent
c7d7af8069
commit
c97b9aa226
31 changed files with 209 additions and 1074 deletions
|
@ -3,8 +3,6 @@ String functions
|
|||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
echo "Testing strtok: ";
|
||||
|
||||
$str = "testing 1/2\\3";
|
||||
|
@ -26,7 +24,7 @@ if ($tok1 != "testing") {
|
|||
|
||||
echo "Testing strstr: ";
|
||||
$test = "This is a test";
|
||||
$found1 = strstr($test, 32);
|
||||
$found1 = strstr($test, chr(32));
|
||||
$found2 = strstr($test, "a ");
|
||||
if ($found1 != " is a test") {
|
||||
echo("failed 1\n");
|
||||
|
@ -39,7 +37,7 @@ if ($found1 != " is a test") {
|
|||
echo "Testing strrchr: ";
|
||||
$test = "fola fola blakken";
|
||||
$found1 = strrchr($test, "b");
|
||||
$found2 = strrchr($test, 102);
|
||||
$found2 = strrchr($test, chr(102));
|
||||
if ($found1 != "blakken") {
|
||||
echo("failed 1\n");
|
||||
} elseif ($found2 != "fola blakken") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue