3v4l.org

run code in 300+ PHP versions simultaneously
<?php $main_url_host = 'main.example.com'; $current_url_host = 'sub.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.0150.00316.88
8.3.50.0000.01416.53
8.3.40.0090.00619.01
8.3.30.0120.00318.95
8.3.20.0040.00419.92
8.3.10.0040.00421.91
8.3.00.0080.00019.68
8.2.180.0090.00618.91
8.2.170.0090.00622.96
8.2.160.0070.01419.33
8.2.150.0000.00824.18
8.2.140.0020.00524.66
8.2.130.0040.00419.31
8.2.120.0040.00426.35
8.2.110.0080.00020.57
8.2.100.0080.00418.16
8.2.90.0030.00619.17
8.2.80.0000.00817.97
8.2.70.0030.00717.75
8.2.60.0030.00518.16
8.2.50.0050.00318.10
8.2.40.0070.00020.60
8.2.30.0000.00719.38
8.2.20.0040.00418.19
8.2.10.0080.00018.13
8.2.00.0040.00417.95
8.1.280.0080.00825.92
8.1.270.0040.00423.85
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0060.00322.81
8.1.230.0080.00319.22
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0060.00317.34
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0060.00318.84
8.1.160.0050.00219.01
8.1.150.0050.00318.94
8.1.140.0040.00419.70
8.1.130.0000.00718.81
8.1.120.0080.00017.50
8.1.110.0040.00417.55
8.1.100.0040.00417.57
8.1.90.0040.00417.63
8.1.80.0030.00517.63
8.1.70.0000.00817.47
8.1.60.0080.00017.78
8.1.50.0000.00917.68
8.1.40.0040.00417.62
8.1.30.0000.00817.81
8.1.20.0030.00617.64
8.1.10.0040.00417.75
8.1.00.0000.00717.68
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0030.00318.50
8.0.270.0050.00217.23
8.0.260.0030.00317.01
8.0.250.0030.00317.04
8.0.240.0030.00917.12
8.0.230.0000.00717.16
8.0.220.0030.00317.00
8.0.210.0030.00316.99
8.0.200.0040.00417.14
8.0.190.0050.00317.12
8.0.180.0050.00317.00
8.0.170.0000.00717.16
8.0.160.0070.00017.07
8.0.150.0000.00716.98
8.0.140.0030.00316.91
8.0.130.0000.00613.50
8.0.120.0000.00817.14
8.0.110.0030.00317.03
8.0.100.0040.00417.13
8.0.90.0050.00316.96
8.0.80.0060.01217.08
8.0.70.0000.00816.96
8.0.60.0050.00517.00
8.0.50.0050.00216.97
8.0.30.0060.01717.37
8.0.20.0110.00817.47
8.0.10.0070.00017.07
8.0.00.0150.00416.66
7.4.330.0000.00515.55
7.4.320.0040.00416.63
7.4.300.0000.00616.68
7.4.290.0040.00416.63
7.4.280.0030.00516.70
7.4.270.0040.00416.65
7.4.260.0030.00316.61
7.4.250.0000.00716.61
7.4.240.0060.00316.66
7.4.230.0000.00816.47
7.4.220.0150.01116.83
7.4.210.0090.00616.76
7.4.200.0040.00416.62
7.4.160.0100.00616.64
7.4.150.0120.00617.40
7.4.140.0110.00817.86
7.4.130.0180.00616.62
7.4.120.0070.01616.70
7.4.110.0100.00716.61
7.4.100.0070.01416.71
7.4.90.0070.01016.51
7.4.80.0100.00719.39
7.4.70.0030.01416.71
7.4.60.0040.01316.66
7.4.50.0080.00516.84
7.4.40.0070.01016.64
7.4.30.0210.00016.85
7.4.00.0070.01015.24
7.3.330.0000.00713.32
7.3.320.0000.00513.37
7.3.310.0000.00716.46
7.3.300.0000.00716.39
7.3.290.0000.00716.50
7.3.280.0080.00916.48
7.3.270.0100.00717.40
7.3.260.0110.01016.60
7.3.250.0090.00816.52
7.3.240.0120.00716.72
7.3.230.0100.00616.41
7.3.210.0030.01316.51
7.3.200.0140.00316.63
7.3.190.0120.00616.59
7.3.180.0130.00316.45
7.3.170.0120.00616.70
7.3.160.0100.00716.51
7.2.330.0110.00916.85
7.2.320.0030.01416.66
7.2.310.0100.00716.66
7.2.300.0070.01116.86
7.2.290.0110.00616.83
7.2.110.0190.00816.78
7.2.90.6170.01315.02
7.2.80.0190.00814.84
7.2.70.0120.01615.20
7.2.60.5000.01614.94
7.2.50.1400.00715.21
7.2.40.1570.00315.16
7.2.30.0110.00715.23
7.2.20.0110.00815.27
7.2.10.0150.00815.28
7.2.00.0100.00315.18
7.1.210.0070.01114.10
7.1.200.0340.00614.14
7.1.190.3940.00714.12
7.1.180.3450.01013.84
7.1.170.2780.00614.23
7.1.160.0140.00314.28
7.1.150.0800.00314.03
7.1.140.0990.00314.10
7.1.130.0160.00614.06
7.1.120.0060.01213.85
7.1.110.1110.00413.95
7.1.100.0150.00914.07
7.1.90.0080.01214.33
7.1.80.0330.00314.00
7.1.70.0400.01814.01
7.1.60.0340.01132.26
7.1.50.0270.02031.82
7.1.40.1300.00331.75
7.1.30.1760.01031.86
7.1.20.0430.01232.20
7.1.10.0140.00714.25
7.1.00.0070.01113.73
7.0.310.2310.01013.89
7.0.300.0140.00613.56
7.0.290.0170.01213.48
7.0.280.0080.00913.70
7.0.270.0570.01213.84
7.0.260.0200.00313.76
7.0.250.0500.00613.60
7.0.240.0210.00313.53
7.0.230.0900.00613.90
7.0.220.0050.01613.57
7.0.210.1230.00913.81
7.0.200.0630.01313.64
7.0.190.0130.00913.55
7.0.180.0200.01113.61
7.0.170.0220.00713.89
7.0.160.0180.00713.99
7.0.150.0410.01113.77
7.0.140.1630.01313.64
7.0.130.0100.01013.89
7.0.120.0140.00913.98
7.0.110.0190.00413.73
7.0.100.0750.00613.77
7.0.90.0370.00413.88
7.0.80.0170.00913.59
7.0.70.0780.00613.52
7.0.60.0170.00313.70
7.0.50.0140.00414.10
7.0.40.0570.00413.99
7.0.30.0180.00314.04
7.0.20.0500.00013.84
7.0.10.0150.01013.87
7.0.00.0860.00013.98

preferences:
45.23 ms | 401 KiB | 5 Q