3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match('/^[^.]*\.(?=\w+\.\w+$)/','subdomain.example.com',$matches); $subdomain = isset($matches[0]) ? trim($matches[0],'.') : ''; echo $subdomain;

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.20.0220.00918.01
8.5.10.0240.00917.93
8.5.00.0210.00917.89
8.4.170.0240.00920.17
8.4.160.0230.01121.41
8.4.150.0210.00717.87
8.4.140.0290.00917.75
8.4.130.0260.00918.09
8.4.120.0300.00819.93
8.4.110.0260.00718.11
8.4.100.0320.00818.10
8.4.90.0340.00818.23
8.4.80.0330.00817.90
8.4.70.0310.00917.97
8.4.60.0280.00818.07
8.4.50.0290.00718.15
8.4.40.0300.00817.63
8.4.30.0340.00818.04
8.4.20.0320.00417.86
8.4.10.0250.00717.76
8.3.300.0230.01019.09
8.3.290.0260.00819.27
8.3.280.0230.01118.51
8.3.270.0270.00916.63
8.3.260.0280.00516.57
8.3.250.0250.00917.40
8.3.240.0210.00716.97
8.3.230.0220.00716.59
8.3.220.0250.00617.08
8.3.210.0200.00716.69
8.3.200.0270.00616.74
8.3.190.0260.00716.64
8.3.180.0260.00816.69
8.3.170.0270.00816.68
8.3.160.0280.00716.87
8.3.150.0340.00617.22
8.3.140.0290.01016.54
8.3.130.0230.00716.50
8.3.120.0250.00616.84
8.3.110.0260.00717.33
8.3.100.0280.00717.80
8.3.90.0280.00718.28
8.3.80.0260.00716.70
8.3.70.0290.00916.60
8.3.60.0300.00916.85
8.3.50.0290.00716.93
8.3.40.0300.00718.14
8.3.30.0270.00817.93
8.3.20.0270.00618.86
8.3.10.0220.00819.05
8.3.00.0220.00619.24
8.2.300.0350.00719.27
8.2.290.0230.00817.41
8.2.280.0250.00817.10
8.2.270.0280.00816.72
8.2.260.0260.00817.28
8.2.250.0270.00616.70
8.2.240.0280.00617.04
8.2.230.0270.00717.51
8.2.220.0310.00620.08
8.2.210.0280.00718.13
8.2.200.0280.00816.53
8.2.190.0280.00816.56
8.2.180.0270.00818.13
8.2.170.0300.00818.13
8.2.160.0290.00918.78
8.2.150.0280.00619.17
8.2.140.0270.00718.96
8.2.130.0240.00619.14
8.2.120.0200.00719.25
8.2.110.0260.00618.26
8.2.100.0260.00617.77
8.2.90.0240.00717.89
8.2.80.0230.00718.03
8.2.70.0210.00517.93
8.2.60.0250.00517.79
8.2.50.0210.00617.94
8.2.40.0200.00718.00
8.2.30.0200.00417.82
8.2.20.0220.00618.28
8.2.10.0210.00817.73
8.2.00.0230.00617.99
8.1.340.0200.01118.10
8.1.330.0270.00817.16
8.1.320.0260.01016.33
8.1.310.0310.00716.70
8.1.300.0290.00716.63
8.1.290.0280.00716.60
8.1.280.0280.01017.99
8.1.270.0250.00719.83
8.1.260.0300.00719.06
8.1.250.0260.00719.36
8.1.240.0240.01017.89
8.1.230.0260.00717.62
8.1.220.0250.00917.58
8.1.210.0280.00817.67
8.1.200.0270.00717.44
8.1.190.0220.00817.31
8.1.180.0250.00717.47
8.1.170.0280.00717.68
8.1.160.0260.00617.75
8.1.150.0280.00617.70
8.1.140.0280.00717.42
8.1.130.0270.00817.49
8.1.120.0250.00717.55
8.1.110.0260.00917.52
8.1.100.0260.00717.42
8.1.90.0220.00817.46
8.1.80.0260.00817.42
8.1.70.0260.00717.42
8.1.60.0280.00617.56
8.1.50.0230.00717.55
8.1.40.0230.00817.59
8.1.30.0260.00817.60
8.1.20.0230.00717.96
8.1.10.0230.00617.62
8.1.00.0220.00717.59
8.0.300.0260.00617.09
8.0.290.0280.00516.79
8.0.280.0240.00717.24
8.0.270.0250.00616.98
8.0.260.0250.00716.79
8.0.250.0260.00716.87
8.0.240.0260.00616.83
8.0.230.0270.00716.86
8.0.220.0260.00716.78
8.0.210.0270.00716.83
8.0.200.0280.00516.84
8.0.190.0250.00616.92
8.0.180.0240.00716.88
8.0.170.0230.00616.77
8.0.160.0240.00816.89
8.0.150.0250.00616.78
8.0.140.0220.00616.83
8.0.130.0190.00616.83
8.0.120.0200.00616.83
8.0.110.0200.00816.61
8.0.100.0220.00816.84
8.0.90.0200.00916.78
8.0.80.0220.00716.77
8.0.70.0220.00716.80
8.0.60.0250.00616.73
8.0.50.0210.00816.79
8.0.30.0220.00616.77
8.0.20.0230.00716.89
8.0.10.0200.00816.96
7.4.330.0230.00616.46
7.4.320.0230.00516.50
7.4.300.0230.00616.61
7.4.290.0240.00416.45
7.4.280.0240.00616.60
7.4.270.0210.00616.62
7.4.260.0200.00616.53
7.4.250.0200.00616.56
7.4.240.0170.00716.58
7.4.230.0220.00616.57
7.4.220.0210.00616.55
7.4.210.0210.00716.59
7.4.200.0190.00616.56
7.4.190.0190.00616.64
7.4.180.0200.00616.65
7.4.160.0210.00616.63
7.4.150.0210.00716.73
7.4.140.0220.00516.57
7.4.130.0180.00716.55
7.4.120.0190.00516.61
7.4.110.0200.00616.55
7.4.100.0180.00716.60
7.4.90.0210.00716.58
7.4.80.0220.00616.56
7.4.70.0200.00516.61
7.4.60.0200.00616.55
7.4.50.0210.00716.47
7.4.40.0190.00616.50
7.4.30.0200.00716.55
7.4.20.0180.00616.56
7.4.10.0180.00616.53
7.4.00.0190.00616.55

preferences:
28.65 ms | 403 KiB | 5 Q