3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vowels = array('a','e','i','o','u'); $other = array(); $prev = null; for ($x=0,$s=null,$s=null;$x<4;$x++) { if (in_array($prev, $other)) { $s .= $vowels[array_rand($vowels)]; } else { $s .= $other[array_rand($other)]; } $prev = $s; } echo $s;
Output for 7.1.0
Warning: array_rand(): Array is empty in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: array_rand(): Array is empty in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: array_rand(): Array is empty in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: array_rand(): Array is empty in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.0.14
Notice: Undefined index: in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11
Output for hhvm-3.10.0 - 3.12.0
Warning: Second argument has to be between 1 and the number of elements in the array in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: Second argument has to be between 1 and the number of elements in the array in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: Second argument has to be between 1 and the number of elements in the array in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11 Warning: Second argument has to be between 1 and the number of elements in the array in /in/kf4Fo on line 11 Notice: Undefined index: in /in/kf4Fo on line 11
Output for 4.3.0 - 5.4.45