How the answer is ABBC? | Sololearn: Learn to code for FREE!


How the answer is ABBC?

It's a challenge question and I didn't get how it works? See the below screenshot.


19 Answers

New Answer


There is "." to concatenate the first and the second lines. So, echo 'A'. b='B'; == echo 'A'.b='B'; == echo 'AB';


echo 'A'. $b = 'B'; echo 'B'; echo 'C'; Answer: ABBC because of dot (.) echo 'A'; $b = 'B'; echo 'B'; echo 'C'; Answer: ABC


There's a dot (.) between first and second line which concatenates AB and the rest is same.


Been answering this question without understanding. Now I do get it, thanks!


Just a small differences ; is replaced by . That's why answer is ABBC🙃🙂


AJ #L1G3 both of these are the same... <?php echo 'A'. /* did you see the period */ $b = 'B'; echo 'B'; echo 'C'; ?> <?='A'.$b='B'.'B'.'C';?>


Vladimir Got it. If there is semicolon then answer will be ABC. Right?



Sanjay Kamath look at my examples above ... Thanks


Because the cache memory is cleared when the second echo command is called ....😐


UTKARSH SANGAL and Tony Mark please do not spam threads as this takes away from the quality of the thread and provides no relevant information to those needing help. Thanks and happy coding.


AB are concatenated by the .(dot) btwn line 1 and 2


AJ #L1G3 It's in the dot (.) and semicolon (;). Many viable answers here already... 👌


Please does anyone know sololearn gmail account



david chongo I totally understand how that works! ☺️😊😂 We all do!