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

Sunday, April 1, 2012

Value of $a?

What is the value of $a?


<?php
$a=in_array('01',array('1'))==var_dump('01'==1);
?>


a) True
b) False
c) Syntax Error
d) Null


At first, answer seems to False because 01 being a string is not equal to 1. ryt?
But 01 here is an octal number and it equals the 1 that is decimal...
therefore answer is
a) True
any confusion?


No comments:

Post a Comment