3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = ['test' => [1,2,3]]; $process = proc_open( 'set', array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), ), $pipes, null, $x ); if (is_resource($process)) { fclose($pipes[0]); echo stream_get_contents($pipes[1]); fclose($pipes[1]); var_dump(proc_close($process)); } print_r($x);
Output for 7.0.12 - 7.1.0
Notice: Array to string conversion in /in/OQI7K on line 12 int(127) Array ( [test] => Array ( [0] => 1 [1] => 2 [2] => 3 ) )
Output for 7.0.0 - 7.0.6
Notice: Array to string conversion in /in/OQI7K on line 12 Notice: Array to string conversion in /in/OQI7K on line 12 int(127) Array ( [test] => Array ( [0] => 1 [1] => 2 [2] => 3 ) )
Output for 5.4.27 - 5.4.45, 5.5.11 - 5.6.28
Notice: Array to string conversion in /in/OQI7K on line 14 Notice: Array to string conversion in /in/OQI7K on line 14 int(127) Array ( [test] => Array ( [0] => 1 [1] => 2 [2] => 3 ) )
Output for 5.4.0 - 5.4.26, 5.5.0 - 5.5.10
Notice: Array to string conversion in /in/OQI7K on line 14 int(127) Array ( [test] => Array )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OQI7K on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/OQI7K on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OQI7K on line 3
Process exited with code 255.