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) { $worldUID = $this->worldUID; return "Person $id in world $world($worldUID) is $name \n"; } } 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 );

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.0110.00418.68
8.3.30.0060.00919.21
8.3.20.0080.00020.21
8.3.10.0070.00023.65
8.3.00.0000.00820.75
8.2.170.0070.01422.96
8.2.160.0070.00722.20
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0080.00022.30
8.2.110.0030.00622.19
8.2.100.0080.00418.03
8.2.90.0000.00919.39
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0000.00819.53
8.2.30.0070.00018.20
8.2.20.0040.00417.64
8.2.10.0080.00017.82
8.2.00.0030.00617.81
8.1.270.0030.00623.92
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.98
8.1.230.0040.00719.22
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0000.00817.52
8.1.180.0030.00718.10
8.1.170.0040.00418.65
8.1.160.0000.00722.02
8.1.150.0040.00418.68
8.1.140.0080.00017.38
8.1.130.0040.00417.95
8.1.120.0000.00717.47
8.1.110.0040.00417.49
8.1.100.0040.00417.45
8.1.90.0050.00317.51
8.1.80.0020.00517.45
8.1.70.0030.00317.42
8.1.60.0000.00817.48
8.1.50.0090.00017.48
8.1.40.0000.00817.41
8.1.30.0040.00417.51
8.1.20.0000.00817.70
8.1.10.0040.00417.59
8.1.00.0030.00517.54
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0000.00718.39
8.0.270.0000.00717.19
8.0.260.0030.00316.84
8.0.250.0070.00016.93
8.0.240.0090.00017.06
8.0.230.0000.00817.07
8.0.220.0030.00517.02
8.0.210.0040.00416.80
8.0.200.0030.00316.92
8.0.190.0070.00017.00
8.0.180.0040.00416.90
8.0.170.0040.00417.06
8.0.160.0000.00717.04
8.0.150.0000.00716.91
8.0.140.0080.00016.78
8.0.130.0000.00613.38
8.0.120.0050.00316.95
8.0.110.0000.00716.88
8.0.100.0000.00816.86
8.0.90.0080.00016.96
8.0.80.0120.00916.96
8.0.70.0040.00416.84
8.0.60.0040.00416.93
8.0.50.0000.00816.98
8.0.30.0110.01017.08
8.0.20.0080.01317.40
8.0.10.0040.00416.95
8.0.00.0090.00816.92
7.4.330.0000.00515.00
7.4.320.0000.00616.48
7.4.300.0020.00516.60
7.4.290.0000.00816.51
7.4.280.0030.00316.56
7.4.270.0000.00616.43
7.4.260.0030.00316.55
7.4.250.0000.00816.45
7.4.240.0030.00316.52
7.4.230.0030.00316.61
7.4.220.0150.00916.57
7.4.210.0060.00916.60
7.4.200.0030.00316.55
7.4.190.0000.00716.77
7.4.160.0100.00716.52
7.4.150.0110.00717.40
7.4.140.0080.01317.86
7.4.130.0150.00816.52
7.4.120.0060.01216.62
7.4.110.0130.00316.62
7.4.100.0130.00516.61
7.4.90.0070.01016.61
7.4.80.0060.01016.64
7.4.70.0100.01016.53
7.4.60.0130.00416.53
7.4.50.0030.00616.48
7.4.40.0080.00822.77
7.4.30.0060.01216.49
7.4.10.0100.00714.68
7.4.00.0080.00914.88
7.3.330.0000.00513.45
7.3.320.0000.00513.42
7.3.310.0000.00716.30
7.3.300.0030.00316.44
7.3.290.0130.00716.43
7.3.280.0080.00816.42
7.3.270.0100.00717.40
7.3.260.0060.01116.57
7.3.250.0100.00716.40
7.3.240.0120.00616.69
7.3.230.0110.00716.44
7.3.210.0200.01816.64
7.3.200.0150.00819.39
7.3.190.0060.00916.50
7.3.180.0060.00916.63
7.3.170.0140.00316.43
7.3.160.0100.01016.67
7.3.130.0120.00615.02
7.3.120.0080.00914.71
7.3.110.0070.01315.11
7.3.100.0070.01115.16
7.3.90.0030.01014.75
7.3.80.0040.00814.80
7.3.70.0060.00914.89
7.3.60.0030.00714.94
7.3.50.0060.00314.62
7.3.40.0030.00614.95
7.3.30.0070.00714.65
7.3.20.0040.01216.77
7.3.10.0060.00616.77
7.3.00.0030.00616.71
7.2.330.0030.01416.81
7.2.320.0100.00716.69
7.2.310.0070.01116.77
7.2.300.0110.01016.86
7.2.290.0100.00616.88
7.2.260.0090.00915.10
7.2.250.0040.01214.83
7.2.240.0000.01414.77
7.2.230.0060.01015.05
7.2.220.0090.00614.98
7.2.210.0040.01115.02
7.2.200.0120.00315.07
7.2.190.0030.00815.09
7.2.180.0040.00814.82
7.2.170.0090.00615.12
7.2.160.0030.00615.08
7.2.150.0000.01416.95
7.2.140.0000.01316.94
7.2.130.0120.00316.91
7.2.120.0070.00716.84
7.2.110.0030.00616.59
7.2.100.0050.00517.03
7.2.90.0090.00616.79
7.2.80.0060.00917.15
7.2.70.0070.00617.09
7.2.60.0030.01017.07
7.2.50.0060.00916.79
7.2.40.0060.00917.11
7.2.30.0070.00716.92
7.2.20.0000.01516.95
7.2.10.0060.00916.88
7.2.00.0030.01017.14
7.1.330.0000.01215.77
7.1.320.0060.00915.77
7.1.310.0000.01215.97
7.1.300.0040.00715.99
7.1.290.0100.00315.68
7.1.280.0030.00715.99
7.1.270.0030.00615.88
7.1.260.0070.00716.05
7.1.250.0000.00815.75
7.1.240.0000.01215.80
7.1.230.0040.01115.85
7.1.220.0000.00915.49
7.1.210.0070.00715.84
7.1.200.0030.00815.90
7.1.190.0060.00615.59
7.1.180.0030.01015.46
7.1.170.0050.00515.80
7.1.160.0060.00615.95
7.1.150.0000.01115.79
7.1.140.0070.00415.88
7.1.130.0000.01215.94
7.1.120.0090.00015.79
7.1.110.0030.00916.00
7.1.100.0100.00615.97
7.1.90.0070.01015.49
7.1.80.0030.00615.99
7.1.70.0030.00616.38
7.1.60.0080.01117.59
7.1.50.0080.00916.55
7.1.40.0000.01315.87
7.1.30.0090.00015.56
7.1.20.0030.00615.84
7.1.10.0070.00715.84
7.1.00.0050.04319.05
7.0.330.0040.00415.50
7.0.320.0060.00315.25
7.0.310.0040.00715.46
7.0.300.0060.00615.17
7.0.290.0000.01215.45
7.0.280.0090.00315.17
7.0.270.0070.00715.27
7.0.260.0030.01115.28
7.0.250.0120.00315.41
7.0.240.0030.01315.26
7.0.230.0050.00515.19
7.0.220.0060.00615.27
7.0.210.0040.01115.32
7.0.200.0050.00316.08
7.0.190.0060.00915.25
7.0.180.0030.01015.40
7.0.170.0000.01515.34
7.0.160.0060.00315.44
7.0.150.0070.00715.24
7.0.140.0080.04018.75
7.0.130.0060.01215.13
7.0.120.0030.01015.58
7.0.110.0070.00715.54
7.0.100.0040.01215.41
7.0.90.0030.01415.44
7.0.80.0060.00615.44
7.0.70.0000.01415.43
7.0.60.0050.04117.70
7.0.50.0050.04316.61
7.0.40.0070.02616.73
7.0.30.0240.02516.85
7.0.20.0130.02516.78
7.0.10.0150.04316.82
7.0.00.0030.04816.86
5.6.400.0030.00614.46
5.6.390.0030.01014.30
5.6.380.0110.00414.44
5.6.370.0070.00714.71
5.6.360.0060.00614.55
5.6.350.0030.00914.17
5.6.340.0100.00314.34
5.6.330.0070.00414.38
5.6.320.0150.00614.29
5.6.310.0120.00014.46
5.6.300.0100.00314.27
5.6.290.0090.00914.57
5.6.280.0080.03817.80
5.6.270.0040.01114.36
5.6.260.0070.01014.28
5.6.250.0060.01214.69
5.6.240.0070.01014.25
5.6.230.0060.00614.63
5.6.220.0090.00314.51
5.6.210.0060.03417.38
5.6.200.0030.02416.39
5.6.190.0080.04817.33
5.6.180.0040.03917.40
5.6.170.0170.02517.39
5.6.160.0090.02317.45
5.6.150.0150.03516.42
5.6.140.0090.03716.43
5.6.130.0070.04016.29
5.6.120.0080.02217.82
5.6.110.0100.02217.74
5.6.100.0000.05217.67
5.6.90.0070.04417.81
5.6.80.0020.02917.54
5.6.70.2260.02517.38
5.6.60.0070.00714.36
5.6.50.0030.00914.21
5.6.40.0080.00614.27
5.6.30.0030.01414.36
5.6.20.0040.01114.27
5.6.10.0070.00714.37
5.6.00.0000.01714.49
5.5.380.0120.00314.39
5.5.370.0070.01014.32
5.5.360.0030.01014.22
5.5.350.0090.04017.39
5.5.340.0030.04116.29
5.5.330.0070.04217.46
5.5.320.0030.05017.34
5.5.310.0030.03117.44
5.5.300.0070.04816.09
5.5.290.0060.02616.19
5.5.280.0060.02317.65
5.5.270.0130.04217.69
5.5.260.0110.04117.57
5.5.250.0080.03417.47
5.5.240.0050.04217.22
5.5.230.0030.00814.32
5.5.220.0140.00014.00
5.5.210.0030.01014.50
5.5.200.0040.01114.15
5.5.190.0100.00614.14
5.5.180.0120.00014.19
5.5.170.0110.00014.37
5.5.160.0100.00614.22
5.5.150.0100.00314.09
5.5.140.0000.01214.14
5.5.130.0070.00314.33
5.5.120.0080.00814.34
5.5.110.0040.01114.18
5.5.100.0040.01214.52
5.5.90.0000.01314.58
5.5.80.0070.00714.54
5.5.70.0090.00614.50
5.5.60.0070.00414.44
5.5.50.0080.00414.38
5.5.40.0070.00714.51
5.5.30.0040.00414.35
5.5.20.0070.00414.16
5.5.10.0030.01014.21
5.5.00.0090.00014.12
5.4.450.0980.02815.33
5.4.440.0800.02615.39
5.4.430.0880.02415.37
5.4.420.0340.02715.46
5.4.410.0050.01815.32
5.4.400.0210.02015.25
5.4.390.0930.02115.07
5.4.380.0890.02415.22
5.4.370.0950.02415.18
5.4.360.1060.02315.07
5.4.350.1110.02515.11
5.4.340.1000.02715.18
5.4.330.0030.00711.28
5.4.320.1000.02315.18
5.4.310.0870.02315.17
5.4.300.0970.01815.06
5.4.290.0930.02215.17
5.4.280.0510.02015.22
5.4.270.0080.02815.17
5.4.260.0050.03915.14
5.4.250.0680.02015.29
5.4.240.1000.02215.17
5.4.230.1080.01715.21
5.4.220.0850.02215.24
5.4.210.0950.02715.13
5.4.200.0900.02315.29
5.4.190.1070.02615.17
5.4.180.1110.02315.31
5.4.170.1030.02515.15
5.4.160.1000.02115.22
5.4.150.0670.02915.27
5.4.140.0050.02013.92
5.4.130.0080.03713.89
5.4.120.0820.02513.87
5.4.110.0950.03013.76
5.4.100.0930.01513.94
5.4.90.0920.01813.85
5.4.80.0980.02013.94
5.4.70.1030.02213.88
5.4.60.1000.01713.76
5.4.50.0920.02013.88
5.4.40.0890.02513.81
5.4.30.1090.01913.81
5.4.20.0870.02013.76
5.4.10.0080.02313.82
5.4.00.0060.01813.62
5.3.290.0400.02213.01
5.3.280.0960.01712.98
5.3.270.0960.01812.91
5.3.260.0980.02013.01
5.3.250.0880.02312.98
5.3.240.0890.02313.01
5.3.230.1090.02512.94
5.3.220.0770.02212.88
5.3.210.0900.02212.89
5.3.200.0930.02212.94
5.3.190.0910.02412.96
5.3.180.0200.03512.89
5.3.170.0000.02412.93
5.3.160.0140.01912.92
5.3.150.1400.02012.89
5.3.140.0200.02612.96
5.3.130.0070.01812.87
5.3.120.0060.02012.91
5.3.110.0260.02312.88
5.3.100.1000.02212.62
5.3.90.0970.02212.68
5.3.80.1120.02712.77
5.3.70.0900.02012.67
5.3.60.0950.02012.61
5.3.50.0830.02012.68
5.3.40.0910.01912.58
5.3.30.0920.02112.63
5.3.20.0150.03112.45
5.3.10.0080.03612.43
5.3.00.0260.03212.43
5.2.170.1530.03011.39
5.2.160.1500.02711.18
5.2.150.1470.03311.08
5.2.140.1530.03311.39
5.2.130.1500.02711.11
5.2.120.1630.03311.22
5.2.110.1470.02711.13
5.2.100.1630.02711.28
5.2.90.1630.05011.25
5.2.80.1430.03011.35
5.2.70.1470.02711.09
5.2.60.1600.03711.09
5.2.50.0630.02711.09
5.2.40.0030.02710.97
5.2.30.0000.06011.22
5.2.20.0030.04011.13
5.2.10.1170.03710.85
5.2.00.1200.02710.71
5.1.60.1100.0279.95
5.1.50.1200.0279.90
5.1.40.1230.0309.98
5.1.30.1130.02710.36
5.1.20.1370.03710.38
5.1.10.1400.03710.02
5.1.00.1370.03010.08
5.0.50.0630.0178.50
5.0.40.0530.0238.57
5.0.30.0600.0338.40
5.0.20.0570.0208.15
5.0.10.0730.0308.13
5.0.00.0630.0278.17
4.4.90.0730.0238.02
4.4.80.0700.0208.02
4.4.70.0570.0178.02
4.4.60.0000.0178.02
4.4.50.0070.0138.02
4.4.40.0030.0438.02
4.4.30.0000.0338.02
4.4.20.0000.0178.02
4.4.10.0000.0178.02
4.4.00.0000.0278.02
4.3.110.0130.0178.02
4.3.100.0600.0138.02
4.3.90.0700.0178.02
4.3.80.0700.0308.02
4.3.70.0600.0208.02
4.3.60.0700.0208.02
4.3.50.0800.0208.02
4.3.40.0770.0338.02
4.3.30.0370.0238.02
4.3.20.0330.0278.02
4.3.10.0270.0178.02
4.3.00.0200.0178.02

preferences:
38.23 ms | 400 KiB | 5 Q