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(); 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( $person1, $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.0140.00718.55
8.3.50.0130.00522.17
8.3.40.0070.00718.84
8.3.30.0040.01118.69
8.3.20.0040.00418.77
8.3.10.0030.00521.17
8.3.00.0040.00423.53
8.2.180.0070.01116.88
8.2.170.0070.00722.96
8.2.160.0070.00720.58
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.89
8.2.110.0100.00021.09
8.2.100.0040.00817.97
8.2.90.0040.00417.75
8.2.80.0040.00418.05
8.2.70.0040.00418.04
8.2.60.0030.00917.93
8.2.50.0040.00418.10
8.2.40.0060.00320.63
8.2.30.0040.00419.78
8.2.20.0070.00017.79
8.2.10.0030.00617.76
8.2.00.0030.00517.64
8.1.280.0110.00325.92
8.1.270.0030.01023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.01019.23
8.1.230.0150.00618.91
8.1.220.0000.00817.76
8.1.210.0050.00318.77
8.1.200.0000.00817.36
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0040.00418.35
8.1.160.0030.00618.89
8.1.150.0040.00418.59
8.1.140.0030.00517.36
8.1.130.0000.00717.79
8.1.120.0030.00417.46
8.1.110.0040.00717.39
8.1.100.0040.00417.50
8.1.90.0040.00417.36
8.1.80.0040.00417.50
8.1.70.0000.00717.45
8.1.60.0030.00517.49
8.1.50.0040.00417.52
8.1.40.0070.00017.43
8.1.30.0040.00417.62
8.1.20.0030.00617.55
8.1.10.0040.00417.61
8.1.00.0000.00817.43
8.0.300.0000.00819.60
8.0.290.0000.00716.63
8.0.280.0050.00318.45
8.0.270.0000.00717.22
8.0.260.0000.00616.77
8.0.250.0040.00416.98
8.0.240.0000.00816.92
8.0.230.0000.00716.89
8.0.220.0000.00816.96
8.0.210.0000.00716.85
8.0.200.0060.00016.89
8.0.190.0040.00417.03
8.0.180.0000.01116.99
8.0.170.0000.00716.83
8.0.160.0070.00017.00
8.0.150.0040.00416.83
8.0.140.0000.01016.83
8.0.130.0000.00613.35
8.0.120.0050.00216.91
8.0.110.0000.00917.03
8.0.100.0040.00417.02
8.0.90.0000.00817.01
8.0.80.0130.00716.96
8.0.70.0040.00417.00
8.0.60.0040.00417.08
8.0.50.0000.00817.00
8.0.30.0060.01717.03
8.0.20.0130.00717.40
8.0.10.0040.00416.87
8.0.00.0090.01016.92
7.4.330.0050.00014.77
7.4.320.0000.00616.50
7.4.300.0050.00316.61
7.4.290.0020.00516.67
7.4.280.0000.01316.48
7.4.270.0070.00016.46
7.4.260.0030.00313.30
7.4.250.0000.00716.60
7.4.240.0030.00316.52
7.4.230.0030.00316.59
7.4.220.0040.01416.67
7.4.210.0070.00916.54
7.4.200.0050.00316.62
7.4.190.0070.00016.62
7.4.160.0040.01816.44
7.4.150.0140.00317.40
7.4.140.0100.00917.86
7.4.130.0080.01216.48
7.4.120.0060.01116.48
7.4.110.0130.00616.65
7.4.100.0060.01416.32
7.4.90.0100.00616.38
7.4.80.0120.00419.37
7.4.70.0070.01116.63
7.4.60.0070.01016.39
7.4.50.0000.00916.35
7.4.40.0130.00322.27
7.4.30.0210.00916.55
7.4.00.0070.01014.69
7.3.330.0050.00213.35
7.3.320.0030.00313.18
7.3.310.0030.00316.41
7.3.300.0040.00416.23
7.3.290.0110.00716.32
7.3.280.0120.00616.37
7.3.270.0170.00017.40
7.3.260.0070.01118.24
7.3.250.0040.01416.51
7.3.240.0140.00416.44
7.3.230.0150.00316.39
7.3.210.0100.00716.39
7.3.200.0100.00619.39
7.3.190.0050.01116.33
7.3.180.0150.00716.59
7.3.170.0110.00616.68
7.3.160.0090.00616.36
7.3.120.0030.01414.88
7.3.10.0000.01716.18
7.3.00.0080.00616.43
7.2.330.0130.00316.77
7.2.320.0150.00316.75
7.2.310.0110.00716.88
7.2.300.0140.00316.91
7.2.290.0100.01316.87
7.2.130.0080.01116.67
7.2.120.0070.01316.86
7.2.110.0140.00916.56
7.2.100.0000.01516.61
7.2.90.0160.00416.83
7.2.80.0060.00916.72
7.2.70.0180.00316.72
7.2.60.0120.00416.74
7.2.50.0090.00616.67
7.2.40.0140.01116.56
7.2.30.0100.01016.64
7.2.20.0200.00316.75
7.2.10.0070.00716.71
7.2.00.0050.00918.15
7.1.250.0190.00315.60
7.1.100.0000.01118.30
7.1.70.0090.00017.25
7.1.60.0070.01719.40
7.1.50.0000.01316.92
7.1.00.0000.07022.30
7.0.200.0070.00016.73
7.0.140.0000.07722.12
7.0.60.0070.07719.99
7.0.50.0030.07017.89
7.0.40.0100.08020.18
7.0.30.0230.03720.26
7.0.20.0300.08020.10
7.0.10.0100.08320.26
7.0.00.0070.08020.18
5.6.280.0030.07320.91
5.6.210.0170.07020.70
5.6.200.0070.06018.22
5.6.190.0100.06020.61
5.6.180.0300.06020.61
5.6.170.0200.03720.50
5.6.160.0100.05020.46
5.6.150.0170.05318.16
5.6.140.0030.08718.17
5.6.130.0070.08318.23
5.6.120.0100.03720.93
5.6.110.0070.04020.96
5.6.100.0070.08720.98
5.6.90.0130.07321.02
5.6.80.0030.07320.37
5.5.350.0000.07720.42
5.5.340.0030.08317.98
5.5.330.0030.08020.31
5.5.320.3830.03720.42
5.5.310.0270.05020.34
5.5.300.0070.08717.93
5.5.290.0070.07317.98
5.5.280.0130.06320.81
5.5.270.0030.04320.77
5.5.260.0070.06020.66
5.5.250.0100.08320.81
5.5.240.0000.07020.17
5.4.450.1700.04319.41
5.4.440.2030.04019.47
5.4.430.1970.05019.39
5.4.420.1900.03719.53
5.4.410.1770.03719.43
5.4.400.1900.04719.22
5.4.390.1700.04319.14
5.4.380.1800.03718.95
5.4.370.1870.03018.85
5.4.360.2030.03719.00
5.4.350.1970.04019.20
5.4.340.1700.04019.22
5.4.320.1700.03318.99
5.4.310.2370.03719.34
5.4.300.2230.04319.15
5.4.290.1370.04718.97
5.4.280.2100.03019.04
5.4.270.1570.03718.99
5.4.260.1630.04319.15
5.4.250.0830.03719.23
5.4.240.0070.04019.08
5.4.230.0100.07319.21
5.4.220.0130.07719.12
5.4.210.0100.06718.97
5.4.200.0070.05018.97
5.4.190.0130.03718.85
5.4.180.0200.03719.12
5.4.170.0170.03718.96
5.4.160.0130.04019.12
5.4.150.0170.04019.18
5.4.140.0230.04016.56
5.4.130.0130.04016.55
5.4.120.0230.04016.54
5.4.110.0170.03716.61
5.4.100.0170.04316.24
5.4.90.0130.03716.50
5.4.80.0200.03316.58
5.4.70.0170.03716.62
5.4.60.0130.03716.17
5.4.50.0200.03316.54
5.4.40.0170.03716.32
5.4.30.0100.04016.53
5.4.20.0200.03016.53
5.4.10.0170.04316.42
5.4.00.0200.04015.79
5.3.290.0130.04014.68
5.3.280.0200.04314.83
5.3.270.0170.04714.70
5.3.260.0230.03314.54
5.3.250.0170.03714.52
5.3.240.0200.03314.70
5.3.230.0170.03714.69
5.3.220.0230.04314.55
5.3.210.0270.04014.51
5.3.200.0200.03314.58
5.3.190.0130.04014.45
5.3.180.0130.04014.63
5.3.170.0170.04014.49
5.3.160.0070.05314.55
5.3.150.0130.05314.72
5.3.140.0130.04314.57
5.3.130.0200.03714.53
5.3.120.0170.04014.47
5.3.110.0200.04714.68
5.3.100.0130.05314.27
5.3.90.0130.04014.01
5.3.80.0270.02714.05
5.3.70.0130.04014.14
5.3.60.0100.04314.10
5.3.50.0070.04714.02
5.3.40.0230.04014.04
5.3.30.0200.04313.83
5.3.20.0170.03713.85
5.3.10.0230.03013.71
5.3.00.0200.03313.77
5.2.170.0130.03311.07
5.2.160.0130.03011.28
5.2.150.0170.02711.08
5.2.140.0170.02711.23
5.2.130.0130.03711.34
5.2.120.0170.03311.23
5.2.110.0130.03011.12
5.2.100.0170.03311.13
5.2.90.0200.03311.18
5.2.80.0130.03311.04
5.2.70.0130.03311.12
5.2.60.0170.03010.98
5.2.50.0130.03011.04
5.2.40.0130.02711.16
5.2.30.0070.04310.99
5.2.20.0130.02710.97
5.2.10.0130.02710.88
5.2.00.0070.03310.67
5.1.60.0100.0209.91
5.1.50.0000.0279.94
5.1.40.0100.02310.07
5.1.30.0100.03010.39
5.1.20.0170.02010.45
5.1.10.0200.02310.17
5.1.00.0170.02710.17
5.0.50.0030.0238.69
5.0.40.0100.0208.31
5.0.30.0100.0278.14
5.0.20.0070.0208.14
5.0.10.0070.0238.27
5.0.00.0030.0378.08
4.4.90.0070.0137.73
4.4.80.0030.0207.73
4.4.70.0100.0177.73
4.4.60.0100.0137.73
4.4.50.0070.0237.73
4.4.40.0030.0307.73
4.4.30.0000.0307.73
4.4.20.0100.0207.73
4.4.10.0000.0307.73
4.4.00.0030.0237.73
4.3.110.0030.0177.73
4.3.100.0170.0137.73
4.3.90.0070.0107.73
4.3.80.0030.0277.73
4.3.70.0000.0207.73
4.3.60.0000.0177.73
4.3.50.0000.0177.73
4.3.40.0030.0507.73
4.3.30.0000.0177.73
4.3.20.0000.0337.73
4.3.10.0100.0307.73
4.3.00.0000.0407.73

preferences:
51.59 ms | 401 KiB | 5 Q