Found this on challenge... Please explain how it work. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Found this on challenge... Please explain how it work.

What is the output of this code? $x = 5 /* + 15 */ + 7; echo $x;

22nd Oct 2017, 9:18 AM
RanjOyHunTer
RanjOyHunTer - avatar
3 Answers
+ 7
The /* */ are there to show where comments are at. just like // except you control use it inside a row, or over different rows. So this is what it also could've said: $x = 5 /* Comment */ +7; That's exactly like: $x = 5 + 7;
22nd Oct 2017, 9:24 AM
Limitless
Limitless - avatar
+ 1
oh didn't see that... the question is kinda confusing... thanks for the answer
22nd Oct 2017, 9:28 AM
RanjOyHunTer
RanjOyHunTer - avatar
0
12
13th Nov 2017, 10:55 AM
Ashish Kumar Keshri
Ashish Kumar Keshri - avatar