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->wrldName = $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 );

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.0120.00918.45
8.3.50.0120.00822.05
8.3.40.0120.00618.81
8.3.30.0030.01020.20
8.3.20.0070.00020.20
8.3.10.0040.00421.92
8.3.00.0040.00422.39
8.2.180.0190.00018.54
8.2.170.0080.00822.96
8.2.160.0040.01120.39
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0050.00319.42
8.2.110.0000.00922.07
8.2.100.0070.00319.39
8.2.90.0000.00819.40
8.2.80.0080.00019.38
8.2.70.0070.00317.63
8.2.60.0050.00318.04
8.2.50.0060.00318.07
8.2.40.0030.00518.03
8.2.30.0040.00418.09
8.2.20.0030.00617.73
8.2.10.0000.00717.75
8.2.00.0060.00317.75
8.1.280.0090.00925.92
8.1.270.0070.00024.66
8.1.260.0020.00526.35
8.1.250.0070.00028.09
8.1.240.0030.00623.70
8.1.230.0040.00819.09
8.1.220.0000.00717.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0080.00017.53
8.1.180.0050.00519.13
8.1.170.0080.00018.54
8.1.160.0000.00722.02
8.1.150.0050.00318.66
8.1.140.0050.00217.38
8.1.130.0000.00717.82
8.1.120.0040.00417.51
8.1.110.0050.00217.29
8.1.100.0030.00517.43
8.1.90.0040.00417.52
8.1.80.0040.00417.38
8.1.70.0030.00317.45
8.1.60.0000.00717.55
8.1.50.0000.00717.41
8.1.40.0000.00717.41
8.1.30.0030.00617.65
8.1.20.0040.00417.63
8.1.10.0030.00517.45
8.1.00.0060.00317.52
8.0.300.0000.00718.77
8.0.290.0070.00017.14
8.0.280.0030.00318.45
8.0.270.0030.00317.21
8.0.260.0000.00716.89
8.0.250.0070.00017.07
8.0.240.0030.00617.09
8.0.230.0000.00717.03
8.0.220.0070.00016.84
8.0.210.0040.00416.89
8.0.200.0030.00317.04
8.0.190.0050.00316.91
8.0.180.0040.00416.96
8.0.170.0060.00316.90
8.0.160.0030.00316.90
8.0.150.0080.00016.79
8.0.140.0070.00016.82
8.0.130.0040.00413.43
8.0.120.0040.00416.84
8.0.110.0040.00416.96
8.0.100.0000.00716.82
8.0.90.0040.00416.78
8.0.80.0130.00716.88
8.0.70.0000.00816.95
8.0.60.0070.00017.08
8.0.50.0000.00716.86
8.0.30.0090.00917.00
8.0.20.0110.00917.40
8.0.10.0000.00717.07
8.0.00.0120.00816.75
7.4.330.0000.00515.00
7.4.320.0000.00616.50
7.4.300.0050.00216.43
7.4.290.0000.00716.47
7.4.280.0030.00316.59
7.4.270.0050.00216.45
7.4.260.0000.00816.52
7.4.250.0000.00716.49
7.4.240.0030.00316.57
7.4.230.0070.00016.61
7.4.220.0110.00716.62
7.4.210.0100.00716.52
7.4.200.0000.00716.35
7.4.190.0070.00016.57
7.4.160.0100.00716.44
7.4.150.0080.00817.40
7.4.140.0090.00717.86
7.4.130.0100.01116.46
7.4.120.0090.00716.58
7.4.110.0110.00816.53
7.4.100.0180.00416.39
7.4.90.0140.00316.33
7.4.80.0090.00919.39
7.4.70.0150.00316.39
7.4.60.0060.01216.43
7.4.50.0040.00416.47
7.4.40.0110.00422.77
7.4.30.0080.00816.27
7.4.00.0090.01015.07
7.3.330.0000.00513.23
7.3.320.0000.00513.23
7.3.310.0000.00716.40
7.3.300.0000.00716.41
7.3.290.0030.01716.41
7.3.280.0080.01016.38
7.3.270.0180.00017.40
7.3.260.0090.00916.63
7.3.250.0080.00816.40
7.3.240.0030.01316.34
7.3.230.0110.00616.56
7.3.210.0030.01316.36
7.3.200.0110.00619.39
7.3.190.0160.00616.45
7.3.180.0090.00616.47
7.3.170.0030.01216.48
7.3.160.0140.00416.62
7.3.120.0060.01014.81
7.3.110.0030.01514.64
7.3.100.0090.00615.04
7.3.90.0090.00314.70
7.3.80.0060.00615.03
7.3.70.0100.00714.75
7.3.60.0000.01114.61
7.3.50.0000.01114.86
7.3.40.0000.01314.76
7.3.30.0000.01114.54
7.3.20.0040.01216.78
7.3.10.0070.00616.48
7.3.00.0070.00716.66
7.2.330.0150.00316.52
7.2.320.0070.01116.65
7.2.310.0070.01116.50
7.2.300.0160.00616.47
7.2.290.0060.01616.58
7.2.250.0100.00715.04
7.2.240.0100.01015.38
7.2.230.0090.00915.30
7.2.220.0060.00314.88
7.2.210.0000.01815.29
7.2.200.0060.00615.26
7.2.190.0030.01315.04
7.2.180.0070.00714.82
7.2.170.0050.00515.16
7.2.130.0070.00717.05
7.2.120.0030.01016.91
7.2.110.0070.00916.79
7.2.100.0050.00616.90
7.2.90.0080.00716.99
7.2.80.0100.00716.63
7.2.70.0120.00617.00
7.2.60.0040.01016.67
7.2.50.0050.00716.90
7.2.40.0040.01116.88
7.2.30.0020.01116.94
7.2.20.0060.00716.96
7.2.10.0050.00916.87
7.2.00.0070.00516.88
7.1.330.0130.00315.87
7.1.320.0040.01115.66
7.1.310.0060.00315.98
7.1.300.0060.00615.56
7.1.290.0040.00415.84
7.1.280.0000.01315.77
7.1.270.0060.00615.54
7.1.260.0030.01015.84
7.1.250.0030.01015.71
7.1.200.0040.01115.93
7.1.100.0040.01118.23
7.1.70.0000.00717.30
7.1.60.0070.01819.43
7.1.50.0140.01017.06
7.1.00.0030.06722.43
7.0.200.0000.00816.83
7.0.140.0000.07722.15
7.0.100.0330.05719.97
7.0.90.0270.05719.87
7.0.80.0030.05719.89
7.0.70.0330.08019.98
7.0.60.0100.07719.98
7.0.50.0400.08320.38
7.0.40.0100.08320.05
7.0.30.0030.05320.17
7.0.20.0100.07020.14
7.0.10.0100.04020.08
7.0.00.0030.08320.16
5.6.280.0000.07720.91
5.6.250.0100.07320.79
5.6.240.0030.08320.63
5.6.230.0070.07720.68
5.6.220.0070.07320.62
5.6.210.0100.08020.78
5.6.200.0100.08021.12
5.6.190.0030.08721.09
5.6.180.0000.09020.97
5.6.170.0100.08321.14
5.6.160.0070.08320.97
5.6.150.0030.09321.14
5.6.140.0070.08721.04
5.6.130.0070.07321.04
5.6.120.0070.05321.00
5.6.110.0100.08320.96
5.6.100.0170.06321.08
5.6.90.0130.08320.94
5.6.80.0130.04020.42
5.6.70.0130.07020.39
5.6.60.0030.08020.48
5.6.50.0170.06720.44
5.6.40.0070.05020.33
5.6.30.0100.07720.46
5.6.20.0100.07720.39
5.6.10.0130.07020.32
5.6.00.0170.08020.31
5.5.380.0200.06720.38
5.5.370.0070.06320.36
5.5.360.0100.08020.56
5.5.350.0100.04720.46
5.5.340.0030.08320.89
5.5.330.0170.07320.84
5.5.320.0030.09020.90
5.5.310.0030.04320.90
5.5.300.0100.07320.77
5.5.290.0200.07020.94
5.5.280.0200.07020.79
5.5.270.0170.06720.87
5.5.260.0000.05320.76
5.5.250.0070.07320.65
5.5.240.0100.06720.20
5.5.230.0100.07320.26
5.5.220.0100.06720.15
5.5.210.0100.07720.28
5.5.200.0230.06320.29
5.5.190.0170.07320.25
5.5.180.0070.07320.16
5.5.160.0070.07320.14
5.5.150.0070.07720.16
5.5.140.0070.07720.23
5.5.130.0130.05320.16
5.5.120.0170.06720.13
5.5.110.0130.06020.22
5.5.100.0070.08020.09
5.5.90.0070.08020.18
5.5.80.0070.08020.02
5.5.70.0130.06320.17
5.5.60.0070.06320.05
5.5.50.0100.06719.98
5.5.40.0100.08320.16
5.5.30.0030.08020.14
5.5.20.0130.07020.05
5.5.10.0070.08020.09
5.5.00.0030.09719.98
5.4.450.0100.07719.48
5.4.440.0130.07019.27
5.4.430.0100.07719.44
5.4.420.0130.07019.21
5.4.410.0170.05719.31
5.4.400.0100.04719.16
5.4.390.0200.06018.95
5.4.380.0000.08718.90
5.4.370.0230.06319.04
5.4.360.0170.08318.90
5.4.350.0130.07019.03
5.4.340.0130.07019.21
5.4.320.0030.08719.13
5.4.310.0100.08319.12
5.4.300.0100.07319.12
5.4.290.0030.07319.23
5.4.280.0070.04018.84
5.4.270.0130.06719.08
5.4.260.0130.03719.23
5.4.250.0070.05719.09
5.4.240.0070.05719.12
5.4.230.0000.05019.12
5.4.220.0000.04719.15
5.4.210.0030.06718.84
5.4.200.0130.03719.02
5.4.190.0170.06719.11
5.4.180.0200.06018.83
5.4.170.0070.06318.86
5.4.160.0130.06319.21
5.4.150.0000.04719.21
5.4.140.0130.04716.39
5.4.130.0170.03716.49
5.4.120.0230.05716.46
5.4.110.0100.06016.48
5.4.100.0070.07316.45
5.4.90.0030.06016.38
5.4.80.0100.07316.44
5.4.70.0100.06316.55
5.4.60.0000.07316.25
5.4.50.0070.05316.39
5.4.40.0170.05016.50
5.4.30.0100.03716.46
5.4.20.0030.03716.32
5.4.10.0070.07316.41
5.4.00.0000.04715.84
5.3.290.0030.08014.80
5.3.280.0000.08014.66
5.3.270.0070.07314.63
5.3.260.0100.07314.57
5.3.250.0130.04314.70
5.3.240.0030.07714.62
5.3.230.0070.05714.70
5.3.220.0170.03314.56
5.3.210.0170.05014.68
5.3.200.0130.07314.53
5.3.190.0030.05314.51
5.3.180.0100.07714.53
5.3.170.0000.06014.71
5.3.160.0030.07014.56
5.3.150.0170.03714.67
5.3.140.0030.06014.68
5.3.130.0030.04714.63
5.3.120.0070.06314.49
5.3.110.0030.04714.57
5.3.100.0070.07314.11
5.3.90.0130.03314.02
5.3.80.0100.06713.96
5.3.70.0030.05014.12
5.3.60.0100.06714.00
5.3.50.0200.05013.95
5.3.40.0070.08013.85
5.3.30.0030.05313.98
5.3.20.0000.07013.64
5.3.10.0030.07713.67
5.3.00.0000.04713.68
5.2.170.0030.06311.09
5.2.160.0030.06011.15
5.2.150.0030.06311.09
5.2.140.0070.06011.21
5.2.130.0030.06311.02
5.2.120.0030.06011.17
5.2.110.0030.06010.98
5.2.100.0100.03311.22
5.2.90.0030.05311.18
5.2.80.0000.06311.22
5.2.70.0030.06011.10
5.2.60.0030.06311.15
5.2.50.0030.04311.04
5.2.40.0070.05711.01
5.2.30.0070.05011.05
5.2.20.0070.06310.89
5.2.10.0070.04010.98
5.2.00.0070.05310.76
5.1.60.0070.0509.85
5.1.50.0130.04310.00
5.1.40.0030.0509.88
5.1.30.0070.02310.41
5.1.20.0100.04710.48
5.1.10.0100.04710.15
5.1.00.0030.05710.15
5.0.50.0100.0378.60
5.0.40.0000.0278.27
5.0.30.0070.0538.23
5.0.20.0070.0408.25
5.0.10.0000.0438.27
5.0.00.0030.0708.01
4.4.90.0000.0377.73
4.4.80.0000.0277.73
4.4.70.0000.0407.73
4.4.60.0030.0177.73
4.4.50.0070.0237.73
4.4.40.0030.0277.73
4.4.30.0000.0307.73
4.4.20.0030.0337.73
4.4.10.0000.0377.73
4.4.00.0000.0407.73
4.3.110.0000.0307.73
4.3.100.0030.0337.73
4.3.90.0030.0237.73
4.3.80.0070.0377.73
4.3.70.0070.0207.73
4.3.60.0000.0337.73
4.3.50.0000.0207.73
4.3.40.0030.0307.73
4.3.30.0030.0377.73
4.3.20.0000.0337.73
4.3.10.0000.0377.73
4.3.00.0000.0337.73

preferences:
39.84 ms | 401 KiB | 5 Q