Bug #65339 [Opn->Nab]: 08 and 8 are not the same and 09 and 9 are also not the same
| From: | felipe@php.net | Date: | Fri, 26 Jul 2013 01:25:47 +0000 |
| Subject: | Bug #65339 [Opn->Nab]: 08 and 8 are not the same and 09 and 9 are also not the same | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180495@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65339&edit=1
ID: 65339
Updated by: felipe@php.net
Reported by: dondanielsgh at yahoo dot com
Summary: 08 and 8 are not the same and 09 and 9 are also not
the same
-Status: Open
+Status: Not a bug
Type: Bug
Package: PHP options/info functions
Operating System: windows
PHP Version: 5.5.1
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2013-07-26 00:03:38] cmbecker69 at gmx dot de
| the results should be correct.
Actually the results are correct. 07, 08 and 09 are treated as
octal integers, and the documentation on integers
(<http://www.php.net/manual/en/language.types.integer.php>)
states:
| If an invalid digit is given in an octal integer (i.e. 8 or 9),
| the rest of the number is ignored.
------------------------------------------------------------------------
[2013-07-25 20:42:49] dondanielsgh at yahoo dot com
Description:
------------
$x = 07;
if($x == 7){
echo 'correct';
}else{
echo 'they are not the same';
}
$x = 08;
if($x == 8){
echo 'correct';
}else{
echo 'they are not the same';
}
$x = 09;
if($x == 9){
echo 'correct';
}else{
echo 'they are not the same';
}
Test script:
---------------
$x = 07;
if($x == 7){
echo 'correct';
}else{
echo 'they are not the same';
}
$x = 08;
if($x == 8){
echo 'correct';
}else{
echo 'they are not the same';
}
$x = 09;
if($x == 9){
echo 'correct';
}else{
echo 'they are not the same';
}
Expected result:
----------------
$x = 08;
if($x == 8){
echo 'correct';
}else{
echo 'they are not the same';
}
$x = 09;
if($x == 9){
echo 'correct';
}else{
echo 'they are not the same';
}
the results should be correct.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65339&edit=1