3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $results = [ 0 => ['txn' => '1', 'doctype' => 0,'docid' => 1534098], 1 => ['txn' => '1', 'doctype' => 4,'docid' => 1545], 2 => ['txn' => '1', 'doctype' => 4,'docid' => 1098554], 3 => ['txn' => '1', 'doctype' => 5,'docid' => 1098574], 4 => ['txn' => '1', 'doctype' => 7,'docid' => 164525], 5 => ['txn' => '1', 'doctype' => 9,'docid' => 153246], 6 => ['txn' => '1', 'doctype' => 9,'docid' => 1554], 7 => ['txn' => '1', 'doctype' => 9,'docid' => 15347], 8 => ['txn' => '1', 'doctype' => 1,'docid' => 153354], 9 => ['txn' => '1', 'doctype' => 1,'docid' => 190755], 10 => ['txn' => '2', 'doctype' => 0,'docid' => 1554], 11 => ['txn' => '2', 'doctype' => 4,'docid' => 159072], 12 => ['txn' => '2', 'doctype' => 7,'docid' => 1436527], 13 => ['txn' => '2', 'doctype' => 9,'docid' => 15647], 14 => ['txn' => '2', 'doctype' => 1,'docid' => 15745], 15 => ['txn' => '3', 'doctype' => 0,'docid' => 1576274], 16 => ['txn' => '3', 'doctype' => 2,'docid' => 15945], 17 => ['txn' => '3', 'doctype' => 4,'docid' => 15436], 18 => ['txn' => '3', 'doctype' => 5,'docid' => 108543], 19 => ['txn' => '3', 'doctype' => 5,'docid' => 91592], 20 => ['txn' => '3', 'doctype' => 1,'docid' => 15046], 21 => ['txn' => '3', 'doctype' => 1,'docid' => 109567], 22 => ['txn' => '3', 'doctype' => 1,'docid' => 1906735] ]; foreach ($results as $row){ $output .= 'Trans: '.$row['txn'].', DocType: '.$row['doctype'].', Doc ID: '.$row['docid'].'<br>'; } echo $output;
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: output in /in/ZQTgR on line 31 Trans: 1, DocType: 0, Doc ID: 1534098<br>Trans: 1, DocType: 4, Doc ID: 1545<br>Trans: 1, DocType: 4, Doc ID: 1098554<br>Trans: 1, DocType: 5, Doc ID: 1098574<br>Trans: 1, DocType: 7, Doc ID: 164525<br>Trans: 1, DocType: 9, Doc ID: 153246<br>Trans: 1, DocType: 9, Doc ID: 1554<br>Trans: 1, DocType: 9, Doc ID: 15347<br>Trans: 1, DocType: 1, Doc ID: 153354<br>Trans: 1, DocType: 1, Doc ID: 190755<br>Trans: 2, DocType: 0, Doc ID: 1554<br>Trans: 2, DocType: 4, Doc ID: 159072<br>Trans: 2, DocType: 7, Doc ID: 1436527<br>Trans: 2, DocType: 9, Doc ID: 15647<br>Trans: 2, DocType: 1, Doc ID: 15745<br>Trans: 3, DocType: 0, Doc ID: 1576274<br>Trans: 3, DocType: 2, Doc ID: 15945<br>Trans: 3, DocType: 4, Doc ID: 15436<br>Trans: 3, DocType: 5, Doc ID: 108543<br>Trans: 3, DocType: 5, Doc ID: 91592<br>Trans: 3, DocType: 1, Doc ID: 15046<br>Trans: 3, DocType: 1, Doc ID: 109567<br>Trans: 3, DocType: 1, Doc ID: 1906735<br>
Output for hhvm-3.10.0 - 3.12.0
Trans: 1, DocType: 0, Doc ID: 1534098<br>Trans: 1, DocType: 4, Doc ID: 1545<br>Trans: 1, DocType: 4, Doc ID: 1098554<br>Trans: 1, DocType: 5, Doc ID: 1098574<br>Trans: 1, DocType: 7, Doc ID: 164525<br>Trans: 1, DocType: 9, Doc ID: 153246<br>Trans: 1, DocType: 9, Doc ID: 1554<br>Trans: 1, DocType: 9, Doc ID: 15347<br>Trans: 1, DocType: 1, Doc ID: 153354<br>Trans: 1, DocType: 1, Doc ID: 190755<br>Trans: 2, DocType: 0, Doc ID: 1554<br>Trans: 2, DocType: 4, Doc ID: 159072<br>Trans: 2, DocType: 7, Doc ID: 1436527<br>Trans: 2, DocType: 9, Doc ID: 15647<br>Trans: 2, DocType: 1, Doc ID: 15745<br>Trans: 3, DocType: 0, Doc ID: 1576274<br>Trans: 3, DocType: 2, Doc ID: 15945<br>Trans: 3, DocType: 4, Doc ID: 15436<br>Trans: 3, DocType: 5, Doc ID: 108543<br>Trans: 3, DocType: 5, Doc ID: 91592<br>Trans: 3, DocType: 1, Doc ID: 15046<br>Trans: 3, DocType: 1, Doc ID: 109567<br>Trans: 3, DocType: 1, Doc ID: 1906735<br>
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/ZQTgR 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/ZQTgR on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ZQTgR on line 3
Process exited with code 255.