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 7.0.0 - 7.1.0
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting variable (T_VARIABLE) in /in/gYDNZ(5) : runtime-created function on line 1
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Fatal error: syntax error, unexpected ',', expecting '&' or T_VARIABLE or ...
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting variable (T_VARIABLE) in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in /in/gYDNZ on line 5 Warning: implode(): Invalid arguments passed in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.4.0 - 5.5.35
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting '&' or variable (T_VARIABLE) in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in /in/gYDNZ on line 5 Warning: implode(): Invalid arguments passed in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting '&' or T_VARIABLE in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in /in/gYDNZ on line 5 Warning: implode(): Invalid arguments passed in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.2.5 - 5.2.17
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting '&' or T_VARIABLE in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Invalid arguments passed in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.1.0 - 5.2.4
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting '&' or T_VARIABLE in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: parse error, unexpected ',', expecting '&' or T_VARIABLE in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: parse error, unexpected ',', expecting '&' or T_VARIABLE in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: syntax error, unexpected ',', expecting ')' in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 4.3.5 - 4.4.1
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: parse error, unexpected ',', expecting ')' in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: parse error, expecting `')'' in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map(): The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode(): Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: key in /in/gYDNZ on line 5 Notice: Undefined variable: value in /in/gYDNZ on line 5 Parse error: parse error, unexpected ',', expecting ')' in /in/gYDNZ(5) : runtime-created function on line 1 Warning: array_map() [http://www.php.net/function.array-map]: The first argument, '', should be either NULL or a valid callback in /in/gYDNZ on line 5 Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/gYDNZ on line 6 <div >faszom</div>
Process exited with code 255.