3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fields = array('name' => array(),'test' => array(),'lol' => array()); foreach($fields as $k => $v){ $max_length = $row[$k]['max_length']; $min_length = $row[$k]['min_length']; if(strlen($v) > $max_length){ echo 'max!!'; exit(); }elseif(strlen($v) < $min_length){ echo 'min!!'; exit(); }else{ echo strlen($v).'<br>'; } if(is_array($v) || ($this->serialize_bool && is_bool($v))){ $v = serialize($v); } $query .= " '".mysql_real_escape_string($v)."'"; $nr++; if($nr != count($fields)){ $query .= ','; } }
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: row in /in/XAkRo on line 6 Notice: Undefined variable: row in /in/XAkRo on line 7 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 9 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 11 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 14 <br> Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /in/XAkRo:19 Stack trace: #0 {main} thrown in /in/XAkRo on line 19
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: row in /in/XAkRo on line 6 Notice: Undefined variable: row in /in/XAkRo on line 7 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 9 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 11 Warning: strlen() expects parameter 1 to be string, array given in /in/XAkRo on line 14 <br> Fatal error: Call to undefined function mysql_real_escape_string() in /in/XAkRo on line 19
Process exited with code 255.
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: row in /in/XAkRo on line 6 Notice: Undefined variable: row in /in/XAkRo on line 7 Notice: Array to string conversion in /in/XAkRo on line 9 max!!
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: row in /in/XAkRo on line 6 Notice: Undefined variable: row in /in/XAkRo on line 7 Notice: Array to string conversion in /in/XAkRo on line 9 max!!