3v4l.org

run code in 200+ 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 7.2.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: count(): Parameter must be an array or an object that implements Countable 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.3.4 - 7.1.7
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
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