3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array( '1' => array( 'prodid' => 1, 'title' => 'product one', ), '2' => array( 'prodid' => 2, 'title' => 'product two', ), '3' => array( 'prodid' => 3, 'title' => 'product three', ), ); foreach ($array1 as $prodid => $data){ $insert .= "($prodid,'".$data['title']."'),"; } $insert = substr($insert,0,-1); echo $insert;
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: insert in /in/d07To on line 17 (1,'product one'),(2,'product two'),(3,'product three')
Output for hhvm-3.10.0 - 3.12.0
(1,'product one'),(2,'product two'),(3,'product three')
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: insert in /in/d07To on line 17 (1,'product one'),(2,'product two'),(3,'product three')