Wednesday, February 10, 2010

What is displayed when the following script is executed?

define(myvalue, "10");
$myarray[10] = "Dog";
$myarray[] = "Human";
$myarray['myvalue'] = "Cat";
$myarray["Dog"] = "Cat";
print "The value is: ";
print $myarray[myvalue]."\n";

a) The value is: Dog
b) The value is: Cat
c) The value is: Human
d) The value is: 10
e) Dog

post comments to answer

3 comments: