3v4l.org

run code in 300+ PHP versions simultaneously
<?php //return $this->has_many('Post'); class Foo{ public static $has_manyhg = "Post"; public static $age = "18"; private static $city = "Boston"; public $r=9; public static $has_many = "Post"; public function has_manyc($a){ return 'hola'; } } function get_relationship($val) { $class = new ReflectionClass('Foo'); $staticProperties = $class->getStaticProperties(); //print_r($staticProperties); $object=new Foo; $model = ucwords(substr($val, 4)); foreach ($staticProperties as $propertyName => $value) { if(preg_match('/^(has_many|age)$/', $propertyName) && $value == $model) { //return call_user_func(array($object, $propertyName.'c'), $model); return $object->{$propertyName.'c'}($model); } } } echo get_relationship('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.60.0110.00418.42
8.3.50.0240.00821.21
8.3.40.0110.00419.00
8.3.30.0110.00420.35
8.3.20.0040.01120.16
8.3.10.0080.00621.89
8.3.00.0070.00722.58
8.2.180.0170.00016.75
8.2.170.0190.00022.96
8.2.160.0070.00722.39
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0130.00326.16
8.2.120.0110.00320.93
8.2.110.0100.00022.20
8.2.100.0120.00018.03
8.2.90.0080.00019.22
8.2.80.0030.00619.21
8.2.70.0030.00617.75
8.2.60.0000.00818.03
8.2.50.0080.00018.07
8.2.40.0050.00318.03
8.2.30.0030.00519.39
8.2.20.0000.00817.87
8.2.10.0040.00417.87
8.2.00.0040.00417.83
8.1.280.0040.01125.92
8.1.270.0050.00323.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.80
8.1.230.0060.00619.07
8.1.220.0030.00517.79
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0060.00317.53
8.1.180.0050.00319.14
8.1.170.0040.00418.75
8.1.160.0080.00020.70
8.1.150.0050.00618.71
8.1.140.0000.00717.56
8.1.130.0040.00417.75
8.1.120.0040.00417.65
8.1.110.0000.00817.61
8.1.100.0080.00017.52
8.1.90.0000.00817.54
8.1.80.0070.00017.50
8.1.70.0000.00717.59
8.1.60.0090.00317.65
8.1.50.0000.00717.57
8.1.40.0030.00517.69
8.1.30.0000.00717.69
8.1.20.0050.00317.81
8.1.10.0040.00417.76
8.1.00.0080.00017.72
8.0.300.0040.00418.77
8.0.290.0000.00717.04
8.0.280.0030.00318.41
8.0.270.0040.00417.29
8.0.260.0000.00716.97
8.0.250.0000.00716.98
8.0.240.0060.00316.95
8.0.230.0070.00017.02
8.0.220.0070.00016.88
8.0.210.0000.00717.03
8.0.200.0000.00617.08
8.0.190.0040.00417.11
8.0.180.0030.00317.05
8.0.170.0000.00916.97
8.0.160.0000.00717.02
8.0.150.0000.00816.96
8.0.140.0000.00716.96
8.0.130.0030.00313.43
8.0.120.0040.00416.97
8.0.110.0000.00716.89
8.0.100.0000.00817.00
8.0.90.0050.00317.02
8.0.80.0100.00617.01
8.0.70.0000.00817.07
8.0.60.0000.00816.92
8.0.50.0000.00816.90
8.0.30.0080.01117.20
8.0.20.0160.00217.40
8.0.10.0070.00017.21
8.0.00.0120.01117.00
7.4.330.0070.00015.00
7.4.320.0030.00316.67
7.4.300.0000.00616.84
7.4.290.0000.00716.82
7.4.280.0000.00816.66
7.4.270.0060.00316.67
7.4.260.0030.00313.49
7.4.250.0030.00516.76
7.4.240.0050.00216.78
7.4.230.0050.00316.62
7.4.220.0090.00616.85
7.4.210.0070.00816.77
7.4.200.0070.00016.52
7.4.190.0000.00816.89
7.4.160.0100.00616.73
7.4.150.0130.00317.40
7.4.140.0130.00617.86
7.4.130.0100.00716.78
7.4.120.0120.00516.77
7.4.110.0000.01716.63
7.4.100.0000.01616.68
7.4.90.0160.00316.90
7.4.80.0130.00319.39
7.4.70.0110.00516.65
7.4.60.0090.00916.67
7.4.50.0030.00616.75
7.4.40.0100.00622.77
7.4.30.0100.00716.68
7.4.00.0070.01115.08
7.3.330.0000.00513.21
7.3.320.0060.00013.32
7.3.310.0000.00716.40
7.3.300.0040.00416.41
7.3.290.0070.00716.47
7.3.280.0080.00816.43
7.3.270.0030.01417.40
7.3.260.0140.00916.78
7.3.250.0100.01016.68
7.3.240.0150.00316.60
7.3.230.0030.01316.59
7.3.210.0320.02116.55
7.3.200.0100.00719.39
7.3.190.0120.00616.82
7.3.180.0070.00716.61
7.3.170.0060.00916.79
7.3.160.0060.00916.68
7.3.120.0140.00315.26
7.3.10.0070.00716.95
7.3.00.0080.00516.71
7.2.330.0220.01316.88
7.2.320.0070.01016.84
7.2.310.0030.01316.80
7.2.300.0070.01016.75
7.2.290.0070.01016.82
7.2.130.0050.00716.87
7.2.120.0040.01017.16
7.2.110.0040.01017.07
7.2.100.0050.00816.94
7.2.90.0060.00817.07
7.2.80.0050.00717.09
7.2.70.0100.00617.17
7.2.60.0090.00617.05
7.2.50.0110.00417.16
7.2.40.0060.00917.00
7.2.30.0100.00717.09
7.2.20.0100.00817.00
7.2.10.0090.00717.05
7.2.00.0110.00317.11
7.1.250.0020.00815.91
7.1.240.0070.00915.85
7.1.230.0030.00915.72
7.1.220.0070.00715.66
7.1.210.0100.00615.74
7.1.200.0050.00615.88
7.1.190.0030.00815.85
7.1.180.0090.00615.64
7.1.170.0050.00815.91
7.1.160.0070.00915.96
7.1.150.0050.01015.90
7.1.140.0070.00815.89
7.1.130.0070.00515.79
7.1.120.0080.00715.78
7.1.110.0060.00915.92
7.1.100.0060.01015.70
7.1.90.0070.00715.90
7.1.80.0080.00715.85
7.1.70.0050.00816.32
7.1.60.0070.00917.11
7.1.50.0080.00816.24
7.1.40.0060.00716.11
7.1.30.0060.00715.81
7.1.20.0050.00615.86
7.1.10.0050.00815.91
7.1.00.0030.01617.92
7.0.330.0050.00615.28
7.0.320.0070.00515.43
7.0.310.0020.00815.61
7.0.300.0100.00815.48
7.0.290.0020.01315.40
7.0.280.0060.01215.39
7.0.270.0030.00815.42
7.0.260.0050.00715.52
7.0.250.0050.01315.54
7.0.240.0090.00615.41
7.0.230.0050.00815.31
7.0.220.0030.01015.52
7.0.210.0100.00715.28
7.0.200.0060.00616.01
7.0.190.0040.00815.52
7.0.180.0120.00315.42
7.0.170.0030.01015.41
7.0.160.0050.00815.56
7.0.150.0060.00615.35
7.0.140.0060.02817.66
7.0.130.0050.00415.50
7.0.120.0060.00715.58
7.0.110.0060.00815.77
7.0.100.0090.02016.95
7.0.90.0040.01717.03
7.0.80.0080.01716.88
7.0.70.0080.01516.92
7.0.60.0050.02316.99
7.0.50.0100.01617.12
7.0.40.0040.01915.71
7.0.30.0030.01815.80
7.0.20.0030.02015.74
7.0.10.0030.01815.79
7.0.00.0000.02315.86
5.6.380.0070.00414.49
5.6.370.0030.01014.23
5.6.360.0030.01014.31
5.6.350.0110.00514.27
5.6.340.0090.00414.26
5.6.330.0060.00514.51
5.6.320.0040.01014.25
5.6.310.0050.01014.40
5.6.300.0030.01014.13
5.6.290.0060.00614.26
5.6.280.0050.02916.54
5.6.270.0080.00614.30
5.6.260.0030.00514.42
5.6.250.0060.02416.37
5.6.240.0060.01816.32
5.6.230.0030.02016.20
5.6.220.0050.01916.26
5.6.210.0070.01716.46
5.6.200.0070.01416.45
5.6.190.0040.02016.40
5.6.180.0050.01616.58
5.6.170.0000.01916.40
5.6.160.0080.02916.63
5.6.150.0040.01816.59
5.6.140.0050.01916.53
5.6.130.0070.01616.48
5.6.120.0020.02616.62
5.6.110.0050.02716.55
5.6.100.0040.02116.46
5.6.90.0040.02416.56
5.6.80.0090.01316.40
5.6.70.0010.02316.18
5.6.60.0070.02316.48
5.6.50.0090.03116.16
5.6.40.0030.02116.28
5.6.30.0050.03016.20
5.6.20.0050.03216.33
5.6.10.0070.02916.10
5.6.00.0090.01916.16
5.5.380.0080.01314.35
5.5.370.0000.02214.25
5.5.360.0040.01914.25
5.5.350.0070.01614.30
5.5.340.0050.01714.45
5.5.330.0040.01614.46
5.5.320.0080.01514.39
5.5.310.0030.01414.47
5.5.300.0110.02614.43
5.5.290.0090.01414.36
5.5.280.0030.03114.37
5.5.270.0020.02614.38
5.5.260.0060.02014.47
5.5.250.0060.01914.36
5.5.240.0050.02914.18
5.5.230.0050.02514.21
5.5.220.0060.02714.23
5.5.210.0060.02914.26
5.5.200.0040.02414.20
5.5.190.0060.01714.16
5.5.180.0060.01714.22
5.5.170.0010.00811.26
5.5.160.0030.01714.24
5.5.150.0020.02014.19
5.5.140.0090.01714.26
5.5.130.0050.01514.17
5.5.120.0060.01614.23
5.5.110.0070.01514.20
5.5.100.0070.02614.19
5.5.90.0060.01714.15
5.5.80.0050.02314.10
5.5.70.0050.03114.15
5.5.60.0020.02914.18
5.5.50.0060.01514.14
5.5.40.0030.01914.17
5.5.30.0050.01914.17
5.5.20.0030.02614.19
5.5.10.0040.02014.12
5.5.00.0020.01614.11
5.4.450.0040.03714.00
5.4.440.0030.02213.90
5.4.430.0010.02013.92
5.4.420.0040.02713.85
5.4.410.0050.01813.80
5.4.400.0080.02213.80
5.4.390.0010.02013.85
5.4.380.0030.03013.88
5.4.370.0090.01113.89
5.4.360.0030.02613.76
5.4.350.0040.02913.88
5.4.340.0050.01513.74
5.4.330.0070.00511.18
5.4.320.0080.02913.77
5.4.310.0030.01713.86
5.4.300.0060.02213.80
5.4.290.0070.01513.74
5.4.280.0010.02013.79
5.4.270.0040.01513.90
5.4.260.0040.02613.80
5.4.250.0030.01713.74
5.4.240.0040.02513.83
5.4.230.0030.02113.79
5.4.220.0050.01813.74
5.4.210.0040.01813.74
5.4.200.0070.02313.73
5.4.190.0060.01413.84
5.4.180.0040.02213.76
5.4.170.0050.01913.79
5.4.160.0010.02713.74
5.4.150.0100.02013.85
5.4.140.0040.02512.95
5.4.130.0040.02612.94
5.4.120.0050.01912.94
5.4.110.0040.01612.95
5.4.100.0050.01612.94
5.4.90.0070.01112.94
5.4.80.0060.02512.95
5.4.70.0040.02412.94
5.4.60.0020.01812.93
5.4.50.0050.01312.96
5.4.40.0030.02512.95
5.4.30.0080.01712.93
5.4.20.0050.02912.90
5.4.10.0060.01912.94
5.4.00.0010.02712.79
5.3.290.0040.03112.36
5.3.280.0020.02912.32
5.3.270.0030.02912.31
5.3.260.0040.02912.34
5.3.250.0040.02712.36
5.3.240.0040.02212.36
5.3.230.0060.01612.33
5.3.220.0020.01812.30
5.3.210.0070.02412.29
5.3.200.0020.03012.28
5.3.190.0040.02612.33
5.3.180.0050.01912.35
5.3.170.0080.01312.31
5.3.160.0030.02612.28
5.3.150.0040.02112.30
5.3.140.0080.02012.34
5.3.130.0090.02612.32
5.3.120.0060.02012.28
5.3.110.0050.02712.34
5.3.100.0050.02812.16
5.3.90.0090.02312.15
5.3.80.0050.02712.13
5.3.70.0070.02712.09
5.3.60.0040.02112.14
5.3.50.0060.02812.15
5.3.40.0080.02412.07
5.3.30.0030.02912.09
5.3.20.0080.02312.01
5.3.10.0050.02112.00
5.3.00.0040.03011.99
5.2.170.0050.02211.52
5.2.160.0050.01611.52
5.2.150.0030.01311.52
5.2.140.0030.02311.52
5.2.130.0040.02511.52
5.2.120.0030.02011.52
5.2.110.0090.00811.52
5.2.100.0030.02511.52
5.2.90.0000.02611.52
5.2.80.0070.01411.52
5.2.70.0040.01211.52
5.2.60.0050.01611.52
5.2.50.0030.02211.52
5.2.40.0060.02211.52
5.2.30.0040.02311.52
5.2.20.0030.02411.52
5.2.10.0050.01211.52
5.2.00.0040.02511.52
5.1.60.0090.01611.52
5.1.50.0060.01411.52
5.1.40.0050.01811.52
5.1.30.0040.01111.52
5.1.20.0030.02411.52
5.1.10.0040.01911.52
5.1.00.0040.02011.52
5.0.50.0020.01511.52
5.0.40.0020.01811.52
5.0.30.0030.01311.52
5.0.20.0030.01011.52
5.0.10.0020.00811.52
5.0.00.0010.01711.52
4.4.90.0020.01111.52
4.4.80.0020.00711.52
4.4.70.0040.01411.52
4.4.60.0030.01311.52
4.4.50.0030.01111.52
4.4.40.0040.01511.52
4.4.30.0010.01511.52
4.4.20.0010.00911.52
4.4.10.0040.01111.52
4.4.00.0050.00911.52
4.3.110.0040.00811.52
4.3.100.0030.00611.52
4.3.90.0020.00711.52
4.3.80.0030.01511.52
4.3.70.0020.00711.52
4.3.60.0000.01311.52
4.3.50.0030.00911.52
4.3.40.0030.01211.52
4.3.30.0010.01111.52
4.3.20.0000.01211.52
4.3.10.0000.01011.52
4.3.00.0030.00711.52

preferences:
45.13 ms | 401 KiB | 5 Q