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 $this->personIDMessage( $personUID, $this->worldName, 'Jack' ); elseif( $personUID === 0 && $this->worldName === 'Columbia' ) return $this->personIDMessage( $personUID, $this->worldName, 'Elizabeth' ); else return 'Unknown Person'; } private function personIDMessage( $id, $world, $name) { return "Person $id in world $world is $name"; } } class Person { static $id = 0; protected $uid; public function __construct() { $this->setUID(); } 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.40.0080.00618.88
8.3.30.0060.00918.66
8.3.20.0060.00318.90
8.3.10.0080.00020.59
8.3.00.0150.00419.38
8.2.170.0110.00622.96
8.2.160.0150.00320.30
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0060.00319.36
8.2.110.0060.00321.13
8.2.100.0040.00817.84
8.2.90.0050.00319.11
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0000.00818.03
8.2.50.0060.00318.10
8.2.40.0000.00718.22
8.2.30.0080.00018.15
8.2.20.0050.00317.80
8.2.10.0040.00417.76
8.2.00.0080.00017.75
8.1.270.0000.00924.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.14
8.1.230.0070.00317.76
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0060.00317.38
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0040.00420.54
8.1.160.0050.00218.89
8.1.150.0050.00318.58
8.1.140.0040.00417.47
8.1.130.0000.00817.79
8.1.120.0000.00717.40
8.1.110.0000.00817.44
8.1.100.0050.00317.51
8.1.90.0040.00417.46
8.1.80.0000.00717.47
8.1.70.0070.00017.47
8.1.60.0000.00817.57
8.1.50.0040.00417.43
8.1.40.0040.00417.50
8.1.30.0040.00417.68
8.1.20.0000.00817.63
8.1.10.0040.00417.43
8.1.00.0000.00817.56
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0050.00218.41
8.0.270.0030.00517.28
8.0.260.0030.00316.91
8.0.250.0040.00416.95
8.0.240.0000.00717.02
8.0.230.0000.01017.08
8.0.220.0030.00516.90
8.0.210.0030.00317.02
8.0.200.0050.00216.88
8.0.190.0080.00016.91
8.0.180.0040.00417.03
8.0.170.0000.00916.98
8.0.160.0050.00216.83
8.0.150.0050.00316.80
8.0.140.0000.00816.96
8.0.130.0000.00513.37
8.0.120.0040.00416.92
8.0.110.0000.00716.93
8.0.100.0040.00417.04
8.0.90.0040.00417.01
8.0.80.0070.00716.89
8.0.70.0050.00316.86
8.0.60.0030.00617.01
8.0.50.0040.00417.04
8.0.30.0150.00817.22
8.0.20.0090.00917.00
8.0.10.0040.00416.91
8.0.00.0080.01316.76
7.4.330.0000.00512.94
7.4.320.0000.00616.62
7.4.300.0030.00316.58
7.4.290.0070.00016.63
7.4.280.0040.00416.54
7.4.270.0050.00216.67
7.4.260.0000.00513.26
7.4.250.0040.00416.52
7.4.240.0000.00716.65
7.4.230.0050.00216.47
7.4.220.0160.00316.47
7.4.210.0100.00816.53
7.4.200.0030.00616.65
7.4.190.0030.00316.71
7.4.160.0060.01116.49
7.4.150.0090.00916.45
7.4.140.0150.00616.63
7.4.130.0130.00616.61
7.4.120.0090.00916.55
7.4.110.0070.01116.53
7.4.100.0110.00716.51
7.4.90.0110.00716.61
7.4.80.0130.00619.39
7.4.70.0130.00916.39
7.4.60.0100.01016.58
7.4.50.0030.00316.55
7.4.40.0040.00816.29
7.4.30.0070.01016.52
7.4.00.0080.01015.08
7.3.330.0000.00613.45
7.3.320.0030.00313.22
7.3.310.0040.00416.20
7.3.300.0040.00416.33
7.3.290.0040.01116.45
7.3.280.0060.01116.34
7.3.270.0130.00416.42
7.3.260.0100.00716.62
7.3.250.0090.00916.50
7.3.240.0170.00016.46
7.3.230.0130.00316.59
7.3.210.0030.01516.39
7.3.200.0060.01216.39
7.3.190.0150.00616.61
7.3.180.0120.00616.54
7.3.170.0060.01116.44
7.3.160.0090.00916.59
7.3.120.0100.00714.76
7.3.110.0060.00914.96
7.3.100.0060.00914.99
7.3.90.0060.00914.75
7.3.80.0000.00914.55
7.3.70.0000.01414.98
7.3.60.0030.00614.56
7.3.50.0090.00015.08
7.3.40.0120.00614.86
7.3.30.0070.01014.79
7.3.20.0030.00616.64
7.3.10.0120.00316.56
7.3.00.0040.01216.58
7.2.330.0060.01216.74
7.2.320.0100.01416.46
7.2.310.0030.01716.54
7.2.300.0090.00616.90
7.2.290.0120.01216.93
7.2.250.0090.00915.38
7.2.240.0060.01315.22
7.2.230.0100.00315.01
7.2.220.0060.00614.96
7.2.210.0030.00915.23
7.2.200.0030.01015.03
7.2.190.0100.00315.09
7.2.180.0040.00815.13
7.2.170.0000.01515.27
7.2.130.0050.01116.91
7.2.120.0100.00516.80
7.2.110.0050.00716.84
7.2.100.0070.00816.93
7.2.90.0050.00716.87
7.2.80.0080.00616.91
7.2.70.0100.00516.73
7.2.60.0040.00916.87
7.2.50.0020.01016.89
7.2.40.0070.00616.92
7.2.30.0080.00816.77
7.2.20.0070.00716.84
7.2.10.0070.00616.79
7.2.00.0050.00816.93
7.1.330.0030.01015.54
7.1.320.0000.01315.96
7.1.310.0030.01015.80
7.1.300.0000.01515.52
7.1.290.0070.01016.00
7.1.280.0090.00615.68
7.1.270.0080.00516.00
7.1.260.0100.00715.87
7.1.250.0090.00715.79
7.1.200.0040.00815.92
7.1.70.0050.00517.17
7.1.60.0170.00719.40
7.1.50.0100.01616.87
7.1.00.0070.08322.45
7.0.200.0170.01014.91
7.0.140.0130.06721.98
7.0.120.0170.05722.21
7.0.60.0000.08319.96
7.0.50.0100.07717.88
7.0.40.0000.07720.21
7.0.30.0270.06320.07
7.0.20.0170.04020.23
7.0.10.0270.08720.28
7.0.00.0100.04020.16
5.6.280.0000.07721.06
5.6.210.0070.05020.52
5.6.200.0100.08018.19
5.6.190.0100.09320.49
5.6.180.0370.05320.41
5.6.170.0230.06720.54
5.6.160.0200.06320.54
5.6.150.0030.04318.29
5.6.140.0130.06718.18
5.6.130.0070.04318.22
5.6.120.0100.06020.91
5.6.110.0000.09021.00
5.6.100.0030.04321.09
5.6.90.0100.07321.01
5.6.80.0070.08320.42
5.6.70.4300.04020.40
5.5.350.0270.05320.34
5.5.340.0070.03318.09
5.5.330.0070.04720.27
5.5.320.0270.05020.38
5.5.310.0300.04720.19
5.5.300.0030.08717.95
5.5.290.0070.05717.98
5.5.280.0170.07020.75
5.5.270.0130.07720.81
5.5.260.0170.07020.69
5.5.250.0070.08320.56
5.5.240.0070.06320.09
5.4.450.0000.04719.25
5.4.440.0130.07319.40
5.4.430.0030.06719.19
5.4.420.0070.07019.44
5.4.410.0000.05019.17
5.4.400.0030.05319.15
5.4.390.0070.06319.00
5.4.380.0100.04319.16
5.4.370.0000.04719.24
5.4.360.0100.07018.87
5.4.350.0030.05319.15
5.4.340.0130.06019.08
5.4.320.0100.05718.85
5.4.310.0070.03318.86
5.4.300.0030.04019.00
5.4.290.0000.04718.85
5.4.280.0200.06019.14
5.4.270.0100.07318.85
5.4.260.0100.07319.24
5.4.250.0100.06718.83
5.4.240.0070.07319.14
5.4.230.0030.05018.91
5.4.220.0100.04319.14
5.4.210.0130.07318.86
5.4.200.0030.05718.97
5.4.190.0100.07319.07
5.4.180.0030.05319.14
5.4.170.0070.03719.07
5.4.160.0100.07718.84
5.4.150.0070.08718.95
5.4.140.0000.05016.60
5.4.130.0070.04316.42
5.4.120.0070.05016.33
5.4.110.0070.07016.36
5.4.100.0030.04016.52
5.4.90.0000.04316.42
5.4.80.0100.06316.46
5.4.70.0030.03716.57
5.4.60.0030.07016.39
5.4.50.0030.05716.38
5.4.40.0130.07016.29
5.4.30.0000.08316.36
5.4.20.0170.04016.46
5.4.10.0170.06316.35
5.4.00.0100.06315.86
5.3.290.0030.04014.71
5.3.280.0070.06314.76
5.3.270.0170.05714.62
5.3.260.0070.07714.65
5.3.250.0070.05014.66
5.3.240.0070.07014.62
5.3.230.0070.04714.67
5.3.220.0000.04314.58
5.3.210.0170.06314.63
5.3.200.0000.05314.59
5.3.190.0030.04714.74
5.3.180.0000.04314.60
5.3.170.0130.04314.59
5.3.160.0100.07014.64
5.3.150.0070.03714.64
5.3.140.0070.04014.58
5.3.130.0070.05714.56
5.3.120.0130.06314.54
5.3.110.0030.04014.59
5.3.100.0270.05314.21
5.3.90.0000.08314.05
5.3.80.0000.05014.08
5.3.70.0070.06713.98
5.3.60.0070.07314.04
5.3.50.0070.07714.00
5.3.40.0070.04713.89
5.3.30.0070.05313.93
5.3.20.0070.06013.68
5.3.10.0100.04713.70
5.3.00.0100.06713.66
5.2.170.0000.03311.25
5.2.160.0100.05311.17
5.2.150.0030.06711.24
5.2.140.0030.06311.23
5.2.130.0030.05011.27
5.2.120.0130.04711.19
5.2.110.0100.05711.07
5.2.100.0030.06311.30
5.2.90.0070.04311.01
5.2.80.0070.06011.12
5.2.70.0100.06311.11
5.2.60.0000.03711.23
5.2.50.0030.03011.04
5.2.40.0030.03011.18
5.2.30.0000.03710.99
5.2.20.0030.03310.98
5.2.10.0030.04310.89
5.2.00.0030.06710.63
5.1.60.0070.05010.06
5.1.50.0070.05010.03
5.1.40.0070.03710.07
5.1.30.0100.04710.32
5.1.20.0070.03010.38
5.1.10.0000.03010.14
5.1.00.0070.05010.05
5.0.50.0030.0208.54
5.0.40.0000.0308.58
5.0.30.0000.0408.22
5.0.20.0030.0178.22
5.0.10.0000.0338.17
5.0.00.0000.0478.19
4.4.90.0000.0207.74
4.4.80.0000.0177.74
4.4.70.0000.0237.74
4.4.60.0000.0337.74
4.4.50.0070.0207.74
4.4.40.0000.0307.74
4.4.30.0030.0207.74
4.4.20.0000.0377.74
4.4.10.0000.0177.74
4.4.00.0030.0237.74
4.3.110.0070.0137.74
4.3.100.0000.0177.74
4.3.90.0030.0137.74
4.3.80.0000.0307.74
4.3.70.0000.0207.74
4.3.60.0070.0307.74
4.3.50.0000.0307.74
4.3.40.0000.0377.74
4.3.30.0030.0137.74
4.3.20.0030.0337.74
4.3.10.0000.0337.74
4.3.00.0030.0207.74

preferences:
37.4 ms | 400 KiB | 5 Q