3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Category { public $foo = [1, 2, 3]; public function getCategories($type) { return $this->foo; } } class ChildCategory extends Category { } // This works fine $categories = (new ChildCategory())->getCategories('xxx'); var_dump($categories); // Fatal error: Uncaught Error: Using $this when not in object context $categories = Category::getCategories('xxx'); var_dump($categories);

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.5.10.0100.00716.82
8.5.00.0120.00920.29
8.4.160.0140.01220.71
8.4.150.0030.00014.05
8.4.140.0120.00917.92
8.4.130.0110.00918.85
8.4.120.0110.00918.58
8.4.110.0070.01020.66
8.4.100.0130.00918.04
8.4.90.0110.00920.29
8.4.80.0110.00918.88
8.4.70.0100.00819.07
8.4.60.0120.00920.44
8.4.50.0120.01022.53
8.4.40.0100.01017.66
8.4.30.0030.00618.71
8.4.20.0130.00720.60
8.4.10.0000.00819.75
8.3.280.0140.00918.31
8.3.270.0120.01016.61
8.3.260.0130.00716.68
8.3.250.0120.00816.72
8.3.240.0130.00816.76
8.3.230.0110.00916.75
8.3.220.0120.00620.61
8.3.210.0130.00616.34
8.3.200.0050.00516.51
8.3.190.0150.00320.81
8.3.180.0060.01018.65
8.3.170.0120.00616.91
8.3.160.0100.01016.78
8.3.150.0070.01116.60
8.3.140.0000.00818.79
8.3.130.0040.00416.84
8.3.120.0150.00419.05
8.3.110.0090.00020.94
8.3.100.0060.00316.91
8.3.90.0050.00326.77
8.3.80.0100.00018.43
8.3.70.0070.01018.33
8.3.60.0150.00416.63
8.3.50.0080.00816.73
8.3.40.0070.00722.03
8.3.30.0050.01022.96
8.3.20.0130.00322.96
8.2.290.0090.00317.17
8.2.280.0090.01118.97
8.2.270.0160.00316.55
8.2.260.0060.00316.98
8.2.250.0150.00416.66
8.2.240.0090.00018.76
8.2.230.0050.00322.58
8.2.220.0100.00024.06
8.2.210.0120.00626.77
8.2.200.0090.00018.31
8.2.190.0070.01318.17
8.2.180.0070.01116.63
8.2.170.0100.01022.96
8.2.160.0090.00622.96
8.2.150.0130.00722.96
8.1.330.0140.00715.98
8.1.320.0110.00821.95
8.1.310.0100.00716.72
8.1.300.0080.00016.21
8.1.290.0100.00030.84
8.1.280.0070.01425.92
7.0.330.0250.00022.96

preferences:
28.47 ms | 403 KiB | 5 Q