3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array("g", "lol", "hhh", "gob" , "pinapple"); var_dump($x); echo count($x); echo "\n" . mt_rand(0, count($vendorlist) - 1);
Output for 5.3.4 - 5.6.25, 7.0.0 - 7.1.0
array(5) { [0]=> string(1) "g" [1]=> string(3) "lol" [2]=> string(3) "hhh" [3]=> string(3) "gob" [4]=> string(8) "pinapple" } 5 Notice: Undefined variable: vendorlist in /in/8c1EN on line 6 Warning: mt_rand(): max(-1) is smaller than min(0) in /in/8c1EN on line 6
Output for 5.0.4 - 5.3.3, hhvm-3.10.0 - 3.12.0
array(5) { [0]=> string(1) "g" [1]=> string(3) "lol" [2]=> string(3) "hhh" [3]=> string(3) "gob" [4]=> string(8) "pinapple" } 5 Notice: Undefined variable: vendorlist in /in/8c1EN on line 6 0
Output for 4.3.0 - 5.0.3
array(5) { [0]=> string(1) "g" [1]=> string(3) "lol" [2]=> string(3) "hhh" [3]=> string(3) "gob" [4]=> string(8) "pinapple" } 5 Notice: Undefined variable: vendorlist in /in/8c1EN on line 6 0