3v4l.org

run code in 300+ PHP versions simultaneously
<?php //return $this->has_many('Post'); 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 __call($name, $args) { if(strpos($name, 'get_') === 0) { $model = ucwords(substr($val, 4)); return $this->get_relationship($val); } } } $foo = new Foo; echo $foo->get_post(); ?>

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.40.0040.01118.91
8.3.30.0180.00020.17
8.3.20.0030.00520.21
8.3.10.0120.00622.03
8.3.00.0050.00322.30
8.2.170.0090.00622.96
8.2.160.0130.00722.21
8.2.150.0060.00324.18
8.2.140.0060.00924.66
8.2.130.0000.00926.16
8.2.120.0030.00521.13
8.2.110.0060.00322.37
8.2.100.0030.00917.97
8.2.90.0030.00619.08
8.2.80.0000.00819.28
8.2.70.0030.00917.88
8.2.60.0000.00817.92
8.2.50.0000.00818.07
8.2.40.0040.00418.20
8.2.30.0080.00019.39
8.2.20.0050.00217.88
8.2.10.0000.00817.89
8.2.00.0050.00517.92
8.1.270.0030.01623.99
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0060.00323.79
8.1.230.0120.00019.12
8.1.220.0040.00417.75
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0030.00617.40
8.1.180.0000.00819.13
8.1.170.0000.00818.77
8.1.160.0070.00018.93
8.1.150.0030.00618.67
8.1.140.0000.00717.49
8.1.130.0030.00317.87
8.1.120.0050.00317.61
8.1.110.0050.00317.52
8.1.100.0040.00417.52
8.1.90.0040.00417.52
8.1.80.0070.00017.60
8.1.70.0070.00017.56
8.1.60.0040.00717.75
8.1.50.0040.00417.68
8.1.40.0040.00417.66
8.1.30.0000.00817.78
8.1.20.0000.00917.73
8.1.10.0030.00517.62
8.1.00.0000.00817.65
8.0.300.0040.00418.77
8.0.290.0060.00317.16
8.0.280.0040.00418.54
8.0.270.0040.00417.21
8.0.260.0070.00016.96
8.0.250.0040.00417.17
8.0.240.0060.00317.06
8.0.230.0000.00717.19
8.0.220.0000.00717.03
8.0.210.0050.00317.08
8.0.200.0030.00317.01
8.0.190.0080.00017.06
8.0.180.0000.00817.10
8.0.170.0000.00917.09
8.0.160.0000.00717.17
8.0.150.0040.00417.02
8.0.140.0050.00317.11
8.0.130.0030.00313.54
8.0.120.0060.00317.07
8.0.110.0030.00317.10
8.0.100.0080.00016.96
8.0.90.0040.00417.09
8.0.80.0110.00317.01
8.0.70.0060.00317.11
8.0.60.0000.00716.97
8.0.50.0000.00716.91
8.0.30.0120.01017.27
8.0.20.0090.00917.40
8.0.10.0000.00717.21
8.0.00.0100.01416.92
7.4.330.0040.00415.00
7.4.320.0000.00716.72
7.4.300.0000.00716.82
7.4.290.0000.00716.75
7.4.280.0000.00716.66
7.4.270.0060.00316.73
7.4.260.0000.00613.55
7.4.250.0040.00416.84
7.4.240.0040.00316.70
7.4.230.0000.00716.93
7.4.220.0070.01416.66
7.4.210.0060.01016.76
7.4.200.0050.00316.58
7.4.190.0000.00716.99
7.4.160.0030.01316.71
7.4.150.0140.00417.40
7.4.140.0090.00917.86
7.4.130.0060.01316.71
7.4.120.0050.01216.85
7.4.110.0090.01216.81
7.4.100.0070.01016.72
7.4.90.0070.01016.80
7.4.80.0090.01219.39
7.4.70.0130.00316.79
7.4.60.0150.00916.84
7.4.50.0040.00416.86
7.4.40.0040.01222.77
7.4.30.0080.01116.70
7.4.00.0070.00915.25
7.3.330.0030.00313.53
7.3.320.0050.00013.52
7.3.310.0030.00616.40
7.3.300.0000.00716.47
7.3.290.0040.01016.55
7.3.280.0110.00716.54
7.3.270.0190.00417.40
7.3.260.0040.01516.52
7.3.250.0100.01216.72
7.3.240.0080.00816.58
7.3.230.0080.00816.67
7.3.210.0130.00316.90
7.3.200.0100.00719.39
7.3.190.0060.01216.63
7.3.180.0030.01216.60
7.3.170.0040.01616.75
7.3.160.0090.00616.89
7.3.120.0060.00914.96
7.3.110.0060.01014.94
7.3.100.0050.01015.16
7.3.90.0060.00614.99
7.3.80.0040.01015.28
7.3.70.0100.00515.04
7.3.60.0080.00615.08
7.3.50.0050.00815.06
7.3.40.0060.00914.90
7.3.30.0060.01115.02
7.3.20.0070.00716.92
7.3.10.0060.00816.76
7.3.00.0080.00516.86
7.2.330.0100.01016.78
7.2.320.0140.00316.87
7.2.310.0130.00316.98
7.2.300.0130.00316.87
7.2.290.0100.00716.88
7.2.250.0080.01015.23
7.2.240.0090.01115.32
7.2.230.0090.00815.09
7.2.220.0090.00415.39
7.2.210.0060.00815.17
7.2.200.0020.01215.18
7.2.190.0060.00715.16
7.2.180.0090.00615.22
7.2.170.0060.01115.29
7.2.60.0090.00617.12
7.2.50.0000.01317.21
7.1.330.0040.01015.93
7.1.320.0040.00916.05
7.1.310.0110.00415.90
7.1.300.0090.00315.89
7.1.290.0080.00815.87
7.1.280.0010.01415.90
7.1.270.0070.00815.93
7.1.260.0070.00515.97
7.1.200.0110.00315.97
7.1.70.0000.00917.48
7.1.60.0140.01019.32
7.1.50.0060.01517.19
7.1.00.0030.03322.47
7.0.200.0060.00316.83
7.0.140.0000.07722.19
7.0.110.0500.04320.11
7.0.100.0170.04320.05
7.0.90.0100.04319.99
7.0.80.0300.04019.98
7.0.70.0130.04319.86
7.0.60.0270.05019.96
7.0.50.0070.06020.36
7.0.40.0100.03720.24
7.0.30.0100.05020.16
7.0.20.0030.04720.03
7.0.10.0070.05020.13
7.0.00.0030.07720.03
5.6.280.0100.06721.12
5.6.260.0030.04320.90
5.6.250.0130.04020.60
5.6.240.0030.04320.67
5.6.230.0070.05020.46
5.6.220.0030.04320.57
5.6.210.0030.08320.67
5.6.200.0030.04020.94
5.6.190.0000.05021.12
5.6.180.0030.04720.95
5.6.170.0070.03721.14
5.6.160.0070.05320.96
5.6.150.0070.08021.15
5.6.140.0030.04021.12
5.6.130.0030.04321.12
5.6.120.0070.04021.03
5.6.110.0000.04720.95
5.6.100.0130.03021.21
5.6.90.0000.05021.13
5.6.80.0030.04020.49
5.6.70.0070.03720.31
5.6.60.0030.07020.52
5.6.50.0200.05720.32
5.6.40.0070.05020.51
5.6.30.0130.07720.55
5.6.20.0030.04320.44
5.6.10.0000.08020.57
5.6.00.0030.07720.54
5.5.380.0030.04320.59
5.5.370.0030.04020.57
5.5.360.0000.05320.54
5.5.350.0030.05020.53
5.5.340.0100.03320.91
5.5.330.0100.03720.82
5.5.320.0030.04320.75
5.5.310.0100.03720.83
5.5.300.0030.06720.85
5.5.290.0030.05020.71
5.5.280.0030.05020.99
5.5.270.0100.07320.92
5.5.260.0030.04320.81
5.5.250.0100.03720.57
5.5.240.0070.05720.43
5.5.230.0170.05720.40
5.5.220.0070.07020.37
5.5.210.0030.08020.40
5.5.200.0030.08320.23
5.5.190.0130.06720.35
5.5.180.0070.06720.06
5.5.160.0070.06720.04
5.5.150.0100.06720.33
5.5.140.0130.06720.10
5.5.130.0200.07020.31
5.5.120.0070.04720.39
5.5.110.0130.04320.22
5.5.100.0030.08020.27
5.5.90.0130.07020.21
5.5.80.0100.08020.01
5.5.70.0070.07720.10
5.5.60.0070.07720.26
5.5.50.0130.07020.07
5.5.40.0070.04320.20
5.5.30.0030.07720.13
5.5.20.0070.07720.09
5.5.10.0130.07020.07
5.5.00.0030.05320.21
5.4.450.0000.04719.34
5.4.440.0100.04719.36
5.4.430.0100.04019.41
5.4.420.0070.04019.46
5.4.410.0100.07019.14
5.4.400.0000.06019.02
5.4.390.0030.03719.04
5.4.380.0100.06718.99
5.4.370.0100.06719.32
5.4.360.0070.08019.00
5.4.350.0130.06319.19
5.4.340.0070.08019.34
5.4.320.0130.07319.18
5.4.310.0100.07318.99
5.4.300.0000.07319.24
5.4.290.0130.07019.33
5.4.280.0030.08019.09
5.4.270.0030.08019.00
5.4.260.0100.03719.23
5.4.250.0130.04019.13
5.4.240.0030.08019.00
5.4.230.0130.05719.13
5.4.220.0200.03719.31
5.4.210.0130.06719.13
5.4.200.0000.08719.04
5.4.190.0070.07718.98
5.4.180.0100.07019.32
5.4.170.0130.07318.95
5.4.160.0070.07319.20
5.4.150.0100.08018.98
5.4.140.0130.06016.63
5.4.130.0030.06016.29
5.4.120.0100.06716.33
5.4.110.0070.07016.45
5.4.100.0030.07716.57
5.4.90.0070.06716.41
5.4.80.0070.06716.53
5.4.70.0030.07316.25
5.4.60.0130.07016.63
5.4.50.0000.07016.19
5.4.40.0000.07316.43
5.4.30.0030.05016.40
5.4.20.0070.04316.38
5.4.10.0130.07016.33
5.4.00.0070.07015.79
5.3.290.0130.07314.91
5.3.280.0100.07714.57
5.3.270.0000.08314.76
5.3.260.0070.07714.63
5.3.250.0100.03314.74
5.3.240.0070.07014.65
5.3.230.0070.06714.59
5.3.220.0030.07714.80
5.3.210.0100.07014.72
5.3.200.0070.07714.61
5.3.190.0100.07014.61
5.3.180.0070.07314.56
5.3.170.0030.04714.56
5.3.160.0070.07314.71
5.3.150.0000.07714.60
5.3.140.0070.07314.57
5.3.130.0170.06714.58
5.3.120.0030.08014.55
5.3.110.0100.07014.56
5.3.100.0030.08014.18
5.3.90.0100.06714.11
5.3.80.0100.05014.03
5.3.70.0070.05714.02
5.3.60.0070.05714.02
5.3.50.0130.06014.03
5.3.40.0100.07313.96
5.3.30.0030.07714.14
5.3.20.0070.07013.69
5.3.10.0000.07713.53
5.3.00.0070.07313.78
5.2.170.0130.06012.11
5.2.160.0070.06312.11
5.2.150.0100.05712.11
5.2.140.0100.05712.11
5.2.130.0100.05712.11
5.2.120.0100.05012.11
5.2.110.0070.06012.11
5.2.100.0130.05312.11
5.2.90.0000.06712.11
5.2.80.0030.06012.11
5.2.70.0070.06012.11
5.2.60.0070.05712.11
5.2.50.0030.06312.11
5.2.40.0030.06012.11
5.2.30.0070.06012.11
5.2.20.0130.05312.11
5.2.10.0000.05712.11
5.2.00.0030.03712.11
5.1.60.0070.05012.11
5.1.50.0030.05012.11
5.1.40.0030.05012.11
5.1.30.0030.06012.11
5.1.20.0070.05312.11
5.1.10.0070.04712.11
5.1.00.0030.05712.11
5.0.50.0100.04012.11
5.0.40.0030.04012.11
5.0.30.0030.04012.11
5.0.20.0000.05012.11
5.0.10.0030.02312.11
5.0.00.0070.05712.11
4.4.90.0070.02712.11
4.4.80.0000.03312.11
4.4.70.0030.03712.11
4.4.60.0100.02012.11
4.4.50.0100.01312.11
4.4.40.0000.05712.11
4.4.30.0000.03012.11
4.4.20.0030.03712.11
4.4.10.0030.02312.11
4.4.00.0070.04712.11
4.3.110.0070.02312.11
4.3.100.0070.02712.11
4.3.90.0000.02012.11
4.3.80.0000.05312.11
4.3.70.0000.03712.11
4.3.60.0000.03712.11
4.3.50.0000.03712.11
4.3.40.0000.04712.11
4.3.30.0030.03712.11
4.3.20.0100.02712.11
4.3.10.0070.02712.11
4.3.00.0030.03312.11

preferences:
41.63 ms | 400 KiB | 5 Q