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.2.00.0060.00919.33
7.1.70.0060.01217.31
7.1.60.0160.01019.82
7.1.50.0040.01917.07
7.1.00.0030.07322.40
7.0.200.0000.01116.61
7.0.140.0170.06022.03
7.0.100.0570.07321.21
7.0.90.0600.08021.26
7.0.80.0030.08321.14
7.0.70.0200.06321.13
7.0.60.0070.08321.29
7.0.50.0130.07321.47
7.0.40.0130.07020.18
7.0.30.0100.04720.11
7.0.20.0070.04320.25
7.0.10.0130.03320.10
7.0.00.0170.06320.16
5.6.280.0070.07022.39
5.6.250.0070.07721.93
5.6.240.0070.08321.90
5.6.230.0130.06721.96
5.6.220.0100.08321.82
5.6.210.0070.06321.92
5.6.200.0100.08022.27
5.6.190.0070.08322.38
5.6.180.0030.06722.33
5.6.170.0000.04722.26
5.6.160.0030.05022.35
5.6.150.0100.04322.26
5.6.140.0170.03722.31
5.6.130.0070.06022.30
5.6.120.0030.03722.41
5.6.110.0000.04022.41
5.6.100.0030.04322.20
5.6.90.0070.07022.32
5.6.80.0030.04721.71
5.6.70.0030.04021.64
5.6.60.0000.04321.70
5.6.50.0030.04321.86
5.6.40.0070.03721.67
5.6.30.0030.04321.72
5.6.20.0030.04021.61
5.6.10.0030.04021.57
5.6.00.0000.04721.69
5.5.380.0200.05721.70
5.5.370.0070.08721.87
5.5.360.0030.06021.72
5.5.350.0170.07721.63
5.5.340.0100.07722.22
5.5.330.0130.09022.20
5.5.320.0070.04322.11
5.5.310.0030.04322.10
5.5.300.0100.04322.11
5.5.290.0030.06022.18
5.5.280.0100.03722.13
5.5.270.0000.05322.05
5.5.260.0070.04022.02
5.5.250.0030.04322.04
5.5.240.0070.03721.50
5.5.230.0070.04021.50
5.5.220.0030.04021.41
5.5.210.0100.03321.50
5.5.200.0070.04021.53
5.5.190.0070.03721.52
5.5.180.0070.05021.52
5.5.160.0030.07721.53
5.5.150.0030.03721.57
5.5.140.0070.03721.48
5.5.130.0070.04321.55
5.5.120.0070.04021.41
5.5.110.0000.04321.57
5.5.100.0100.05321.45
5.5.90.0000.04721.40
5.5.80.0000.04721.40
5.5.70.0030.04721.23
5.5.60.0000.06721.23
5.5.50.0000.07721.34
5.5.40.0030.08321.35
5.5.30.0100.07321.44
5.5.20.0130.07721.23
5.5.10.0100.08021.28
5.5.00.0070.08021.24
5.4.450.0100.03320.58
5.4.440.0100.03720.59
5.4.430.0070.04020.44
5.4.420.0030.04020.77
5.4.410.0030.04320.29
5.4.400.0000.07320.23
5.4.390.0030.04020.41
5.4.380.0030.04020.22
5.4.370.0100.03320.33
5.4.360.0030.04020.09
5.4.350.0070.05720.25
5.4.340.0000.04320.26
5.4.320.0000.04320.28
5.4.310.0000.04020.23
5.4.300.0030.03720.25
5.4.290.0100.03320.32
5.4.280.0070.03720.23
5.4.270.0030.04720.25
5.4.260.0130.03720.25
5.4.250.0070.05020.25
5.4.240.0000.04320.32
5.4.230.0100.05720.41
5.4.220.0100.03320.23
5.4.210.0070.07320.33
5.4.200.0100.07720.38
5.4.190.0070.07720.32
5.4.180.0130.06720.33
5.4.170.0030.07020.12
5.4.160.0100.06720.28
5.4.150.0070.06020.23
5.4.140.0030.06017.64
5.4.130.0100.07317.65
5.4.120.0070.07317.58
5.4.110.0130.07717.64
5.4.100.0170.06017.63
5.4.90.0130.06717.66
5.4.80.0070.07017.57
5.4.70.0130.06717.61
5.4.60.0030.08017.58
5.4.50.0070.07317.75
5.4.40.0030.07317.67
5.4.30.0100.07717.67
5.4.20.0130.07017.69
5.4.10.0130.06317.57
5.4.00.0030.05016.98
5.3.290.0100.03316.16
5.3.280.0030.03716.09
5.3.270.0100.06016.21
5.3.260.0030.05716.19
5.3.250.0100.07716.18
5.3.240.0100.08016.12
5.3.230.0070.08016.02
5.3.220.0170.07316.03
5.3.210.0130.04316.03
5.3.200.0030.08016.07
5.3.190.0200.06716.05
5.3.180.0130.07316.14
5.3.170.0100.07716.02
5.3.160.0130.05016.17
5.3.150.0070.04715.96
5.3.140.0070.08016.02
5.3.130.0070.07715.98
5.3.120.0030.08316.14
5.3.110.0170.06715.97
5.3.100.0070.08015.57
5.3.90.0030.08315.55
5.3.80.0100.07015.37
5.3.70.0070.08015.50
5.3.60.0070.07315.54
5.3.50.0070.08315.48
5.3.40.0100.07015.36
5.3.30.0070.07715.44
5.3.20.0030.07315.12
5.3.10.0170.06715.18
5.3.00.0070.04715.06
5.2.170.0000.06311.57
5.2.160.0070.04711.57
5.2.150.0030.04011.57
5.2.140.0030.05011.57
5.2.130.0030.05711.57
5.2.120.0100.05311.57
5.2.110.0000.06011.57
5.2.100.0030.06011.57
5.2.90.0070.05711.57
5.2.80.0000.06011.57
5.2.70.0130.05311.57
5.2.60.0030.05711.57
5.2.50.0030.06011.57
5.2.40.0100.05711.57
5.2.30.0070.06011.57
5.2.20.0100.05311.57
5.2.10.0030.06311.57
5.2.00.0070.05311.57
5.1.60.0000.06011.57
5.1.50.0100.04711.57
5.1.40.0030.03011.57
5.1.30.0070.05711.57
5.1.20.0070.05711.57
5.1.10.0000.03011.57
5.1.00.0100.04711.57
5.0.50.0100.03011.57
5.0.40.0030.04311.57
5.0.30.0030.06011.57
5.0.20.0030.04311.57
5.0.10.0070.04011.57
5.0.00.0000.04311.57
4.4.90.0000.04011.57
4.4.80.0000.03711.57
4.4.70.0030.02711.57
4.4.60.0030.03011.57
4.4.50.0030.03011.57
4.4.40.0070.04711.57
4.4.30.0030.03011.57
4.4.20.0030.03311.57
4.4.10.0000.04011.57
4.4.00.0000.05711.57
4.3.110.0000.03011.57
4.3.100.0030.03311.57
4.3.90.0170.00711.57
4.3.80.0070.04711.57
4.3.70.0000.02011.57
4.3.60.0000.03711.57
4.3.50.0100.03011.57
4.3.40.0070.04011.57
4.3.30.0070.03311.57
4.3.20.0030.03311.57
4.3.10.0030.02711.57
4.3.00.0030.03311.57

preferences:
34.79 ms | 401 KiB | 5 Q