3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! function get_in_sql($getdata){ if(is_array($getdata)) { //$string = ""; if (count($getdata) == 1) { $string = $getdata[0]; } else { foreach ($getdata as $value) { $string .= $value.","; } } return $string; } return $getdata; } $array = array('0'=>1,'1'=>3,'2'=>2); echo get_in_sql($array);
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: string in /in/esKks on line 10 1,3,2,
Output for hhvm-3.10.0 - 3.12.0
1,3,2,
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: string in /in/esKks on line 10 1,3,2,