3v4l.org

run code in 300+ PHP versions simultaneously
<?php $options = ['paper', 'rock', 'scissors']; $lookup = array_flip($options); $outcomes = ['draw', 'win', 'lose']; // only extract a random value if the player has selected an option -- otherwise there is no comparison executed. $cpuSelection = $options[array_rand($options)]; $playerSelection = 'rock'; $comparison = $lookup[$cpuSelection] - $lookup[$playerSelection]; var_export([ 'cpu' => $cpuSelection, 'human' => $playerSelection, 'outcome' => $outcomes[($comparison + 3) % 3] ]);

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.80.0090.01216.47
7.4.70.0130.00516.38
7.4.60.0100.00716.27
7.4.50.0130.00916.57
7.4.40.0100.00716.55
7.4.30.0120.01216.22
7.4.20.0140.00416.68
7.4.10.0150.00916.55
7.4.00.0100.00716.70
7.3.200.0140.00616.32
7.3.190.0100.01016.34
7.3.180.0110.00616.25
7.3.170.0090.00816.21
7.3.160.0060.01216.32
7.3.150.0070.01716.53
7.3.140.0130.01016.45
7.3.130.0130.00416.59
7.3.120.0120.00616.64
7.3.110.0090.00616.62
7.3.100.0070.01016.54
7.3.90.0090.00816.29
7.3.80.0100.00616.59
7.3.70.0140.00616.25
7.3.60.0050.01016.34
7.3.50.0040.01216.36
7.3.40.0100.00716.43
7.3.30.0100.00516.38
7.3.20.0110.00616.46
7.3.10.0120.00616.40
7.3.00.0050.01616.48
7.2.320.0100.01316.42
7.2.310.0130.01016.41
7.2.300.0110.00716.78
7.2.290.0160.01016.45
7.2.280.0130.00716.74
7.2.270.0090.01216.53
7.2.260.0060.01016.35
7.2.250.0180.00616.79
7.2.240.0130.00416.70
7.2.230.0120.00516.32
7.2.220.0080.00816.53
7.2.210.0070.01016.39
7.2.200.0080.00816.59
7.2.190.0130.00516.47
7.2.180.0060.01016.29
7.2.170.0110.00516.55
7.2.160.0060.00916.46
7.2.150.0530.01316.58
7.2.140.0000.02516.53
7.2.130.0140.00416.48
7.2.120.0070.01416.59
7.2.110.0100.00616.62
7.2.100.0100.00716.45
7.2.90.0100.00816.42
7.2.80.0100.00716.61
7.2.70.0080.00816.39
7.2.60.0090.00916.73
7.2.50.0070.01016.33
7.2.40.0150.00316.59
7.2.30.0070.01116.71
7.2.20.0070.01016.67
7.2.10.0120.00616.45
7.2.00.0070.01116.31

preferences:
42.95 ms | 400 KiB | 5 Q