3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringRegex = "/([aA][0-9]+)/"; $schema = [ 'a26UserId', 'a17Passwd', 'cAccountChannel', 'a256PcInfo1' ]; $result = []; foreach ($schema as $currentType) { if (preg_match($stringRegex, $currentType, $matches)) { $result[] = $matches[1]; } else { $result[] = substr($currentType, 0, 1); } } print_r($result);

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.3.60.0070.01418.56
8.3.50.0140.00718.32
8.3.40.0120.00318.73
8.3.30.0140.00018.90
8.3.20.0040.00420.17
8.3.10.0040.00423.67
8.3.00.0040.00419.15
8.2.180.0180.00618.67
8.2.170.0040.01122.96
8.2.160.0130.00319.46
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0080.00019.89
8.2.110.0030.00722.37
8.2.100.0000.01217.97
8.2.90.0060.00318.00
8.2.80.0000.00818.00
8.2.70.0000.00818.03
8.2.60.0000.00918.09
8.2.50.0080.00018.10
8.2.40.0060.00319.43
8.2.30.0040.00419.46
8.2.20.0070.00017.96
8.2.10.0040.00418.23
8.2.00.0040.00417.89
8.1.280.0140.00325.92
8.1.270.0080.00018.91
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.95
8.1.230.0080.00320.89
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0050.00317.50
8.1.180.0000.00818.10
8.1.170.0030.00518.91
8.1.160.0000.00719.02
8.1.150.0000.00818.93
8.1.140.0000.00817.58
8.1.130.0070.00017.78
8.1.120.0000.00817.51
8.1.110.0000.00717.44
8.1.100.0040.00417.50
8.1.90.0000.00717.64
8.1.80.0000.00717.61
8.1.70.0030.00317.50
8.1.60.0080.00017.62
8.1.50.0050.00517.62
8.1.40.0040.00417.61
8.1.30.0050.00317.72
8.1.20.0080.00017.67
8.1.10.0000.00817.66
8.1.00.0070.00017.61
8.0.300.0080.00019.98
8.0.290.0000.00716.88
8.0.280.0030.00318.42
8.0.270.0020.00517.34
8.0.260.0030.00317.23
8.0.250.0000.00717.17
8.0.240.0000.00617.09
8.0.230.0000.00717.00
8.0.220.0000.00716.97
8.0.210.0000.00717.01
8.0.200.0000.00917.12
8.0.190.0030.00617.16
8.0.180.0000.00717.02
8.0.170.0060.00316.88
8.0.160.0030.00316.99
8.0.150.0000.00716.87
8.0.140.0050.00316.92
8.0.130.0030.00313.42
8.0.120.0040.00416.93
8.0.110.0050.00217.17
8.0.100.0040.00417.05
8.0.90.0050.00216.93
8.0.80.0140.00717.04
8.0.70.0030.00517.13
8.0.60.0000.00717.06
8.0.50.0070.00016.97
8.0.30.0080.01417.31
8.0.20.0100.01017.43
8.0.10.0000.00817.23
8.0.00.0070.01116.93
7.4.330.0000.00515.16
7.4.320.0060.00016.91
7.4.300.0030.00316.76
7.4.290.0000.00816.72
7.4.280.0040.00416.75
7.4.270.0000.00716.91
7.4.260.0040.00416.88
7.4.250.0000.00716.83
7.4.240.0020.00516.79
7.4.230.0070.00016.96
7.4.220.0030.01616.76
7.4.210.0030.01616.72
7.4.200.0000.00816.77
7.4.160.0110.00416.59
7.4.150.0140.00417.40
7.4.140.0070.01217.86
7.4.130.0120.00816.75
7.4.120.0120.00716.64
7.4.110.0070.01916.73
7.4.100.0160.00316.79
7.4.90.0030.01316.83
7.4.80.0170.00319.39
7.4.70.0140.01516.82
7.4.60.0100.00716.63
7.4.50.0000.00816.71
7.4.40.0100.00716.90
7.4.30.0130.00316.71
7.4.00.0100.00815.27
7.3.330.0030.00313.41
7.3.320.0000.00513.41
7.3.310.0030.00316.30
7.3.300.0030.00416.47
7.3.290.0110.00516.43
7.3.280.0100.00816.40
7.3.270.0130.00417.40
7.3.260.0180.00416.56
7.3.250.0090.00916.61
7.3.240.0060.01116.67
7.3.230.0060.01216.59
7.3.210.0130.00316.45
7.3.200.0100.00719.39
7.3.190.0030.01316.76
7.3.180.0040.01116.58
7.3.170.0100.00716.63
7.3.160.0080.00716.46
7.3.120.0070.01115.22
7.3.110.0130.00615.25
7.3.100.0000.01015.23
7.3.90.0110.00714.79
7.3.80.0000.01214.82
7.3.70.0030.00615.02
7.3.60.0040.01215.05
7.3.50.0000.01015.02
7.3.40.0090.00314.87
7.3.30.0100.00715.04
7.3.20.0110.00416.77
7.3.10.0030.01017.01
7.3.00.0060.00616.72
7.2.330.0130.00316.74
7.2.320.0090.00616.87
7.2.310.0140.01016.85
7.2.300.0110.00616.77
7.2.290.0060.01616.81
7.2.250.0070.01415.03
7.2.240.0070.01415.34
7.2.230.0060.01215.21
7.2.220.0040.00715.03
7.2.210.0060.00615.38
7.2.200.0030.00715.30
7.2.190.0070.00715.16
7.2.180.0060.00915.08
7.2.170.0110.00415.34
7.2.00.0070.01019.79
7.1.330.0070.00715.87
7.1.320.0070.00715.97
7.1.310.0000.00915.83
7.1.300.0060.00616.08
7.1.290.0080.00616.04
7.1.280.0040.00415.96
7.1.270.0070.01116.04
7.1.260.0070.00716.07
7.1.100.0030.00618.51
7.1.70.0110.00417.37
7.1.60.0070.01819.22
7.1.50.0000.01716.84
7.1.00.0070.07022.46
7.0.200.0000.00716.82
7.0.140.0030.07322.06
7.0.60.0100.08020.03
7.0.50.0070.08717.98
7.0.40.0030.05020.14
7.0.30.0300.07720.10
7.0.20.0330.08020.07
7.0.10.0070.04320.25
7.0.00.0030.04320.09
5.6.280.0030.07321.04
5.6.210.0100.06020.64
5.6.200.0130.05318.18
5.6.190.0100.08320.47
5.6.180.0370.07020.64
5.6.170.0270.05320.50
5.6.160.0170.07320.61
5.6.150.0070.04718.22
5.6.140.0070.08018.24
5.6.130.0130.08018.26
5.6.120.0100.07721.02
5.6.110.0000.06721.04
5.6.100.0070.08321.10
5.6.90.0130.06721.00
5.6.80.0070.08020.37
5.5.350.0230.05320.37
5.5.340.0030.04717.99
5.5.330.0030.07320.26
5.5.320.0200.03720.23
5.5.310.0300.06320.24
5.5.300.0000.04017.95
5.5.290.0100.07717.95
5.5.280.0170.08320.84
5.5.270.0100.08320.63
5.5.260.0170.07320.73
5.5.250.0070.08720.61
5.5.240.0030.07720.18
5.4.450.0330.06719.38
5.4.440.0200.04719.51
5.4.430.0270.07019.30
5.4.420.0130.05019.54
5.4.410.0230.03019.34
5.4.400.0270.03718.96
5.4.390.0200.07319.05
5.4.380.0170.05019.22
5.4.370.0230.07319.14
5.4.360.0230.05719.21
5.4.350.0230.07019.06
5.4.340.0230.04719.00
5.4.320.0230.06019.08
5.4.310.0300.03019.31
5.4.300.0370.06018.99
5.4.290.0270.05019.23
5.4.280.0270.03318.97
5.4.270.0230.04319.23
5.4.260.0270.06718.88
5.4.250.0330.02719.30
5.4.240.0300.07019.23
5.4.230.0200.05018.99
5.4.220.0270.05018.86
5.4.210.0270.04319.30
5.4.200.0200.05719.05
5.4.190.0130.05319.30
5.4.180.0270.06719.18
5.4.170.0170.05319.18
5.4.160.0270.04318.97
5.4.150.0200.05319.05
5.4.140.0300.04316.52
5.4.130.0230.04716.48
5.4.120.0230.03716.46
5.4.110.0270.05016.45
5.4.100.0200.07316.45
5.4.90.0300.03716.45
5.4.80.0200.04016.17
5.4.70.0170.03716.39
5.4.60.0200.03316.43
5.4.50.0200.03316.53
5.4.40.0170.04016.50
5.4.30.0170.03316.42
5.4.20.0170.03716.25
5.4.10.0100.04016.25
5.4.00.0170.03715.79
5.3.290.0200.04314.71
5.3.280.0200.03714.54
5.3.270.0270.05314.46
5.3.260.0270.06014.65
5.3.250.0170.04314.59
5.3.240.0230.07314.56
5.3.230.0130.04314.51
5.3.220.0270.05714.50
5.3.210.0200.03314.41
5.3.200.0270.05314.40
5.3.190.0100.05014.54
5.3.180.0200.03714.45
5.3.170.0230.04714.66
5.3.160.0170.04714.53
5.3.150.0200.07314.50
5.3.140.0230.04314.51
5.3.130.0200.04314.48
5.3.120.0230.03014.64
5.3.110.0200.06714.45
5.3.100.0200.04013.88
5.3.90.0170.06714.04
5.3.80.0200.06013.89
5.3.70.0130.05013.79
5.3.60.0200.03313.99
5.3.50.0230.04013.82
5.3.40.0200.03314.04
5.3.30.0100.04013.79
5.3.20.0130.03313.64
5.3.10.0270.02713.61
5.3.00.0130.03313.58
5.2.170.0070.03012.32
5.2.160.0170.04012.32
5.2.150.0170.03312.32
5.2.140.0100.05312.32
5.2.130.0200.05012.32
5.2.120.0300.03012.32
5.2.110.0230.02312.32
5.2.100.0170.06012.32
5.2.90.0130.03312.32
5.2.80.0130.05712.32
5.2.70.0230.05312.32
5.2.60.0130.04012.32
5.2.50.0170.03312.32
5.2.40.0270.05012.32
5.2.30.0170.03312.32
5.2.20.0130.05012.32
5.2.10.0130.03312.32
5.2.00.0170.06012.32
5.1.60.0230.04312.32
5.1.50.0100.03312.32
5.1.40.0070.05012.32
5.1.30.0100.02312.32
5.1.20.0030.04012.32
5.1.10.0070.02712.32
5.1.00.0070.05712.32
5.0.50.0100.02312.32
5.0.40.0070.04312.32
5.0.30.0230.05712.32
5.0.20.0070.02712.32
5.0.10.0070.04312.32
5.0.00.0030.06012.32
4.4.90.0130.02312.32
4.4.80.0070.02012.32
4.4.70.0030.02012.32
4.4.60.0030.01712.32
4.4.50.0070.02012.32
4.4.40.0100.04012.32
4.4.30.0000.02012.32
4.4.20.0000.02312.32
4.4.10.0030.03712.32
4.4.00.0070.02712.32
4.3.110.0070.02312.32
4.3.100.0070.02012.32
4.3.90.0100.03312.32
4.3.80.0100.04012.32
4.3.70.0100.03312.32
4.3.60.0100.01312.32
4.3.50.0100.01312.32
4.3.40.0100.03712.32
4.3.30.0100.01312.32
4.3.20.0000.02012.32
4.3.10.0070.02712.32
4.3.00.0070.01312.32

preferences:
40.66 ms | 400 KiB | 5 Q