3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PilotId { protected $pid; /** * @param PilotId|string $pid */ public function __construct($pid){ if(!preg_match("^(AFA|PAY)([0-9]{4})$", (string)$pid)) throw new \InvalidArgumentException('Invalid PID'); $this->pid = $pid; } function __toString(){ return $this->pid; } } echo new PilotId("AFA-1111");

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.70.0120.00318.54
8.3.60.0090.00916.50
8.3.50.0100.01021.99
8.3.40.0070.00718.63
8.3.30.0070.00718.81
8.3.20.0040.01120.07
8.3.10.0070.00023.31
8.3.00.0040.00419.38
8.2.190.0060.01218.29
8.2.180.0150.00616.50
8.2.170.0030.01022.96
8.2.160.0000.01422.14
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00417.50
8.2.120.0080.00026.35
8.2.110.0060.00320.39
8.2.100.0070.00417.91
8.2.90.0000.00719.22
8.2.80.0050.00317.97
8.2.70.0040.00817.36
8.2.60.0070.00418.05
8.2.50.0050.00318.07
8.2.40.0060.00319.38
8.2.30.0040.00420.63
8.2.20.0040.00417.74
8.2.10.0030.00618.04
8.2.00.0090.00017.95
8.1.280.0090.00925.92
8.1.270.0060.00322.05
8.1.260.0000.00728.09
8.1.250.0070.00728.09
8.1.240.0110.00023.77
8.1.230.0060.00620.93
8.1.220.0060.00317.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0030.00517.23
8.1.180.0050.00218.10
8.1.170.0030.00620.19
8.1.160.0070.00021.93
8.1.150.0000.00718.90
8.1.140.0040.00419.61
8.1.130.0000.00717.55
8.1.120.0070.00017.42
8.1.110.0040.00417.27
8.1.100.0040.00417.39
8.1.90.0000.00817.30
8.1.80.0000.00717.28
8.1.70.0030.00317.42
8.1.60.0050.00317.43
8.1.50.0080.00017.40
8.1.40.0070.00417.34
8.1.30.0050.00317.52
8.1.20.0000.00717.52
8.1.10.0030.00617.54
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.44
8.0.270.0030.00317.18
8.0.260.0000.00617.19
8.0.250.0000.00716.91
8.0.240.0030.00617.02
8.0.230.0030.00317.09
8.0.220.0000.00716.90
8.0.210.0030.00316.94
8.0.200.0000.00716.99
8.0.190.0080.00017.07
8.0.180.0020.00516.86
8.0.170.0030.00617.03
8.0.160.0030.00516.98
8.0.150.0050.00316.90
8.0.140.0070.00416.79
8.0.130.0030.00313.44
8.0.120.0080.00016.90
8.0.110.0040.00416.91
8.0.100.0000.00716.94
8.0.90.0030.00317.02
8.0.80.0030.01916.88
8.0.70.0050.00217.02
8.0.60.0020.00516.83
8.0.50.0000.00716.80
8.0.30.0130.00517.25
8.0.20.0060.01317.40
8.0.10.0030.00516.81
8.0.00.0070.01016.70
7.4.330.0000.00516.81
7.4.320.0030.00316.36
7.4.300.0000.00616.54
7.4.290.0000.00716.55
7.4.280.0030.00716.54
7.4.270.0030.00316.46
7.4.260.0080.00016.32
7.4.250.0030.00616.41
7.4.240.0020.00516.38
7.4.230.0080.00016.62
7.4.220.0140.00316.48
7.4.210.0110.00716.57
7.4.200.0050.00316.65
7.4.160.0050.01016.34
7.4.150.0070.01517.40
7.4.140.0080.01317.86
7.4.130.0120.00616.70
7.4.120.0100.00716.56
7.4.110.0100.00716.47
7.4.100.0110.00716.46
7.4.90.0130.00916.40
7.4.80.0200.00319.39
7.4.70.0070.01016.49
7.4.60.0100.00616.49
7.4.50.0000.01416.19
7.4.40.0180.00316.40
7.4.30.0090.01316.16
7.4.00.0130.00315.04
7.3.330.0030.00313.23
7.3.320.0030.00313.37
7.3.310.0070.00016.38
7.3.300.0040.00416.28
7.3.290.0050.01216.32
7.3.280.0110.00816.32
7.3.270.0070.01017.40
7.3.260.0150.01216.58
7.3.250.0100.01016.41
7.3.240.0070.01416.33
7.3.230.0000.01716.43
7.3.210.0060.01016.45
7.3.200.0110.00516.42
7.3.190.0110.00716.37
7.3.180.0120.00316.50
7.3.170.0090.00916.56
7.3.160.0130.00316.50
7.3.120.0070.01114.85
7.3.110.0030.01014.42
7.3.100.0130.00714.84
7.3.90.0060.00914.86
7.3.80.0000.01414.52
7.3.70.0120.00614.91
7.3.60.0060.00614.58
7.3.50.0090.00914.73
7.3.40.0030.01015.00
7.3.30.0000.00914.66
7.3.20.0000.01016.63
7.3.10.0030.01016.61
7.3.00.0040.01116.73
7.2.330.0080.00816.73
7.2.320.0140.00716.67
7.2.310.0000.01616.53
7.2.300.0150.00316.66
7.2.290.0030.02016.54
7.2.250.0090.00614.96
7.2.240.0100.01015.22
7.2.230.0030.01315.13
7.2.220.0040.01114.77
7.2.210.0120.00015.21
7.2.200.0060.00614.76
7.2.190.0030.01015.07
7.2.180.0000.01315.03
7.2.170.0070.00714.77
7.2.60.0070.00717.00
7.2.00.0190.00318.88
7.1.330.0040.00815.82
7.1.320.0130.00015.62
7.1.310.0130.00615.54
7.1.300.0100.00315.71
7.1.290.0030.01015.71
7.1.280.0090.00615.56
7.1.270.0060.00315.74
7.1.260.0110.00315.70
7.1.200.0040.00815.77
7.1.100.0000.01017.97
7.1.70.0000.00717.04
7.1.60.0070.01819.48
7.1.50.0130.00916.54
7.1.00.0000.08022.36
7.0.200.0520.00314.62
7.0.60.0070.08719.89
7.0.50.0070.06017.84
7.0.40.0100.08320.11
7.0.30.0070.04320.07
7.0.20.0330.07720.33
7.0.10.0100.08320.13
7.0.00.0100.04720.23
5.6.280.0000.07720.79
5.6.210.0070.05720.53
5.6.200.0030.09018.15
5.6.190.0100.07020.48
5.6.180.0430.08320.46
5.6.170.0200.05020.71
5.6.160.0100.05720.62
5.6.150.0130.08318.17
5.6.140.0030.03718.13
5.6.130.0070.08018.23
5.6.120.0070.09021.00
5.6.110.0100.04021.15
5.6.100.0070.07720.96
5.6.90.0070.08021.00
5.6.80.0030.04020.54
5.5.350.4270.04020.50
5.5.340.0130.07318.09
5.5.330.0070.04320.19
5.5.320.0130.04020.35
5.5.310.0330.05720.34
5.5.300.0000.07017.95
5.5.290.0000.04718.08
5.5.280.0070.08320.66
5.5.270.0030.04320.88
5.5.260.0100.08320.73
5.5.250.0130.07320.69
5.5.240.0100.05020.38

preferences:
48.79 ms | 401 KiB | 5 Q