Consider following code snippet:
$a = 3;
$arr[] = "TRUE";
$arr = (array) $a;
echo $arr[0];
What will be printed after executing the code above?
$arr[] = "TRUE"; - first ( 0 ) element in $arr array.
$arr = (array) $a; - after the type conversion we will have $arr: ([0]=>3), and that is means 0 element of $arr array will overwrite.

Follow CodeGalaxy

Mobile Beta

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