3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = "This is a body of {{awesome}} text {{blabla}} from a book."; //$count = 0; $terms[] = '1'; $terms[] = '2'; echo preg_replace_callback('/\{{2}(.*?)\}{2}/',function($match) use (&$count,$terms) { $return = !empty($terms[$count]) ? $terms[$count] : 'Default value for unknown term'; // $count++; echo "#$count#"; return $return; }, $body, -1, $count);

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.0090.01316.75
8.3.50.0070.01016.63
8.3.40.0080.00818.97
8.3.30.0150.00018.96
8.3.20.0040.00420.34
8.3.10.0080.00023.65
8.3.00.0000.00723.51
8.2.180.0040.01118.66
8.2.170.0120.00322.96
8.2.160.0080.00819.22
8.2.150.0070.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00820.48
8.2.120.0050.00326.35
8.2.110.0090.00021.16
8.2.100.0060.00617.88
8.2.90.0030.00618.22
8.2.80.0030.00618.16
8.2.70.0000.00817.86
8.2.60.0040.00417.75
8.2.50.0040.00417.75
8.2.40.0000.00822.24
8.2.30.0080.00019.46
8.2.20.0000.00818.06
8.2.10.0000.00718.20
8.2.00.0030.00518.17
8.1.280.0120.00325.92
8.1.270.0030.00623.93
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0060.00323.98
8.1.230.0090.00320.84
8.1.220.0040.00417.79
8.1.210.0000.00818.84
8.1.200.0060.00317.48
8.1.190.0100.00017.36
8.1.180.0080.00018.10
8.1.170.0040.00418.63
8.1.160.0070.00018.93
8.1.150.0030.00520.10
8.1.140.0000.00719.23
8.1.130.0030.00318.84
8.1.120.0060.00317.56
8.1.110.0070.00317.49
8.1.100.0000.00817.58
8.1.90.0000.00717.48
8.1.80.0000.00717.57
8.1.70.0050.00217.52
8.1.60.0000.00817.77
8.1.50.0070.00317.70
8.1.40.0000.00817.70
8.1.30.0040.00417.84
8.1.20.0040.00417.84
8.1.10.0040.00417.73
8.1.00.0070.00017.71
8.0.300.0030.00319.94
8.0.290.0030.00516.88
8.0.280.0070.00018.37
8.0.270.0000.00717.36
8.0.260.0000.00718.82
8.0.250.0100.00017.17
8.0.240.0030.00317.11
8.0.230.0080.00017.02
8.0.220.0040.00417.13
8.0.210.0000.00717.02
8.0.200.0060.00017.12
8.0.190.0060.00317.13
8.0.180.0060.00317.15
8.0.170.0020.00517.03
8.0.160.0040.00417.06
8.0.150.0040.00417.05
8.0.140.0000.00817.01
8.0.130.0030.00313.52
8.0.120.0080.00016.95
8.0.110.0000.00816.96
8.0.100.0000.00817.11
8.0.90.0030.00517.05
8.0.80.0060.00916.95
8.0.70.0000.00717.09
8.0.60.0000.00817.06
8.0.50.0070.00016.93
8.0.30.0020.01717.25
8.0.20.0110.00917.40
8.0.10.0050.00317.11
8.0.00.0090.01516.99
7.4.330.0020.00215.55
7.4.320.0030.00316.86
7.4.300.0070.00016.73
7.4.290.0030.00316.82
7.4.280.0000.00816.82
7.4.270.0040.00416.74
7.4.260.0070.00016.78
7.4.250.0040.00416.69
7.4.240.0080.00016.75
7.4.230.0000.00816.71
7.4.220.0090.00616.84
7.4.210.0110.00716.78
7.4.200.0000.00816.85
7.4.160.0110.01116.64
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0150.00916.55
7.4.120.0090.01016.70
7.4.110.0030.01416.65
7.4.100.0150.00916.64
7.4.90.0070.01116.83
7.4.80.0060.01219.39
7.4.70.0090.01316.80
7.4.60.0150.00316.78
7.4.50.0070.00716.53
7.4.40.0100.00716.71
7.4.30.0130.00716.81
7.4.00.0070.00715.38
7.3.330.0030.00313.34
7.3.320.0000.00513.30
7.3.310.0030.00316.41
7.3.300.0050.00216.47
7.3.290.0070.00016.49
7.3.280.0060.00916.50
7.3.270.0140.00317.40
7.3.260.0150.00216.82
7.3.250.0070.01116.52
7.3.240.0100.01116.53
7.3.230.0100.00716.72
7.3.210.0070.01016.73
7.3.200.0140.00316.53
7.3.190.0120.00916.63
7.3.180.0130.00516.43
7.3.170.0080.00816.66
7.3.160.0150.00316.41
7.2.330.0000.01816.63
7.2.320.0110.00816.71
7.2.310.0110.00716.70
7.2.300.0090.00916.89
7.2.290.0060.01716.59
7.2.90.0050.00915.09
7.2.80.0110.00714.85
7.2.70.0320.00415.17
7.2.60.0070.01415.12
7.2.50.0480.00315.38
7.2.40.0140.00615.03
7.2.30.0090.00615.08
7.2.20.0000.01315.05
7.2.10.1450.00015.16
7.2.00.0150.00015.25
7.1.210.0770.00913.80
7.1.200.0160.00014.07
7.1.190.0790.00414.08
7.1.180.0440.00314.33
7.1.170.0060.00914.01
7.1.160.0310.00814.06
7.1.150.0100.00414.14
7.1.140.0280.00714.25
7.1.130.0350.00014.30
7.1.120.0110.00414.28
7.1.110.0040.00814.26
7.1.100.0070.00714.18
7.1.90.0080.00414.13
7.1.80.1170.00714.26
7.1.70.0050.01414.09
7.1.60.0250.01332.03
7.1.50.0470.00932.01
7.1.40.0880.00332.19
7.1.30.1590.01332.09
7.1.20.0470.00732.11
7.1.10.0030.01514.24
7.1.00.0090.00414.14
7.0.310.0080.00813.86
7.0.300.0110.01113.66
7.0.290.0660.00413.47
7.0.280.0360.00413.79
7.0.270.0120.00313.59
7.0.260.0460.01113.79
7.0.250.0380.00413.83
7.0.240.0660.00013.88
7.0.230.0230.00713.57
7.0.220.0080.00313.53
7.0.210.0920.00613.75
7.0.200.0070.00613.73
7.0.190.0120.00213.70
7.0.180.0110.00213.80
7.0.170.0450.00813.57
7.0.160.0180.01013.56
7.0.150.0190.00313.56
7.0.140.0000.01313.47
7.0.130.0300.00313.75
7.0.120.1850.00713.59
7.0.110.0150.00513.73
7.0.100.0120.00013.59
7.0.90.0090.00313.73
7.0.80.0230.00413.97
7.0.70.0070.00713.73
7.0.60.1560.00613.80
7.0.50.0100.00613.88
7.0.40.0060.00613.57
7.0.30.0100.00513.85
7.0.20.1510.00413.94
7.0.10.0310.00713.78
7.0.00.0820.00313.80

preferences:
52.98 ms | 400 KiB | 5 Q