3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Lock { function unlock() { $this->isLocked = false; echo 'You unlocked the Lock'."\n"; } function lock() { $this->isLocked = true; echo 'You locked the Lock'."\n"; } function isLocked() { return $this->isLocked; } } class Door { function __construct(Lock $lock) { $this->lock = $lock; $this->connectsTo = 'bedroom'."\n"; } function open() { if($this->lock->isLocked()) { echo 'Cannot open Door. It is locked.'."\n"; } else { echo 'You opened the Door connecting to: ', $this->connectsTo."\n"; } } } $lock = new Lock; $door = new Door($lock); $door->open(); $lock->unlock(); $door->open();

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.60.0040.01116.97
7.2.00.0040.01118.60
7.1.200.0060.00315.68
7.1.100.0000.01117.91
7.1.70.0030.00617.20
7.1.60.0100.01619.31
7.1.50.0040.01816.69
7.1.00.0000.04322.54
7.0.200.0190.00314.52
7.0.140.0000.07721.95
7.0.120.0100.07022.09
7.0.60.0070.08719.98
7.0.50.0030.05717.88
7.0.40.0070.05020.23
7.0.30.0430.03720.09
7.0.20.0300.07720.10
7.0.10.0400.07320.08
7.0.00.0100.08720.07
5.6.280.0070.07021.08
5.6.210.0030.06020.62
5.6.200.0100.05718.16
5.6.190.0070.04320.43
5.6.180.0200.04320.74
5.6.170.0330.07020.56
5.6.160.0000.04720.61
5.6.150.0170.04318.20
5.6.140.0030.08718.19
5.6.130.0130.07318.19
5.6.120.0030.08320.97
5.6.110.0130.08021.12
5.6.100.0070.06020.96
5.6.90.0170.06720.86
5.6.80.0100.06320.45
5.6.70.0330.06720.51
5.5.350.0230.06320.35
5.5.340.0030.04018.07
5.5.330.0200.07720.35
5.5.320.0100.06320.23
5.5.310.0400.06720.35
5.5.300.0070.04717.93
5.5.290.0030.04017.98
5.5.280.0070.06020.91
5.5.270.0070.04720.78
5.5.260.0130.07020.77
5.5.250.0100.07720.70
5.5.240.0070.08320.13
5.4.450.0030.07319.20
5.4.440.0030.06319.56
5.4.430.0170.06019.32
5.4.420.0100.06319.24
5.4.410.0100.03319.04
5.4.400.0130.07019.12
5.4.390.0030.08319.14
5.4.380.0030.06319.09
5.4.370.0000.07718.96
5.4.360.0130.07319.08
5.4.350.0100.07018.86
5.4.340.0030.06719.17
5.4.320.0070.07319.01
5.4.310.0070.07019.14
5.4.300.0030.04018.94
5.4.290.0170.05019.24
5.4.280.0100.06319.14
5.4.270.0070.08019.08
5.4.260.0070.07318.97
5.4.250.0070.07719.23
5.4.240.0200.05719.16
5.4.230.0030.04318.91
5.4.220.0070.07318.86
5.4.210.0070.07019.14
5.4.200.0100.07319.18
5.4.190.0030.04019.26
5.4.180.0100.06319.15
5.4.170.0030.06318.91
5.4.160.0030.07318.85
5.4.150.0070.03719.13
5.4.140.0030.06016.36
5.4.130.0070.03716.54
5.4.120.0100.07016.42
5.4.110.0100.03016.35
5.4.100.0100.05716.38
5.4.90.0130.03716.35
5.4.80.0070.03716.51
5.4.70.0030.05016.62
5.4.60.0000.04016.39
5.4.50.0030.03716.26
5.4.40.0030.08016.40
5.4.30.0030.07316.41
5.4.20.0100.06316.27
5.4.10.0030.04016.35
5.4.00.0000.04315.88
5.3.290.0070.05714.70
5.3.280.0130.06014.66
5.3.270.0030.08014.62
5.3.260.0030.05314.61
5.3.250.0100.04314.50
5.3.240.0000.04014.66
5.3.230.0030.04314.60
5.3.220.0070.03314.57
5.3.210.0200.03014.73
5.3.200.0170.06714.56
5.3.190.0030.04014.64
5.3.180.0030.05714.63
5.3.170.0070.08014.48
5.3.160.0030.04314.64
5.3.150.0000.05014.57
5.3.140.0100.05014.56
5.3.130.0070.06714.44
5.3.120.0070.05014.56
5.3.110.0100.03314.61
5.3.100.0170.04014.05
5.3.90.0100.06714.04
5.3.80.0070.03713.92
5.3.70.0000.04014.08
5.3.60.0100.07014.04
5.3.50.0030.06713.98
5.3.40.0070.04714.02
5.3.30.0070.06313.94
5.3.20.0000.05013.75
5.3.10.0070.07013.65
5.3.00.0030.04313.67
5.2.170.0000.05011.32
5.2.160.0000.06011.05
5.2.150.0070.06311.21
5.2.140.0100.05711.04
5.2.130.0070.05711.09
5.2.120.0070.05711.17
5.2.110.0030.06711.16
5.2.100.0000.03011.11
5.2.90.0130.02711.16
5.2.80.0030.03311.26
5.2.70.0030.04011.25
5.2.60.0000.06710.96
5.2.50.0070.05011.03
5.2.40.0000.04011.06
5.2.30.0000.03711.03
5.2.20.0030.06310.85
5.2.10.0000.04010.84
5.2.00.0130.04710.79
5.1.60.0030.0509.97
5.1.50.0000.05310.07
5.1.40.0000.0439.98
5.1.30.0030.04710.40
5.1.20.0030.05710.25
5.1.10.0030.06010.14
5.1.00.0100.05310.08
5.0.50.0070.0278.61
5.0.40.0030.0238.52
5.0.30.0100.0608.29
5.0.20.0070.0208.25
5.0.10.0000.0308.15
5.0.00.0000.0638.23
4.4.90.0130.0237.97
4.4.80.0000.0307.97
4.4.70.0030.0337.97
4.4.60.0070.0337.97
4.4.50.0030.0237.97
4.4.40.0030.0437.97
4.4.30.0070.0277.97
4.4.20.0000.0207.97
4.4.10.0030.0377.97
4.4.00.0000.0337.97
4.3.110.0000.0207.97
4.3.100.0030.0307.97
4.3.90.0030.0307.97
4.3.80.0000.0307.97
4.3.70.0070.0277.97
4.3.60.0070.0307.97
4.3.50.0030.0337.97
4.3.40.0000.0277.97
4.3.30.0000.0377.97
4.3.20.0000.0407.97
4.3.10.0030.0337.97
4.3.00.0070.0277.97