3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mobile = '123456789'; $pattern = '(xx)-xxxxxxx'; echo preg_replace_callback('/x+/', function ($match) use (&$mobile) { $length = strlen($match[0]); $replacement = substr($mobile, 0, $length); $mobile = substr($mobile, $length); return $replacement; }, $pattern);

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.5.10.0120.00716.79
8.5.00.0130.00820.06
8.4.150.0030.00014.05
8.4.140.0140.00817.56
8.4.130.0120.00817.86
8.4.120.0120.00720.91
8.4.110.0110.00922.52
8.4.100.0070.00318.79
8.4.90.0120.00818.96
8.4.80.0080.01018.77
8.4.70.0120.00718.07
8.4.60.0090.01118.77
8.4.50.0110.00918.74
8.4.40.0070.01019.62
8.4.30.0060.00922.38
8.4.20.0160.00318.62
8.4.10.0160.00319.77
8.3.280.0110.00918.58
8.3.270.0100.01016.98
8.3.260.0140.00616.74
8.3.250.0130.00619.05
8.3.240.0130.00616.98
8.3.230.0110.00516.77
8.3.220.0080.00718.90
8.3.210.0110.00818.63
8.3.200.0050.00416.72
8.3.190.0110.00917.07
8.3.180.0110.00716.66
8.3.170.0090.00620.71
8.3.160.0120.00617.26
8.3.150.0120.00817.42
8.3.140.0030.00616.77
8.3.130.0030.00618.49
8.3.120.0090.00018.82
8.3.110.0000.00816.86
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0060.00319.36
8.3.70.0100.00718.68
8.3.60.0140.00316.50
8.3.50.0070.00717.49
8.3.40.0090.00618.90
8.3.30.0100.00618.84
8.3.20.0040.00420.95
8.3.10.0030.00620.20
8.3.00.0080.00022.51
8.2.290.0130.00720.20
8.2.280.0150.00718.65
8.2.270.0130.00617.34
8.2.260.0120.00318.66
8.2.250.0100.01016.93
8.2.240.0000.00917.38
8.2.230.0030.00620.94
8.2.220.0060.00337.54
8.2.210.0050.00326.77
8.2.200.0000.01018.88
8.2.190.0070.01416.82
8.2.180.0210.00018.26
8.2.170.0140.00022.96
8.2.160.0090.00520.52
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0110.00726.16
8.2.120.0040.00421.04
8.2.110.0060.00320.39
8.2.100.0040.00817.91
8.2.90.0060.00317.88
8.2.80.0030.00519.04
8.2.70.0050.00317.77
8.2.60.0000.00818.30
8.2.50.0030.00518.10
8.2.40.0050.00321.02
8.2.30.0030.00519.33
8.2.20.0000.00718.09
8.2.10.0030.00519.43
8.2.00.0050.00218.09
8.1.330.0110.00721.99
8.1.320.0120.00716.43
8.1.310.0000.00816.96
8.1.300.0030.00516.33
8.1.290.0090.00030.84
8.1.280.0090.00925.92
8.1.270.0000.00818.95
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0000.01122.15
8.1.230.0000.01220.90
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0040.00417.48
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0060.00318.71
8.1.160.0040.00419.09
8.1.150.0080.00018.87
8.1.140.0000.00820.38
8.1.130.0030.00320.26
8.1.120.0000.00917.62
8.1.110.0030.00717.57
8.1.100.0030.00317.65
8.1.90.0070.00017.54
8.1.80.0030.00517.51
8.1.70.0070.00017.65
8.1.60.0040.00417.76
8.1.50.0080.00017.61
8.1.40.0000.00717.57
8.1.30.0040.00417.80
8.1.20.0070.00417.84
8.1.10.0000.00917.64
8.1.00.0040.00417.69
8.0.300.0060.00318.77
8.0.290.0070.00017.00
8.0.280.0070.00018.47
8.0.270.0030.00417.30
8.0.260.0060.00018.48
8.0.250.0020.00517.16
8.0.240.0030.00317.13
8.0.230.0030.00317.14
8.0.220.0000.00716.91
8.0.210.0000.00716.95
8.0.200.0040.00417.12
8.0.190.0040.00417.11
8.0.180.0060.00317.00
8.0.170.0060.00317.11
8.0.160.0070.00016.95
8.0.150.0000.00816.98
8.0.140.0070.00016.90
8.0.130.0050.00013.52
8.0.120.0040.00416.93
8.0.110.0000.00716.88
8.0.100.0040.00416.93
8.0.90.0040.00416.92
8.0.80.0060.00916.98
8.0.70.0040.00417.14
8.0.60.0020.00517.09
8.0.50.0020.00516.91
8.0.30.0130.00617.16
8.0.20.0180.00417.14
8.0.10.0000.00716.98
8.0.00.0120.01316.89
7.4.330.0000.00715.55
7.4.320.0000.00716.85
7.4.300.0060.00016.73
7.4.290.0040.00416.74
7.4.280.0000.00716.73
7.4.270.0030.00316.86
7.4.260.0040.00416.73
7.4.250.0040.00416.60
7.4.240.0050.00216.81
7.4.230.0040.00416.72
7.4.220.0000.00916.48
7.4.210.0080.01016.83
7.4.200.0030.00316.93
7.4.160.0090.00716.76
7.4.140.0090.00917.86
7.4.130.0150.00916.65
7.4.120.0120.00616.50
7.4.110.0070.01116.70
7.4.100.0110.00716.75
7.4.90.0110.00616.95
7.4.80.0000.01819.39
7.4.70.0150.00016.71
7.4.60.0080.00816.64
7.4.50.0140.00316.74
7.4.40.0040.01316.62
7.4.00.0070.00715.31
7.3.330.0060.00013.47
7.3.320.0030.00313.51
7.3.310.0050.00216.56
7.3.300.0030.00316.40
7.3.290.0000.00716.47
7.3.280.0070.01016.47
7.3.260.0110.00916.68
7.3.240.0140.00416.57
7.3.230.0030.01316.46
7.3.210.0130.00316.53
7.3.200.0070.01416.69
7.3.190.0130.01016.52
7.3.180.0090.00916.53
7.3.170.0110.01416.66
7.3.160.0140.00316.46
7.3.20.0940.00914.88
7.3.10.0520.01714.94
7.3.00.0620.01015.00
7.2.330.0120.00616.77
7.2.320.0080.00816.79
7.2.310.0130.00316.98
7.2.300.0130.00316.97
7.2.290.0100.00516.70
7.2.150.0240.00915.27
7.2.140.0720.01615.26
7.2.130.0680.00315.17
7.2.120.0630.00015.02
7.2.110.0720.01415.21
7.2.100.0730.01315.24
7.2.90.0830.01015.47
7.2.80.0770.01314.93
7.2.70.0790.01315.32
7.2.60.0780.01015.16
7.2.50.0740.01415.34
7.2.40.0700.00715.33
7.2.30.0750.01315.09
7.2.20.0830.00715.32
7.2.10.0900.00715.19
7.2.00.0710.00315.18
7.1.250.0680.00714.23

preferences:
35.17 ms | 403 KiB | 5 Q