3v4l.org

run code in 200+ 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 - 7.2.0
Notice: Undefined variable: string in /in/esKks on line 10 1,3,2,
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: string in /in/esKks on line 10 1,3,2,