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->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.60.0070.01116.75
8.3.50.0080.00818.04
8.3.40.0120.00318.88
8.3.30.0060.00918.84
8.3.20.0040.00420.16
8.3.10.0040.00423.65
8.3.00.0090.00020.82
8.2.180.0040.01118.31
8.2.170.0040.01218.94
8.2.160.0070.00722.96
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0040.00419.21
8.2.120.0000.00826.35
8.2.110.0100.00021.98
8.2.100.0110.00017.77
8.2.90.0080.00019.21
8.2.80.0080.00018.03
8.2.70.0060.00317.47
8.2.60.0060.00317.87
8.2.50.0050.00318.07
8.2.40.0080.00022.15
8.2.30.0040.00420.64
8.2.20.0000.00917.70
8.2.10.0050.00218.18
8.2.00.0040.00418.00
8.1.280.0060.00925.92
8.1.270.0060.00320.13
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0200.00323.86
8.1.230.0080.00422.69
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0080.00018.74
8.1.160.0000.00820.79
8.1.150.0000.00818.77
8.1.140.0080.00019.47
8.1.130.0070.00017.64
8.1.120.0000.00717.39
8.1.110.0070.00017.36
8.1.100.0040.00417.44
8.1.90.0030.00517.51
8.1.80.0000.00717.54
8.1.70.0070.00017.50
8.1.60.0000.00817.54
8.1.50.0030.00617.39
8.1.40.0030.00617.44
8.1.30.0000.00817.68
8.1.20.0040.00417.67
8.1.10.0000.00817.57
8.1.00.0050.00317.57
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0030.00318.39
8.0.270.0030.00317.26
8.0.260.0030.00317.18
8.0.250.0000.00816.94
8.0.240.0030.00516.85
8.0.230.0040.00417.03
8.0.220.0070.00016.84
8.0.210.0080.00016.87
8.0.200.0030.00316.91
8.0.190.0030.00517.03
8.0.180.0000.00716.88
8.0.170.0030.00617.00
8.0.160.0000.00716.89
8.0.150.0060.00316.98
8.0.140.0000.00716.93
8.0.130.0000.00613.43
8.0.120.0080.00016.95
8.0.110.0040.00416.92
8.0.100.0070.00016.79
8.0.90.0000.00717.00
8.0.80.0080.00816.95
8.0.70.0050.00216.85
8.0.60.0050.00216.96
8.0.50.0020.00516.98
8.0.30.0130.00417.07
8.0.20.0100.00917.40
8.0.10.0000.00716.99
8.0.00.0110.01116.82
7.4.330.0000.00516.73
7.4.320.0000.00616.63
7.4.300.0000.00616.52
7.4.290.0030.00316.45
7.4.280.0040.00416.50
7.4.270.0070.00016.66
7.4.260.0030.00516.49
7.4.250.0000.00716.39
7.4.240.0050.00216.63
7.4.230.0040.00316.52
7.4.220.0130.00616.36
7.4.210.0070.00916.64
7.4.200.0030.00316.26
7.4.160.0100.00716.48
7.4.150.0070.01117.40
7.4.140.0120.00817.86
7.4.130.0140.00416.45
7.4.120.0130.00516.66
7.4.110.0070.02016.66
7.4.100.0090.00916.48
7.4.90.0090.00916.75
7.4.80.0060.01519.39
7.4.70.0130.00316.32
7.4.60.0100.00716.54
7.4.50.0030.01016.59
7.4.40.0100.00616.48
7.4.30.0150.00816.64
7.4.00.0120.00614.94
7.3.330.0000.00613.28
7.3.320.0030.00313.26
7.3.310.0030.00316.41
7.3.300.0030.00316.29
7.3.290.0040.00416.34
7.3.280.0110.00616.43
7.3.270.0130.00317.40
7.3.260.0100.00916.44
7.3.250.0100.01116.40
7.3.240.0080.01316.45
7.3.230.0070.01416.39
7.3.210.0060.01116.38
7.3.200.0040.01416.26
7.3.190.0100.00716.66
7.3.180.0070.01016.52
7.3.170.0110.01016.33
7.3.160.0140.00816.32
7.3.120.0110.00614.86
7.3.110.0080.00914.82
7.3.100.0070.00714.75
7.3.90.0080.00914.80
7.3.80.0080.00714.86
7.3.70.0030.01114.75
7.3.60.0080.00514.63
7.3.50.0080.00814.87
7.3.40.0050.00914.73
7.3.30.0020.01314.76
7.3.20.0050.00816.61
7.3.10.0080.00516.71
7.3.00.0100.00316.61
7.2.330.0110.00716.93
7.2.320.0110.01116.82
7.2.310.0000.01716.46
7.2.300.0090.01616.49
7.2.290.0030.01316.54
7.2.250.0090.00814.77
7.2.240.0070.01315.05
7.2.230.0050.01114.98
7.2.220.0050.00915.21
7.2.210.0020.01315.09
7.2.200.0000.01214.95
7.2.190.0030.00815.05
7.2.180.0050.00814.87
7.2.170.0060.00915.00
7.2.60.0060.00617.02
7.2.00.0000.01219.47
7.1.330.0050.01015.71
7.1.320.0030.01115.68
7.1.310.0090.00515.64
7.1.300.0050.00715.65
7.1.290.0070.00815.69
7.1.280.0030.01215.73
7.1.270.0060.00415.62
7.1.260.0080.00815.61
7.1.200.0040.00415.58
7.1.100.0030.00618.20
7.1.70.0040.00416.88
7.1.60.0040.01119.52
7.1.50.0060.00617.00
7.1.00.0030.07722.31
7.0.200.0030.00716.44
7.0.60.0100.03319.96
7.0.50.0070.08017.91
7.0.40.0000.06020.25
7.0.30.0470.07020.23
7.0.20.0270.08020.23
7.0.10.0130.08020.26
7.0.00.0100.08020.11
5.6.280.0030.06321.03
5.6.210.0030.07720.55
5.6.200.0130.06718.19
5.6.190.0100.05020.77
5.6.180.0170.04720.57
5.6.170.0230.07720.71
5.6.160.0070.07020.62
5.6.150.0100.03318.14
5.6.140.0000.04718.17
5.6.130.0130.06018.16
5.6.120.0170.07721.01
5.6.110.0100.05021.02
5.6.100.0100.07721.12
5.6.90.0100.06721.13
5.6.80.0030.09020.38
5.5.350.3670.04720.31
5.5.340.0100.06318.05
5.5.330.0100.07320.47
5.5.320.0500.07720.56
5.5.310.0270.07720.30
5.5.300.0230.05718.02
5.5.290.0100.07017.98
5.5.280.0000.08720.91
5.5.270.0070.08320.88
5.5.260.0070.08320.89
5.5.250.0030.07720.80
5.5.240.3700.03320.16

preferences:
77.6 ms | 400 KiB | 5 Q