+ 2

Output of this code with explanation

<?php $x=11+011; echo $x; ?>

31st Aug 2018, 4:19 PM
Rahul shukla
Rahul shukla - avatar
2 Respostas
+ 1
thanks
31st Aug 2018, 5:37 PM
Rahul shukla
Rahul shukla - avatar
+ 4
Output is 20. When you put a 0 in front, it treats it as an octal value instead. This evals to 9, so 11 + 9 is 20.
31st Aug 2018, 4:25 PM
Fata1 Err0r
Fata1 Err0r - avatar