Register now or log in to join your professional community.
<p><?php</p> <p>$k=0123;echo $k;</p> <p>?></p>
Yes anything that starts with0 is an octal integer.
If you don't want to store string and want to store number then following are2 options.
$k =0123.00;
OR if you want to stick with integer then you can do casting.
$k = (int)0123.00;
Because it's assigning $k to the octal value of0123 which is83.
0123 =83 in octal
Instead, try to store0123 as a string e.g. $k = "0123";
This is OCTAL Number so this will be calculated as: