3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $product = array('material', 'britelki', 'chaschka', 'kostochki', 'vkladish', 'zastejka'); if( !function_exists('create_from_variable') ){ function create_from_variable($arr){ foreach($product as $key){ create_function('',"$gc_".$key." = 123; echo '<p>$gc_".$key."</p>';"); } } } create_from_variable($product);
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: product in /in/OL72p on line 8 Warning: Invalid argument supplied for foreach() in /in/OL72p on line 8
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: product in /in/OL72p on line 12 Warning: Invalid argument supplied for foreach() in /in/OL72p on line 12
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/OL72p on line 8
Output for 4.3.11