|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-10-03 09:54 UTC] robin at patenall dot org dot uk
Description:
------------
It appears that when comparing two arrays with the same keys but in different orders it is possible for the first to be both less than and greater than the second.
Test script:
---------------
<?php
$a = array("b" => 2, "a" => 4);
$b = array("a" => 3, "b" => 3);
/** $b = array("b" => 3, "a" => 3); This works correctly **/
if($a < $b) echo "a is less than b\n";
if($a <= $b) echo "a is less than or equal to b\n";
if($a > $b) echo "a is greater than b\n";
if($a >= $b) echo "a is greater than or equal to b\n";
if($a == $b) echo "a is equal to b\n";
if($a != $b) echo "a is not equal to b\n";
Expected result:
----------------
a is less than b
a is less than or equal to b
a is not equal to b
Actual result:
--------------
a is less than b
a is less than or equal to b
a is greater than b
a is greater than or equal to b
a is not equal to b
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
if (isset($_SERVER['SERVER_ADDR'])) { if (strpos($_SERVER['SERVER_ADDR'],"192.168.10") >= 0) { $where="http://qnap/piwik/"; } else { $where="https://www.someurl/piwik/"; } } else $where="https://someurl/piwik/"; Problem arrises when >= is processed