3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { protected $variable = array('test' => 'hello world!', 'another_test' => 'hello world?'); public function __construct($var) { var_dump($this->variable); // this is the whole array you defined initially $this->variable = $var; // here the $var ('testing contents') overwrites `variable` var_dump($var); // 'testing contents' var_dum($this->variable); // $this->variable is now the same as the argument passed in } } new Test('testing contents');
based on uackm

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0100.00316.60
7.3.00.0090.00616.25
7.2.130.0030.00916.94
7.2.120.0030.01316.79
7.2.110.0110.00416.96
7.2.100.0060.00916.98
7.2.90.0070.01016.89
7.2.80.0040.00716.75
7.2.70.0060.00316.70
7.2.60.0110.00316.68
7.2.50.0060.00316.96
7.2.40.0040.01116.78
7.2.30.0040.00817.02
7.2.20.0070.00316.89
7.2.10.0030.00816.98
7.2.00.0050.00818.11
7.1.250.0030.00615.70
7.1.200.0100.00315.78
7.1.100.0080.00418.36
7.1.70.0040.00717.09
7.1.60.0040.01819.27
7.1.50.0100.01316.63
7.1.00.0170.06022.54
7.0.200.0050.00316.45
7.0.60.0070.06319.91
7.0.50.0070.08317.83
7.0.40.0070.06320.13
7.0.30.0270.05320.14
7.0.20.0330.07320.06
7.0.10.0100.08720.23
7.0.00.0100.05320.07
5.6.280.0030.07021.03
5.6.210.0030.08020.53
5.6.200.0030.07018.14
5.6.190.0130.08020.57
5.6.180.3170.03720.47
5.6.170.0270.07320.57
5.6.160.0070.09020.47
5.6.150.0130.04718.12
5.6.140.0000.08718.27
5.6.130.0100.05018.18
5.6.120.0130.07021.13
5.6.110.0100.08321.11
5.6.100.0070.08321.14
5.6.90.0100.08321.13
5.6.80.0030.04020.50
5.6.70.4430.04020.40
5.5.350.0070.07720.33
5.5.340.0070.05017.99
5.5.330.0170.07020.13
5.5.320.0330.06720.31
5.5.310.0100.05020.19
5.5.300.0070.04018.08
5.5.290.0070.07717.97
5.5.280.0030.07320.90
5.5.270.0030.04720.98
5.5.260.0030.08720.88
5.5.250.0100.07020.77
5.5.240.0030.04720.07
5.4.450.0770.05319.38
5.4.440.0600.06319.59
5.4.430.0330.05719.29
5.4.420.0170.05019.63
5.4.410.0200.06019.07
5.4.400.0730.05319.28
5.4.390.0370.04719.15
5.4.380.0130.05019.36
5.4.370.0330.05019.05
5.4.360.0400.08018.84
5.4.350.0630.05019.21
5.4.340.0600.07319.28
5.4.320.0670.08719.27
5.4.310.0800.04718.86
5.4.300.0630.05719.03
5.4.290.0530.05718.97
5.4.280.0800.06019.27
5.4.270.0600.07319.12
5.4.260.0670.07019.14
5.4.250.0700.06719.25
5.4.240.0700.06319.27
5.4.230.0730.07018.99
5.4.220.0600.07719.22
5.4.210.0700.07019.26
5.4.200.0570.06319.11
5.4.190.0830.06319.25
5.4.180.0670.04719.24
5.4.170.0700.04719.21
5.4.160.0830.06019.26
5.4.150.0670.04719.38
5.4.140.0670.05316.56
5.4.130.0530.05016.43
5.4.120.0730.04716.31
5.4.110.0530.04316.19
5.4.100.0570.04716.62
5.4.90.0700.05016.61
5.4.80.0900.04716.41
5.4.70.0200.05016.53
5.4.60.0300.05716.26
5.4.50.0030.03316.48
5.4.40.0130.04016.36
5.4.30.0000.07016.50
5.4.20.0230.04316.51
5.3.290.4030.04014.58
5.3.280.3630.04014.60
5.3.270.3900.04714.69
5.3.260.3700.03314.52
5.3.250.3600.04014.75
5.3.240.0230.07314.52
5.3.230.3900.04014.52
5.3.220.3370.04014.64
5.3.210.0270.07714.68
5.3.200.0300.03714.71
5.3.190.0230.03314.79
5.3.180.0170.03714.56