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['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.0030.01416.75
8.3.50.0060.00916.29
8.3.40.0060.00918.67
8.3.30.0040.01118.85
8.3.20.0070.00020.13
8.3.10.0040.00421.73
8.3.00.0030.00517.90
8.2.180.0040.01116.38
8.2.170.0110.00322.96
8.2.160.0070.01020.39
8.2.150.0030.00625.66
8.2.140.0080.00024.66
8.2.130.0030.00622.29
8.2.120.0080.00026.35
8.2.110.0100.00022.21
8.2.100.0110.00017.91
8.2.90.0000.00818.03
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0030.00617.68
8.2.50.0060.00318.10
8.2.40.0000.00822.27
8.2.30.0040.00421.16
8.2.20.0050.00218.17
8.2.10.0050.00218.19
8.2.00.0040.00418.19
8.1.280.0090.00625.92
8.1.270.0080.00023.83
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00322.25
8.1.230.0090.00320.97
8.1.220.0080.00017.79
8.1.210.0040.00418.80
8.1.200.0060.00317.35
8.1.190.0100.00017.22
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0040.00419.03
8.1.150.0080.00020.67
8.1.140.0070.00019.64
8.1.130.0000.00718.89
8.1.120.0000.00717.48
8.1.110.0040.00417.52
8.1.100.0050.00217.36
8.1.90.0000.00717.31
8.1.80.0060.00317.50
8.1.70.0000.00717.47
8.1.60.0090.00017.60
8.1.50.0070.00017.42
8.1.40.0040.00417.49
8.1.30.0030.00617.58
8.1.20.0030.00517.64
8.1.10.0030.00617.59
8.1.00.0040.00417.50
8.0.300.0040.00419.98
8.0.290.0050.00216.63
8.0.280.0030.00518.52
8.0.270.0050.00217.24
8.0.260.0000.00616.75
8.0.250.0040.00416.99
8.0.240.0060.00316.91
8.0.230.0030.00316.98
8.0.220.0000.00616.95
8.0.210.0000.00716.93
8.0.200.0000.00617.00
8.0.190.0090.00016.86
8.0.180.0000.00716.88
8.0.170.0040.00416.82
8.0.160.0000.00716.82
8.0.150.0040.00416.80
8.0.140.0040.00416.85
8.0.130.0060.00013.30
8.0.120.0020.00516.95
8.0.110.0000.00716.90
8.0.100.0040.00416.82
8.0.90.0000.00716.85
8.0.80.0060.01016.96
8.0.70.0060.00316.79
8.0.60.0030.00516.95
8.0.50.0000.00816.96
8.0.30.0080.01017.27
8.0.20.0110.01017.40
8.0.10.0040.00417.09
8.0.00.0040.01616.89
7.4.330.0020.00215.55
7.4.320.0070.00016.50
7.4.300.0000.00716.51
7.4.290.0030.00316.61
7.4.280.0070.00016.52
7.4.270.0030.00316.62
7.4.260.0060.00013.23
7.4.250.0070.00016.56
7.4.240.0040.00416.41
7.4.230.0070.00016.69
7.4.220.0090.00916.52
7.4.210.0070.00716.65
7.4.200.0030.00316.33
7.4.160.0050.01216.46
7.4.150.0090.00817.40
7.4.140.0090.01017.86
7.4.130.0100.00716.60
7.4.120.0060.01116.49
7.4.110.0170.00316.50
7.4.100.0110.00616.66
7.4.90.0060.01216.36
7.4.80.0070.01119.39
7.4.70.0110.00616.60
7.4.60.0130.00316.55
7.4.50.0060.01116.38
7.4.40.0110.00616.63
7.4.30.0110.00616.45
7.4.00.0100.00614.91
7.3.330.0000.00613.37
7.3.320.0000.00613.30
7.3.310.0070.00016.36
7.3.300.0030.00316.30
7.3.290.0050.00916.27
7.3.280.0070.00916.28
7.3.270.0110.00617.40
7.3.260.0080.00816.44
7.3.250.0140.00516.38
7.3.240.0120.00816.39
7.3.230.0120.01416.30
7.3.210.0100.00716.52
7.3.200.0120.00416.30
7.3.190.0120.00416.44
7.3.180.0070.01016.50
7.3.170.0030.01316.47
7.3.160.0130.01016.47
7.2.330.0030.01616.75
7.2.320.0150.00316.80
7.2.310.0000.02116.80
7.2.300.0090.00916.70
7.2.290.0170.00416.43
7.2.60.0070.00716.71
7.2.00.0100.00319.53
7.1.200.0070.00315.91
7.1.100.0070.00718.41
7.1.70.3170.01714.96
7.1.60.3300.02733.16
7.1.50.3170.01732.98
7.1.40.2430.01732.59
7.1.30.3570.01032.65
7.1.20.3030.02032.44
7.1.10.2970.01014.49
7.1.00.3700.01714.64
7.0.200.4200.01014.65
7.0.190.3670.00714.53
7.0.180.2730.01314.32
7.0.170.3900.01014.47
7.0.160.4000.02014.32
7.0.150.2730.01314.64
7.0.140.4030.01314.40
7.0.130.3670.00314.44
7.0.120.3370.01014.63
7.0.110.3130.01714.38
7.0.100.2930.00714.39
7.0.90.2730.01314.36
7.0.80.2130.01014.58
7.0.70.2600.01014.44
7.0.60.1930.01714.15
7.0.50.2630.01314.62
7.0.40.2470.01314.66
7.0.30.2970.01014.84
7.0.20.2530.00014.64
7.0.10.2370.00714.61
7.0.00.2100.00714.48

preferences:
39.08 ms | 400 KiB | 5 Q