rfc:comparison_inconsistency

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:comparison_inconsistency [2014/01/02 19:52] – Add INF/NAN comparison against integer. yohgakirfc:comparison_inconsistency [2014/01/08 01:56] yohgaki
Line 137: Line 137:
   "          b"   "          b"
  
-=== String Integer conversion ===+==== String Integer conversion ====
  
 PHP converts "integer like string to integer". PHP converts "integer like string to integer".
Line 157: Line 157:
 https://bugs.php.net/bug.php?id=66211 https://bugs.php.net/bug.php?id=66211
  
-=== NAN/INF of float ===+==== NAN/INF of float ====
  
 NAN/INF issue. NAN/INF issue.
Line 174: Line 174:
   var_dump((int) (bool) INF);   // int 1   var_dump((int) (bool) INF);   // int 1
  
 +E_WARNING for these invalid/unreliable operations might be better.
 + 
 This could be mitigated by GMP float support. This could be mitigated by GMP float support.
 +
 +
 +==== Object Array conversion of numeric property/index ====
 +
 +https://bugs.php.net/bug.php?id=66173
 +
 +  $ php -v
 +  PHP 5.5.7 (cli) (built: Dec 11 2013 07:51:06) 
 +  Copyright (c) 1997-2013 The PHP Group
 +  Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
 +  
 +  $ php -r '$obj = new StdClass; $obj->{12} = 234; ${1} = 567; var_dump($obj, ${1}); $ary = (array)$obj; var_dump($ary, $ary[12]);'
 +  object(stdClass)#1 (1) {
 +    ["12"]=>
 +    int(234)
 +  }
 +  int(567)
 +
 +
 +  Notice: Undefined offset: 12 in Command line code on line 1
 +  array(1) {
 +    ["12"]=>
 +    int(234)
 +  }
 +  NULL <= SHOULD BE int(234)
 +
 +
 +
  
 ==== Function/Method ==== ==== Function/Method ====
 +
 +=== is_numeric ===
 +
 +https://bugs.php.net/bug.php?id=66399
 +
 +
 +=== base_convert ====
 +
 +https://wiki.php.net/rfc/base-convert
 +
  
 === min() function === === min() function ===
Line 210: Line 250:
 There are bug reports that complain return value inconsistency. The document could be improved with more explanations. There are bug reports that complain return value inconsistency. The document could be improved with more explanations.
  
-== Related Bug Reports ==+**Related Bug Reports**
   * https://bugs.php.net/bug.php?id=60338 (Returns value for wrong key())   * https://bugs.php.net/bug.php?id=60338 (Returns value for wrong key())
   * https://bugs.php.net/bug.php?id=64860 (returns NULL for wrong file parameter)   * https://bugs.php.net/bug.php?id=64860 (returns NULL for wrong file parameter)