3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function _div($params = array(), $content=null) { //$value = preg_replace("/(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/", "$1.$2.$3 $4:$5", $value); if(count($params) > 0) { $createParams = array_map(create_function($key, $value, 'return $key."=\'".$value."\'";'), array_keys($params), array_values($params)); $paramsText = implode(" ",$createParams); } return "<div ".$paramsText.">".$content."</div>"; } print _div(array('field' => 'teszt'), 'faszom');
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: key in /in/6Ea8M on line 5 Notice: Undefined variable: value in /in/6Ea8M on line 5 Warning: create_function() expects exactly 2 parameters, 3 given in /in/6Ea8M on line 5 Notice: Array to string conversion in /in/6Ea8M on line 6 <div Array>faszom</div>
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: key in /in/6Ea8M on line 5 Notice: Undefined variable: value in /in/6Ea8M on line 5 Warning: Wrong parameter count for create_function() in /in/6Ea8M on line 5 Notice: Array to string conversion in /in/6Ea8M on line 6 <div Array>faszom</div>
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: key in /in/6Ea8M on line 5 Notice: Undefined variable: value in /in/6Ea8M on line 5 Warning: Wrong parameter count for create_function() in /in/6Ea8M on line 5 Notice: Array to string conversion in /in/6Ea8M on line 6 <div Array>faszom</div>
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: key in /in/6Ea8M on line 5 Notice: Undefined variable: value in /in/6Ea8M on line 5 Warning: Wrong parameter count for create_function() in /in/6Ea8M on line 5 Notice: Array to string conversion in /in/6Ea8M on line 6 <div Array>faszom<.div>