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($name, -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.0170.00318.68
8.3.50.0130.00622.17
8.3.40.0140.00318.92
8.3.30.0110.00420.34
8.3.20.0110.00420.21
8.3.10.0070.00321.89
8.3.00.0060.00322.46
8.2.180.0100.00617.00
8.2.170.0070.00722.96
8.2.160.0070.01022.41
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00421.00
8.2.110.0060.00322.22
8.2.100.0040.00818.09
8.2.90.0030.00519.17
8.2.80.0040.00417.97
8.2.70.0070.00317.88
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0060.00320.00
8.2.30.0000.01018.06
8.2.20.0050.00317.97
8.2.10.0000.00717.89
8.2.00.0100.00017.82
8.1.280.0100.01025.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.83
8.1.230.0070.00318.99
8.1.220.0040.00417.74
8.1.210.0080.00418.77
8.1.200.0060.00317.48
8.1.190.0050.00317.53
8.1.180.0000.00818.10
8.1.170.0000.00918.75
8.1.160.0080.00022.11
8.1.150.0040.00418.82
8.1.140.0000.00717.63
8.1.130.0000.00717.80
8.1.120.0000.00717.57
8.1.110.0070.00017.61
8.1.100.0000.00717.53
8.1.90.0070.00017.64
8.1.80.0050.00217.64
8.1.70.0070.00017.56
8.1.60.0060.00317.77
8.1.50.0000.00817.70
8.1.40.0050.00317.59
8.1.30.0040.00417.70
8.1.20.0030.00617.81
8.1.10.0060.00317.68
8.1.00.0000.00817.57
8.0.300.0070.00018.77
8.0.290.0020.00517.28
8.0.280.0070.00018.49
8.0.270.0070.00017.32
8.0.260.0030.00317.11
8.0.250.0030.00317.18
8.0.240.0040.00417.09
8.0.230.0040.00417.11
8.0.220.0000.00717.08
8.0.210.0030.00317.15
8.0.200.0060.00017.20
8.0.190.0070.00017.25
8.0.180.0000.00717.07
8.0.170.0030.00617.13
8.0.160.0040.00417.14
8.0.150.0040.00317.09
8.0.140.0040.00417.07
8.0.130.0030.00313.54
8.0.120.0000.00717.10
8.0.110.0040.00417.18
8.0.100.0040.00416.98
8.0.90.0040.00417.04
8.0.80.0060.00917.01
8.0.70.0040.00417.17
8.0.60.0030.00517.21
8.0.50.0050.00317.13
8.0.30.0110.00817.30
8.0.20.0110.00717.42
8.0.10.0000.00817.30
8.0.00.0110.01117.08
7.4.330.0000.00715.00
7.4.320.0000.00716.84
7.4.300.0030.00316.69
7.4.290.0040.00416.73
7.4.280.0040.00416.83
7.4.270.0030.00316.74
7.4.260.0030.00313.49
7.4.250.0040.00416.74
7.4.240.0040.00416.84
7.4.230.0000.00716.73
7.4.220.0100.00616.88
7.4.210.0050.01016.83
7.4.200.0070.00016.87
7.4.190.0030.00316.93
7.4.160.0080.00816.84
7.4.150.0110.00717.40
7.4.140.0050.01517.86
7.4.130.0080.01116.78
7.4.120.0120.00616.87
7.4.110.0180.00016.63
7.4.100.0100.01016.70
7.4.90.0060.01216.71
7.4.80.0140.01019.39
7.4.70.0140.00316.66
7.4.60.0090.00916.65
7.4.50.0000.00816.78
7.4.40.0060.00922.77
7.4.30.0030.01616.71
7.4.00.0080.00715.07
7.3.330.0000.00513.39
7.3.320.0000.00613.37
7.3.310.0030.00316.52
7.3.300.0070.00016.54
7.3.290.0180.00016.66
7.3.280.0090.00916.56
7.3.270.0120.01217.40
7.3.260.0080.00816.51
7.3.250.0130.00616.59
7.3.240.0100.01016.82
7.3.230.0070.01016.73
7.3.210.0120.00616.51
7.3.200.0100.00719.39
7.3.190.0090.01016.66
7.3.180.0080.00816.70
7.3.170.0060.00916.59
7.3.160.0120.00416.70
7.3.120.0050.01214.89
7.3.110.0070.01015.28
7.3.100.0030.01415.17
7.3.90.0110.00615.04
7.3.80.0110.00415.05
7.3.70.0060.00914.90
7.3.60.0000.01114.80
7.3.50.0120.00315.01
7.3.40.0120.00315.06
7.3.30.0040.00714.75
7.3.20.0030.00616.87
7.3.10.0050.00516.84
7.3.00.0090.00516.89
7.2.330.0170.00016.99
7.2.320.0060.01216.80
7.2.310.0100.01316.95
7.2.300.0080.01216.91
7.2.290.0030.01316.89
7.2.250.0150.00415.24
7.2.240.0030.01615.25
7.2.230.0090.00614.95
7.2.220.0070.01015.29
7.2.210.0090.00315.49
7.2.200.0030.01415.14
7.2.190.0070.01015.27
7.2.180.0030.01015.36
7.2.170.0060.00615.25
7.2.130.0060.00916.83
7.2.120.0070.00716.87
7.2.110.0000.00817.19
7.2.100.0060.00617.12
7.2.90.0030.01017.08
7.2.80.0120.00317.24
7.2.70.0000.01317.05
7.2.60.0030.01016.79
7.2.50.0000.01417.28
7.2.40.0040.01117.10
7.2.30.0030.01017.09
7.2.20.0030.01017.32
7.2.10.0000.01417.29
7.2.00.0030.00818.52
7.1.330.0040.01115.91
7.1.320.0070.01116.00
7.1.310.0070.00716.02
7.1.300.0040.00815.91
7.1.290.0100.00615.97
7.1.280.0030.01215.83
7.1.270.0070.01016.10
7.1.260.0000.00915.97
7.1.250.0000.01016.04
7.1.100.0090.00318.24
7.1.70.0030.01017.49
7.1.60.0060.01919.32
7.1.50.0140.01017.29
7.1.00.0000.03722.49
7.0.200.0040.00416.64
7.0.140.0130.06721.98
7.0.100.0130.07019.87
7.0.90.0070.07720.13
7.0.80.0130.03719.95
7.0.70.0370.04719.87
7.0.60.0200.07319.82
7.0.50.0170.08720.36
7.0.40.0170.07719.98
7.0.30.0100.04719.96
7.0.20.0070.07020.02
7.0.10.0130.07019.94
7.0.00.0070.06020.08
5.6.250.0100.07720.55
5.6.240.0070.08020.47
5.6.230.0070.05020.52
5.6.220.0030.08320.62
5.6.210.0070.04720.63
5.6.200.0100.08020.91
5.6.190.0100.07320.99
5.6.180.0030.06021.04
5.6.170.0030.08020.99
5.6.160.0100.08021.13
5.6.150.0070.08721.00
5.6.140.0130.07021.11
5.6.130.0130.08021.12
5.6.120.0030.08720.98
5.6.110.0100.05720.89
5.6.100.0100.04720.99
5.6.90.0030.10320.85
5.6.80.0070.08020.51
5.6.70.0030.08020.36
5.6.60.0170.06320.33
5.6.50.0100.07720.30
5.6.40.0100.06320.30
5.6.30.0100.06020.38
5.6.20.0030.05320.42
5.6.10.0070.07720.23
5.6.00.0100.04320.38
5.5.380.0130.07720.33
5.5.370.0070.08020.37
5.5.360.0030.08320.49
5.5.350.0100.04320.36
5.5.340.0130.07020.87
5.5.330.0130.08020.82
5.5.320.0170.05320.86
5.5.310.0000.08320.81
5.5.300.0130.04020.79
5.5.290.0130.04020.81
5.5.280.0030.06720.79
5.5.270.0070.06020.88
5.5.260.0100.08020.72
5.5.250.0030.07720.56
5.5.240.0130.07020.11
5.5.230.0130.07720.23
5.5.220.0030.08720.15
5.5.210.0100.07320.23
5.5.200.0030.09020.13
5.5.190.0130.07020.23
5.5.180.0130.07320.13
5.5.160.0070.07320.22
5.5.150.0070.04320.21
5.5.140.0070.08320.13
5.5.130.0070.07720.04
5.5.120.0170.07020.14
5.5.110.0100.08020.21
5.5.100.0070.07720.10
5.5.90.0070.07319.90
5.5.80.0070.07720.02
5.5.70.0030.08020.05
5.5.60.0070.04320.07
5.5.50.0130.05020.02
5.5.40.0030.08719.92
5.5.30.0200.06020.01
5.5.20.0030.06720.09
5.5.10.0000.06719.93
5.5.00.0170.03320.00
5.4.450.0100.07019.43
5.4.440.0100.07019.35
5.4.430.0070.07719.46
5.4.420.0170.07019.48
5.4.410.0070.05319.24
5.4.400.0130.07019.23
5.4.390.0030.08019.14
5.4.380.0000.08318.85
5.4.370.0100.06019.05
5.4.360.0100.08019.21
5.4.350.0100.07019.12
5.4.340.0070.07319.09
5.4.320.0130.06018.86
5.4.310.0070.07319.14
5.4.300.0030.08319.09
5.4.290.0070.05019.04
5.4.280.0000.08719.13
5.4.270.0000.05318.89
5.4.260.0130.05719.17
5.4.250.0030.05318.94
5.4.240.0170.07318.87
5.4.230.0170.07019.20
5.4.220.0100.07019.27
5.4.210.0130.06719.11
5.4.200.0070.06319.18
5.4.190.0170.03719.21
5.4.180.0100.07319.11
5.4.170.0000.09019.11
5.4.160.0100.05018.86
5.4.150.0030.05319.11
5.4.140.0030.06016.30
5.4.130.0030.07316.29
5.4.120.0130.06716.40
5.4.110.0130.03316.51
5.4.100.0000.06016.48
5.4.90.0070.07016.43
5.4.80.0070.05316.26
5.4.70.0030.07016.34
5.4.60.0130.07016.42
5.4.50.0100.07316.32
5.4.40.0130.06316.49
5.4.30.0030.06016.33
5.4.20.0170.06716.39
5.4.10.0030.07716.26
5.4.00.0130.06015.84
5.3.290.0030.07314.79
5.3.280.0030.07714.74
5.3.270.0070.04714.60
5.3.260.0130.07014.62
5.3.250.0030.05014.54
5.3.240.0030.07314.55
5.3.230.0000.06314.66
5.3.220.0070.04314.57
5.3.210.0030.06714.56
5.3.200.0070.05314.50
5.3.190.0000.04314.70
5.3.180.0070.04314.50
5.3.170.0100.07314.50
5.3.160.0070.04314.63
5.3.150.0130.06714.55
5.3.140.0230.05714.68
5.3.130.0070.07714.53
5.3.120.0070.07014.61
5.3.110.0130.07314.62
5.3.100.0100.04014.19
5.3.90.0130.06714.12
5.3.80.0130.04714.06
5.3.70.0030.06014.05
5.3.60.0070.04013.94
5.3.50.0000.07714.01
5.3.40.0100.07013.94
5.3.30.0170.05313.89
5.3.20.0030.07713.69
5.3.10.0030.06713.69
5.3.00.0000.07313.65
5.2.170.0030.06311.01
5.2.160.0030.06011.25
5.2.150.0100.03011.26
5.2.140.0030.06311.05
5.2.130.0070.06311.01
5.2.120.0070.04711.16
5.2.110.0100.02711.13
5.2.100.0130.04311.21
5.2.90.0130.04711.18
5.2.80.0070.05711.16
5.2.70.0000.06711.22
5.2.60.0030.06310.95
5.2.50.0000.06710.95
5.2.40.0070.06011.13
5.2.30.0070.05710.88
5.2.20.0070.06011.13
5.2.10.0000.04310.96
5.2.00.0030.03010.83
5.1.60.0030.05710.09
5.1.50.0000.03710.12
5.1.40.0000.05010.07
5.1.30.0000.03710.30
5.1.20.0100.04710.45
5.1.10.0000.06010.13
5.1.00.0030.0539.93
5.0.50.0000.0478.67
5.0.40.0130.0308.31
5.0.30.0030.0538.13
5.0.20.0030.0438.32
5.0.10.0000.0438.17
5.0.00.0070.0638.25
4.4.90.0000.0277.30
4.4.80.0000.0377.30
4.4.70.0000.0307.30
4.4.60.0070.0307.30
4.4.50.0030.0207.30
4.4.40.0000.0477.30
4.4.30.0070.0207.30
4.4.20.0030.0177.30
4.4.10.0030.0337.30
4.4.00.0100.0407.30
4.3.110.0070.0307.30
4.3.100.0070.0177.30
4.3.90.0070.0237.30
4.3.80.0000.0577.30
4.3.70.0070.0277.30
4.3.60.0000.0307.30
4.3.50.0000.0377.30
4.3.40.0030.0407.30
4.3.30.0000.0307.30
4.3.20.0000.0337.30
4.3.10.0030.0337.30
4.3.00.0000.0337.30

preferences:
41.52 ms | 401 KiB | 5 Q