What is the result of executing following code?
<?php
    define('FOO', 10);
    $array = array(10 => FOO, "FOO" => 20);
    print $array[$array[FOO]] * $array["FOO"];
?>
Explanation

print $array[$array[FOO]] * $array["FOO"];

$array[FOO] = FOO = 10;
$array[$array[FOO]] = $array[10] = 10;

$array["FOO"] = 20;

10 * 20 = 200;

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
PHP quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes