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) { echo $name; if(substr($name, -strlen('_set')) === '_set') { echo $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.0100.01018.58
8.3.50.0090.00921.21
8.3.40.0090.01218.92
8.3.30.0030.01220.34
8.3.20.0080.00020.34
8.3.10.0060.00321.97
8.3.00.0040.00422.20
8.2.180.0040.01518.54
8.2.170.0070.00722.96
8.2.160.0070.00722.25
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0000.00820.77
8.2.110.0030.00621.16
8.2.100.0040.00818.03
8.2.90.0040.00419.17
8.2.80.0050.00317.97
8.2.70.0040.00417.74
8.2.60.0050.00318.03
8.2.50.0000.00818.07
8.2.40.0080.00018.28
8.2.30.0040.00419.43
8.2.20.0040.00417.73
8.2.10.0040.00417.88
8.2.00.0000.01017.75
8.1.280.0180.00325.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00621.27
8.1.230.0080.00417.45
8.1.220.0000.00817.74
8.1.210.0070.00318.77
8.1.200.0040.00417.60
8.1.190.0000.00817.48
8.1.180.0040.00419.22
8.1.170.0060.00318.66
8.1.160.0050.00220.70
8.1.150.0080.00318.79
8.1.140.0000.00717.62
8.1.130.0000.00717.86
8.1.120.0000.00717.63
8.1.110.0000.00817.58
8.1.100.0050.00317.62
8.1.90.0040.00417.48
8.1.80.0070.00017.52
8.1.70.0030.00317.62
8.1.60.0000.00817.64
8.1.50.0040.00417.74
8.1.40.0030.00517.65
8.1.30.0000.00717.73
8.1.20.0000.00817.67
8.1.10.0030.00617.72
8.1.00.0030.00517.69
8.0.300.0000.00718.77
8.0.290.0080.00016.88
8.0.280.0000.00718.41
8.0.270.0070.00017.31
8.0.260.0000.00616.89
8.0.250.0030.00317.05
8.0.240.0040.00417.05
8.0.230.0070.00017.08
8.0.220.0030.00316.96
8.0.210.0030.00317.04
8.0.200.0000.00716.97
8.0.190.0030.00616.97
8.0.180.0080.00017.05
8.0.170.0050.00216.96
8.0.160.0030.00417.11
8.0.150.0040.00417.06
8.0.140.0060.00316.84
8.0.130.0000.00613.45
8.0.120.0030.00617.07
8.0.110.0000.00717.05
8.0.100.0040.00417.05
8.0.90.0000.00716.94
8.0.80.0060.00917.02
8.0.70.0040.00417.10
8.0.60.0080.00016.92
8.0.50.0000.00716.94
8.0.30.0110.00817.20
8.0.20.0110.01117.40
8.0.10.0000.00717.02
8.0.00.0080.01217.06
7.4.330.0060.00015.00
7.4.320.0070.00016.82
7.4.300.0000.00616.64
7.4.290.0000.00716.65
7.4.280.0000.00616.71
7.4.270.0000.00716.85
7.4.260.0050.00013.49
7.4.250.0070.00016.70
7.4.240.0000.00716.71
7.4.230.0000.00716.73
7.4.220.0140.01116.89
7.4.210.0080.00916.81
7.4.200.0070.00016.48
7.4.190.0000.00716.92
7.4.160.0060.00916.71
7.4.150.0090.00917.40
7.4.140.0140.00717.86
7.4.130.0120.00716.65
7.4.120.0090.00816.66
7.4.110.0130.01016.85
7.4.100.0060.01516.56
7.4.90.0070.01016.82
7.4.80.0060.01119.39
7.4.70.0180.00316.78
7.4.60.0090.00616.54
7.4.50.0040.00516.71
7.4.40.0070.01022.77
7.4.30.0070.01416.76
7.4.00.0030.01315.24
7.3.330.0050.00013.33
7.3.320.0060.00013.29
7.3.310.0030.00616.63
7.3.300.0030.00316.47
7.3.290.0160.00516.38
7.3.280.0060.00916.47
7.3.270.0070.01017.40
7.3.260.0160.00716.68
7.3.250.0070.01016.56
7.3.240.0090.00916.44
7.3.230.0060.01116.82
7.3.210.0100.00716.78
7.3.200.0000.02219.39
7.3.190.0070.01016.71
7.3.180.0100.00716.52
7.3.170.0150.00816.71
7.3.160.0070.00716.50
7.3.120.0110.00415.12
7.3.110.0070.01115.00
7.3.100.0030.01414.98
7.3.90.0080.00814.74
7.3.80.0130.00714.91
7.3.70.0050.00515.12
7.3.60.0050.00514.89
7.3.50.0070.00714.71
7.3.40.0030.00715.09
7.3.30.0000.00915.12
7.3.20.0030.00916.95
7.3.10.0030.01016.58
7.3.00.0000.00816.93
7.2.330.0140.01116.95
7.2.320.0060.01317.00
7.2.310.0090.01516.89
7.2.300.0100.00716.73
7.2.290.0090.00616.83
7.2.250.0030.01515.02
7.2.240.0070.01415.17
7.2.230.0070.01315.25
7.2.220.0060.00615.18
7.2.210.0000.01615.54
7.2.200.0100.00315.27
7.2.190.0060.00615.07
7.2.180.0090.00615.36
7.2.170.0060.00915.12
7.1.330.0150.00016.04
7.1.320.0070.01015.64
7.1.310.0110.00816.23
7.1.300.0060.00815.89
7.1.290.0030.01016.07
7.1.280.0040.00415.96
7.1.270.0000.01115.85
7.1.260.0000.01015.97
7.1.100.0070.00718.68
7.1.70.0000.01217.33
7.1.60.0070.00419.32
7.1.50.0060.00617.07
7.1.00.0030.04022.39
7.0.200.0050.00516.64
7.0.140.0070.07021.95
7.0.100.0200.04319.93
7.0.90.0200.06019.93
7.0.80.0070.05320.00
7.0.70.0100.06019.96
7.0.60.0330.07720.01
7.0.50.0270.07720.32
7.0.40.0070.08020.15
7.0.30.0130.08020.00
7.0.20.0100.07720.13
7.0.10.0100.08320.11
7.0.00.0100.08320.17
5.6.280.0100.06721.13
5.6.250.0130.03320.82
5.6.240.0030.07320.68
5.6.230.0030.06020.68
5.6.220.0230.07020.65
5.6.210.0070.04320.57
5.6.200.0130.08021.03
5.6.190.0030.04321.13
5.6.180.0030.08720.95
5.6.170.0200.07320.94
5.6.160.0070.04321.02
5.6.150.0100.06721.02
5.6.140.0070.08021.17
5.6.130.0100.05021.11
5.6.120.0100.07321.11
5.6.110.0100.08321.07
5.6.100.0100.06021.10
5.6.90.0070.05021.07
5.6.80.0130.04020.42
5.6.70.0070.04320.52
5.6.60.0070.06720.39
5.6.50.0130.07720.43
5.6.40.0030.04320.38
5.6.30.0100.04020.39
5.6.20.0000.07720.30
5.6.10.0000.08020.33
5.6.00.0030.08720.39
5.5.380.0030.08320.40
5.5.370.0100.07720.52
5.5.360.0070.06720.41
5.5.350.0030.05020.47
5.5.340.0030.05720.87
5.5.330.0030.05720.91
5.5.320.0170.08020.77
5.5.310.0170.08020.91
5.5.300.0100.04020.89
5.5.290.0130.06320.86
5.5.280.0000.07720.84
5.5.270.0030.08320.83
5.5.260.0070.06020.88
5.5.250.0030.08720.65
5.5.240.0100.06720.27
5.5.230.0100.07020.14
5.5.220.0070.08320.30
5.5.210.0070.05720.03
5.5.200.0130.03320.13
5.5.190.0070.04020.29
5.5.180.0030.04720.25
5.5.160.0070.08019.99
5.5.150.0030.05020.28
5.5.140.0130.07020.19
5.5.130.0070.07020.21
5.5.120.0070.08320.23
5.5.110.0030.04720.14
5.5.100.0170.06320.17
5.5.90.0100.04320.12
5.5.80.0030.08020.08
5.5.70.0130.06720.17
5.5.60.0070.08020.07
5.5.50.0170.06720.01
5.5.40.0130.07320.05
5.5.30.0070.07320.11
5.5.20.0000.06320.11
5.5.10.0130.07320.05
5.5.00.0000.06019.97
5.4.450.0030.09019.41
5.4.440.0030.08019.38
5.4.430.0100.07319.41
5.4.420.0230.06719.55
5.4.410.0030.04319.22
5.4.400.0070.04318.86
5.4.390.0130.06719.09
5.4.380.0030.07319.20
5.4.370.0000.08319.07
5.4.360.0070.05318.85
5.4.350.0070.04319.04
5.4.340.0130.06019.04
5.4.320.0070.08019.13
5.4.310.0130.08319.09
5.4.300.0030.04718.88
5.4.290.0130.05719.04
5.4.280.0070.07719.12
5.4.270.0000.07719.02
5.4.260.0170.06719.04
5.4.250.0100.07718.87
5.4.240.0170.06719.12
5.4.230.0200.04019.04
5.4.220.0030.07019.04
5.4.210.0130.07018.84
5.4.200.0030.08019.11
5.4.190.0170.08019.03
5.4.180.0070.08019.19
5.4.170.0100.07319.12
5.4.160.0070.08019.00
5.4.150.0170.05718.92
5.4.140.0100.07716.44
5.4.130.0100.06716.46
5.4.120.0070.03716.32
5.4.110.0100.04016.49
5.4.100.0100.03016.46
5.4.90.0030.07716.32
5.4.80.0100.07016.25
5.4.70.0070.04016.39
5.4.60.0030.04316.34
5.4.50.0000.04316.40
5.4.40.0070.03016.54
5.4.30.0170.06716.36
5.4.20.0070.07016.44
5.4.10.0070.03316.41
5.4.00.0100.03315.90
5.3.290.0070.07314.72
5.3.280.0100.06014.53
5.3.270.0030.08014.72
5.3.260.0100.07314.56
5.3.250.0070.04714.59
5.3.240.0070.07714.58
5.3.230.0000.07714.72
5.3.220.0000.05314.70
5.3.210.0130.07014.57
5.3.200.0070.03314.57
5.3.190.0030.07314.53
5.3.180.0030.08014.57
5.3.170.0030.06314.56
5.3.160.0030.04314.68
5.3.150.0070.07314.54
5.3.140.0070.06314.58
5.3.130.0100.07014.62
5.3.120.0070.06714.62
5.3.110.0100.07014.67
5.3.100.0070.07714.14
5.3.90.0030.07314.03
5.3.80.0200.05714.09
5.3.70.0030.07014.13
5.3.60.0130.06314.09
5.3.50.0030.05014.02
5.3.40.0070.04014.09
5.3.30.0100.07313.84
5.3.20.0000.05713.60
5.3.10.0030.07313.60
5.3.00.0030.07313.59
5.2.170.0070.06011.07
5.2.160.0070.03711.27
5.2.150.0030.05311.21
5.2.140.0100.03011.04
5.2.130.0070.05711.25
5.2.120.0030.06711.20
5.2.110.0100.06311.17
5.2.100.0100.07010.97
5.2.90.0030.03311.14
5.2.80.0000.06311.00
5.2.70.0070.05011.05
5.2.60.0030.05011.02
5.2.50.0070.05711.14
5.2.40.0030.05711.02
5.2.30.0030.06311.04
5.2.20.0030.06010.96
5.2.10.0000.04310.89
5.2.00.0030.05710.86
5.1.60.0100.0479.85
5.1.50.0000.05010.00
5.1.40.0000.0539.83
5.1.30.0030.03310.37
5.1.20.0000.06010.45
5.1.10.0000.05310.15
5.1.00.0030.05010.07
5.0.50.0100.0339.58
5.0.40.0000.0279.58
5.0.30.0030.0309.58
5.0.20.0000.0479.58
5.0.10.0030.0439.58
5.0.00.0030.0639.58
4.4.90.0100.0109.58
4.4.80.0100.0279.58
4.4.70.0000.0409.58
4.4.60.0030.0339.58
4.4.50.0030.0309.58
4.4.40.0030.0539.58
4.4.30.0030.0339.58
4.4.20.0070.0309.58
4.4.10.0030.0239.58
4.4.00.0070.0209.58
4.3.110.0070.0279.58
4.3.100.0000.0309.58
4.3.90.0070.0279.58
4.3.80.0030.0309.58
4.3.70.0000.0309.58
4.3.60.0000.0309.58
4.3.50.0000.0379.58
4.3.40.0100.0209.58
4.3.30.0030.0339.58
4.3.20.0000.0339.58
4.3.10.0000.0409.58
4.3.00.0000.0309.58

preferences:
47.2 ms | 401 KiB | 5 Q