3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen_explode($delimiter, $string, $limit=NULL) { $offset = 0; $count = 0; $dlen = strlen($delimiter); $len = strlen($string); while( ($pos = strpos($string, $delimiter, $offset)) !== false ) { if( !is_null($limit) && $count++ >= $limit ) { return; } yield substr($string, $offset, $pos-$offset); $offset = $pos + $dlen; } if( $offset == $len ) { yield ''; // replicate explode() empty trailing groups } else if( $offset < $len ) { yield substr($string, $offset); } } $input = "1||50||£---2||25||£---3||25||£---"; foreach( gen_explode('---', $input, 3) as $piece ) { var_dump($piece); foreach( gen_explode('||', $piece) as $smaller_piece ) { var_dump($smaller_piece); } }

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.0140.00718.43
8.3.50.0120.00318.16
8.3.40.0090.00618.88
8.3.30.0000.01418.75
8.3.20.0040.00418.74
8.3.10.0040.00423.52
8.3.00.0040.00420.58
8.2.180.0100.01016.63
8.2.170.0120.00622.96
8.2.160.0120.00319.29
8.2.150.0000.00824.18
8.2.140.0000.00924.66
8.2.130.0040.00717.91
8.2.120.0040.00426.35
8.2.110.0090.00020.52
8.2.100.0030.00917.91
8.2.90.0000.00817.75
8.2.80.0040.00418.80
8.2.70.0080.00017.63
8.2.60.0050.00318.04
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0070.00017.98
8.2.20.0050.00318.07
8.2.10.0000.00718.23
8.2.00.0030.00617.71
8.1.280.0180.00025.92
8.1.270.0080.00018.80
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00023.83
8.1.230.0080.00319.09
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0050.00317.47
8.1.180.0000.00818.10
8.1.170.0040.00818.53
8.1.160.0050.00218.93
8.1.150.0030.00618.84
8.1.140.0040.00423.95
8.1.130.0000.00719.15
8.1.120.0070.00017.56
8.1.110.0000.00717.50
8.1.100.0000.00717.44
8.1.90.0040.00417.42
8.1.80.0000.00817.49
8.1.70.0070.00017.55
8.1.60.0080.00017.62
8.1.50.0060.00317.51
8.1.40.0050.00317.52
8.1.30.0000.00817.71
8.1.20.0030.00517.73
8.1.10.0030.00517.44
8.1.00.0050.00217.45
8.0.300.0040.00419.52
8.0.290.0050.00316.63
8.0.280.0040.00418.54
8.0.270.0000.00817.16
8.0.260.0000.00716.87
8.0.250.0030.00317.02
8.0.240.0000.00717.00
8.0.230.0030.00316.89
8.0.220.0000.00916.82
8.0.210.0040.00416.92
8.0.200.0000.00716.90
8.0.190.0040.00416.88
8.0.180.0000.00716.87
8.0.170.0030.00516.86
8.0.160.0040.00417.02
8.0.150.0040.00416.82
8.0.140.0000.00716.84
8.0.130.0030.00313.36
8.0.120.0050.00316.80
8.0.110.0040.00416.75
8.0.100.0050.00216.74
8.0.90.0070.00016.92
8.0.80.0050.01116.94
8.0.70.0070.00016.72
8.0.60.0040.00416.93
8.0.50.0040.00416.84
8.0.30.0080.01117.25
8.0.20.0120.00617.40
8.0.10.0050.00216.85
8.0.00.0060.01316.77
7.4.330.0000.00515.55
7.4.320.0030.00316.69
7.4.300.0030.00316.68
7.4.290.0030.00316.52
7.4.280.0030.00516.64
7.4.270.0030.00316.69
7.4.260.0000.00716.55
7.4.250.0070.00016.58
7.4.240.0040.00416.50
7.4.230.0000.00716.43
7.4.220.0000.00816.42
7.4.210.0040.01116.62
7.4.200.0040.00416.47
7.4.160.0110.00716.51
7.4.140.0100.00817.86
7.4.130.0100.00716.61
7.4.120.0110.00916.58
7.4.110.0090.00916.48
7.4.100.0030.01416.46
7.4.90.0070.01116.55
7.4.80.0100.01019.39
7.4.70.0090.00916.54
7.4.60.0090.00616.54
7.4.50.0070.01116.45
7.4.40.0160.00616.42
7.4.10.0080.00815.68
7.4.00.0040.01115.49
7.3.330.0000.00513.35
7.3.320.0030.00313.22
7.3.310.0020.00516.21
7.3.300.0030.00316.44
7.3.290.0070.00016.26
7.3.280.0130.00716.36
7.3.260.0080.01216.45
7.3.240.0100.00916.53
7.3.230.0120.00616.67
7.3.210.0060.01216.56
7.3.200.0120.00916.49
7.3.190.0090.00916.60
7.3.180.0050.01116.48
7.3.170.0120.00616.67
7.3.160.0160.00316.31
7.3.130.0080.01015.79
7.3.120.0120.00515.42
7.3.110.0050.01315.23
7.3.100.0070.00715.50
7.3.90.0040.01015.43
7.3.80.0100.00315.36
7.3.70.0060.00815.37
7.3.60.0070.00915.34
7.3.50.0060.00815.27
7.3.40.0040.00715.24
7.3.30.0060.00815.30
7.3.20.0030.01217.09
7.3.10.0060.00617.05
7.3.00.0080.00516.95
7.2.330.0110.00816.73
7.2.320.0090.01116.69
7.2.310.0090.01216.69
7.2.300.0060.01716.73
7.2.290.0090.01316.70
7.2.260.0100.01015.81
7.2.250.0110.01015.82
7.2.240.0120.00415.46
7.2.230.0080.00515.68
7.2.220.0080.00715.65
7.2.210.0100.00615.62
7.2.200.0030.01315.58
7.2.190.0030.01215.52
7.2.180.0080.00715.55
7.2.170.0060.00715.59
7.2.160.0010.01715.51
7.2.150.0070.00817.47
7.2.140.0080.00717.46
7.2.130.0070.00617.18
7.2.120.0080.00717.15
7.2.110.0450.00816.75
7.2.100.0520.00816.76
7.2.90.0510.00716.70
7.2.80.0570.00516.68
7.2.70.0530.01016.84
7.2.60.0550.01016.76
7.2.50.0450.00916.80
7.2.40.0550.00816.82
7.2.30.0500.00816.80
7.2.20.0510.00716.91
7.2.10.0540.00916.69
7.2.00.0460.00616.78
7.1.330.0050.01316.36
7.1.320.0050.00716.25
7.1.310.0060.00816.35
7.1.300.0060.00816.14
7.1.290.0010.01316.23
7.1.280.0020.01116.20
7.1.270.0080.00816.30
7.1.260.0050.00516.34
7.1.250.0050.00716.09
7.1.240.0020.01016.63
7.1.230.0970.01115.76
7.1.220.0790.00615.54
7.1.210.0860.01015.61
7.1.200.0760.01415.66
7.1.190.0980.00515.66
7.1.180.0890.00815.61
7.1.170.0750.00615.68
7.1.160.0770.01415.55
7.1.150.0920.01015.60
7.1.140.0770.01115.66
7.1.130.0740.00815.65
7.1.120.0870.00715.65
7.1.110.0910.01015.49
7.1.100.0880.00915.63
7.1.90.0730.00515.59
7.1.80.0770.00715.65
7.1.70.0870.01015.55
7.1.60.0820.01021.61
7.1.50.1230.01121.69
7.1.40.0880.01121.54
7.1.30.0780.00521.75
7.1.20.0890.01221.65
7.1.10.0750.00915.74
7.1.00.0700.00814.08
7.0.330.0050.00816.20
7.0.320.0050.00816.23
7.0.310.0030.00916.26
7.0.300.0050.01016.21
7.0.290.0050.00916.26
7.0.280.0030.01016.15
7.0.270.0050.01016.16
7.0.260.0080.00716.17
7.0.250.0030.01016.11
7.0.240.0060.01016.30
7.0.230.0090.00716.28
7.0.220.0050.00616.03
7.0.210.0080.00716.36
7.0.200.0050.00816.15
7.0.190.0050.00916.18
7.0.180.0070.00916.29
7.0.170.0070.00516.20
7.0.160.0050.01016.28
7.0.150.0050.00716.28
7.0.140.0070.00616.30
7.0.130.0090.00716.31
7.0.120.0060.00816.21
7.0.110.0060.00516.27
7.0.100.0080.00716.26
7.0.90.0030.01316.20
7.0.80.0050.00816.32
7.0.70.0060.00716.09
7.0.60.0040.01116.30
7.0.50.0020.00916.27
7.0.40.0050.00714.35
7.0.30.0090.00514.22
7.0.20.0050.00814.30
7.0.10.0070.00814.15
7.0.00.0060.00814.22
5.6.400.0080.00315.18
5.6.390.0030.01114.86
5.6.380.0040.01114.76
5.6.370.0040.00715.29
5.6.360.0070.00715.11
5.6.350.0040.01215.13
5.6.340.0030.01115.25
5.6.330.0130.00215.25
5.6.320.0060.00615.26
5.6.310.0060.00615.09
5.6.300.0080.00814.96
5.6.290.0050.00914.94
5.6.280.0110.00315.20
5.6.270.0050.00715.28
5.6.260.0040.01115.11
5.6.250.0090.00815.20
5.6.240.0110.00715.17
5.6.230.0090.00615.07
5.6.220.0080.00714.96
5.6.210.0050.00815.12
5.6.200.0050.00715.04
5.6.190.0090.00514.88
5.6.180.0080.00615.10
5.6.170.0070.00915.25
5.6.160.0050.00815.12
5.6.150.0060.00715.13
5.6.140.0050.01015.03
5.6.130.0050.01015.18
5.6.120.0070.00215.09
5.6.110.0080.00615.14
5.6.100.0020.01315.12
5.6.90.0030.01115.09
5.6.80.0050.00915.01
5.6.70.0130.00215.13
5.6.60.0050.00815.12
5.6.50.0070.01015.04
5.6.40.0100.00115.08
5.6.30.0050.01015.01
5.6.20.0140.00315.02
5.6.10.0050.00915.06
5.6.00.0080.00515.02

preferences:
31.89 ms | 401 KiB | 5 Q