Practice mode PHP

What is the output of the PHP statement echo “5” + “3”;?

Correct answer D. 8

Explanation

The + operator is arithmetic in PHP, so numeric strings are converted to numbers and added. "5" + "3" gives 8, not the concatenated "53".

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.