|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-05 18:53 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2012-03-05 18:53 UTC] rasmus@php.net
[2012-03-05 23:58 UTC] anon at anon dot anon
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 15:00:01 2025 UTC |
Description: ------------ My concern is that PHP treats the handling of variable assignment inconsistently. For example if I assign 01 to a variable $i01 the result will be an int 1, the same as if I had assigned 1 to the variable. This works for values of 01,02,03,04,05,06, and 07. However 08 and 09 are assigned as 0! See repeatable test below. Test script: --------------- Assign variables: $s09 = '09'; $c09 = (integer) '09'; $i09 = 09; Result of var_dump($s09.' / '.$c09.' / '.$i09); string '09 / 9 / 0' Assign variables: $s07 = '07'; $c07 = (integer) '07'; $i07 = 07; Result of var_dump($s07.' / '.$c07.' / '.$i07); string '07 / 7 / 7' And when I just dump the $iXX variable I get: var_dump($i09); Result int 0 var_dump($i07); Result int 7 This looks like a bug to me.