3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = 11; while( $num > 0) { array_push($stack,($num % $base)); // pushes remainder on stack $num = (int) ($num/$base); // no integer division } while($stack) { echo array_pop($stack); // 1011 in final iteration } echo "\n";
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: base in /in/hima8 on line 7 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/hima8:7 Stack trace: #0 {main} thrown in /in/hima8 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: Division by zero in /in/hima8 on line 7 Warning: array_push() expects parameter 1 to be array, null given in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9
Output for 5.2.0 - 5.2.17
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: Division by zero in /in/hima8 on line 7 Warning: array_push(): First argument should be an array in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9
Output for 5.0.4 - 5.1.6
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: array_push(): First argument should be an array in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9
Output for 4.3.2 - 4.4.4, 5.0.0 - 5.0.3
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: array_push(): First argument should be an array in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: Division by zero in /in/hima8 on line 7 Warning: array_push(): First argument should be an array in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: base in /in/hima8 on line 7 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/hima8 on line 7 Notice: Undefined variable: base in /in/hima8 on line 9 Warning: Division by zero in /in/hima8 on line 9