3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($i=0; $i < 20; $i++) { $sterren = array("3","4","5"); $sterrenr = array_rand($sterren, 3); $sterrenf = $sterren[$sterrenr]; echo $sterrenf."\n"; }
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6 Warning: Illegal offset type in /in/rf1Gc on line 6
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6 Notice: Array to string conversion in /in/rf1Gc on line 6 Notice: Undefined index: Array in /in/rf1Gc on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6 Notice: Array to string conversion in /in/rf1Gc on line 6 Notice: Undefined index: Array in /in/rf1Gc on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6 Notice: Array to string conversion in /in/rf1Gc on line 6 Notice: Undefined index: Array in /in/rf1Gc on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6 Notice: Array to string conversion in /in/rf1Gc on line 6 Notice: Undefined index: Array in /in/rf1Gc on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6 Notice: Array to string conversion in /in/rf1Gc on line 6 Notice: Undefined index: Array in /in/rf1Gc on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/rf1Gc on line 6