3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $x; public function __construct($self) { $this->x = $self; } } Class Bar { static function create(){ $b = new Bar(); $b->f = new Foo($b->get()); } function get(){ $self = $this; return function() use ($self) {return $self;}; } } echo memory_get_usage(), "\n"; for ($i = 0; $i < 1000; ++$i) { Bar::create(); } echo gc_collect_cycles() . "\n"; echo memory_get_usage(), "\n";

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)
7.4.00.0130.00616.05
7.3.120.0000.01815.95
7.3.110.0120.00915.94
7.3.100.0070.01015.99
7.3.90.0070.01115.91
7.3.80.0070.01016.21
7.3.70.0030.00916.05
7.3.60.0000.01816.07
7.3.50.0000.01215.98
7.3.40.0090.00915.94
7.3.30.0040.01215.75
7.3.20.0060.01016.74
7.3.10.0070.01016.76
7.3.00.0000.01416.56
7.2.250.0060.01315.87
7.2.240.0120.00616.38
7.2.230.0000.01116.14
7.2.220.0100.01016.17
7.2.210.0090.00915.80
7.2.200.0100.01016.30
7.2.190.0110.00616.37
7.2.180.0120.00616.26
7.2.170.0140.00716.40
7.2.00.0000.01719.47
7.1.330.0040.01516.00
7.1.320.0040.01216.04
7.1.310.0060.01015.65
7.1.300.0070.00315.68
7.1.290.0000.01915.77
7.1.280.0060.01215.93
7.1.270.0070.00415.70
7.1.260.0000.01415.96
7.1.70.0000.01017.28
7.1.60.0160.00319.32
7.1.50.0060.00616.99
7.1.00.0000.08022.49
7.0.200.0080.00316.76
7.0.140.0000.08022.28
7.0.60.0030.06321.24
7.0.50.0000.04319.12
7.0.40.0170.05020.15
7.0.30.0200.04720.11
7.0.20.0430.04720.06
7.0.10.0030.08720.26
7.0.00.0070.08720.07
5.6.280.0070.07022.44
5.6.210.0070.08021.96
5.6.200.0030.07019.45
5.6.190.0070.05021.71
5.6.180.0300.06721.64
5.6.170.0200.04021.62
5.6.160.0130.08021.64
5.6.150.0100.07719.43
5.6.140.0070.04319.29
5.6.130.0100.08019.43
5.6.120.0070.07722.26
5.6.110.0070.07322.18
5.6.100.0130.07022.30
5.6.90.0070.04022.40
5.6.80.0200.06321.58
5.5.350.3900.04021.68
5.5.340.0070.07019.24
5.5.330.0130.03321.52
5.5.320.0370.06021.55
5.5.310.0330.04321.43
5.5.300.0070.05719.22
5.5.290.0100.04019.24
5.5.280.0200.04722.18
5.5.270.0070.06021.97
5.5.260.0030.04322.27
5.5.250.0070.04321.98
5.5.240.0170.07021.38
5.4.450.0170.05320.88
5.4.440.0270.03320.62
5.4.430.0200.05020.54
5.4.420.0270.03720.77
5.4.410.0270.03020.51
5.4.400.0230.03720.47
5.4.390.0300.04320.36
5.4.380.0230.06020.18
5.4.370.0200.05020.31
5.4.360.0270.04720.36
5.4.350.0270.07020.18
5.4.340.0170.04320.32
5.4.320.0270.07720.23
5.4.310.0330.05720.54
5.4.300.0370.07020.32
5.4.290.0300.07720.21
5.4.280.0330.05320.11
5.4.270.0230.05320.35
5.4.260.0270.03720.32
5.4.250.0370.05720.46
5.4.240.0200.07020.29
5.4.230.0270.05720.27
5.4.220.0300.05020.26
5.4.210.0430.06320.21
5.4.200.0330.04320.35
5.4.190.0270.04020.28
5.4.180.0270.07320.31
5.4.170.0330.07720.53
5.4.160.0200.04320.30
5.4.150.0270.08020.08
5.4.140.0370.06717.59
5.4.130.0330.06717.54
5.4.120.0300.04317.73
5.4.110.0300.07017.72
5.4.100.0270.03717.86
5.4.90.0330.07017.69
5.4.80.0300.03717.73
5.4.70.0330.06017.67
5.4.60.0300.06317.70
5.4.50.0330.05017.53
5.4.40.0300.05717.80
5.4.30.0270.03717.66
5.4.20.0300.07017.51
5.4.10.0270.06317.69
5.4.00.0270.04017.09
5.3.290.0370.07316.04
5.3.280.0270.08716.08
5.3.270.0270.07716.01
5.3.260.0200.05316.14
5.3.250.0330.07316.03
5.3.240.0300.07016.09
5.3.230.0330.07016.18
5.3.220.0330.06316.00
5.3.210.0230.04716.14
5.3.200.0330.06716.04
5.3.190.0270.04316.11
5.3.180.0170.05016.04
5.3.170.0270.04715.96
5.3.160.0300.07016.06
5.3.150.0230.06716.05
5.3.140.0330.03316.05
5.3.130.0270.07716.05
5.3.120.0300.05016.17
5.3.110.0230.06716.05
5.3.100.0270.04715.53
5.3.90.0300.04715.42
5.3.80.0200.05315.44
5.3.70.0230.06715.46
5.3.60.0330.06715.56
5.3.50.0230.04315.38
5.3.40.0330.07015.47
5.3.30.0230.04315.28
5.3.20.0330.04315.12
5.3.10.0230.05315.06
5.3.00.0300.06715.14
5.2.170.0270.02711.10
5.2.160.0200.02711.05
5.2.150.0200.04011.08
5.2.140.0270.04711.30
5.2.130.0230.03010.97
5.2.120.0200.04011.03
5.2.110.0330.02311.04
5.2.100.0270.05311.19
5.2.90.0200.04311.12
5.2.80.0230.03311.11
5.2.70.0230.03311.03
5.2.60.0330.05311.14
5.2.50.0300.03011.09
5.2.40.0130.03011.21
5.2.30.0170.03310.88
5.2.20.0170.04711.08
5.2.10.0170.04710.80
5.2.00.0170.04710.95
5.1.60.0170.0409.94
5.1.50.0170.05310.13
5.1.40.0200.03010.21
5.1.30.0230.03310.28
5.1.20.0200.02710.28
5.1.10.0270.05010.05
5.1.00.0200.03310.05
5.0.50.0100.0379.94
5.0.40.0100.0309.94
5.0.30.0130.0579.94
5.0.20.0130.0309.94
5.0.10.0100.0209.94
5.0.00.0100.0379.94
4.4.90.0130.0139.94
4.4.80.0070.0339.94
4.4.70.0100.0179.94
4.4.60.0130.0309.94
4.4.50.0070.0309.94
4.4.40.0070.0279.94
4.4.30.0070.0179.94
4.4.20.0070.0239.94
4.4.10.0070.0379.94
4.4.00.0130.0479.94
4.3.110.0130.0339.94
4.3.100.0200.0279.94
4.3.90.0130.0309.94
4.3.80.0130.0479.94
4.3.70.0070.0279.94
4.3.60.0100.0279.94
4.3.50.0130.0339.94
4.3.40.0100.0509.94
4.3.30.0130.0179.94
4.3.20.0030.0239.94
4.3.10.0070.0179.94
4.3.00.0030.0309.94

preferences:
36.64 ms | 401 KiB | 5 Q