3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'foo', 'bar', 'baz' ); srand(1); if (defined('MT_RAND_PHP')) mt_srand(1, MT_RAND_PHP); else mt_srand(1); function custom_array_rand() { global $array; $key = array_rand($array); var_dump('found key ' . $key); return $array[$key]; } var_dump( custom_array_rand(), custom_array_rand(), custom_array_rand() );

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)
8.1.120.0030.00617.40
8.1.110.0110.00617.38
8.1.100.0120.00317.32
8.1.90.0130.00317.32
8.1.80.0120.00417.32
8.1.70.0120.00317.23
8.1.60.0090.00917.57
8.1.50.0130.00717.50
8.1.40.0060.01217.41
8.1.30.0120.00617.57
8.1.20.0110.00717.64
8.1.10.0190.00017.59
8.1.00.0140.00517.53
8.0.250.0040.00716.96
8.0.240.0130.00416.93
8.0.230.0080.00816.88
8.0.220.0100.00516.82
8.0.210.0000.01616.79
8.0.200.0100.00517.06
8.0.190.0070.00716.76
8.0.180.0070.00716.96
8.0.170.0100.00517.00
8.0.160.0150.00016.87
8.0.150.0000.01416.82
8.0.140.0150.00016.93
8.0.130.0150.00016.86
8.0.120.0130.00316.87
8.0.110.0110.00416.82
8.0.100.0060.00916.88
8.0.90.0080.00816.80
8.0.80.0110.00416.83
8.0.70.0130.00316.68
8.0.60.0080.00516.75
8.0.50.0050.01016.91
8.0.30.0130.00216.85
8.0.20.0150.00016.94
8.0.10.0120.00316.87
8.0.00.0130.00316.92
7.4.320.0100.00516.43
7.4.300.0110.00516.62
7.4.290.0170.00016.60
7.4.280.0170.00016.57
7.4.270.0160.00016.58
7.4.260.0160.00216.57
7.4.250.0080.00816.41
7.4.240.0150.00016.48
7.4.230.0160.00016.50
7.4.220.0090.00416.61
7.4.210.0080.00316.50
7.4.200.0090.00416.57
7.4.190.0120.00216.54
7.4.180.0070.00716.65
7.4.160.0130.00016.57
7.4.150.0120.00316.57
7.4.140.0070.00716.45
7.4.130.0110.00216.43
7.4.120.0110.00316.47
7.4.110.0150.00016.43
7.4.100.0140.00016.54
7.4.90.0100.00316.45
7.4.80.0140.00016.41
7.4.70.0130.00016.42
7.4.60.0080.00816.44
7.4.50.0000.01416.38
7.4.40.0070.00716.33
7.4.30.0050.00816.56
7.4.20.0140.00016.45
7.4.10.0080.00516.50
7.4.00.0080.00416.48
7.3.330.0130.00316.21
7.3.320.0100.00316.33
7.3.310.0070.00716.44
7.3.300.0070.00716.39
7.3.290.0140.00016.37
7.3.280.0080.00816.21
7.3.270.0130.00316.33
7.3.260.0070.00816.30
7.3.250.0060.00916.29
7.3.240.0110.00316.32
7.3.230.0120.00316.20
7.3.220.0090.00616.31
7.3.210.0150.00016.24
7.3.200.0050.01016.29
7.3.190.0110.00416.27
7.3.180.0140.00016.06
7.3.170.0120.00416.14
7.3.160.0140.00016.16
7.3.150.0070.00716.30
7.3.140.0080.00716.10
7.3.130.0140.00016.14
7.3.120.0150.00016.25
7.3.110.0140.00016.33
7.3.100.0070.00716.25
7.3.90.0140.00016.42
7.3.80.0070.00716.28
7.3.70.0080.00716.44
7.3.60.0140.00016.48
7.3.50.0120.00416.43
7.3.40.0090.00516.36
7.3.30.0000.01316.41
7.3.20.0070.00716.47
7.3.10.0090.00616.27
7.3.00.0150.00216.34
7.2.340.0110.00416.38
7.2.330.0140.00416.38
7.2.320.0090.00616.32
7.2.310.0100.00716.14
7.2.300.0110.00316.14
7.2.290.0090.00616.32
7.2.280.0100.00516.34
7.2.270.0110.00316.18
7.2.260.0130.00316.33
7.2.250.0140.00016.36
7.2.240.0100.00516.20
7.2.230.0120.00216.23
7.2.220.0070.00716.37
7.2.210.0100.00316.18
7.2.200.0140.00316.33
7.2.190.0090.00516.33
7.2.180.0170.00016.54
7.2.170.0110.00416.50
7.2.160.0120.00316.41
7.2.150.0000.01416.57
7.2.140.0100.00416.36
7.2.130.0150.00016.49
7.2.120.0140.00016.55
7.2.110.0220.00016.48
7.2.100.0080.00816.56
7.2.90.0130.00316.54
7.2.80.0040.01316.40
7.2.70.0110.00416.54
7.2.60.0080.00816.60
7.2.50.0140.00316.49
7.2.40.0110.00516.59
7.2.30.0170.00316.65
7.2.20.0090.00716.55
7.2.10.0120.00316.49
7.2.00.0100.00516.64
7.1.330.0070.00715.55
7.1.320.0000.01415.38
7.1.310.0110.00315.67
7.1.300.0100.00415.72
7.1.290.0120.00315.45
7.1.280.0100.00415.45
7.1.270.0100.00415.56
7.1.260.0120.00215.49
7.1.250.0120.00315.61
7.1.240.0070.00715.45
7.1.230.0110.00615.42
7.1.220.0140.00015.61
7.1.210.0100.00515.61
7.1.200.0080.00615.43
7.1.190.0110.00315.61
7.1.180.0070.00715.43
7.1.170.0120.00315.40
7.1.160.0110.00715.59
7.1.150.0100.00515.51
7.1.140.0130.00315.36
7.1.130.0150.00015.55
7.1.120.0050.00915.48
7.1.110.0110.00315.54
7.1.100.0080.00815.59
7.1.90.0120.00315.48
7.1.80.0140.00015.48
7.1.70.0050.01115.36
7.1.60.0050.00915.65
7.1.50.0090.00415.64
7.1.40.0140.00015.71
7.1.30.0120.00315.51
7.1.20.0080.00815.64
7.1.10.0170.00215.39
7.1.00.0140.00115.57
7.0.330.0120.00315.27
7.0.320.0110.00415.10
7.0.310.0080.00515.26
7.0.300.0070.00715.27
7.0.290.0110.00715.21
7.0.280.0070.00715.08
7.0.270.0100.00515.03
7.0.260.0110.00314.99
7.0.250.0110.00415.33
7.0.240.0050.00915.30
7.0.230.0110.00315.53
7.0.220.0120.00315.38
7.0.210.0070.00715.44
7.0.200.0070.00715.25
7.0.190.0120.00215.26
7.0.180.0040.00915.41
7.0.170.0110.00415.21
7.0.160.0130.00015.20
7.0.150.0140.00015.29
7.0.140.0150.00015.33
7.0.130.0250.00015.21
7.0.120.0090.00515.40
7.0.110.0080.00715.20
7.0.100.0100.00515.20
7.0.90.0140.00015.14
7.0.80.0180.00015.14
7.0.70.0100.00315.21
7.0.60.0150.00015.30
7.0.50.0100.00415.16
7.0.40.0140.00015.39
7.0.30.0090.00515.07
7.0.20.0140.00015.20
7.0.10.0000.01315.26
7.0.00.0100.00315.18
5.6.400.0060.00615.79
5.6.390.0070.00715.71
5.6.380.0040.00915.64
5.6.370.0100.00315.83
5.6.360.0080.00615.71
5.6.350.0140.00015.96
5.6.340.0070.00515.84
5.6.330.0060.00615.90
5.6.320.0100.00315.71
5.6.310.0100.00515.94
5.6.300.0080.00615.77
5.6.290.0070.00715.92
5.6.280.0110.00315.90
5.6.270.0070.00715.85
5.6.260.0100.00315.66
5.6.250.0130.00015.88
5.6.240.0100.00315.73
5.6.230.0110.00315.74
5.6.220.0070.00715.89
5.6.210.0100.00315.99
5.6.200.0090.00316.17
5.6.190.0130.00016.04
5.6.180.0090.00416.00
5.6.170.0050.00816.03
5.6.160.0090.00415.94
5.6.150.0070.00616.18
5.6.140.0110.00315.90
5.6.130.0120.00015.98
5.6.120.0080.00515.99
5.6.110.0130.00015.89
5.6.100.0140.00015.91
5.6.90.0130.00015.86
5.6.80.0040.00915.77
5.6.70.0000.01316.02
5.6.60.0130.00016.13
5.6.50.0070.00715.66
5.6.40.0060.00715.71
5.6.30.0110.00315.95
5.6.20.0060.00615.80
5.6.10.0100.00315.77
5.6.00.0090.00315.83
5.5.380.0130.00015.88
5.5.370.0060.00616.08
5.5.360.0130.00015.59
5.5.350.0120.00215.71
5.5.340.0110.00315.72
5.5.330.0140.00015.79
5.5.320.0110.00415.54
5.5.310.0090.00615.72
5.5.300.0140.00015.71
5.5.290.0100.00315.93
5.5.280.0140.00015.75
5.5.270.0060.00615.62
5.5.260.0070.00715.66
5.5.250.0100.00315.82
5.5.240.0040.00915.99
5.5.230.0090.00515.71
5.5.220.0110.00315.77
5.5.210.0090.00315.89
5.5.200.0130.00015.65
5.5.190.0140.00015.54
5.5.180.0100.00215.64
5.5.170.0100.00315.54
5.5.160.0090.00315.82
5.5.150.0090.00415.63
5.5.140.0090.00315.63
5.5.130.0130.00015.36
5.5.120.0130.00015.54
5.5.110.0070.00715.43
5.5.100.0090.00515.73
5.5.90.0130.00015.85
5.5.80.0080.00515.88
5.5.70.0080.00515.93
5.5.60.0100.00315.56
5.5.50.0080.00415.59
5.5.40.0080.00415.61
5.5.30.0130.00015.87
5.5.20.0120.00015.82
5.5.10.0060.00615.69
5.5.00.0100.00315.59
5.4.450.0070.00412.93
5.4.440.0030.00612.79
5.4.430.0050.00512.57
5.4.420.0100.00012.88
5.4.410.0100.00012.81
5.4.400.0110.00012.47
5.4.390.0110.00012.57
5.4.380.0050.00612.54
5.4.370.0070.00412.71
5.4.360.0110.00012.84
5.4.350.0050.00612.68
5.4.340.0050.00512.70
5.4.330.0100.00012.67
5.4.320.0100.00012.60
5.4.310.0110.00012.60
5.4.300.0040.00812.54
5.4.290.0070.00512.51
5.4.280.0080.00412.75
5.4.270.0060.00612.58
5.4.260.0040.00712.65
5.4.250.0090.00312.52
5.4.240.0080.00312.75
5.4.230.0070.00412.64
5.4.220.0110.00012.50
5.4.210.0050.00512.65
5.4.200.0080.00312.25
5.4.190.0110.00012.64
5.4.180.0090.00312.47
5.4.170.0130.00012.38
5.4.160.0100.00012.57
5.4.150.0040.00712.62
5.4.140.0080.00312.66
5.4.130.0100.00012.69
5.4.120.0050.00512.58
5.4.110.0100.00012.77
5.4.100.0070.00412.79
5.4.90.0060.00612.79
5.4.80.0060.00613.00
5.4.70.0080.00312.75
5.4.60.0080.00312.70
5.4.50.0070.00412.88
5.4.40.0080.00212.51
5.4.30.0100.00012.63
5.4.20.0000.01012.83
5.4.10.0070.00413.01
5.4.00.0040.00712.60
5.3.290.0110.00013.05
5.3.280.0090.00212.91
5.3.270.0070.00413.21
5.3.260.0090.00212.94
5.3.250.0110.00012.96
5.3.240.0040.00713.03
5.3.230.0110.00012.88
5.3.220.0080.00313.07
5.3.210.0070.00412.82
5.3.200.0060.00613.07
5.3.190.0070.00412.88
5.3.180.0090.00313.13
5.3.170.0100.00212.94
5.3.160.0000.01213.18
5.3.150.0100.00013.22
5.3.140.0060.00412.90
5.3.130.0120.00012.99
5.3.120.0060.00513.06
5.3.110.0060.00613.07
5.3.100.0070.00513.15
5.3.90.0070.00312.77
5.3.80.0050.00512.68
5.3.70.0040.00712.79
5.3.60.0060.00413.04
5.3.50.0070.00412.97
5.3.40.0050.00512.74
5.3.30.0030.00712.91
5.3.20.0040.00812.88
5.3.10.0080.00312.63
5.3.00.0100.00012.83
5.2.170.0030.00612.11
5.2.160.0040.00412.16
5.2.150.0000.00811.94
5.2.140.0040.00411.82
5.2.130.0060.00311.77
5.2.120.0050.00312.13
5.2.110.0000.00912.14
5.2.100.0090.00011.87
5.2.90.0080.00012.06
5.2.80.0070.00211.96
5.2.70.0090.00011.93
5.2.60.0030.00611.80
5.2.50.0070.00211.70
5.2.40.0040.00412.00
5.2.30.0000.00811.82
5.2.20.0050.00311.64
5.2.10.0080.00011.63
5.2.00.0040.00511.57
5.1.60.0040.00410.87
5.1.50.0080.00011.07
5.1.40.0070.00010.98
5.1.30.0040.00411.27
5.1.20.0030.00611.20
5.1.10.0080.00010.90
5.1.00.0000.00711.02
5.0.50.0030.0039.86
5.0.40.0040.0029.77
5.0.30.0060.0009.85
5.0.20.0030.00310.01
5.0.10.0060.0009.84
5.0.00.0000.0069.47
4.4.90.0000.0039.25
4.4.80.0000.0049.25
4.4.70.0000.0039.25
4.4.60.0020.0029.25
4.4.50.0000.0049.25
4.4.40.0040.0009.25
4.4.30.0000.0049.25
4.4.20.0040.0009.25
4.4.10.0020.0029.25
4.4.00.0030.0009.25
4.3.110.0040.0009.25
4.3.100.0000.0039.25
4.3.90.0040.0009.25
4.3.80.0030.0009.25
4.3.70.0040.0009.25
4.3.60.0040.0009.25
4.3.50.0040.0009.25
4.3.40.0030.0009.25
4.3.30.0000.0029.25
4.3.20.0010.0019.25
4.3.10.0010.0019.25
4.3.00.0030.0009.25

preferences:
46.94 ms | 403 KiB | 5 Q