Why the answer is 0? | SoloLearn: Learn to code for FREE!

+15

Why the answer is 0?

It's a challenge question and found answer 0 but don't know how. Can anyone please explain? Check the attached Screenshot. https://photos.app.goo.gl/oE8XPESjPi7kcP539

php

8/4/2020 4:40:35 PM

A J

4 Answers

New Answer

+11

In echo statement you can not use plus sign to join two strings.

+9

To concatenate we use '.' symbol'+' is for numbers. Here string as a number is zero. Adding two strings is 0 + 0=0

+6

Thanks everyone I got now.

+5

AJ #L1G3 string concatenate is done by dot operator so that's why non numeric value is provided it's parses error. Due to that to make it more good the author of that quiz has used 0 as error 1 as executed.