3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_key = uniqid("\x00"); if (preg_match('/[a-zA-Z]/', $my_key)) { echo "key has alpha chars\n"; } preg_replace('/[a-zA-Z]/', "4", $my_key); $var[$my_key] = TRUE; foreach($var as $key => $val) { if ($key === $my_key) { echo 'You got it right'; } else { echo 'You got it wrong'; } }

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.10.0040.01514.99
7.4.00.0080.01215.22
7.3.130.0030.01415.00
7.3.120.0120.00614.94
7.3.110.0070.01315.23
7.3.100.0060.00914.87
7.3.90.0030.00815.13
7.3.80.0060.00715.12
7.3.70.0080.00614.79
7.3.60.0070.00714.93
7.3.50.0020.01515.06
7.3.40.0080.00614.89
7.3.30.0020.01115.07
7.3.20.0050.00716.84
7.3.10.0070.00916.78
7.3.00.0080.00316.97
7.2.260.0120.00615.07
7.2.250.0080.01115.20
7.2.240.0100.00715.18
7.2.230.0070.00915.14
7.2.220.0080.00515.27
7.2.210.0070.00815.22
7.2.200.0030.01415.17
7.2.190.0120.00715.08
7.2.180.0020.01415.04
7.2.170.0070.00715.19
7.2.160.0090.00215.16
7.2.150.0000.01517.18
7.2.140.0080.00817.15
7.2.130.0110.00017.11
7.2.120.0050.00517.18
7.2.110.0040.01117.19
7.2.100.0110.00716.93
7.2.90.0030.00917.19
7.2.80.0060.00717.22
7.2.70.0030.00916.86
7.2.60.0030.01417.15
7.2.50.0060.00617.20
7.2.40.0050.00517.13
7.2.30.0090.00616.99
7.2.20.0070.01016.99
7.2.10.0070.00717.14
7.2.00.0000.01016.87
7.1.330.0000.01416.02
7.1.320.0060.00715.92
7.1.310.0060.00715.95
7.1.300.0070.00615.88
7.1.290.0060.00915.91
7.1.280.0020.01216.02
7.1.270.0080.00616.01
7.1.260.0120.00315.85
7.1.250.0040.00715.88
7.1.240.0040.00416.10
7.1.230.0040.00815.98
7.1.220.0110.00715.91
7.1.210.0070.01115.75
7.1.200.0030.00916.05
7.1.190.0110.00415.97
7.1.180.0070.00715.61
7.1.170.0040.00415.91
7.1.160.0000.01115.91
7.1.150.0040.01115.65
7.1.140.0030.01415.86
7.1.130.0040.01116.16
7.1.120.0030.00915.89
7.1.110.0060.00915.95
7.1.100.0060.00616.20
7.1.90.0070.01016.00
7.1.80.0060.00616.03
7.1.70.0040.00716.54
7.1.60.0070.01317.74
7.1.50.0090.00616.53
7.1.40.0070.01015.98
7.1.30.0070.01015.97
7.1.20.0070.00716.02
7.1.10.0030.00915.95
7.1.00.0070.04119.32
7.0.330.0030.00515.50
7.0.320.0070.00715.55
7.0.310.0000.01215.62
7.0.300.0070.00715.67
7.0.290.0060.00315.48
7.0.280.0060.00615.64
7.0.270.0000.01315.32
7.0.260.0000.01515.46
7.0.250.0080.00015.74
7.0.240.0030.00715.89
7.0.230.0030.01015.81
7.0.220.0080.00715.71
7.0.210.0080.00815.56
7.0.200.0030.00816.39
7.0.190.0060.00615.59
7.0.180.0080.00415.48
7.0.170.0040.00815.44
7.0.160.0120.00315.34
7.0.150.0080.00815.64
7.0.140.0090.03718.78
7.0.130.0060.01015.41
7.0.120.0040.00815.74
7.0.110.0070.00715.53
7.0.100.0000.01415.60
7.0.90.0040.00715.75
7.0.80.0090.00315.46
7.0.70.0110.00315.50
7.0.60.0100.02017.81
7.0.50.0070.04516.78
7.0.40.0020.04916.93
7.0.30.0090.02616.94
7.0.20.0230.03617.03
7.0.10.0080.04416.89
7.0.00.0050.03217.01
5.6.400.0070.00314.17
5.6.390.0000.01014.63
5.6.380.0130.00014.57
5.6.370.0040.01114.12
5.6.360.0040.00814.69
5.6.350.0040.00914.46
5.6.340.0060.00914.64
5.6.330.0040.00414.54
5.6.320.0040.01114.20
5.6.310.0040.01214.64
5.6.300.0070.00414.75
5.6.290.0000.01314.29
5.6.280.0050.04017.87
5.6.270.0030.00914.63
5.6.260.0040.01114.36
5.6.250.0040.01114.66
5.6.240.0000.01314.30
5.6.230.0090.00614.32
5.6.220.0030.01414.38
5.6.210.0050.03917.46
5.6.200.0050.04016.33
5.6.190.0110.01917.44
5.6.180.0110.02517.64
5.6.170.0240.03117.35
5.6.160.0070.02617.43
5.6.150.0000.02916.36
5.6.140.0100.04016.36
5.6.130.0110.04116.23
5.6.120.0060.02217.66
5.6.110.0050.04017.67
5.6.100.0080.03917.83
5.6.90.0080.04217.65
5.6.80.0070.02217.32
5.6.70.0090.00314.48
5.6.60.0000.01614.45
5.6.50.0000.00814.40
5.6.40.0090.00614.57
5.6.30.0060.00914.25
5.6.20.0070.00714.04
5.6.10.0000.01114.28
5.6.00.0030.00614.47
5.5.380.0110.00314.33
5.5.370.0090.00614.29
5.5.360.0120.00014.39
5.5.350.0150.04017.43
5.5.340.0080.04016.31
5.5.330.0050.03017.37
5.5.320.0180.03917.31
5.5.310.0180.02817.51
5.5.300.0100.04016.12
5.5.290.0080.04016.15
5.5.280.0020.04217.56
5.5.270.0030.04217.41
5.5.260.0120.04317.53
5.5.250.0120.04017.35
5.5.240.0100.03917.11
5.5.230.0070.01014.27
5.5.220.0030.00814.21
5.5.210.0040.00714.13
5.5.200.0030.01014.17
5.5.190.0030.00614.41
5.5.180.0070.00714.40
5.5.170.0060.00614.28
5.5.160.0070.00714.05
5.5.150.0060.00614.49
5.5.140.0000.01314.02
5.5.130.0070.00814.49
5.5.120.0080.00414.41
5.5.110.0040.01114.43
5.5.100.0160.00013.98
5.5.90.0060.00314.18
5.5.80.0040.00814.43
5.5.70.0000.01514.24
5.5.60.0000.01314.36
5.5.50.0000.01714.41
5.5.40.0040.00814.45
5.5.30.0030.01514.23
5.5.20.0000.01414.36
5.5.10.0090.00614.47
5.5.00.0030.01214.26
5.4.450.0240.02215.30
5.4.440.0330.02515.27
5.4.430.0180.02715.30
5.4.420.0210.02415.24
5.4.410.0210.02115.09
5.4.400.0240.01815.03
5.4.390.0120.02315.14
5.4.380.0200.03314.76
5.4.370.0170.02714.87
5.4.360.0220.03214.80
5.4.350.0180.02814.79
5.4.340.0120.03014.61
5.4.330.0050.00511.06
5.4.320.0030.02111.75
5.4.310.0050.02411.72
5.4.300.0060.02111.78
5.4.290.0100.01811.70
5.4.280.0060.02211.72
5.4.270.0060.02111.70
5.4.260.0060.02211.55
5.4.250.0060.02211.75
5.4.240.0020.02411.75
5.4.230.0070.02111.70
5.4.220.0050.02411.54
5.4.210.0060.01811.55
5.4.200.0080.02211.57
5.4.190.0060.02111.73
5.4.180.0080.01911.75
5.4.170.0040.02311.60
5.4.160.0030.02211.63
5.4.150.0030.02311.68
5.4.140.0020.02611.41
5.4.130.0050.02011.57
5.4.120.0040.02111.50
5.4.110.0030.02411.51
5.4.100.0050.02511.41
5.4.90.0080.01911.45
5.4.80.0050.02211.47
5.4.70.0070.02211.46
5.4.60.0050.01911.60
5.4.50.0060.02111.60
5.4.40.0040.02611.53
5.4.30.0020.02511.38
5.4.20.0050.02311.47
5.4.10.0060.02011.38
5.4.00.0030.02411.22
5.3.290.0070.03812.80
5.3.280.0070.03612.71
5.3.270.0060.03912.73
5.3.260.0050.04012.71
5.3.250.0090.03712.72
5.3.240.0080.03512.72
5.3.230.0090.03512.71
5.3.220.0050.04012.68
5.3.210.0060.03812.68
5.3.200.0080.03512.68
5.3.190.0070.03912.67
5.3.180.0080.03512.68
5.3.170.0060.03712.67
5.3.160.0090.03712.67
5.3.150.0060.04612.68
5.3.140.0070.04312.66
5.3.130.0060.03812.66
5.3.120.0070.03712.66
5.3.110.0080.03812.66
5.3.100.0070.04312.12
5.3.90.0060.03612.08
5.3.80.0060.03612.08
5.3.70.0080.04212.08
5.3.60.0110.04312.07
5.3.50.0080.03712.00
5.3.40.0090.03812.00
5.3.30.0060.03511.95
5.3.20.0070.04011.73
5.3.10.0070.03811.69
5.3.00.0090.03611.68
5.2.170.0040.0349.18
5.2.160.0050.0379.18
5.2.150.0060.0369.18
5.2.140.0060.0389.18
5.2.130.0070.0349.14
5.2.120.0030.0299.14
5.2.110.0080.0369.14
5.2.100.0050.0389.14
5.2.90.0010.0329.14
5.2.80.0060.0339.14
5.2.70.0080.0269.14
5.2.60.0070.0359.09
5.2.50.0050.0319.06
5.2.40.0070.0339.05
5.2.30.0060.0289.02
5.2.20.0100.0259.00
5.2.10.0060.0348.92
5.2.00.0080.0388.79
5.1.60.0080.0208.07
5.1.50.0070.0228.07
5.1.40.0090.0198.05
5.1.30.0040.0268.40
5.1.20.0040.0278.42
5.1.10.0040.0268.14
5.1.00.0090.0218.14
5.0.50.0040.0206.62
5.0.40.0060.0176.48
5.0.30.0050.0306.29
5.0.20.0040.0196.27
5.0.10.0040.0196.24
5.0.00.0060.0316.23
4.4.90.0020.0184.78
4.4.80.0000.0184.75
4.4.70.0020.0164.75
4.4.60.0080.0154.75
4.4.50.0010.0194.77
4.4.40.0040.0284.71
4.4.30.0030.0204.76
4.4.20.0040.0244.84
4.4.10.0020.0164.85
4.4.00.0050.0224.76
4.3.110.0060.0134.67
4.3.100.0030.0144.66
4.3.90.0020.0154.63
4.3.80.0030.0244.58
4.3.70.0060.0114.63
4.3.60.0020.0154.63
4.3.50.0010.0174.63
4.3.40.0040.0224.54
4.3.30.0030.0163.30
4.3.20.0020.0163.27
4.3.10.0020.0163.23
4.3.00.0030.02013.95

preferences:
41.08 ms | 401 KiB | 5 Q