"/>
Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. What will be the output of the following PHP code ?

    <?php

    $x = "test";

    $y = "this";

    $z = "also";

    $x .= $y .= $z ;

    echo $x;

    echo $y;

    ?>

  2. A.

     testthisthisalso

    B.

     testthis

    C.

     testthisalsothisalso

    D.

     error at line 4

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    The x .= y is a shorthand for x = x.y and this is evaluated from right to left.


Be The First To Comment