3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $params_to_return = array( 'count' => range(1,10), 'sum' => array_sum(range(1,10)) ); // Manually $count = $params_to_return['count']; $sum = $params_to_return['sum']; var_dump($count, $sum); unset($count, $sum); var_dump($count, $sum); // Automatically extract($params_to_return); var_dump($count, $sum); unset($count, $sum); var_dump($count, $sum); // Listing list($count, $sum) = $params_to_return; var_dump($count, $sum); unset($count, $sum); var_dump($count, $sum);
Output for 7.0.0 - 7.1.0
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 14 Notice: Undefined variable: sum in /in/cDqaG on line 14 NULL NULL array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 21 Notice: Undefined variable: sum in /in/cDqaG on line 21 NULL NULL Notice: Undefined offset: 0 in /in/cDqaG on line 24 Notice: Undefined offset: 1 in /in/cDqaG on line 24 NULL NULL Notice: Undefined variable: count in /in/cDqaG on line 28 Notice: Undefined variable: sum in /in/cDqaG on line 28 NULL NULL
Output for hhvm-3.10.0 - 3.12.0
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 14 Notice: Undefined variable: sum in /in/cDqaG on line 14 NULL NULL array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 21 Notice: Undefined variable: sum in /in/cDqaG on line 21 NULL NULL Notice: Undefined index: 0 in /in/cDqaG on line 24 Notice: Undefined index: 1 in /in/cDqaG on line 24 NULL NULL Notice: Undefined variable: count in /in/cDqaG on line 28 Notice: Undefined variable: sum in /in/cDqaG on line 28 NULL NULL
Output for 5.3.0 - 5.6.28
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 14 Notice: Undefined variable: sum in /in/cDqaG on line 14 NULL NULL array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 21 Notice: Undefined variable: sum in /in/cDqaG on line 21 NULL NULL Notice: Undefined offset: 1 in /in/cDqaG on line 24 Notice: Undefined offset: 0 in /in/cDqaG on line 24 NULL NULL Notice: Undefined variable: count in /in/cDqaG on line 28 Notice: Undefined variable: sum in /in/cDqaG on line 28 NULL NULL
Output for 5.0.4 - 5.2.17
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 14 Notice: Undefined variable: sum in /in/cDqaG on line 14 NULL NULL array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 21 Notice: Undefined variable: sum in /in/cDqaG on line 21 NULL NULL Notice: Undefined offset: 1 in /in/cDqaG on line 24 Notice: Undefined offset: 0 in /in/cDqaG on line 24 NULL NULL Notice: Undefined variable: count in /in/cDqaG on line 28 Notice: Undefined variable: sum in /in/cDqaG on line 28 NULL NULL
Output for 4.3.0 - 5.0.3
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 14 Notice: Undefined variable: sum in /in/cDqaG on line 14 NULL NULL array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(9) [9]=> int(10) } int(55) Notice: Undefined variable: count in /in/cDqaG on line 21 Notice: Undefined variable: sum in /in/cDqaG on line 21 NULL NULL Notice: Undefined offset: 1 in /in/cDqaG on line 24 Notice: Undefined offset: 0 in /in/cDqaG on line 24 NULL NULL Notice: Undefined variable: count in /in/cDqaG on line 28 Notice: Undefined variable: sum in /in/cDqaG on line 28 NULL NULL