3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $product = array('material', 'britelki', 'chaschka', 'kostochki', 'vkladish', 'zastejka'); foreach($product as $key){ $var = "show_the_product_".$key; echo $key.'<br>'; $$var = function($key){ $a = "gc_".$key; echo $a; }; } $show_the_product_material();
Output for 7.1.0
material<br>britelki<br>chaschka<br>kostochki<br>vkladish<br>zastejka<br> Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 0 passed in /in/uHAmH on line 16 and exactly 1 expected in /in/uHAmH:8 Stack trace: #0 /in/uHAmH(16): {closure}() #1 {main} thrown in /in/uHAmH on line 8
Process exited with code 255.
Output for 5.3.0 - 7.0.14
material<br>britelki<br>chaschka<br>kostochki<br>vkladish<br>zastejka<br> Warning: Missing argument 1 for {closure}(), called in /in/uHAmH on line 16 and defined in /in/uHAmH on line 8 Notice: Undefined variable: key in /in/uHAmH on line 9 gc_
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/uHAmH on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/uHAmH on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/uHAmH on line 8
Process exited with code 255.