Working with the ‘+’ operator

Predict the output of the following code snippet.

<?php

$a = array(

0=>”ONE”,

2=>”TWO”);

$b = array(

1=>”Three”,

2=>”Four”);

foreach(($a + $b) as $key=>$value)

{

print(“$key: $value\n”);

}

?>

Options

1.0: ONE

2: TWO

1: THREE

2: TWO

2.0: ONE

2: TWO

1: THREE

2: FOUR

3.0: ONE

2: TWO

1: THREE

4.None of these

Related Posts

Close Bitnami banner
Bitnami