3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( 'status' => (object) (array( 'code' => 0, 'message' => 'Success', )), 'result' => array( 0 => (object) (array( 'base' => (object) (array( 'id' => 3, 'created' => '2012-11-11 12:11:07', 'start' => '2012-11-11', )), 'pos' => array( 0 => (object) (array( 'id' => 4, 'invoices_id' => 3, 'article_id' => 1, 'quantity' => 1, 'unit' => 'Monate', 'pos_txt' => 'Paketname', )), ), 'summ' => (object) (array( 'net' => '2.52', 'discount' => 0, 'tax' => '0.47899159663865', 'gross' => 3, 'rounded_net' => '2.52', )), )), 1 => (object) (array( 'base' => (object) (array( 'id' => 2, 'created' => '2012-11-11 12:10:39', 'start' => '2012-11-11', )), 'pos' => array( 0 => (object) (array( 'id' => 3, 'invoices_id' => 2, 'article_id' => 2, 'quantity' => 1, 'unit' => 'Monate', 'pos_txt' => 'Paketname2', )), ), 'summ' => (object) (array( 'net' => '5.04', 'discount' => 0, 'tax' => '0.95798319327731', 'gross' => 6, 'rounded_net' => '5.04', )), )), ), ); echo "<pre>"; foreach(array_map(function($v){ return $v->pos ;}, $data['result']) as $list) { foreach($list as $objPos) echo $objPos->pos_txt,PHP_EOL; } ?>
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
<pre>Paketname Paketname2
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/07B2Q on line 70
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/07B2Q on line 70
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/07B2Q on line 70
Process exited with code 255.

preferences:
282.39 ms | 401 KiB | 447 Q