note 127931 added to migration80.incompatible
| From: | 1035041238 at qq dot com | Date: | Tue, 15 Nov 2022 02:41:35 +0000 |
| Subject: | note 127931 added to migration80.incompatible | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219885@lists.php.net to get a copy of this message | ||
In PHP 8, an empty string is less than any number, an English letter is always bigger than any
number.
More interesting are the punctuation marks and non-word characters, some bigger than numbers, some
smaller than numbers
$string = '`~!@#$%^&*()-_=+[]{};:\'"\\|,.<>/?';
$number = 999999999999;
$str_len = strlen($string);
$bigger = $smaller = $equal = [];
for ( $i = 0; $i < $str_len; ++$i ) {
if ( $string[$i] > $number ) {
$bigger[] = $string[$i];
} elseif ( $string[$i] < $number ) {
$smaller[] = $string[$i];
} else {
$equal[] = $string[$i];
}
}
var_dump( $bigger ); //['`', '~', '@', '^', '_',
'=', '[', ']', '{', '}', ';',
':', '\', '|', '<', '>', '?']
var_dump( $smaller); //['!', '#', '$', '%',
'&', '*', '(', ')', '-', '+',
''', '"', ',', '.', '/']
var_dump( $equal); //[]
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 123.177.48.188)
----
Manual Page -- https://php.net/manual/en/migration80.incompatible.php
Edit -- https://main.php.net/note/edit/127931
Del: integrated -- https://main.php.net/note/delete/127931/integrated
Del: useless -- https://main.php.net/note/delete/127931/useless
Del: bad code -- https://main.php.net/note/delete/127931/bad+code
Del: spam -- https://main.php.net/note/delete/127931/spam
Del: non-english -- https://main.php.net/note/delete/127931/non-english
Del: in docs -- https://main.php.net/note/delete/127931/in+docs
Del: other reasons-- https://main.php.net/note/delete/127931
Reject -- https://main.php.net/note/reject/127931
Search -- https://main.php.net/manage/user-notes.php