PHP ZCE mock test, interview preparation, daily lessons under chalk talk

Thursday, January 12, 2012

ZCE Zend Certified Engineer Define problem


View the Complete Blog on ZCE

define('FOO', 10);

$array = array(10 => FOO,
               "FOO" => 20);

print $array[$array[FOO]] * $array["FOO"];
Answer: $array[FOO] will be replaced by $array[10].
The value of $array[10] is again FOO ie 10
therefore $array[$array[FOO]] = 10


2 comments: