3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; private $baz; public function __construct($bar, $baz) { $this->bar = $bar; $this->baz = $baz; } } $foo = new Foo('hello','word'); $json = json_encode($foo); echo $json; $serialize = serialize($foo); echo $serialize; var_dump( json_decode($json) ); var_dump( deserialize($serialize) );
based on sn8JQ

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.2.80.0100.00316.52
7.2.60.0070.01016.68
7.2.00.0000.01419.20
7.1.200.0080.00415.74
7.1.100.0060.00918.07
7.1.70.0040.00417.32
7.1.60.0160.01020.03
7.1.50.0110.01117.01
7.1.00.0070.07322.54
7.0.200.0110.00014.53
7.0.90.0530.05719.93
7.0.80.0470.04320.08
7.0.70.0600.07719.80
7.0.60.0630.07719.88
7.0.50.0500.07020.23
7.0.40.0130.06020.13
7.0.30.0070.04320.10
7.0.20.0100.05720.18
7.0.10.0070.04720.10
7.0.00.0030.04320.10
5.6.280.0000.07321.02
5.6.240.0170.04320.50
5.6.230.0170.07020.52
5.6.220.0130.08020.61
5.6.210.0070.07320.55
5.6.200.0170.07021.05
5.6.190.0070.04721.05
5.6.180.0100.06321.11
5.6.170.0070.08020.93
5.6.160.0100.05021.02
5.6.150.0070.03721.11
5.6.140.0000.04721.06
5.6.130.0070.03321.02
5.6.120.0070.04021.03
5.6.110.0070.03320.94
5.6.100.0030.05020.95
5.6.90.0000.04720.86
5.6.80.0030.03720.40
5.6.70.0030.05320.34
5.6.60.0070.03320.54
5.6.50.0070.03320.52
5.6.40.0100.06320.39
5.6.30.0070.03720.41
5.6.20.0030.04020.43
5.6.10.0100.03320.43
5.6.00.0070.05020.30
5.5.380.0070.08720.31
5.5.370.0070.04720.46
5.5.360.0030.08720.50
5.5.350.0170.07720.42
5.5.340.0170.07720.92
5.5.330.0170.05720.89
5.5.320.0100.03720.88
5.5.310.0070.04720.80
5.5.300.0030.04020.78
5.5.290.0070.05320.91
5.5.280.0030.04320.90
5.5.270.0130.03320.89
5.5.260.0100.07720.76
5.5.250.0030.04320.70
5.5.240.0000.04320.22
5.5.230.0030.04320.30
5.5.220.0130.06020.27
5.5.210.0130.03020.11
5.5.200.0070.05020.21
5.5.190.0170.06020.23
5.5.180.0000.04320.11
5.5.160.0000.05720.13
5.5.150.0070.03720.17
5.5.140.0070.03320.18
5.5.130.0070.06720.11
5.5.120.0070.04020.14
5.5.110.0100.05320.18
5.5.100.0070.03720.10
5.5.90.0130.06020.15
5.5.80.0000.05020.16
5.5.70.0100.03320.07
5.5.60.0000.05320.09
5.5.50.0100.07020.15
5.5.40.0030.04020.04
5.5.30.0170.06319.96
5.5.20.0070.06720.14
5.5.10.0070.05720.13
5.5.00.0070.08320.10
5.4.450.0030.06719.43
5.4.440.0030.05719.50
5.4.430.0200.06719.48
5.4.420.0030.03719.45
5.4.410.0000.04319.24
5.4.400.0130.06319.14
5.4.390.0030.03719.05
5.4.380.0070.03319.12
5.4.370.0030.03719.18
5.4.360.0070.03719.21
5.4.350.0000.06718.88
5.4.340.0030.03719.02
5.4.320.0070.04319.03
5.4.310.0000.04319.03
5.4.300.0100.06319.14
5.4.290.0030.03719.04
5.4.280.0000.04019.04
5.4.270.0130.02318.90
5.4.260.0100.03018.94
5.4.250.0070.04019.11
5.4.240.0100.06018.87
5.4.230.0100.05319.17
5.4.220.0100.03319.15
5.4.210.0070.06319.04
5.4.200.0070.07718.87
5.4.190.0130.06719.03
5.4.180.0170.06319.02
5.4.170.0130.05719.11
5.4.160.0130.05319.13
5.4.150.0100.07319.21
5.4.140.0070.04716.50
5.4.130.0070.08016.29
5.4.120.0030.07316.28
5.4.110.0030.07016.50
5.4.100.0100.05716.43
5.4.90.0070.07716.36
5.4.80.0100.07016.47
5.4.70.0070.07316.50
5.4.60.0030.07316.25
5.4.50.0070.07716.30
5.4.40.0130.04716.49
5.4.30.0030.06716.55
5.4.20.0070.04316.44
5.4.10.0170.05316.36
5.4.00.0070.04015.84