3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public function __construct() { $item = $this->itemResolver(); foreach(iterator_to_array($item,true) as $field){ } } public function itemResolver(): \Generator { // $stmt = mysqli_query($db_connect, "select pk_i_id from oc_t_item_resource ORDER by pk_i_id desc"); // $records = mysqli_fetch_all($stmt); $records = [ 0 => [0 => '4031'], 1 => [0 => '4030'], 2 => [0 => '4029'] ]; foreach($records as $record => $value){ yield $record; } } } var_dump(new Test());
based on scse5
Output for 7.0.28 - 7.3.0rc3
object(Test)#1 (0) { }
Output for 5.6.38
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/XCW43 on line 15
Process exited with code 255.