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.40.0000.01518.95
8.3.30.0040.01118.83
8.3.20.0070.00020.21
8.3.10.0040.00421.85
8.3.00.0000.00817.89
8.2.170.0040.01122.96
8.2.160.0030.01020.31
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00017.75
8.2.110.0030.00720.58
8.2.100.0060.00617.97
8.2.90.0050.00318.00
8.2.80.0030.00519.03
8.2.70.0060.00317.93
8.2.60.0080.00018.34
8.2.50.0000.00818.10
8.2.40.0000.00819.22
8.2.30.0040.00420.65
8.2.20.0050.00317.83
8.2.10.0060.00318.07
8.2.00.0050.00218.14
8.1.270.0090.00621.90
8.1.260.0080.00026.35
8.1.250.0090.00928.09
8.1.240.0030.00623.83
8.1.230.0060.00620.96
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0040.00417.48
8.1.180.0040.00418.78
8.1.170.0080.00018.59
8.1.160.0040.00422.16
8.1.150.0020.00518.82
8.1.140.0080.00017.60
8.1.130.0030.00317.63
8.1.120.0040.00317.66
8.1.110.0040.00417.50
8.1.100.0000.00717.64
8.1.90.0060.00317.62
8.1.80.0070.00017.62
8.1.70.0040.00417.60
8.1.60.0060.00317.65
8.1.50.0040.00417.64
8.1.40.0040.00417.66
8.1.30.0040.00417.72
8.1.20.0060.00317.71
8.1.10.0020.00517.71
8.1.00.0080.00017.55
8.0.300.0000.00818.77
8.0.290.0000.00816.88
8.0.280.0000.00718.45
8.0.270.0040.00417.18
8.0.260.0080.00017.31
8.0.250.0040.00417.02
8.0.240.0000.00617.10
8.0.230.0000.00817.02
8.0.220.0000.00716.94
8.0.210.0040.00416.94
8.0.200.0000.00617.07
8.0.190.0070.00417.09
8.0.180.0000.00716.96
8.0.170.0000.00717.08
8.0.160.0040.00416.93
8.0.150.0020.00517.03
8.0.140.0000.00816.98
8.0.130.0060.00013.45
8.0.120.0040.00416.92
8.0.110.0000.00716.94
8.0.100.0060.00317.00
8.0.90.0040.00417.04
8.0.80.0150.00617.05
8.0.70.0070.00016.98
8.0.60.0070.00017.00
8.0.50.0020.00517.07
8.0.30.0100.00717.28
8.0.20.0100.01017.40
8.0.10.0000.00717.20
8.0.00.0120.00817.02
7.4.330.0020.00215.08
7.4.320.0000.00716.65
7.4.300.0060.00016.62
7.4.290.0000.00716.59
7.4.280.0100.00016.58
7.4.270.0080.00016.80
7.4.260.0080.00016.81
7.4.250.0020.00516.53
7.4.240.0020.00516.80
7.4.230.0030.00316.80
7.4.220.0090.01116.63
7.4.210.0060.00916.82
7.4.200.0070.00016.61
7.4.160.0100.00516.85
7.4.150.0130.00617.40
7.4.140.0170.00517.86
7.4.130.0110.01016.62
7.4.120.0110.01016.72
7.4.110.0120.00816.77
7.4.100.0160.00816.59
7.4.90.0170.00016.64
7.4.80.0060.00919.39
7.4.70.0140.00716.75
7.4.60.0130.00416.60
7.4.50.0050.00316.71
7.4.40.0110.00716.67
7.4.30.0080.01616.80
7.4.00.0030.01415.09
7.3.330.0030.00313.39
7.3.320.0000.00513.37
7.3.310.0080.00016.41
7.3.300.0060.00016.46
7.3.290.0060.00916.41
7.3.280.0120.00816.38
7.3.270.0160.00317.40
7.3.260.0180.00616.48
7.3.250.0100.01016.63
7.3.240.0070.01016.45
7.3.230.0100.01316.76
7.3.210.0030.01716.80
7.3.200.0100.00716.45
7.3.190.0160.00016.36
7.3.180.0060.01016.42
7.3.170.0180.00416.42
7.3.160.0090.00916.76
7.3.10.0120.00316.69
7.3.00.0010.01116.61
7.2.330.0100.00716.81
7.2.320.0060.01216.73
7.2.310.0090.00916.79
7.2.300.0090.00916.71
7.2.290.0060.01316.97
7.2.130.0040.00917.13
7.2.120.0060.00916.99
7.2.110.0080.00616.79
7.2.100.0100.00616.84
7.2.90.0070.00717.03
7.2.80.0080.00817.01
7.2.70.0060.00816.93
7.2.60.0040.00917.12
7.2.50.0050.01217.02
7.2.40.0040.01316.98
7.2.30.0080.00617.00
7.2.20.0080.00517.07
7.2.10.0060.00717.20
7.2.00.0070.00618.00
7.1.250.0050.00915.75
7.1.200.0110.00015.86
7.1.100.0040.00818.51
7.1.70.0000.00717.42
7.1.60.0030.01619.27
7.1.50.0090.01517.12
7.1.00.0070.07022.55
7.0.200.0040.00416.97
7.0.60.0070.04719.96
7.0.50.0070.04017.98
7.0.40.0070.07720.41
7.0.30.0100.05020.22
7.0.20.0300.07320.31
7.0.10.0070.09020.22
7.0.00.0070.08720.20
5.6.210.0130.07720.48
5.6.200.0130.07718.22
5.6.190.0100.06320.57
5.6.180.0370.03320.57
5.6.170.0370.06720.48
5.6.160.0000.04320.61
5.6.150.0070.08318.12
5.6.140.0000.04718.16
5.6.130.0070.05318.14
5.6.120.0100.05721.03
5.6.110.0070.03720.90
5.6.100.0100.07721.00
5.6.90.0100.04721.00
5.6.80.0130.06020.45
5.5.350.4400.04320.42
5.5.340.0030.05717.97
5.5.330.0100.08020.28
5.5.320.0130.08320.27
5.5.310.0170.04020.25
5.5.300.0000.07717.95
5.5.290.0070.08017.98
5.5.280.0030.08320.81
5.5.270.0030.06720.77
5.5.260.0070.07020.65
5.5.250.0000.08720.72
5.5.240.0230.07020.29
5.4.450.0300.07019.64
5.4.440.0330.04319.46
5.4.430.0300.04019.41
5.4.420.0370.06719.18
5.4.410.0270.04019.05
5.4.400.0270.07318.98
5.4.390.0200.04318.87
5.4.380.0270.05319.13
5.4.370.0300.07019.05
5.4.360.0270.06319.25
5.4.350.0230.06319.31
5.4.340.0200.05718.88
5.4.320.0330.06019.09
5.4.310.0330.04719.22
5.4.300.0370.06318.98
5.4.290.0270.06018.94
5.4.280.0270.07719.21
5.4.270.0200.04019.21
5.4.260.0230.03719.31
5.4.250.0270.06719.20
5.4.240.0430.05719.07
5.4.230.0230.06719.13
5.4.220.0300.06019.08
5.4.210.0270.07719.21
5.4.200.0230.05319.08
5.4.190.0300.05718.84
5.4.180.0370.04019.07
5.4.170.0300.05719.13
5.4.160.0400.06019.14
5.4.150.0330.07019.30
5.4.140.0330.05716.57
5.4.130.0330.05716.39
5.4.120.0330.06716.43
5.4.110.0330.06016.23
5.4.100.0330.06316.60
5.4.90.0330.06016.61
5.4.80.0300.06016.55

preferences:
57.14 ms | 400 KiB | 5 Q