3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Produce { private $fruits = array('red'=>'apple', 'yellow'=>'banana'); private $vegetables = array('beet', 'potato', 'zucchini'); public function getFruits() { return $this->fruits; } public function getVegetables() { return $this->vegetables; } } $foo = ((new Produce())->getFruits())['yellow']; $bar = ((new Produce())->getVegetables())[1]; var_dump($foo); var_dump($bar);

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.70.0110.01118.30
8.3.60.0140.00316.50
8.3.50.0070.00918.25
8.3.40.0070.00718.54
8.3.30.0090.00618.67
8.3.20.0040.00420.21
8.3.10.0040.00423.69
8.3.00.0020.00523.61
8.2.190.0070.01116.58
8.2.180.0120.00616.50
8.2.170.0170.00422.96
8.2.160.0100.00320.34
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00422.21
8.2.120.0040.00426.35
8.2.110.0040.00721.12
8.2.100.0070.00417.72
8.2.90.0040.00418.98
8.2.80.0040.00417.97
8.2.70.0100.00017.38
8.2.60.0000.00719.19
8.2.50.0040.00418.10
8.2.40.0030.00620.59
8.2.30.0080.00019.25
8.2.20.0060.00318.08
8.2.10.0000.00718.00
8.2.00.0040.00418.11
8.1.280.0040.01225.92
8.1.270.0050.00322.20
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.16
8.1.230.0100.00017.70
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.10
8.1.190.0040.00417.13
8.1.180.0050.00318.10
8.1.170.0000.00818.52
8.1.160.0060.00318.82
8.1.150.0000.00719.99
8.1.140.0040.00419.43
8.1.130.0030.00318.73
8.1.120.0000.00817.26
8.1.110.0000.00817.43
8.1.100.0040.00417.39
8.1.90.0000.00717.41
8.1.80.0050.00317.36
8.1.70.0070.00017.28
8.1.60.0040.00417.61
8.1.50.0050.00217.53
8.1.40.0050.00217.39
8.1.30.0000.00817.66
8.1.20.0080.00017.61
8.1.10.0000.00817.42
8.1.00.0040.00417.46
8.0.300.0050.00318.77
8.0.290.0030.00716.58
8.0.280.0000.00818.39
8.0.270.0000.00717.12
8.0.260.0030.00316.69
8.0.250.0030.00316.80
8.0.240.0000.00716.93
8.0.230.0000.00816.86
8.0.220.0080.00016.73
8.0.210.0030.00316.83
8.0.200.0000.00616.95
8.0.190.0030.00616.84
8.0.180.0040.00416.93
8.0.170.0040.00416.71
8.0.160.0000.00716.80
8.0.150.0050.00216.75
8.0.140.0000.00716.66
8.0.130.0000.00513.14
8.0.120.0000.00816.88
8.0.110.0030.00316.70
8.0.100.0000.00816.76
8.0.90.0000.00716.81
8.0.80.0080.00616.86
8.0.70.0040.00416.82
8.0.60.0000.00716.70
8.0.50.0000.00716.75
8.0.30.0060.01216.99
8.0.20.0130.00717.40
8.0.10.0000.00716.94
8.0.00.0060.01216.93
7.4.330.0060.00016.67
7.4.320.0070.00016.58
7.4.300.0060.00016.51
7.4.290.0030.00316.60
7.4.280.0080.00016.60
7.4.270.0030.00616.42
7.4.260.0000.00716.53
7.4.250.0040.00416.55
7.4.240.0040.00416.52
7.4.230.0040.00416.50
7.4.220.0140.00416.55
7.4.210.0070.01016.58
7.4.200.0060.00316.40
7.4.160.0070.00916.42
7.4.150.0140.00417.40
7.4.140.0130.00617.86
7.4.130.0060.01416.47
7.4.120.0080.01416.48
7.4.110.0070.01116.56
7.4.100.0120.01216.48
7.4.90.0110.00516.42
7.4.80.0080.01117.85
7.4.70.0080.00916.31
7.4.60.0110.00716.38
7.4.50.0030.01216.34
7.4.40.0070.01416.46
7.4.30.0100.00716.32
7.4.20.0120.01216.19
7.4.10.0060.01116.28
7.4.00.0080.01015.52
7.3.330.0000.00513.09
7.3.320.0030.00313.17
7.3.310.0040.00416.40
7.3.300.0030.00316.16
7.3.290.0070.00016.29
7.3.280.0080.00916.28
7.3.270.0090.00817.40
7.3.260.0130.00716.26
7.3.250.0150.00516.22
7.3.240.0080.00916.38
7.3.230.0070.01016.23
7.3.210.0130.00316.61
7.3.200.0140.00516.37
7.3.190.0100.00716.52
7.3.180.0130.00616.29
7.3.170.0080.00816.45
7.3.160.0110.00716.42
7.3.150.0130.00916.13
7.3.140.0030.01516.50
7.3.130.0030.01316.20
7.3.120.0060.01515.56
7.3.110.0070.01315.43
7.3.100.0090.00715.73
7.3.90.0080.00615.54
7.3.80.0100.00315.61
7.3.70.0090.00615.60
7.3.60.0130.00515.54
7.3.50.0080.00815.38
7.3.40.0110.00315.32
7.3.30.0110.00315.44
7.3.20.0050.01316.26
7.3.10.0050.01216.48
7.3.00.0080.00516.34
7.2.330.0140.00716.28
7.2.320.0090.00916.70
7.2.310.0070.00916.63
7.2.300.0140.00916.62
7.2.290.0080.00816.39
7.2.280.0100.01016.32
7.2.270.0030.01316.61
7.2.260.0070.01116.49
7.2.250.0130.00415.79
7.2.240.0080.01015.62
7.2.230.0030.01615.60
7.2.220.0050.00915.68
7.2.210.0040.01015.70
7.2.200.0090.00915.91
7.2.190.0060.00715.79
7.2.180.0060.01015.70
7.2.170.0080.00815.74
7.2.160.0060.01316.24
7.2.150.0360.00716.38
7.2.140.0090.00916.42
7.2.130.0120.01216.43
7.2.120.0090.01316.59
7.2.110.0060.01516.70
7.2.100.0100.01016.54
7.2.90.0120.00616.36
7.2.80.0120.00616.28
7.2.70.0060.01216.32
7.2.60.0240.01216.58
7.2.50.0100.01316.77
7.2.40.0100.01316.43
7.2.30.0120.00916.62
7.2.20.0000.01816.39
7.2.10.0100.01316.47
7.2.00.0100.01016.75
7.1.330.0150.00615.58
7.1.320.0150.00715.64
7.1.310.0070.01215.69
7.1.300.0130.00415.61
7.1.290.0170.00315.54
7.1.280.0070.01315.57
7.1.270.0140.00915.62
7.1.260.0090.00915.61
7.1.250.0200.01115.24
7.1.240.0190.00515.18
7.1.230.0210.01015.39
7.1.220.0200.00815.59
7.1.210.0160.01015.26
7.1.200.0140.00815.44
7.1.190.0220.00915.45
7.1.180.0150.01915.55
7.1.170.0150.01515.56
7.1.160.0260.00615.53
7.1.150.0320.00315.46
7.1.140.0220.01015.55
7.1.130.0210.01415.63
7.1.120.0260.00415.59
7.1.110.0900.01016.04
7.1.100.0590.00815.74
7.1.90.0780.00915.79
7.1.80.1060.01015.86
7.1.70.1110.01215.39
7.1.60.0530.01127.39
7.1.50.1100.01327.25
7.1.40.0860.01226.89
7.1.30.0610.00827.07
7.1.20.1360.01227.11
7.1.10.0910.00815.11
7.1.00.1010.00915.07
7.0.330.0170.00715.32
7.0.320.0190.01115.09
7.0.310.0200.01015.12
7.0.300.0160.01215.27
7.0.290.0250.00715.14
7.0.280.0310.00415.19
7.0.270.0220.01115.34
7.0.260.0190.00915.12
7.0.250.0770.00815.39
7.0.240.0780.00815.47
7.0.230.0700.01115.39
7.0.220.1040.00815.46
7.0.210.0840.00714.92
7.0.200.1160.00915.07
7.0.190.1300.00814.82
7.0.180.0810.01114.68
7.0.170.1180.00714.58
7.0.160.1260.01114.70
7.0.150.1000.00914.70
7.0.140.0570.00914.72
7.0.130.0460.00914.82
7.0.120.0730.00914.86
7.0.110.0670.01014.79
7.0.100.0920.00614.69
7.0.90.1130.01014.68
7.0.80.1220.01314.63
7.0.70.0980.01114.83
7.0.60.0350.00514.62
7.0.50.0300.01214.78
7.0.40.0220.00814.86
7.0.30.0740.00914.77
7.0.20.0970.00914.74
7.0.10.1030.01014.73
7.0.00.1000.01214.68
5.6.400.0190.01015.70
5.6.390.0230.00515.60
5.6.380.0170.00815.35
5.6.370.0210.00915.79
5.6.360.0160.01415.86
5.6.350.0260.00615.77
5.6.340.0240.00615.63
5.6.330.0230.01015.49
5.6.320.0180.01315.71
5.6.310.0220.01115.61
5.6.300.0130.04819.04
5.6.290.0170.03819.02
5.6.280.0150.04119.22
5.6.270.0150.04019.15
5.6.260.0160.03819.04
5.6.250.0150.04019.11
5.6.240.0170.04319.09
5.6.230.0100.04619.11
5.6.220.0130.04519.11
5.6.210.0130.04219.15
5.6.200.0190.03819.03
5.6.190.0160.04019.06
5.6.180.0130.04119.19
5.6.170.0140.04019.10
5.6.160.0140.04319.02
5.6.150.0150.04219.07
5.6.140.0180.04019.10
5.6.130.0180.03919.14
5.6.120.0140.04519.13
5.6.110.0140.04519.08
5.6.100.0130.04619.16
5.6.90.0180.03919.00
5.6.80.0130.04018.66
5.6.70.0150.04118.66
5.6.60.0170.03818.61
5.6.50.0160.03818.61
5.6.40.0140.04018.70
5.6.30.0150.03918.68
5.6.20.0140.03918.62
5.6.10.0160.03618.58
5.6.00.0130.03918.64

preferences:
22.09 ms | 401 KiB | 5 Q