3v4l.org

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

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.00816.63
8.3.60.0160.00316.63
8.3.50.0130.00822.11
8.3.40.0110.00419.22
8.3.30.0170.00018.92
8.3.20.0080.00820.16
8.3.10.0000.00823.65
8.3.00.0040.00419.50
8.2.190.0070.00718.66
8.2.180.0100.01016.75
8.2.170.0060.00922.96
8.2.160.0070.00721.97
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00419.49
8.2.120.0080.00026.35
8.2.110.0060.00321.30
8.2.100.0090.00317.97
8.2.90.0040.00418.15
8.2.80.0080.00017.97
8.2.70.0110.00017.75
8.2.60.0030.00718.05
8.2.50.0040.00418.07
8.2.40.0000.00819.16
8.2.30.0000.00720.60
8.2.20.0000.00817.74
8.2.10.0040.00417.99
8.2.00.0030.00718.14
8.1.280.0120.00625.92
8.1.270.0030.00622.02
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0000.00922.48
8.1.230.0040.00721.04
8.1.220.0090.00017.74
8.1.210.0040.00418.87
8.1.200.0060.00317.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00720.24
8.1.160.0040.00421.99
8.1.150.0040.00418.80
8.1.140.0040.00419.56
8.1.130.0000.00717.64
8.1.120.0030.00317.57
8.1.110.0070.00017.62
8.1.100.0050.00317.66
8.1.90.0050.00217.57
8.1.80.0040.00417.61
8.1.70.0030.00317.55
8.1.60.0030.00517.74
8.1.50.0000.00917.67
8.1.40.0120.00017.59
8.1.30.0000.00817.77
8.1.20.0050.00217.73
8.1.10.0050.00317.64
8.1.00.0080.00017.62
8.0.300.0000.00820.08
8.0.290.0000.00716.88
8.0.280.0070.00018.39
8.0.270.0070.00017.28
8.0.260.0060.00017.32
8.0.250.0070.00017.15
8.0.240.0040.00417.09
8.0.230.0000.00717.10
8.0.220.0000.00716.93
8.0.210.0030.00317.02
8.0.200.0000.00617.11
8.0.190.0000.00717.05
8.0.180.0000.00717.05
8.0.170.0050.00316.95
8.0.160.0080.00017.05
8.0.150.0000.00716.96
8.0.140.0070.00416.88
8.0.130.0030.00313.48
8.0.120.0000.00816.89
8.0.110.0000.00817.04
8.0.100.0040.00417.08
8.0.90.0040.00416.95
8.0.80.0120.00917.09
8.0.70.0070.00016.84
8.0.60.0000.00716.91
8.0.50.0050.00217.14
8.0.30.0110.00917.44
8.0.20.0090.01117.40
8.0.10.0040.00417.02
8.0.00.0110.00616.99
7.4.330.0050.00016.78
7.4.320.0040.00416.79
7.4.300.0000.00616.73
7.4.290.0040.00416.57
7.4.280.0040.00716.64
7.4.270.0000.00716.74
7.4.260.0000.00716.73
7.4.250.0000.00716.61
7.4.240.0020.00516.66
7.4.230.0000.00716.84
7.4.220.0060.01216.83
7.4.210.0080.01116.62
7.4.200.0040.00416.73
7.4.160.0120.00316.60
7.4.150.0100.01017.40
7.4.140.0140.00717.86
7.4.130.0070.01516.64
7.4.120.0100.00816.69
7.4.110.0070.01116.61
7.4.100.0140.00316.81
7.4.90.0130.00316.75
7.4.80.0070.01119.39
7.4.70.0130.00316.51
7.4.60.0090.00916.63
7.4.50.0060.00916.79
7.4.40.0100.00716.53
7.4.30.0060.01716.75
7.4.00.0080.00915.24
7.3.330.0060.00013.31
7.3.320.0000.00513.45
7.3.310.0000.00816.39
7.3.300.0030.00516.47
7.3.290.0000.01616.44
7.3.280.0100.00616.45
7.3.270.0130.00317.40
7.3.260.0110.00716.57
7.3.250.0090.00916.49
7.3.240.0090.01016.47
7.3.230.0070.01016.59
7.3.210.0140.00316.79
7.3.200.0070.01016.43
7.3.190.0090.00616.70
7.3.180.0100.01016.69
7.3.170.0120.00616.45
7.3.160.0070.01016.53
7.3.120.0000.01814.95
7.3.110.0140.00414.93
7.3.100.0100.00715.07
7.3.90.0070.00714.95
7.3.80.0040.00915.16
7.3.70.0000.00914.90
7.3.60.0030.01015.12
7.3.50.0030.01315.15
7.3.40.0030.01314.99
7.3.30.0030.00615.05
7.3.20.0060.00616.86
7.3.10.0080.01216.63
7.3.00.0070.00916.50
7.2.330.0140.00316.88
7.2.320.0070.01016.89
7.2.310.0110.00517.03
7.2.300.0070.01016.86
7.2.290.0150.00716.96
7.2.250.0090.00615.45
7.2.240.0070.01415.26
7.2.230.0070.01315.24
7.2.220.0030.01015.23
7.2.210.0040.01115.40
7.2.200.0030.01015.34
7.2.190.0090.00615.15
7.2.180.0060.00915.32
7.2.170.0070.00715.23
7.2.130.0100.01016.95
7.2.120.0040.01216.70
7.2.110.0180.00916.87
7.2.100.0160.00716.69
7.2.90.0200.01016.94
7.2.80.0160.00016.91
7.2.70.0160.00316.59
7.2.60.0140.00316.89
7.2.50.0130.00816.75
7.2.40.0140.01116.55
7.2.30.0180.01216.89
7.2.20.0140.01116.48
7.2.10.0160.01017.13
7.2.00.0150.01218.34
7.1.330.0000.01215.91
7.1.320.0100.00315.66
7.1.310.0100.00315.95
7.1.300.0000.01215.70
7.1.290.0100.00315.87
7.1.280.0050.00315.94
7.1.270.0080.00316.11
7.1.260.0100.00315.77
7.1.250.0120.01215.48
7.1.200.0030.00915.83
7.1.100.0000.01018.53
7.1.70.0000.00817.41
7.1.60.0090.01219.48
7.1.50.0070.01017.15
7.1.00.0000.08022.28
7.0.200.0390.00314.73
7.0.60.0070.08019.93
7.0.50.0070.08318.00
7.0.40.0100.08720.06
7.0.30.0270.04020.29
7.0.20.0330.05320.07
7.0.10.0070.04720.27
7.0.00.0000.06020.17
5.6.280.0070.03321.11
5.6.210.0070.07020.77
5.6.200.0030.05018.16
5.6.190.0130.06720.50
5.6.180.0300.08020.63
5.6.170.0400.07720.48
5.6.160.0070.04020.55
5.6.150.0030.08718.19
5.6.140.0030.03718.29
5.6.130.0030.08318.18
5.6.120.0230.06720.91
5.6.110.0030.09321.02
5.6.100.0070.03721.02
5.6.90.0130.08320.95
5.6.80.0130.07720.38
5.5.350.4230.04320.42
5.5.340.0200.04718.04
5.5.330.0200.07020.13
5.5.320.0300.07020.51
5.5.310.0300.07020.27
5.5.300.0070.08317.96
5.5.290.0070.04017.95
5.5.280.0070.04720.77
5.5.270.0070.08320.75
5.5.260.0100.06320.73
5.5.250.0100.07320.69
5.5.240.0230.08320.16

preferences:
47.27 ms | 401 KiB | 5 Q