note 125547 deleted from language.operators.comparison by crell
| From: | crell@php.net | Date: | Thu, 31 Mar 2022 17:48:05 +0000 |
| Subject: | note 125547 deleted from language.operators.comparison by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217883@lists.php.net to get a copy of this message | ||
Note Submitter: Ireneusz Pachulski
----
Note that spaceship operator (<=>) is binary safe.
<?php
$a = "Hello";
$b = "Hello\x00World";
echo ($a <=> $b) . "<br>"; // -1
echo strcmp($a, $b) . "<br>"; // -6
echo strcoll($a, $b) . "<br>"; // 0 => not binary safe
?>