[php-langspec][Issue #191] - Array Comparison
| From: | noreply@php.net | Date: | Fri, 03 Feb 2017 23:06:20 +0000 |
| Subject: | [php-langspec][Issue #191] - Array Comparison | ||
| Groups: | php.standards | ||
| Request: | Send a blank email to standards-+get-1251@lists.php.net to get a copy of this message | ||
You can view the Issue on github:
https://github.com/php/php-langspec/issues/191
Opened By: Fleshgrinder
Issue Description:
In note 5. about array comparison the following is stated:
> If the next key in the left-hand operand does not exist in the right-hand operand, the arrays
> cannot be compared and
FALSE is returned.
This is actually not true in case of the spaceship operator on both PHP and HHVM.
```php
<?php
$lhs = [0 => 0];
$rhs = [1 => 1];
var_dump(
$lhs < $rhs,
$lhs <= $rhs,
$lhs <=> $rhs,
$lhs >= $rhs,
$lhs > $rhs
);
/*
bool(false)
bool(false)
int(1)
bool(false)
bool(false)
*/
```