3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = '{wordone|wordtwo {wordthree|wordfour}}'; $sentences = []; for($i = 0; $i < 20; $i++) { $sentences[] = sentence_spinning($sentence); } var_dump(array_values(array_unique($sentences))); function sentence_spinning($str) { do { $str = preg_replace_callback('#\{([^{}]*)\}#', function($matches) { return explode('|', $matches[1])[mt_rand(0, substr_count($matches[1], '|'))]; }, $str, -1, $count); } while ($count !== 0); return $str; }

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.3.120.0030.01615.20
7.3.110.0110.00715.00
7.3.100.0030.01014.62
7.3.90.0060.01014.96
7.3.80.0040.01414.81
7.3.70.0000.01315.05
7.3.60.0130.00315.10
7.3.50.0060.00315.24
7.3.40.0040.00814.98
7.3.30.0070.00714.95
7.3.20.0000.01516.95
7.3.10.0080.00817.03
7.3.00.0000.01316.80
7.2.240.0100.01015.23
7.2.230.0060.00915.18
7.2.220.0070.00715.04
7.2.210.0060.00615.07
7.2.200.0070.00715.18
7.2.190.0100.00615.21
7.2.180.0080.00415.12
7.2.170.0090.00615.07
7.2.160.0110.00715.25
7.2.150.0110.00717.17
7.2.140.0030.01317.20
7.2.130.0040.01116.89
7.2.120.0090.00617.05
7.2.110.0030.00717.09
7.2.100.0030.01117.11
7.2.90.0090.00617.32
7.2.80.0080.00817.00
7.2.70.0030.01417.14
7.2.60.0070.01017.02
7.2.50.0000.01516.92
7.2.40.0040.01117.21
7.2.30.0000.01617.27
7.2.20.0080.00617.13
7.2.10.0060.01017.23
7.2.00.0060.00818.25
7.1.330.0130.00615.55
7.1.320.0140.00315.96
7.1.310.0130.00015.85
7.1.300.0070.00716.14
7.1.290.0000.01916.09
7.1.280.0100.00716.06
7.1.270.0000.00915.96
7.1.260.0030.01015.89
7.1.250.0100.00316.05
7.1.70.0030.00917.59
7.1.60.0070.01819.17
7.1.50.0000.02217.22
7.1.00.0030.03322.46
7.0.200.0030.00816.92
7.0.140.0100.06721.92
7.0.70.0170.04319.95
7.0.60.0070.04719.95
7.0.50.0070.08720.31
7.0.40.0170.08020.14
7.0.30.0100.07719.98
7.0.20.0130.06320.12
7.0.10.0200.07320.18
7.0.00.0070.07320.09
5.6.280.0000.07720.91
5.6.220.0130.04320.58
5.6.210.0170.07020.46
5.6.200.0100.07021.18
5.6.190.0070.07021.07
5.6.180.0070.08321.14
5.6.170.0070.05321.10
5.6.160.0100.06021.03
5.6.150.0100.05721.11
5.6.140.0100.04320.96
5.6.130.0130.07321.04
5.6.120.0230.07321.11
5.6.110.0130.08021.02
5.6.100.0070.09021.08
5.6.90.0100.07721.02
5.6.80.0230.04020.50
5.6.70.0200.06320.34
5.6.60.0030.08720.40
5.6.50.0030.08720.50
5.6.40.0130.07020.38
5.6.30.0070.08320.41
5.6.20.0230.06320.44
5.6.10.0100.06720.40
5.6.00.0170.07720.43
5.5.360.0030.05720.42
5.5.350.0030.08720.43
5.5.340.0130.07320.61
5.5.330.0030.08720.79
5.5.320.0100.07320.80
5.5.310.0200.06720.89
5.5.300.0030.08020.93
5.5.290.0070.06720.91
5.5.280.0100.08720.83
5.5.270.0000.05720.75
5.5.260.0070.08720.72
5.5.250.0130.05320.46
5.5.240.0030.08320.10
5.5.230.0100.05020.31
5.5.220.0100.04720.28
5.5.210.0070.07720.25
5.5.200.0130.06719.99
5.5.190.0100.06020.27
5.5.180.0030.05020.00
5.5.160.0130.05020.19
5.5.150.0130.08020.23
5.5.140.0030.09020.27
5.5.130.0030.06020.00
5.5.120.0130.06020.21
5.5.110.0070.08020.13
5.5.100.0030.08320.17
5.5.90.0100.08020.10
5.5.80.0100.07020.07
5.5.70.0070.08319.93
5.5.60.0070.05320.14
5.5.50.0100.06020.05
5.5.40.0100.04020.06
5.5.30.0100.07020.00
5.5.20.0070.06719.91
5.5.10.0000.07720.06
5.5.00.0100.08320.04
5.4.450.0230.06719.18
5.4.440.0100.07719.54
5.4.430.0000.07319.48
5.4.420.0100.06319.44
5.4.410.0100.08019.23
5.4.400.0030.05318.95
5.4.390.0070.08019.03
5.4.380.0030.05019.21
5.4.370.0100.08019.09
5.4.360.0000.06018.90
5.4.350.0030.05318.90
5.4.340.0130.07719.03
5.4.320.0030.05319.05
5.4.310.0030.04019.23
5.4.300.0070.06019.02
5.4.290.0070.07719.22
5.4.280.0130.06318.84
5.4.270.0070.08019.04
5.4.260.0230.06719.04
5.4.250.0030.07319.22
5.4.240.0000.04318.96
5.4.230.0070.04719.02
5.4.220.0070.06019.12
5.4.210.0030.08019.12
5.4.200.0030.08718.94
5.4.190.0070.04719.11
5.4.180.0200.06319.13
5.4.170.0100.06019.22
5.4.160.0100.05719.02
5.4.150.0070.04019.00
5.4.140.0130.05016.28
5.4.130.0100.07016.25
5.4.120.0130.06316.38
5.4.110.0100.04016.45
5.4.100.0030.08016.48
5.4.90.0030.05016.49
5.4.80.0130.05016.51
5.4.70.0070.07316.38
5.4.60.0070.07716.45
5.4.50.0100.06716.40
5.4.40.0170.06316.38
5.4.30.0130.06716.47
5.4.20.0130.07016.50
5.4.10.0170.06316.40
5.4.00.0070.06315.70
5.3.290.0000.05014.50
5.3.280.0130.07714.45
5.3.270.0030.08714.57
5.3.260.0070.08314.59
5.3.250.0070.06714.60
5.3.240.0100.05314.46
5.3.230.0130.07314.60
5.3.220.0170.06314.53
5.3.210.0070.04714.55
5.3.200.0100.07014.57
5.3.190.0100.07314.39
5.3.180.0000.05314.55
5.3.170.0000.05014.39
5.3.160.0100.06714.51
5.3.150.0030.05314.55
5.3.140.0030.08014.43
5.3.130.0100.04714.41
5.3.120.0130.07014.41
5.3.110.0100.07314.37
5.3.100.0000.04314.05
5.3.90.0070.07314.03
5.3.80.0030.07713.97
5.3.70.0030.05313.99
5.3.60.0070.07013.96
5.3.50.0100.07313.92
5.3.40.0100.06013.71
5.3.30.0000.08313.87
5.3.20.0070.05313.65
5.3.10.0030.05313.63
5.3.00.0070.04713.50
5.2.170.0070.04012.24
5.2.160.0030.06712.24
5.2.150.0100.05312.24
5.2.140.0030.06312.24
5.2.130.0070.05312.24
5.2.120.0030.06312.24
5.2.110.0000.05012.24
5.2.100.0030.06712.24
5.2.90.0030.06312.24
5.2.80.0030.06312.24
5.2.70.0070.06312.24
5.2.60.0000.05712.24
5.2.50.0030.06312.24
5.2.40.0030.06712.24
5.2.30.0100.05012.24
5.2.20.0070.04312.24
5.2.10.0070.06012.24
5.2.00.0070.06012.24
5.1.60.0030.05012.24
5.1.50.0070.05312.24
5.1.40.0000.06012.24
5.1.30.0100.05012.24
5.1.20.0100.04312.24
5.1.10.0070.05712.24
5.1.00.0030.04012.24
5.0.50.0000.05012.24
5.0.40.0000.05012.24
5.0.30.0000.05712.24
5.0.20.0030.04712.24
5.0.10.0100.03312.24
5.0.00.0070.05312.24
4.4.90.0000.03312.24
4.4.80.0070.03012.24
4.4.70.0030.02012.24
4.4.60.0030.03312.24
4.4.50.0030.03712.24
4.4.40.0030.05312.24
4.4.30.0030.03312.24
4.4.20.0000.02312.24
4.4.10.0030.02012.24
4.4.00.0070.04712.24
4.3.110.0000.03712.24
4.3.100.0000.03712.24
4.3.90.0070.03312.24
4.3.80.0030.05012.24
4.3.70.0070.03012.24
4.3.60.0030.02712.24
4.3.50.0000.03712.24
4.3.40.0070.04712.24
4.3.30.0030.02712.24
4.3.20.0000.03012.24
4.3.10.0000.03312.24
4.3.00.0030.03712.24

preferences:
29.86 ms | 401 KiB | 5 Q