3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public static $company = 'TechBase VietNam'; public function getFriends() { return [ 'John' => function () { return 'John is my best friend!'; }, 'Alan' => function () { return 'Alan is old friend!'; } ]; } public function getFriendOf($someone) { return $this->getFriends()[$someone]; } public static function getNewPerson() { return new Person(); } } // Create instance $person = new Person(); // Get friend echo "\n" . $person->getFriends()['John'] . "\n"; echo "\n" . $person->getFriends('Alan') . "\n"; // Get company echo "\n" . $person::getNewPerson()::$company . "\n";

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.0110.00416.75
8.3.50.0080.01221.99
8.3.40.0140.00418.84
8.3.30.0090.00918.79
8.3.20.0040.00420.16
8.3.10.0080.00023.57
8.3.00.0040.00420.52
8.2.180.0110.00717.00
8.2.170.0000.01522.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00319.45
8.2.120.0040.00426.35
8.2.110.0080.00020.56
8.2.100.0080.00318.04
8.2.90.0040.00419.28
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0000.00818.16
8.2.50.0080.00018.07
8.2.40.0040.00422.37
8.2.30.0070.00020.56
8.2.20.0000.00817.70
8.2.10.0080.00018.20
8.2.00.0000.00918.13
8.1.280.0110.00425.92
8.1.270.0040.00422.03
8.1.260.0040.00428.09
8.1.250.0080.00628.09
8.1.240.0050.00523.88
8.1.230.0040.00817.79
8.1.220.0000.00917.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.57
8.1.160.0070.00020.65
8.1.150.0070.00018.86
8.1.140.0060.00319.64
8.1.130.0000.00717.68
8.1.120.0070.00017.45
8.1.110.0070.00017.45
8.1.100.0070.00017.46
8.1.90.0040.00417.37
8.1.80.0050.00317.48
8.1.70.0030.00517.45
8.1.60.0080.00017.66
8.1.50.0000.00917.43
8.1.40.0020.00517.50
8.1.30.0060.00317.62
8.1.20.0040.00417.66
8.1.10.0000.00817.54
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0000.00717.25
8.0.260.0030.00317.25
8.0.250.0050.00217.02
8.0.240.0000.00617.02
8.0.230.0030.00317.06
8.0.220.0040.00416.86
8.0.210.0040.00316.91
8.0.200.0030.00317.03
8.0.190.0000.00817.05
8.0.180.0070.00016.90
8.0.170.0040.00417.07
8.0.160.0040.00716.92
8.0.150.0040.00416.92
8.0.140.0000.00816.79
8.0.130.0030.00613.32
8.0.120.0050.00316.84
8.0.110.0040.00416.95
8.0.100.0000.00716.82
8.0.90.0000.00716.95
8.0.80.0100.01316.89
8.0.70.0070.00016.84
8.0.60.0000.00816.83
8.0.50.0060.00316.92
8.0.30.0090.01017.02
8.0.20.0100.00917.40
8.0.10.0050.00316.96
8.0.00.0050.01416.57
7.4.330.0000.00516.83
7.4.320.0000.00616.55
7.4.300.0060.00016.51
7.4.290.0000.00716.51
7.4.280.0030.00516.40
7.4.270.0030.00316.51
7.4.260.0000.00816.50
7.4.250.0080.00016.52
7.4.240.0050.00316.51
7.4.230.0000.00716.68
7.4.220.0070.01016.47
7.4.210.0070.00816.60
7.4.200.0030.00316.70
7.4.160.0090.00616.44
7.4.150.0130.01017.40
7.4.140.0170.01417.86
7.4.130.0070.01016.52
7.4.120.0060.01216.62
7.4.110.0030.02016.70
7.4.100.0160.00816.63
7.4.90.0110.00616.50
7.4.80.0070.01119.39
7.4.70.0120.00916.35
7.4.60.0090.00616.58
7.4.50.0040.01116.27
7.4.40.0060.01116.51
7.4.30.0030.01316.40
7.4.00.0000.01815.15
7.3.330.0000.00713.42
7.3.320.0060.00013.22
7.3.310.0020.00516.48
7.3.300.0050.00216.44
7.3.290.0030.00316.29
7.3.280.0050.01216.38
7.3.270.0030.01617.40
7.3.260.0070.01716.37
7.3.250.0080.01016.37
7.3.240.0090.00716.43
7.3.230.0030.02116.39
7.3.210.0110.00516.48
7.3.200.0030.01316.41
7.3.190.0130.00316.39
7.3.180.0120.00916.31
7.3.170.0110.00616.39
7.3.160.0030.01316.55
7.3.10.0110.01516.50
7.3.00.0140.00716.34
7.2.330.0080.01116.42
7.2.320.0140.00916.45
7.2.310.0060.00916.45
7.2.300.0130.00316.52
7.2.290.0180.00016.64
7.2.130.0170.00316.75
7.2.120.0120.00316.77
7.2.110.0000.01416.42
7.2.100.0060.01316.33
7.2.90.0130.00316.33
7.2.80.0030.01016.40
7.2.70.0040.01216.32
7.2.60.0090.00116.91
7.2.50.0070.00716.71
7.2.40.0070.00716.81
7.2.30.0070.00716.64
7.2.20.0100.00716.67
7.2.10.0030.00716.10
7.2.00.0050.00918.04
7.1.250.0070.01115.51
7.1.200.0060.00315.86
7.1.100.0030.00917.98
7.1.70.0000.00716.92
7.1.60.0130.01019.52
7.1.50.0000.02017.05
7.1.00.0000.08022.37
7.0.200.0180.00016.63
7.0.60.0170.07319.90
7.0.50.0070.08017.88
7.0.40.0000.04720.11
7.0.30.0400.08020.07
7.0.20.0330.07320.09
7.0.10.0070.05720.12
7.0.00.0100.08320.07
5.6.280.0030.05321.11
5.6.210.0100.06720.62
5.6.200.0100.07718.13
5.6.190.0170.06720.61
5.6.180.0270.06320.41
5.6.170.0330.07720.50
5.6.160.0070.05020.44
5.6.150.0030.07318.17
5.6.140.0100.05018.14
5.6.130.0070.05718.17
5.6.120.0070.05320.99
5.6.110.0100.08020.98
5.6.100.0130.07720.99
5.6.90.0070.07720.98
5.6.80.0130.05020.45
5.5.350.2700.02720.36
5.5.340.0070.07318.08
5.5.330.0070.07720.43
5.5.320.0530.04720.30
5.5.310.0200.04320.27
5.5.300.0030.04018.08
5.5.290.0130.07718.02
5.5.280.0100.08020.78
5.5.270.0130.05020.69
5.5.260.0030.04320.77
5.5.250.0170.07020.57
5.5.240.4100.03320.37

preferences:
80.06 ms | 401 KiB | 5 Q