3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $has_many = "Post"; public function has_many($a){ return 'hola'; } function get_relationship($model) { $class = new ReflectionClass($this); $staticProperties = $class->getStaticProperties(); foreach($staticProperties as $propertyName => $value) { if(preg_match('/^(has_many|age)$/', $propertyName) && $value == $model) { return $this->{$propertyName}($model); } } } function __get($name) { if(substr($name, -strlen('_set')) === '_set') { $model = ucwords(substr($name, 4)); return $this->get_relationship($model); } } } echo substr('post_set', -strlen('_set')); $foo = new Foo; echo $foo->post_set; ?>

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)
8.3.60.0080.00816.75
8.3.50.0210.00516.43
8.3.40.0090.01218.87
8.3.30.0120.00318.92
8.3.20.0080.00018.91
8.3.10.0090.00018.83
8.3.00.0080.00019.50
8.2.180.0130.00917.00
8.2.170.0070.00722.96
8.2.160.0110.00721.16
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00818.81
8.2.110.0060.00621.18
8.2.100.0110.00018.03
8.2.90.0050.00519.30
8.2.80.0020.00519.25
8.2.70.0060.00317.75
8.2.60.0040.00417.68
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0020.00518.16
8.2.20.0000.00917.94
8.2.10.0070.00017.91
8.2.00.0030.00617.94
8.1.280.0060.01225.92
8.1.270.0040.00424.66
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0070.00420.70
8.1.230.0060.00620.97
8.1.220.0050.00317.79
8.1.210.0000.00818.90
8.1.200.0040.00417.48
8.1.190.0060.00317.52
8.1.180.0000.00818.10
8.1.170.0080.00018.89
8.1.160.0040.00418.98
8.1.150.0040.00418.66
8.1.140.0040.00417.62
8.1.130.0070.00017.74
8.1.120.0040.00317.66
8.1.110.0030.00617.61
8.1.100.0050.00217.49
8.1.90.0050.00317.66
8.1.80.0070.00017.63
8.1.70.0070.00017.55
8.1.60.0000.00817.64
8.1.50.0040.00417.55
8.1.40.0080.00017.60
8.1.30.0040.00417.67
8.1.20.0060.00317.79
8.1.10.0040.00417.76
8.1.00.0000.00817.70
8.0.300.0000.00720.03
8.0.290.0070.00016.75
8.0.280.0000.00718.40
8.0.270.0030.00317.29
8.0.260.0070.00017.05
8.0.250.0040.00417.07
8.0.240.0000.00717.11
8.0.230.0030.00317.13
8.0.220.0050.00317.04
8.0.210.0000.00717.08
8.0.200.0030.00317.13
8.0.190.0000.01117.08
8.0.180.0050.00216.97
8.0.170.0070.00316.96
8.0.160.0000.00717.13
8.0.150.0070.00317.04
8.0.140.0030.00617.01
8.0.130.0000.00613.54
8.0.120.0030.00516.93
8.0.110.0050.00216.92
8.0.100.0070.00017.04
8.0.90.0000.00716.90
8.0.80.0090.00617.02
8.0.70.0000.00816.94
8.0.60.0070.00016.92
8.0.50.0000.00817.16
8.0.30.0140.00717.52
8.0.20.0130.00717.24
8.0.10.0040.00417.13
8.0.00.0080.01117.04
7.4.330.0050.00013.23
7.4.320.0000.00716.80
7.4.300.0000.00716.73
7.4.290.0000.00616.84
7.4.280.0000.00816.73
7.4.270.0040.00416.86
7.4.260.0060.00013.51
7.4.250.0080.00016.65
7.4.240.0040.00316.75
7.4.230.0040.00416.95
7.4.220.0030.01516.83
7.4.210.0070.00816.84
7.4.200.0040.00416.74
7.4.190.0000.00716.69
7.4.160.0120.01216.91
7.4.150.0100.00716.60
7.4.140.0050.01216.68
7.4.130.0120.00716.66
7.4.120.0100.00716.77
7.4.110.0100.01316.66
7.4.100.0110.01116.75
7.4.90.0090.00916.84
7.4.80.0070.01019.39
7.4.70.0070.01316.69
7.4.60.0040.01416.77
7.4.50.0080.00416.71
7.4.40.0000.01016.61
7.4.30.0050.01416.81
7.4.00.0050.01114.98
7.3.330.0030.00313.38
7.3.320.0000.00613.46
7.3.310.0000.00716.28
7.3.300.0030.00316.46
7.3.290.0090.00916.47
7.3.280.0090.00916.46
7.3.270.0100.00716.59
7.3.260.0030.01516.72
7.3.250.0120.00816.81
7.3.240.0120.00616.50
7.3.230.0070.01416.83
7.3.210.0130.00316.90
7.3.200.0060.01016.60
7.3.190.0110.01116.82
7.3.180.0140.00516.83
7.3.170.0120.00316.55
7.3.160.0190.02516.76
7.3.120.0070.01015.17
7.3.110.0040.01514.95
7.3.100.0100.00315.13
7.3.90.0090.00014.75
7.3.80.0070.00715.29
7.3.70.0090.00314.77
7.3.60.0060.00314.96
7.3.50.0100.01014.76
7.3.40.0070.01014.95
7.3.30.0000.01414.99
7.3.20.0070.00716.70
7.3.10.0030.01017.04
7.3.00.0000.01016.71
7.2.330.0090.00916.92
7.2.320.0160.00716.89
7.2.310.0170.00716.89
7.2.300.0130.00316.93
7.2.290.0130.00316.96
7.2.250.0070.01115.29
7.2.240.0030.01614.88
7.2.230.0040.00815.21
7.2.220.0070.00715.42
7.2.210.0130.00315.36
7.2.200.0060.00914.99
7.2.190.0070.01015.14
7.2.180.0070.01114.97
7.2.170.0000.01914.82
7.2.00.0100.00319.64
7.1.330.0120.00316.01
7.1.320.0070.00715.92
7.1.310.0120.00315.89
7.1.300.0090.00616.15
7.1.290.0060.01215.89
7.1.280.0070.00715.95
7.1.270.0070.00416.00
7.1.260.0090.00616.11
7.1.70.0040.00417.30
7.1.60.0040.02119.40
7.1.50.0100.01017.22
7.1.00.0000.04722.53
7.0.200.0040.00416.64
7.0.140.0030.07321.99
7.0.120.0030.07322.05
7.0.110.0070.05019.89
7.0.100.0030.08319.99
7.0.90.0070.07719.97
7.0.80.0030.09019.96
7.0.70.0100.08019.92
7.0.60.0070.08320.05
7.0.50.0100.08020.50
7.0.40.0030.08320.09
7.0.30.0100.08020.19
7.0.20.0100.05020.27
7.0.10.0070.08320.21
7.0.00.0070.07020.11
5.6.260.0030.04320.75
5.6.250.0100.07720.66
5.6.240.0030.08320.71
5.6.230.0070.08720.67
5.6.220.0030.06020.55
5.6.210.0130.06720.59
5.6.200.0030.07721.28
5.6.190.0070.05721.20
5.6.180.0100.07321.30
5.6.170.0070.08320.95
5.6.160.0130.08021.09
5.6.150.0130.07720.94
5.6.140.0100.06020.94
5.6.130.0070.07720.99
5.6.120.0070.08321.10
5.6.110.0100.06721.20
5.6.100.0170.06721.07
5.6.90.0100.08021.10
5.6.80.0100.08020.48
5.6.70.0130.07320.57
5.6.60.0130.06720.66
5.6.50.0100.05720.51
5.6.40.0200.07320.50
5.6.30.0100.07020.50
5.6.20.0130.07320.43
5.6.10.0130.04320.57
5.6.00.0030.07320.56
5.5.380.0130.07020.39
5.5.370.0130.08020.55
5.5.360.0130.07320.23
5.5.350.0130.03320.16
5.5.340.0130.07720.82
5.5.330.0170.04720.96
5.5.320.0030.06020.82
5.5.310.0030.09020.88
5.5.300.0130.07321.05
5.5.290.0070.06320.82
5.5.280.0030.05320.85
5.5.270.0100.08320.99
5.5.260.0070.08720.88
5.5.250.0100.07320.80
5.5.240.0070.08020.30
5.5.230.0030.07720.37
5.5.220.0070.07320.27
5.5.210.0100.07320.16
5.5.200.0070.08020.38
5.5.190.0070.07720.32
5.5.180.0200.06720.06
5.5.160.0070.08020.34
5.5.150.0100.06720.20
5.5.140.0130.04020.31
5.5.130.0030.08320.18
5.5.120.0030.05720.05
5.5.110.0100.08320.05
5.5.100.0130.07020.29
5.5.90.0170.03720.15
5.5.80.0070.04319.99
5.5.70.0000.08020.04
5.5.60.0070.08019.98
5.5.50.0070.08320.20
5.5.40.0100.07020.10
5.5.30.0070.07020.15
5.5.20.0170.06720.02
5.5.10.0100.07020.12
5.5.00.0070.07719.95
5.4.450.0100.08019.34
5.4.440.0100.07319.34
5.4.430.0100.07319.48
5.4.420.0070.08019.50
5.4.410.0070.04719.14
5.4.400.0070.07718.99
5.4.390.0070.06719.02
5.4.380.0030.06718.93
5.4.370.0070.08719.00
5.4.360.0000.08319.11
5.4.350.0170.03318.97
5.4.340.0170.06719.04
5.4.320.0030.08019.04
5.4.310.0030.06719.14
5.4.300.0070.07719.09
5.4.290.0130.06719.00
5.4.280.0100.07319.19
5.4.270.0030.08019.33
5.4.260.0070.07719.01
5.4.250.0170.06319.08
5.4.240.0070.06719.10
5.4.230.0130.06019.33
5.4.220.0000.04019.30
5.4.210.0030.03319.00
5.4.200.0070.07719.02
5.4.190.0070.07319.16
5.4.180.0070.07019.02
5.4.170.0030.08319.32
5.4.160.0030.06019.14
5.4.150.0100.07319.31
5.4.140.0000.08016.43
5.4.130.0030.07716.59
5.4.120.0100.06716.62
5.4.110.0100.04316.43
5.4.100.0200.06716.55
5.4.90.0170.06316.48
5.4.80.0030.07716.51
5.4.70.0130.07016.35
5.4.60.0070.07316.40
5.4.50.0130.05316.43
5.4.40.0070.07316.53
5.4.30.0070.07316.58
5.4.20.0100.06716.28
5.4.10.0070.07316.38
5.4.00.0030.07715.73
5.3.290.0030.04014.68
5.3.280.0070.08014.61
5.3.270.0070.06314.48
5.3.260.0130.07014.66
5.3.250.0100.07314.76
5.3.240.0000.07314.64
5.3.230.0030.08014.61
5.3.220.0100.07314.57
5.3.210.0070.07714.60
5.3.200.0000.04714.71
5.3.190.0070.07714.66
5.3.180.0070.08014.61
5.3.170.0200.06314.58
5.3.160.0030.08014.70
5.3.150.0030.05714.58
5.3.140.0070.07014.54
5.3.130.0070.04314.56
5.3.120.0130.06714.55
5.3.110.0100.07314.69
5.3.100.0000.08014.04
5.3.90.0200.05713.99
5.3.80.0030.07014.25
5.3.70.0030.07314.05
5.3.60.0100.06314.09
5.3.50.0000.07713.97
5.3.40.0000.08013.96
5.3.30.0030.07713.95
5.3.20.0070.06013.71
5.3.10.0100.06313.81
5.3.00.0100.03713.63
5.2.170.0030.05711.92
5.2.160.0130.05011.92
5.2.150.0030.03711.92
5.2.140.0130.04011.92
5.2.130.0100.05311.92
5.2.120.0030.06011.92
5.2.110.0100.05311.92
5.2.100.0070.06011.92
5.2.90.0070.06011.92
5.2.80.0070.05311.92
5.2.70.0030.06311.92
5.2.60.0100.06011.92
5.2.50.0100.06011.92
5.2.40.0030.06711.92
5.2.30.0100.05311.92
5.2.20.0000.06311.92
5.2.10.0030.06711.92
5.2.00.0100.05711.92
5.1.60.0030.05311.92
5.1.50.0030.03011.92
5.1.40.0030.06011.92
5.1.30.0030.03311.92
5.1.20.0000.06011.92
5.1.10.0030.05711.92
5.1.00.0070.05011.92
5.0.50.0000.04311.92
5.0.40.0070.03711.92
5.0.30.0070.06711.92
5.0.20.0130.03311.92
5.0.10.0070.03011.92
5.0.00.0030.05711.92
4.4.90.0000.03311.92
4.4.80.0000.03711.92
4.4.70.0000.04011.92
4.4.60.0070.02011.92
4.4.50.0130.02711.92
4.4.40.0000.05311.92
4.4.30.0100.03011.92
4.4.20.0070.03011.92
4.4.10.0070.03311.92
4.4.00.0000.05311.92
4.3.110.0030.02711.92
4.3.100.0000.03711.92
4.3.90.0000.03311.92
4.3.80.0070.05011.92
4.3.70.0030.03311.92
4.3.60.0030.01711.92
4.3.50.0000.03711.92
4.3.40.0070.04011.92
4.3.30.0100.02711.92
4.3.20.0000.03711.92
4.3.10.0070.02311.92
4.3.00.0030.03311.92

preferences:
43.87 ms | 401 KiB | 5 Q