3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const MYARRAY = ['foo' => 'bar']; protected static $props = ['Hello' => 'Foo Value']; function getPropValue($propName) { return static::$props[$propName]; } function myFunc() { return 'hey myFunc'; } function yourFunc() { return 'hey yourFunc'; } function checkConst() { // if (isset(static::MYARRAY)) { // echo 'const is set' . "\n\n"; // } else { // echo 'const is not set' . "\n\n"; // } if (isset(static::MYARRAY['foo'])) { echo 'foo is set' . "\n\n"; } else { echo 'foo is not set' . "\n\n"; } } } class Bar extends Foo { protected static $props = ['Hello' => 'Bar Value']; } $foo = new Foo(); echo $foo->getPropValue('Hello') . "\n\n"; // $functionArray = ['myFunc' => 'myFunc']; // echo $foo->$functionArray['myFunc']() . "\n\n"; $bar = new Bar(); echo $bar->getPropValue('Hello') . "\n\n"; $foo->checkConst();

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.0040.01116.50
8.3.50.0040.01116.36
8.3.40.0140.00018.67
8.3.30.0110.00418.76
8.3.20.0070.00020.16
8.3.10.0080.00021.90
8.3.00.0000.00817.63
8.2.180.0070.00716.50
8.2.170.0100.01319.08
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00420.35
8.2.120.0080.00026.35
8.2.110.0070.00319.21
8.2.100.0080.00418.22
8.2.90.0040.00419.26
8.2.80.0050.00318.05
8.2.70.0090.00017.75
8.2.60.0040.00417.90
8.2.50.0040.00418.10
8.2.40.0040.00420.37
8.2.30.0000.00721.04
8.2.20.0000.00718.07
8.2.10.0050.00217.99
8.2.00.0040.00418.13
8.1.280.0110.00425.92
8.1.270.0070.00023.81
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00022.48
8.1.230.0080.00417.52
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0110.00017.35
8.1.180.0000.00718.10
8.1.170.0040.00418.62
8.1.160.0000.00718.98
8.1.150.0030.00520.73
8.1.140.0040.00419.52
8.1.130.0000.00718.90
8.1.120.0020.00517.47
8.1.110.0040.00417.35
8.1.100.0040.00417.52
8.1.90.0000.00717.36
8.1.80.0000.00717.44
8.1.70.0000.00717.48
8.1.60.0040.00417.53
8.1.50.0000.00917.54
8.1.40.0060.00317.47
8.1.30.0000.00717.70
8.1.20.0000.00817.50
8.1.10.0040.00417.61
8.1.00.0040.00417.44
8.0.300.0000.00718.77
8.0.290.0050.00316.63
8.0.280.0030.00318.39
8.0.270.0040.00417.18
8.0.260.0030.00316.78
8.0.250.0070.00016.86
8.0.240.0090.00016.84
8.0.230.0040.00417.00
8.0.220.0040.00416.86
8.0.210.0000.00716.89
8.0.200.0060.00016.88
8.0.190.0000.00816.95
8.0.180.0040.00416.75
8.0.170.0000.00716.92
8.0.160.0000.00716.95
8.0.150.0040.00416.91
8.0.140.0080.00016.86
8.0.130.0060.00013.32
8.0.120.0040.00416.89
8.0.110.0040.00416.89
8.0.100.0000.00816.72
8.0.90.0040.00416.77
8.0.80.0080.00816.81
8.0.70.0070.00016.96
8.0.60.0020.00516.76
8.0.50.0030.00616.72
8.0.30.0100.00817.13
8.0.20.0070.01417.40
8.0.10.0000.00716.81
8.0.00.0070.01116.90
7.4.330.0030.00315.55
7.4.320.0080.00016.58
7.4.300.0030.00316.49
7.4.290.0000.00716.56
7.4.280.0040.00416.50
7.4.270.0030.00316.61
7.4.260.0030.00313.26
7.4.250.0070.00016.48
7.4.240.0000.00716.61
7.4.230.0030.00316.69
7.4.220.0070.01016.47
7.4.210.0070.00716.54
7.4.200.0000.00716.36
7.4.160.0090.00916.44
7.4.150.0150.00917.40
7.4.140.0080.00917.86
7.4.130.0100.01316.55
7.4.120.0120.01016.44
7.4.110.0160.00616.39
7.4.100.0160.00316.43
7.4.90.0090.00916.57
7.4.80.0110.00919.39
7.4.70.0130.00316.60
7.4.60.0090.00616.49
7.4.50.0090.00316.38
7.4.40.0120.00616.54
7.4.30.0050.01116.31
7.4.00.0070.01014.98
7.3.330.0030.00313.37
7.3.320.0050.00013.36
7.3.310.0040.00416.27
7.3.300.0030.00316.36
7.3.290.0130.00616.28
7.3.280.0060.01016.30
7.3.270.0060.01617.40
7.3.260.0120.00816.48
7.3.250.0110.00816.44
7.3.240.0090.00816.43
7.3.230.0130.01216.42
7.3.210.0030.01416.60
7.3.200.0030.01716.45
7.3.190.0030.01316.44
7.3.180.0040.01316.50
7.3.170.0040.01216.46
7.3.160.0030.01416.40
7.3.00.0100.01016.60
7.2.330.0080.01116.68
7.2.320.0030.01416.41
7.2.310.0030.01916.84
7.2.300.0140.01016.75
7.2.290.0160.00016.79
7.2.130.0080.00816.78
7.2.120.0170.00716.90
7.2.110.0100.00716.47
7.2.100.0060.00616.90
7.2.90.0070.01016.97
7.2.80.0110.00316.73
7.2.70.0100.00616.87
7.2.60.0080.00616.83
7.2.50.0060.00616.64
7.2.40.0080.00617.02
7.2.30.0110.00317.04
7.2.20.0000.01316.89
7.2.10.0030.00717.00
7.2.00.0030.00818.04
7.1.250.0110.00715.60
7.1.240.0140.00015.98
7.1.230.0070.01015.77
7.1.220.0000.01415.64
7.1.210.0030.00715.87
7.1.200.0030.01015.73
7.1.190.0000.01315.57
7.1.180.0140.00015.84
7.1.170.0030.00715.76
7.1.160.0030.00915.56
7.1.150.0080.00415.61
7.1.140.0060.00915.74
7.1.130.0030.00915.59
7.1.120.0040.01115.51
7.1.110.0060.00615.93
7.1.100.0060.00716.98
7.1.90.0070.00715.73
7.1.80.0070.00715.56
7.1.70.1400.00815.48
7.1.60.1550.01224.46
7.1.50.1240.00824.28
7.1.40.1820.01024.09
7.1.30.1960.00824.03
7.1.20.1640.01024.11
7.1.10.1550.01115.11
7.1.00.2070.00715.13
7.0.330.0130.00715.05
7.0.320.0030.00915.22
7.0.310.0060.00615.41
7.0.300.0060.00815.54
7.0.290.0060.00615.13
7.0.280.0040.01115.10
7.0.270.0030.01015.56
7.0.260.0030.01215.14
7.0.250.0090.00315.23
7.0.240.0030.00915.30
7.0.230.0030.00715.40
7.0.220.0030.00915.46
7.0.210.0040.00815.53
7.0.200.2070.01214.89
7.0.190.2120.01615.06
7.0.180.1700.01214.89
7.0.170.2340.01014.85
7.0.160.2210.00614.71
7.0.150.1630.01314.79
7.0.140.2210.00914.82
7.0.130.2080.00814.96
7.0.120.1920.00814.81
7.0.110.1780.00814.93
7.0.100.1380.00914.84
7.0.90.1800.01514.90
7.0.80.1700.01214.94
7.0.70.1570.01114.86
7.0.60.1600.01014.77
7.0.50.1380.00514.81
7.0.40.1310.00213.98
7.0.30.1470.01014.26
7.0.20.1100.00813.97
7.0.10.1210.01113.89
7.0.00.1350.01113.87
5.6.380.0030.00914.27

preferences:
44.48 ms | 400 KiB | 5 Q