Bug #67876 [Opn->Nab]: output invalid
Edit report at https://bugs.php.net/bug.php?id=67876&edit=1
ID: 67876
Updated by: requinix@php.net
Reported by: jaikeysarraf at gmail dot com
Summary: output invalid
-Status: Open
+Status: Not a bug
Type: Bug
Package: Output Control
Operating System: all
PHP Version: 5.5.15
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Zero prefix on a number means octal. 08 is invalid octal so $b is 0.
http://php.net/manual/en/language.types.integer.php
Previous Comments:
------------------------------------------------------------------------
[2014-08-21 04:15:40] jaikeysarraf at gmail dot com
Description:
------------
here is my simple code :
<?php
$a=07;
$b=08;
if ($a>$b)
{
echo $a;
}
else {
echo $b;
}
?>
this should output 8
but shows me 7
I don't know why but in other languages(java vb) answer is always 8
Test script:
---------------
<?php
$a=07;
$b=08;
if ($a>$b)
{
echo $a;
}
else {
echo $b;
}
?>
Expected result:
----------------
should be 8 in output
Actual result:
--------------
7
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67876&edit=1
Thread (2 messages)