3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code = array_map( function ($line) { return $line ? ' '.$line : $line; }, explode("\n", $code) ); return sprintf( "if (%s)\n{\n%s}\n", implode(' && ', $conditions), $code );
Output for 7.0.20, 7.1.5 - 7.2.0
Notice: Undefined variable: code in /in/6tcFf on line 7 Notice: Undefined variable: conditions in /in/6tcFf on line 11 Warning: implode(): Invalid arguments passed in /in/6tcFf on line 11 Notice: Array to string conversion in /in/6tcFf on line 12
Output for 7.0.0 - 7.0.6, 7.1.0
Notice: Undefined variable: code in /in/6tcFf on line 7 Notice: Undefined variable: conditions in /in/6tcFf on line 11 Warning: implode(): Invalid arguments passed in /in/6tcFf on line 11 Notice: Array to string conversion in /in/6tcFf on line 11
Output for 5.4.9 - 5.6.28
Notice: Undefined variable: code in /in/6tcFf on line 7 Notice: Undefined variable: conditions in /in/6tcFf on line 11 Warning: implode(): Invalid arguments passed in /in/6tcFf on line 11 Notice: Array to string conversion in /in/6tcFf on line 13
Output for 5.3.19 - 5.3.29
Notice: Undefined variable: code in /in/6tcFf on line 7 Notice: Undefined variable: conditions in /in/6tcFf on line 11 Warning: implode(): Invalid arguments passed in /in/6tcFf on line 11