If you need to test PHP between different PHP version try this online sandbox:
https://sandbox.onlinephpfunctions.com/

1 How to not get an “apple” element from the array

$a = array("a" => "apple", "b" => "banana");
  1. arraypop(arrayreverse($a))
  2. $a”a” (should it not be $a[“a”] ?)
  3. array_pop($a)
  4. find($a, ‘apple’)

2 Pick the correct answer

<?
$a = array("a" => "apple", "b" => "banana");
$b = array("a" => "pear", "b" => "strawberry", "c" => "cherry");
$c = $a + $b;
print_r($c); // what will it output?

Results:

  1. the keys will be duplicated
  2. the same-key elements in array a will be replaced with the elements of array b
  3. the same-key elements in array b will be replaced with the elements of array a
  4. we cannot add arrays

This page is under development. More content coming out soon…

1
0
Would love your thoughts, please comment.x
()
x