3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_value() { // If there were no values returned, return false. if (func_num_args() == 0) { return false; } // Get all the values supplied $values = func_get_args(); $random = array_rand($values); return $values[$random]; } echo "First random try: ".random_value(1, 5, 4, 5); echo "\n\n"; echo "Second random try: ".random_value(9, 8); echo "\n\n"; echo "Third random try: ".random_value(3, 10, 6, 2, 4, 7);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.4.00.0110.01115.02
7.3.120.0080.00414.59
7.3.110.0140.00714.39
7.3.100.0060.00914.66
7.3.90.0000.01114.91
7.3.80.0000.01414.61
7.3.70.0030.00814.73
7.3.60.0100.00814.52
7.3.50.0110.00614.69
7.3.40.0090.00414.74
7.3.30.0110.00414.84
7.3.20.0050.01115.72
7.3.10.0080.00915.56
7.3.00.0060.00915.78
7.2.250.0100.01014.95
7.2.240.0030.01614.76
7.2.230.0000.01514.88
7.2.220.0070.00314.90
7.2.210.0060.01015.31
7.2.200.0130.00315.11
7.2.190.0100.00515.11
7.2.180.0090.00715.03
7.2.170.0070.00914.98
7.2.160.0050.00915.14
7.2.150.0190.00914.95
7.2.140.0130.01014.96
7.2.130.0130.00615.05
7.2.120.0110.00415.04
7.2.110.0110.00715.25
7.2.100.0130.01015.20
7.2.90.0830.00315.23
7.2.80.0140.00615.27
7.2.70.0290.00015.26
7.2.60.0100.01015.27
7.2.50.0160.00615.13
7.2.40.0200.01015.29
7.2.30.0100.00714.98
7.2.20.0190.00314.97
7.2.10.0130.00415.13
7.2.00.0100.00715.19
7.1.330.0030.01015.91
7.1.320.0040.00815.83
7.1.310.0030.01015.91
7.1.300.0110.00814.77
7.1.290.0090.00714.88
7.1.280.0130.00314.73
7.1.270.0140.00614.73
7.1.260.0050.01114.80
7.1.250.0060.00613.80

preferences:
36.81 ms | 401 KiB | 5 Q