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?
<?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