3v4l.org

run code in 300+ PHP versions simultaneously
<?php class World { static $id = 0; protected $uid; protected $worldName; const type = 'world'; public function __construct( $worldName ) { $this->setUID(); $this->worldName = $worldName; } private function setUID() { $this->uid = self::$id++; } public function whoIsPerson( Person $person ) { $personUID = $person->getUID(); var_dump( $personUID ); if( $personUID === 0 && $this->worldName === 'Rapture' ) return 'Jack'; elseif( $personUID === 0 && $this->worldName === 'Columbia' ) return 'Elizabeth'; else return 'Unknown Person'; } } class Person { static $id = 0; protected $uid; private function setUID() { $this->uid = self::$id++; } public function getUID() { return $this->uid; } } $person1 = new Person(); $world1 = new World('Rapture'); echo $world1->whoIsPerson( $person1 ); $world2 = new World('Columbia'); echo $world2->whoIsPerson( $person1 ); var_dump( $world1, $world2 );

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.00018.30
8.3.50.0080.01021.99
8.3.40.0140.00018.84
8.3.30.0120.00318.84
8.3.20.0040.00418.70
8.3.10.0040.00420.65
8.3.00.0070.00723.65
8.2.180.0140.00716.36
8.2.170.0140.00722.96
8.2.160.0070.01320.44
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0030.00626.16
8.2.120.0080.00019.23
8.2.110.0030.00822.26
8.2.100.0110.00017.84
8.2.90.0080.00019.30
8.2.80.0050.00518.05
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0050.00318.16
8.2.30.0040.00419.81
8.2.20.0040.00417.82
8.2.10.0040.00417.76
8.2.00.0000.00817.56
8.1.280.0160.00325.92
8.1.270.0070.00023.99
8.1.260.0110.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00722.65
8.1.230.0120.00020.96
8.1.220.0000.00918.77
8.1.210.0030.00519.00
8.1.200.0060.00317.48
8.1.190.0040.00417.39
8.1.180.0000.00818.10
8.1.170.0040.00418.84
8.1.160.0080.00018.94
8.1.150.0050.00218.66
8.1.140.0050.00217.44
8.1.130.0000.00717.83
8.1.120.0000.00817.50
8.1.110.0040.00417.50
8.1.100.0000.00717.46
8.1.90.0040.00417.36
8.1.80.0070.00017.42
8.1.70.0030.00317.35
8.1.60.0000.00917.41
8.1.50.0000.00817.49
8.1.40.0000.00717.52
8.1.30.0000.00817.48
8.1.20.0000.00817.66
8.1.10.0040.00417.55
8.1.00.0000.00817.37
8.0.300.0000.00820.05
8.0.290.0070.00016.88
8.0.280.0000.00818.36
8.0.270.0100.00017.13
8.0.260.0000.00716.80
8.0.250.0080.00016.98
8.0.240.0030.00717.03
8.0.230.0030.00316.98
8.0.220.0070.00016.94
8.0.210.0000.00716.89
8.0.200.0060.00017.06
8.0.190.0000.00817.03
8.0.180.0000.00717.02
8.0.170.0050.00216.87
8.0.160.0070.00416.95
8.0.150.0030.00716.86
8.0.140.0040.00416.95
8.0.130.0050.00013.31
8.0.120.0000.00716.80
8.0.110.0040.00416.95
8.0.100.0070.00016.91
8.0.90.0000.00816.81
8.0.80.0090.00617.02
8.0.70.0040.00416.98
8.0.60.0000.00816.91
8.0.50.0040.00416.89
8.0.30.0070.01217.11
8.0.20.0050.01417.40
8.0.10.0030.00516.94
8.0.00.0080.01016.78
7.4.330.0000.00713.43
7.4.320.0030.00316.59
7.4.300.0000.00716.45
7.4.290.0050.00316.59
7.4.280.0030.00616.41
7.4.270.0000.00716.63
7.4.260.0050.00013.24
7.4.250.0040.00416.61
7.4.240.0000.00716.65
7.4.230.0040.00416.69
7.4.220.0090.00916.49
7.4.210.0040.01116.50
7.4.200.0000.00716.63
7.4.190.0070.00016.59
7.4.160.0160.00016.45
7.4.150.0060.01217.40
7.4.140.0040.01417.86
7.4.130.0110.00616.57
7.4.120.0130.00416.50
7.4.110.0140.00316.41
7.4.100.0130.00316.41
7.4.90.0190.00616.50
7.4.80.0040.01319.04
7.4.70.0110.00916.65
7.4.60.0060.01216.51
7.4.50.0060.00316.35
7.4.40.0090.00622.27
7.4.30.0060.01116.37
7.4.00.0070.01014.96
7.3.330.0030.00213.23
7.3.320.0030.00313.20
7.3.310.0000.00716.36
7.3.300.0000.00716.32
7.3.290.0080.00816.38
7.3.280.0110.00816.35
7.3.270.0120.00617.40
7.3.260.0120.01018.24
7.3.250.0170.00516.51
7.3.240.0080.00816.35
7.3.230.0060.01216.66
7.3.210.0150.00316.35
7.3.200.0030.01919.39
7.3.190.0040.01816.66
7.3.180.0090.00816.64
7.3.170.0060.01416.36
7.3.160.0060.01216.55
7.3.120.0060.00614.84
7.2.330.0060.01216.49
7.2.320.0100.00716.44
7.2.310.0120.00616.84
7.2.300.0100.01016.49
7.2.290.0110.00516.41
7.1.70.0030.00517.23
7.1.60.0100.01319.40
7.1.50.0070.01416.96
7.1.00.0070.03022.54
7.0.200.0030.00316.72
7.0.140.0000.07722.05
7.0.60.0230.07719.89
7.0.50.0100.07017.86
7.0.40.0070.06320.08
7.0.30.0070.07320.16
7.0.20.0070.07020.23
7.0.10.0100.04720.26
7.0.00.0070.07320.09
5.6.280.0070.07021.13
5.6.210.0030.08320.75
5.6.200.0070.05318.29
5.6.190.0030.09320.49
5.6.180.0000.08020.63
5.6.170.0130.07320.32
5.6.160.0070.08320.76
5.6.150.0100.06020.49
5.6.140.0030.04320.37
5.6.130.0070.08020.17
5.6.120.0000.09020.39
5.6.110.0070.04320.15
5.6.100.0070.07720.16
5.6.90.0130.03720.47
5.6.80.0070.05319.89
5.6.70.0000.09019.54
5.6.60.0100.07719.87
5.6.50.0100.04019.73
5.6.40.0070.05019.78
5.6.30.0100.04319.77
5.6.20.0070.03719.80
5.6.10.0030.07019.76
5.6.00.0070.08719.75
5.5.350.0000.05320.51
5.5.340.0030.04018.07
5.5.330.0170.07020.19
5.5.320.0070.04320.47
5.5.310.0070.07720.29
5.5.300.0000.04720.14
5.5.290.0100.06720.11
5.5.280.0000.06020.30
5.5.270.0070.04020.29
5.5.260.0170.06719.96
5.5.250.0100.03719.93
5.5.240.0130.04319.59
5.5.230.0100.05319.36
5.5.220.0100.08319.55
5.5.210.0070.08319.55
5.5.200.0030.07319.65
5.5.190.0070.04719.32
5.5.180.0000.04319.48
5.5.160.0070.08719.64
5.5.150.0100.08019.31
5.5.140.0200.05719.64
5.5.130.0070.08019.55
5.5.120.0030.04719.38
5.5.110.0200.06719.31
5.5.100.0130.06319.23
5.5.90.0100.05719.29
5.5.80.0100.07719.41
5.5.70.0100.06719.44
5.5.60.0070.03719.37
5.5.50.0070.06319.21
5.5.40.0130.04719.21
5.5.30.0100.07719.46
5.5.20.0070.06719.52
5.5.10.0100.06719.47
5.5.00.0070.03719.30
5.4.450.0130.06719.48
5.4.440.0130.04319.18
5.4.430.0070.03719.46
5.4.420.0130.05319.52
5.4.410.0070.04019.44
5.4.400.0070.04719.25
5.4.390.0070.03718.87
5.4.380.0100.04319.24
5.4.370.0070.07718.84
5.4.360.0070.06319.15
5.4.350.0070.06319.20
5.4.340.0030.04018.85
5.4.320.0130.07019.12
5.4.310.0070.04318.93
5.4.300.0030.06719.15
5.4.290.0030.08019.08
5.4.280.0130.06719.09
5.4.270.0070.06319.24
5.4.260.0130.06019.24
5.4.250.0130.07019.14
5.4.240.0030.08018.86
5.4.230.0100.04318.91
5.4.220.0100.06318.84
5.4.210.0170.06719.23
5.4.200.0030.04719.23
5.4.190.0100.04318.99
5.4.180.0200.06319.14
5.4.170.0100.06018.91
5.4.160.0000.04318.84
5.4.150.0070.05319.12
5.4.140.0030.06016.45
5.4.130.0100.03716.55
5.4.120.0070.03316.39
5.4.110.0030.08016.46
5.4.100.0070.06716.42
5.4.90.0030.04316.47
5.4.80.0100.03016.53
5.4.70.0100.07016.45
5.4.60.0130.04016.32
5.4.50.0030.05316.39
5.4.40.0030.03716.36
5.4.30.0030.03716.48
5.4.20.0100.05716.38
5.4.10.0000.05016.39
5.4.00.0070.03315.82
5.3.290.0000.05014.72
5.3.280.0000.05014.62
5.3.270.0030.08314.68
5.3.260.0000.04314.69
5.3.250.0030.04314.77
5.3.240.0100.04314.62
5.3.230.0000.04014.75
5.3.220.0100.05714.73
5.3.210.0000.04314.58
5.3.200.0000.04714.64
5.3.190.0070.07314.72
5.3.180.0100.07014.60
5.3.170.0030.04014.73
5.3.160.0030.08314.57
5.3.150.0000.04714.57
5.3.140.0070.04714.56
5.3.130.0070.08014.55
5.3.120.0070.04314.57
5.3.110.0000.06014.59
5.3.100.0200.02014.21
5.3.90.0000.07314.02
5.3.80.0070.03714.08
5.3.70.0130.06314.08
5.3.60.0000.05314.07
5.3.50.0170.05714.13
5.3.40.0070.07014.05
5.3.30.0070.05013.99
5.3.20.0100.07013.63
5.3.10.0030.07013.74
5.3.00.0100.06713.67
5.2.170.0100.04311.16
5.2.160.0070.06311.31
5.2.150.0100.05311.21
5.2.140.0030.04011.16
5.2.130.0030.03011.27
5.2.120.0100.05711.11
5.2.110.0030.05711.04
5.2.100.0030.05011.12
5.2.90.0000.06311.08
5.2.80.0070.06011.16
5.2.70.0000.04311.12
5.2.60.0070.05311.06
5.2.50.0030.06311.06
5.2.40.0070.03011.07
5.2.30.0030.03010.99
5.2.20.0070.02310.98
5.2.10.0100.05310.93
5.2.00.0070.05710.79
5.1.60.0000.0509.92
5.1.50.0000.0609.96
5.1.40.0030.03010.06
5.1.30.0030.02710.36
5.1.20.0030.02710.37
5.1.10.0000.03310.05
5.1.00.0030.0579.99
5.0.50.0030.0438.53
5.0.40.0000.0308.47
5.0.30.0030.0578.14
5.0.20.0070.0338.21
5.0.10.0070.0408.25
5.0.00.0000.0338.22
4.4.90.0030.0337.03
4.4.80.0030.0177.03
4.4.70.0030.0137.03
4.4.60.0030.0377.03
4.4.50.0030.0207.03
4.4.40.0030.0407.03
4.4.30.0030.0237.03
4.4.20.0030.0377.03
4.4.10.0070.0307.03
4.4.00.0030.0337.03
4.3.110.0000.0377.03
4.3.100.0030.0277.03
4.3.90.0000.0307.03
4.3.80.0030.0577.03
4.3.70.0000.0337.03
4.3.60.0000.0337.03
4.3.50.0070.0307.03
4.3.40.0030.0307.03
4.3.30.0000.0337.03
4.3.20.0030.0237.03
4.3.10.0030.0337.03
4.3.00.0000.0177.03

preferences:
41.65 ms | 401 KiB | 5 Q