What is the output of the following code?

What is the output of the following code?

echo "1" + 2 * "0x02";
A . 1
B . 3
C . 5
D . 20
E . 7

Answer: C

Subscribe
Notify of
guest
1 Comment
Inline Feedbacks
View all comments
Md Mahsin Ahmed
Md Mahsin Ahmed
2 years ago

from PHP 7 or later result is A
till PHP 5.6.29 result is C