Operations where the dividend value starts at 0

Asked

Viewed 23 times

0

I have the following code:

$value = 040;
echo $value / 2;

Exit:

16

The variable $valueand receives 040 instead of simply 40. However, in some languages, perhaps most, the 0 would be disregarded, in PHP no.

What would be the logic behind this operation?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.