3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = 'Aaaafaba Bbab'; $ret = preg_replace_callback( '~[a]+~i', function ($match) { echo strlen(match[0], ' matches for "a" found', PHP_EOL); }, $subject ); var_dump($ret); var_dump($subject); $ret = preg_replace_callback_array( [ '~[a]+~i' => function ($match) { echo strlen($match[0]), ' matches for "a" found', PHP_EOL; }, '~[b]+~i' => function ($match) { echo strlen($match[0]), ' matches for "b" found', PHP_EOL; } ], $subject ); var_dump($ret); var_dump($subject);

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.0150.00418.68
8.3.50.0120.00921.13
8.3.40.0090.00618.79
8.3.30.0030.01018.77
8.3.20.0040.00420.25
8.3.10.0040.00421.98
8.3.00.0050.00317.80
8.2.180.0190.00016.63
8.2.170.0120.00322.96
8.2.160.0130.00620.39
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0030.00617.63
8.2.110.0060.00319.33
8.2.100.0080.00419.53
8.2.90.0040.00418.93
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0050.00317.68
8.2.50.0000.00818.07
8.2.40.0000.00819.38
8.2.30.0070.00020.52
8.2.20.0080.00017.73
8.2.10.0030.00517.82
8.2.00.0000.00717.89
8.1.280.0130.00725.92
8.1.270.0140.00322.11
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00620.99
8.1.230.0040.00817.42
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0000.01117.11
8.1.180.0040.00418.10
8.1.170.0030.00618.56
8.1.160.0030.00321.91
8.1.150.0040.00418.71
8.1.140.0000.00817.35
8.1.130.0030.00317.56
8.1.120.0030.00317.25
8.1.110.0000.00717.29
8.1.100.0000.00717.18
8.1.90.0070.00317.37
8.1.80.0040.00417.21
8.1.70.0000.00717.30
8.1.60.0070.00017.40
8.1.50.0000.00817.41
8.1.40.0080.00017.29
8.1.30.0000.00817.55
8.1.20.0040.00417.43
8.1.10.0050.00317.42
8.1.00.0040.00417.34
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0070.00018.28
8.0.270.0000.00717.16
8.0.260.0040.00417.08
8.0.250.0040.00417.00
8.0.240.0040.00416.80
8.0.230.0080.00016.96
8.0.220.0000.00716.91
8.0.210.0070.00016.87
8.0.200.0000.00616.86
8.0.190.0040.00716.83
8.0.180.0060.00316.87
8.0.170.0000.00816.70
8.0.160.0050.00316.76
8.0.150.0070.00016.85
8.0.140.0000.00716.89
8.0.130.0000.00513.30
8.0.120.0000.00816.66
8.0.110.0030.00516.88
8.0.100.0000.00916.71
8.0.90.0040.00416.76
8.0.80.0070.00716.88
8.0.70.0040.00416.66
8.0.60.0030.00316.66
8.0.50.0040.00416.93
8.0.30.0090.01017.00
8.0.20.0060.01417.40
8.0.10.0040.00416.99
8.0.00.0120.00716.70
7.4.330.0030.00315.10
7.4.320.0040.00416.70
7.4.300.0070.00016.70
7.4.290.0000.00716.68
7.4.280.0060.00316.64
7.4.270.0040.00416.76
7.4.260.0040.00416.80
7.4.250.0000.00716.58
7.4.240.0050.00216.81
7.4.230.0000.00716.79
7.4.220.0040.01416.75
7.4.210.0090.00816.81
7.4.200.0070.00016.88
7.4.160.0060.00916.54
7.4.150.0000.01817.40
7.4.140.0180.00317.86
7.4.130.0090.00916.58
7.4.120.0080.01116.73
7.4.110.0120.00616.70
7.4.100.0100.01316.80
7.4.90.0070.01116.61
7.4.80.0090.00919.39
7.4.70.0130.00316.68
7.4.60.0130.00616.70
7.4.50.0000.00716.43
7.4.40.0130.00316.61
7.4.30.0060.01616.81
7.4.00.0070.01015.11
7.3.330.0060.00013.50
7.3.320.0050.00013.45
7.3.310.0070.00016.57
7.3.300.0000.00716.44
7.3.290.0090.00616.52
7.3.280.0090.00816.46
7.3.270.0130.00417.40
7.3.260.0170.00716.80
7.3.250.0070.01216.50
7.3.240.0140.01016.52
7.3.230.0080.00916.59
7.3.210.0130.00716.82
7.3.200.0060.01116.61
7.3.190.0140.00316.62
7.3.180.0100.00616.83
7.3.170.0160.00016.43
7.3.160.0070.01116.64
7.3.120.0100.01015.05
7.3.110.0100.00715.21
7.3.100.0130.00614.94
7.3.90.0000.01414.71
7.3.80.0000.01515.13
7.3.70.0030.00915.05
7.3.60.0030.01015.11
7.3.50.0070.00715.08
7.3.40.0030.00915.06
7.3.30.0110.00414.91
7.3.20.0060.01016.97
7.3.10.0110.00416.70
7.3.00.0120.00316.81
7.2.330.0080.00816.81
7.2.320.0190.02016.82
7.2.310.0060.01216.93
7.2.300.0100.00716.88
7.2.290.0140.00316.73
7.2.250.0110.00715.05
7.2.240.0070.01015.37
7.2.230.0030.01315.21
7.2.220.0000.01315.23
7.2.210.0000.01515.27
7.2.200.0150.00014.98
7.2.190.0040.00815.47
7.2.180.0050.00515.36
7.2.170.0070.01015.22
7.2.60.0100.00616.94
7.2.00.0000.01819.75
7.1.330.0030.01015.74
7.1.320.0090.00315.75
7.1.310.0050.00515.81
7.1.300.0040.01115.96
7.1.290.0000.00815.99
7.1.280.0030.01016.11
7.1.270.0100.00715.83
7.1.260.0060.00915.67
7.1.200.0060.00616.06
7.1.100.0030.01018.43
7.1.70.0020.00517.02
7.1.60.0060.00619.27
7.1.50.0070.01317.10
7.1.00.0070.07322.55
7.0.200.0040.00416.70
7.0.60.0330.03020.04
7.0.50.0100.05017.89
7.0.40.0000.04720.06
7.0.30.0530.07020.28
7.0.20.0230.08320.17
7.0.10.0000.04720.26
7.0.00.0000.04320.07
5.6.280.0000.03721.14
5.6.210.0000.06320.62
5.6.200.0100.05018.20
5.6.190.0030.05720.67
5.6.180.0270.06320.39
5.6.170.0230.04320.43
5.6.160.0100.07020.48
5.6.150.0030.04018.14
5.6.140.0070.06018.21
5.6.130.0070.04018.18
5.6.120.0170.06021.15
5.6.110.0130.03321.07
5.6.100.0070.08721.15
5.6.90.0070.03721.02
5.6.80.0070.08020.40
5.5.350.0000.08320.44
5.5.340.0130.07317.95
5.5.330.0070.04020.41
5.5.320.0300.07720.20
5.5.310.0400.05320.51
5.5.300.0070.08017.98
5.5.290.0030.04318.00
5.5.280.0130.07720.80
5.5.270.0070.08720.76
5.5.260.0100.06020.86
5.5.250.0130.07720.70
5.5.240.0000.06320.07
5.4.450.0800.06319.47
5.4.440.0770.06719.52
5.4.430.0700.06019.58
5.4.420.0630.06019.67
5.4.410.0630.06019.32
5.4.400.0730.05318.86
5.4.390.0700.05319.34
5.4.380.0700.05319.34
5.4.370.0830.05718.98
5.4.360.0830.05719.13
5.4.350.0670.06319.14
5.4.340.0530.06319.25
5.4.320.0500.06719.34
5.4.310.0530.06019.01
5.4.300.0670.05319.00
5.4.290.0630.06319.12
5.4.280.0530.06018.98
5.4.270.0630.05018.82
5.4.260.0530.05319.29
5.4.250.0530.06019.13
5.4.240.0500.06019.05
5.4.230.0700.05319.14
5.4.220.0700.05719.14
5.4.210.0800.05718.86
5.4.200.0470.06319.12
5.4.190.0500.06019.24
5.4.180.0630.04719.34
5.4.170.0700.07019.05
5.4.160.0770.04319.12
5.4.150.0670.05719.32
5.4.140.0670.06716.55
5.4.130.0770.05316.36
5.4.120.0670.06016.44
5.4.110.0670.05716.42
5.4.100.0730.05016.57
5.4.90.0830.03716.61
5.4.80.0670.05716.60
5.4.70.0100.04316.43
5.4.60.0100.03016.54
5.4.50.0000.03716.43
5.4.40.0230.05716.32
5.4.30.0330.04016.33
5.4.20.0270.06016.55

preferences:
56.66 ms | 401 KiB | 5 Q