Doc #70850 [NEW]: error in summary of array comparison
| From: | JQKP at example dot com | Date: | Tue, 03 Nov 2015 21:53:34 +0000 |
| Subject: | Doc #70850 [NEW]: error in summary of array comparison | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-12854@lists.php.net to get a copy of this message | ||
From: JQKP at example dot com
Operating system: MS Windows
PHP version: 5.6.15
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:error in summary of array comparison
Description:
------------
---
From manual page: http://www.php.net/language.operators.comparison
---
> Array with fewer members is smaller, if
> key from operand 1 is not found in operand
> 2 then arrays are uncomparable, otherwise
> - compare value by value
This is not true. See my test script below.
(However, the "Example #2 Transcription of standard array comparison" on
the manual page does seem to be true.)
Test script:
---------------
C:\Users\Michael>php
<?php
$a=[1=>1,2=>3];
$b=[1=>2,6=>7];
print $a<$b;
# This prints 1 because it compares the first keys.
# However, according to the manual, as quoted above,
# it should print '' because "key from operand 1
# [namely 2] is not found in operand 2".
--
Edit bug report at https://bugs.php.net/bug.php?id=70850&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70850&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70850&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70850&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70850&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70850&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70850&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70850&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70850&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70850&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70850&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70850&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70850&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70850&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70850&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70850&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70850&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70850&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70850&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70850&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70850&r=mysqlcfg