3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = str_split('pierwszy string { drugi string|trzeci string {czwarty string|piąty string}} szósty string {{ósmy string| dziewiąty string} dziesiąty string}{jedenasty string| dwunasty string} trzynasty string', 1); $a = array(); $a[] = ''; $c &= $a[0]; foreach ( $string as $val ) { switch ( $val ) { case '{': // kod break; case '|': // kod break; case '}': //kod break; default: $c .= $val; break; } } print_r($a);

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.0110.00416.50
8.3.50.0150.00721.93
8.3.40.0070.00718.79
8.3.30.0100.00319.17
8.3.20.0030.00620.26
8.3.10.0040.00423.48
8.3.00.0070.00419.50
8.2.180.0150.00018.36
8.2.170.0070.01022.96
8.2.160.0030.01020.53
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0110.00726.16
8.2.120.0000.00822.30
8.2.110.0060.00322.08
8.2.100.0080.00417.91
8.2.90.0050.00319.05
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0030.00518.22
8.2.30.0000.00818.12
8.2.20.0040.00417.78
8.2.10.0080.00019.83
8.2.00.0000.01017.66
8.1.280.0140.00025.92
8.1.270.0040.00423.97
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0030.00623.84
8.1.230.0040.00719.16
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0090.00317.35
8.1.190.0030.00617.41
8.1.180.0040.00418.10
8.1.170.0000.00818.40
8.1.160.0070.00021.88
8.1.150.0050.00318.63
8.1.140.0040.00417.31
8.1.130.0030.00317.77
8.1.120.0000.00717.25
8.1.110.0040.00417.44
8.1.100.0030.00317.41
8.1.90.0040.00317.38
8.1.80.0000.00717.43
8.1.70.0070.00017.30
8.1.60.0000.00817.53
8.1.50.0000.00917.54
8.1.40.0060.00317.54
8.1.30.0000.00817.63
8.1.20.0080.00017.50
8.1.10.0060.00317.59
8.1.00.0030.00617.56
8.0.300.0000.00818.77
8.0.290.0070.00017.18
8.0.280.0000.01018.27
8.0.270.0000.00817.25
8.0.260.0040.00417.27
8.0.250.0000.00716.87
8.0.240.0040.00416.98
8.0.230.0040.00417.03
8.0.220.0000.00816.91
8.0.210.0050.00216.86
8.0.200.0030.00316.90
8.0.190.0040.00416.96
8.0.180.0040.00416.91
8.0.170.0060.00316.91
8.0.160.0070.00016.87
8.0.150.0030.00616.88
8.0.140.0030.00316.89
8.0.130.0000.00613.37
8.0.120.0000.00816.87
8.0.110.0040.00416.97
8.0.100.0030.00516.78
8.0.90.0000.00716.77
8.0.80.0060.01216.87
8.0.70.0050.00316.96
8.0.60.0040.00416.78
8.0.50.0000.00816.86
8.0.30.0070.01317.30
8.0.20.0110.00717.40
8.0.10.0000.00717.06
8.0.00.0100.00716.87
7.4.330.0030.00315.00
7.4.320.0030.00316.67
7.4.300.0000.00616.62
7.4.290.0070.00016.45
7.4.280.0060.00016.61
7.4.270.0070.00016.54
7.4.260.0030.00516.62
7.4.250.0050.00216.62
7.4.240.0030.00416.52
7.4.230.0050.00216.61
7.4.220.0000.01816.47
7.4.210.0050.00916.56
7.4.200.0000.00716.32
7.4.190.0040.00416.70
7.4.160.0120.00616.57
7.4.150.0030.01317.40
7.4.140.0100.00817.86
7.4.130.0090.00716.63
7.4.120.0090.00816.52
7.4.110.0120.00916.41
7.4.100.0170.00316.58
7.4.90.0180.00016.52
7.4.80.0110.00619.39
7.4.70.0070.01016.65
7.4.60.0130.00316.43
7.4.50.0020.00216.62
7.4.40.0090.00622.77
7.4.30.0000.01616.61
7.4.00.0080.00815.05
7.3.330.0000.00513.37
7.3.320.0000.00613.26
7.3.310.0040.00416.25
7.3.300.0000.00616.29
7.3.290.0080.00816.48
7.3.280.0070.01016.45
7.3.270.0030.01317.40
7.3.260.0120.00616.39
7.3.250.0120.00716.46
7.3.240.0030.01316.57
7.3.230.0160.00416.45
7.3.210.0110.00616.59
7.3.200.0090.00919.39
7.3.190.0140.00916.63
7.3.180.0080.00816.36
7.3.170.0060.01016.56
7.3.160.0090.00816.42
7.3.120.0060.00815.09
7.3.110.0030.01314.96
7.3.100.0100.00714.76
7.3.90.0060.01215.04
7.3.80.0030.00914.88
7.3.70.0120.00314.95
7.3.60.0040.00814.97
7.3.50.0060.01214.68
7.3.40.0070.01114.73
7.3.30.0140.00314.68
7.3.20.0110.00316.59
7.3.10.0070.00716.61
7.3.00.0090.00616.78
7.2.330.0090.01216.64
7.2.320.0110.01116.71
7.2.310.0060.01216.52
7.2.300.0090.00916.50
7.2.290.0090.00916.54
7.2.250.0070.01315.06
7.2.240.0120.00914.81
7.2.230.0000.01415.08
7.2.220.0110.00315.27
7.2.210.0040.00815.16
7.2.200.0060.01015.27
7.2.190.0060.00915.04
7.2.180.0030.01014.92
7.2.170.0100.01014.88
7.2.60.0070.01016.82
7.2.00.0030.00919.55
7.1.330.0140.00316.10
7.1.320.0030.01015.91
7.1.310.0040.00415.91
7.1.300.0080.00815.74
7.1.290.0090.00915.82
7.1.280.0070.01115.84
7.1.270.0070.00715.63
7.1.260.0090.00615.88
7.1.200.0090.00315.78
7.1.100.0030.01018.20
7.1.70.0110.00617.21
7.1.60.0120.01219.33
7.1.50.0120.00316.79
7.1.00.0000.08022.48
7.0.200.0000.00916.51
7.0.140.0100.06721.97
7.0.60.0070.08719.88
7.0.50.0200.06717.73
7.0.40.0100.04020.27
7.0.30.0170.05320.24
7.0.20.0300.04720.15
7.0.10.0030.09020.10
7.0.00.0030.06020.10
5.6.280.0000.07720.99
5.6.210.0070.04020.50
5.6.200.0100.08018.18
5.6.190.0030.04320.32
5.6.180.0470.05320.52
5.6.170.0270.03320.57
5.6.160.0000.04720.46
5.6.150.0170.05718.13
5.6.140.0070.08318.21
5.6.130.0030.06318.18
5.6.120.0130.07021.04
5.6.110.0000.08720.89
5.6.100.0070.05321.11
5.6.90.0070.06320.98
5.6.80.0070.06020.41
5.6.70.4170.04020.47
5.5.350.0200.06320.41
5.5.340.0100.07717.97
5.5.330.0100.08020.40
5.5.320.0370.07720.34
5.5.310.0300.07020.34
5.5.300.0030.06318.07
5.5.290.0100.04318.04
5.5.280.0000.04720.96
5.5.270.0070.08020.89
5.5.260.0030.09020.96
5.5.250.0100.05720.58
5.5.240.0170.03020.26
5.4.450.0130.06319.32
5.4.440.0270.07319.46
5.4.430.0100.04719.54
5.4.420.0200.07719.56
5.4.410.0170.05319.42
5.4.400.0270.05018.88
5.4.390.0230.04318.98
5.4.380.0130.08318.88
5.4.370.0230.07318.98
5.4.360.0300.06719.19
5.4.350.0230.07718.87
5.4.340.0200.04018.85
5.4.320.0300.06718.89
5.4.310.0370.05318.99
5.4.300.0170.06318.87
5.4.290.0330.05719.05
5.4.280.0200.06318.98
5.4.270.0200.08019.31
5.4.260.0100.06019.22
5.4.250.0170.07719.19
5.4.240.0300.06018.86
5.4.230.0170.05318.98
5.4.220.0170.06719.30
5.4.210.0170.07719.15
5.4.200.0270.06718.99
5.4.190.0230.07719.20
5.4.180.0230.07019.13
5.4.170.0200.08018.86
5.4.160.0200.06719.06
5.4.150.0270.06019.13
5.4.140.0270.06316.38
5.4.130.0300.06316.36
5.4.120.0130.04716.48
5.4.110.0330.06316.38
5.4.100.0330.05716.46
5.4.90.0200.06716.51
5.4.80.0270.06716.36
5.4.70.0300.06016.36
5.4.60.0230.06716.52
5.4.50.0230.07016.45
5.4.40.0200.06316.27
5.4.30.0230.06016.55
5.4.20.0170.06316.57
5.4.10.0400.04716.38
5.4.00.0400.05015.77
5.3.290.0130.05314.68
5.3.280.0170.04714.54
5.3.270.0300.06314.60
5.3.260.0170.05014.54
5.3.250.0130.08314.55
5.3.240.0370.07314.64
5.3.230.0200.04714.61
5.3.220.0230.03014.49
5.3.210.0270.05714.61
5.3.200.0230.08014.75
5.3.190.0200.07714.61
5.3.180.0200.07714.70
5.3.170.0230.06014.64
5.3.160.0230.06314.50
5.3.150.0130.04714.72
5.3.140.0230.04314.56
5.3.130.0170.06314.59
5.3.120.0200.04714.59
5.3.110.0170.08014.79
5.3.100.0230.07714.14
5.3.90.0270.05713.96
5.3.80.0300.06313.95
5.3.70.0200.04014.13
5.3.60.0170.07014.08
5.3.50.0170.04314.09
5.3.40.0170.06313.90
5.3.30.0200.06713.95
5.3.20.0270.06713.61
5.3.10.0230.05713.60
5.3.00.0170.06313.68
5.2.170.0200.04312.23
5.2.160.0130.04712.23
5.2.150.0200.03712.23
5.2.140.0070.03312.23
5.2.130.0200.05712.23
5.2.120.0270.04012.23
5.2.110.0230.05712.23
5.2.100.0230.05712.23
5.2.90.0130.05312.23
5.2.80.0200.04012.23
5.2.70.0200.06012.23
5.2.60.0270.06012.23
5.2.50.0200.05312.23
5.2.40.0130.05312.23
5.2.30.0170.05012.23
5.2.20.0170.05012.23
5.2.10.0200.06012.23
5.2.00.0230.04012.23
5.1.60.0170.05012.23
5.1.50.0100.05312.23
5.1.40.0170.05312.23
5.1.30.0200.04012.23
5.1.20.0170.05312.23
5.1.10.0130.05712.23
5.1.00.0230.03712.23
5.0.50.0100.03012.23
5.0.40.0070.04712.23
5.0.30.0070.07312.23
5.0.20.0070.04312.23
5.0.10.0130.03712.23
5.0.00.0070.07012.23
4.4.90.0100.03312.23
4.4.80.0100.02712.23
4.4.70.0100.03712.23
4.4.60.0070.03312.23
4.4.50.0130.02712.23
4.4.40.0030.03712.23
4.4.30.0100.01312.23
4.4.20.0130.02312.23
4.4.10.0030.03712.23
4.4.00.0030.05312.23
4.3.110.0030.04012.23
4.3.100.0130.02712.23
4.3.90.0130.02312.23
4.3.80.0130.04712.23
4.3.70.0070.02012.23
4.3.60.0100.01712.23
4.3.50.0030.02012.23
4.3.40.0070.02712.23
4.3.30.0000.02012.23
4.3.20.0070.01012.23
4.3.10.0000.01712.23
4.3.00.0000.01712.23

preferences:
33.83 ms | 401 KiB | 5 Q