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 getFriendsOf($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->getFriendsOf('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.40.0110.01118.92
8.3.30.0140.00018.69
8.3.20.0070.00020.23
8.3.10.0040.00423.71
8.3.00.0050.00320.86
8.2.170.0120.00322.96
8.2.160.0100.00320.50
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00319.27
8.2.120.0000.00826.35
8.2.110.0000.00820.92
8.2.100.0110.00018.05
8.2.90.0050.00319.12
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0000.01017.93
8.2.50.0030.00618.07
8.2.40.0040.00422.35
8.2.30.0080.00020.55
8.2.20.0040.00417.93
8.2.10.0080.00018.15
8.2.00.0050.00318.00
8.1.270.0090.00020.38
8.1.260.0000.01028.09
8.1.250.0050.00228.09
8.1.240.0080.00417.38
8.1.230.0100.00019.16
8.1.220.0000.00917.78
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0040.00420.69
8.1.150.0060.00318.81
8.1.140.0000.00819.59
8.1.130.0070.00017.82
8.1.120.0070.00017.40
8.1.110.0000.00717.51
8.1.100.0040.00417.52
8.1.90.0000.00817.45
8.1.80.0000.00717.43
8.1.70.0000.00717.45
8.1.60.0040.00417.59
8.1.50.0060.00317.56
8.1.40.0030.00517.55
8.1.30.0000.00817.67
8.1.20.0050.00317.65
8.1.10.0030.00517.57
8.1.00.0040.00417.58
8.0.300.0000.00818.77
8.0.290.0000.00716.63
8.0.280.0050.00318.49
8.0.270.0070.00017.21
8.0.260.0030.00317.14
8.0.250.0040.00417.08
8.0.240.0050.00216.91
8.0.230.0040.00417.00
8.0.220.0070.00017.01
8.0.210.0000.00816.87
8.0.200.0030.00317.03
8.0.190.0040.00416.93
8.0.180.0000.00717.02
8.0.170.0040.00416.91
8.0.160.0000.00716.93
8.0.150.0000.00716.91
8.0.140.0080.00016.89
8.0.130.0030.00513.35
8.0.120.0000.00816.91
8.0.110.0050.00316.91
8.0.100.0000.00716.95
8.0.90.0000.00817.02
8.0.80.0060.01016.92
8.0.70.0000.00716.75
8.0.60.0000.00816.82
8.0.50.0070.00017.02
8.0.30.0080.01117.29
8.0.20.0100.01017.40
8.0.10.0070.00016.95
8.0.00.0090.00916.86
7.4.330.0020.00216.79
7.4.320.0000.00616.43
7.4.300.0000.00716.50
7.4.290.0000.00816.51
7.4.280.0060.00316.56
7.4.270.0000.00716.53
7.4.260.0070.00016.56
7.4.250.0000.00716.41
7.4.240.0040.00316.49
7.4.230.0040.00416.60
7.4.220.0070.01116.53
7.4.210.0060.01116.57
7.4.200.0030.00316.58
7.4.160.0100.01416.43
7.4.150.0070.01017.40
7.4.140.0100.00717.86
7.4.130.0090.01116.47
7.4.120.0050.01416.62
7.4.110.0130.01316.61
7.4.100.0090.01216.44
7.4.90.0100.00716.57
7.4.80.0130.01019.39
7.4.70.0080.01216.49
7.4.60.0040.01116.70
7.4.50.0090.00616.55
7.4.40.0120.00616.60
7.4.30.0130.00316.54
7.4.00.0030.01215.03
7.3.330.0000.00513.27
7.3.320.0050.00313.29
7.3.310.0040.00416.41
7.3.300.0060.00316.29
7.3.290.0030.00316.38
7.3.280.0110.00716.46
7.3.270.0080.01117.40
7.3.260.0030.01316.36
7.3.250.0090.00816.41
7.3.240.0170.00616.44
7.3.230.0100.01016.39
7.3.210.0100.00616.38
7.3.200.0120.00616.39
7.3.190.0070.01016.42
7.3.180.0060.00916.42
7.3.170.0130.00616.30
7.3.160.0000.01616.43
7.3.10.0070.00716.51
7.3.00.0120.00016.79
7.2.330.0090.00916.37
7.2.320.0160.00916.47
7.2.310.0120.00416.75
7.2.300.0060.01016.83
7.2.290.0100.01316.68
7.2.130.0040.01116.89
7.2.120.0040.01416.70
7.2.110.0070.00716.93
7.2.100.0000.01017.13
7.2.90.0070.00716.91
7.2.80.0060.00916.87
7.2.70.0000.01116.85
7.2.60.0070.00616.85
7.2.50.0070.00716.99
7.2.40.0090.00316.85
7.2.30.0000.01317.02
7.2.20.0070.00716.89
7.2.10.0060.00617.04
7.2.00.0020.01018.09
7.1.250.0000.01315.89
7.1.200.0130.00015.55
7.1.100.0060.00617.83
7.1.70.0030.00317.11
7.1.60.0070.01019.52
7.1.50.0090.00916.77
7.1.00.0000.08022.35
7.0.200.0030.00316.80
7.0.60.0070.08019.82
7.0.50.0030.05317.88
7.0.40.0070.04720.03
7.0.30.0230.05320.26
7.0.20.0370.06720.22
7.0.10.0070.08720.21
7.0.00.0030.05720.22
5.6.280.0000.06720.82
5.6.210.0070.06720.71
5.6.200.0070.05018.29
5.6.190.0100.08320.66
5.6.180.0170.04320.61
5.6.170.0270.06720.54
5.6.160.0070.04020.53
5.6.150.0130.07718.18
5.6.140.0030.03718.28
5.6.130.0070.08718.18
5.6.120.0030.07321.13
5.6.110.0070.08721.02
5.6.100.0130.07721.01
5.6.90.0070.04020.99
5.6.80.0130.07320.35
5.5.350.4100.04320.48
5.5.340.0030.08017.97
5.5.330.0070.06320.44
5.5.320.0570.07020.25
5.5.310.0300.07720.27
5.5.300.0170.06318.09
5.5.290.0000.06017.97
5.5.280.0100.07320.75
5.5.270.0070.09020.77
5.5.260.0170.06720.86
5.5.250.0000.04720.67
5.5.240.3930.03720.25

preferences:
47.43 ms | 400 KiB | 5 Q