3v4l.org

run code in 300+ PHP versions simultaneously
<?php $main_url_host = 'main.example.com'; $current_url_host = 'sub.main.example.com'; preg_match('~(.+)*\.' . $main_url_host. '~', $current_url_host, $matches ); var_dump($matches[1]);

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.0100.00716.63
8.3.50.0130.00716.52
8.3.40.0100.01018.71
8.3.30.0100.01019.01
8.3.20.0080.00020.35
8.3.10.0030.00623.48
8.3.00.0000.00919.55
8.2.180.0090.01218.16
8.2.170.0160.00622.96
8.2.160.0160.00619.16
8.2.150.0000.01024.18
8.2.140.0050.00324.66
8.2.130.0050.00319.33
8.2.120.0060.00326.35
8.2.110.0000.01022.33
8.2.100.0040.00817.91
8.2.90.0040.00419.01
8.2.80.0000.00917.97
8.2.70.0030.01017.75
8.2.60.0060.00318.16
8.2.50.0060.00318.16
8.2.40.0000.01020.42
8.2.30.0000.00919.27
8.2.20.0030.00618.14
8.2.10.0000.00818.00
8.2.00.0060.00318.12
8.1.280.0100.00625.92
8.1.270.0080.00023.74
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0070.00323.93
8.1.230.0060.00622.14
8.1.220.0060.00317.74
8.1.210.0030.00718.77
8.1.200.0110.00017.47
8.1.190.0030.00617.35
8.1.180.0000.00918.10
8.1.170.0000.01018.78
8.1.160.0040.00418.94
8.1.150.0030.00618.78
8.1.140.0040.00419.64
8.1.130.0000.00818.90
8.1.120.0050.00517.50
8.1.110.0000.00917.42
8.1.100.0090.00017.63
8.1.90.0000.00817.55
8.1.80.0030.00617.61
8.1.70.0000.00817.55
8.1.60.0030.00717.59
8.1.50.0090.00017.68
8.1.40.0030.00617.68
8.1.30.0030.00617.79
8.1.20.0050.00517.86
8.1.10.0060.00317.61
8.1.00.0100.00017.69
8.0.300.0030.00618.77
8.0.290.0000.01016.88
8.0.280.0030.00518.37
8.0.270.0040.00417.25
8.0.260.0000.00816.92
8.0.250.0000.00917.05
8.0.240.0030.00617.13
8.0.230.0030.00517.17
8.0.220.0050.00316.98
8.0.210.0030.00617.03
8.0.200.0040.00417.06
8.0.190.0040.00417.05
8.0.180.0000.00817.09
8.0.170.0090.00017.07
8.0.160.0040.00416.97
8.0.150.0030.00616.90
8.0.140.0000.00816.87
8.0.130.0040.00413.42
8.0.120.0000.00916.89
8.0.110.0060.00317.00
8.0.100.0030.00616.89
8.0.90.0050.00516.92
8.0.80.0040.01417.02
8.0.70.0080.00017.05
8.0.60.0030.00617.02
8.0.50.0030.00616.96
8.0.30.0140.00717.13
8.0.20.0100.01017.40
8.0.10.0030.00616.90
8.0.00.0070.01417.05
7.4.330.0000.00615.55
7.4.320.0040.00416.55
7.4.300.0040.00416.73
7.4.290.0060.00316.75
7.4.280.0030.00716.62
7.4.270.0000.00816.71
7.4.260.0030.00716.67
7.4.250.0060.00616.59
7.4.240.0000.00916.66
7.4.230.0030.00616.83
7.4.220.0100.00916.57
7.4.210.0110.00816.61
7.4.200.0000.00816.64
7.4.160.0120.00916.73
7.4.150.0130.00717.40
7.4.140.0090.01217.86
7.4.130.0120.01316.85
7.4.120.0110.01416.68
7.4.110.0130.00716.75
7.4.100.0100.01416.76
7.4.90.0120.01616.71
7.4.80.0060.01319.39
7.4.70.0090.00916.79
7.4.60.0030.01916.69
7.4.50.0090.00716.58
7.4.40.0130.01616.57
7.4.30.0120.01116.63
7.4.00.0060.01514.99
7.3.330.0080.00013.35
7.3.320.0000.00613.33
7.3.310.0000.00816.54
7.3.300.0000.00816.42
7.3.290.0000.00816.34
7.3.280.0090.01216.39
7.3.270.0090.00917.40
7.3.260.0070.01316.66
7.3.250.0110.00816.55
7.3.240.0130.00916.63
7.3.230.0100.00716.56
7.3.210.0090.01016.52
7.3.200.0100.01016.57
7.3.190.0070.01116.62
7.3.180.0130.01016.70
7.3.170.0070.01316.75
7.3.160.0070.01516.64
7.3.120.0080.00814.90
7.3.110.0040.01514.90
7.3.100.0070.01015.03
7.3.90.0030.01415.00
7.3.80.0060.00914.95
7.3.70.0050.01214.93
7.3.60.0030.01214.95
7.3.50.0050.01015.01
7.3.40.0050.01114.90
7.3.30.0040.00814.98
7.3.20.0070.00816.79
7.3.10.0090.00516.61
7.3.00.0060.00816.77
7.2.330.0070.01516.68
7.2.320.0080.01216.83
7.2.310.0090.00916.80
7.2.300.0030.02116.64
7.2.290.0120.01216.63
7.2.250.0050.01415.19
7.2.240.0050.01415.13
7.2.230.0020.01415.22
7.2.220.0090.00515.20
7.2.210.0040.00815.07
7.2.200.0070.00915.16
7.2.190.0060.01115.01
7.2.180.0060.00915.19
7.2.170.0040.01115.22
7.2.160.0030.01214.95
7.2.150.0080.00817.08
7.2.140.0090.00616.97
7.2.130.0050.01417.15
7.2.120.0090.00916.91
7.2.110.0080.00816.95
7.2.100.0050.01317.08
7.2.90.0090.00916.22
7.2.80.0150.00716.27
7.2.70.0210.01216.23
7.2.60.0080.00816.34
7.2.50.0060.01316.37
7.2.40.0090.01016.35
7.2.30.0090.01016.26
7.2.20.0070.00916.31
7.2.10.0040.01416.18
7.2.00.0090.00616.34
7.1.330.0020.01515.91
7.1.320.0070.00716.01
7.1.310.0060.00816.01
7.1.300.0100.00715.96
7.1.290.0030.01015.84
7.1.280.0030.01016.06
7.1.270.0050.00816.12
7.1.260.0100.00416.07
7.1.250.0030.00815.97
7.1.210.1890.00613.89
7.1.200.0060.01814.21
7.1.190.0860.00314.19
7.1.180.0330.00613.91
7.1.170.0140.00514.05
7.1.160.0060.00914.00
7.1.150.0140.00613.82
7.1.140.0090.00914.20
7.1.130.0110.00414.00
7.1.120.0210.01414.04
7.1.110.0310.00714.34
7.1.100.3870.00614.11
7.1.90.1190.01014.22
7.1.80.1530.01013.99
7.1.70.0810.00614.20
7.1.60.0230.01432.07
7.1.50.0320.01632.12
7.1.40.2110.01332.05
7.1.30.1800.02031.86
7.1.20.0320.00331.91
7.1.10.1010.00613.71
7.1.00.1090.01214.07
7.0.310.0110.00813.55
7.0.300.0480.00913.68
7.0.290.0170.01013.85
7.0.280.0080.01313.60
7.0.270.0150.00613.81
7.0.260.3210.01013.91
7.0.250.0460.00413.86
7.0.240.3250.00613.57
7.0.230.0040.00913.91
7.0.220.1900.00413.85
7.0.210.0140.00613.63
7.0.200.0150.00713.57
7.0.190.1470.01313.73
7.0.180.1080.00713.77
7.0.170.0410.01213.77
7.0.160.1580.01313.75
7.0.150.0940.01013.80
7.0.140.1770.01313.87
7.0.130.0670.01413.98
7.0.120.0150.01213.95
7.0.110.0070.01313.86
7.0.100.0070.00713.54
7.0.90.0090.01313.71
7.0.80.0610.01113.81
7.0.70.0930.01313.67
7.0.60.0070.00713.74
7.0.50.0510.00613.87
7.0.40.0550.00614.02
7.0.30.0130.01013.73
7.0.20.0820.01313.94
7.0.10.0160.00913.95
7.0.00.0740.00613.95

preferences:
51.95 ms | 401 KiB | 5 Q