3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parser { private $parse; public function __construct() { $this->parse = new ArrayObject(); } public function parse($str){ preg_match_all("/@(.*) \((.*)\)/\n", $str, $matches); $this->fill($matches[1],$matches[2]); return $this; } protected function fill(array $classes, array $args){ $count = count($classes); for($i=0;$i<$count;$i++){ $this->parse->offsetSet($classes[$i], new $classes[$i]($args[$i])); } return $this; } function getParse() { return $this->parse; } public function getData($name) { return $this->parse->offsetExists($name)?$this->parse->offsetGet($name):NULL; } } class Column { private $name; private $type; private $length; function __construct($args) { $parse = json_decode($args); $this->setLength($parse->length); $this->setName($parse->name); $this->setType($parse->type); } function getName() { return $this->name; } function getType() { return $this->type; } function getLength() { return $this->length; } function setName($name) { $this->name = $name; } function setType($type) { $this->type = $type; } function setLength($length) { $this->length = $length; } } class Form { private $field; function __construct($args) { $parser = json_decode($args); $this->setField($parser->field); } function getField() { return $this->field; } function setField($field) { $this->field = $field; } } class Teste { /** * @Column ({"name":"name","type":"varchar","length":123}) * @Form ({"field":"nome"}) */ private $nome; /** * @Column ({"name":"idade","type":"int","length":123}) * @Form ({"field":"idade"}) */ private $idade; } $p = new Parser(); $r = new ReflectionClass(new Teste()); $props = $r->getProperties(); $array = array(); foreach($props as $prop){ var_dump($p->parse($prop->getDocComment())->getParse()); $array[$prop->getName()] = $p->parse($prop->getDocComment())->getParse(); } echo '<pre>'; print_r($array['idade']['Column']->getType());

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.0040.01116.88
8.3.50.0100.01222.20
8.3.40.0070.00718.96
8.3.30.0090.00618.98
8.3.20.0000.00820.21
8.3.10.0090.00021.77
8.3.00.0050.00319.15
8.2.180.0110.01118.79
8.2.170.0160.00622.96
8.2.160.0100.00722.21
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00419.79
8.2.110.0030.00620.47
8.2.100.0120.00018.22
8.2.90.0040.00419.40
8.2.80.0030.00517.97
8.2.70.0040.00417.88
8.2.60.0030.00717.93
8.2.50.0040.00418.07
8.2.40.0070.00717.97
8.2.30.0040.00419.51
8.2.20.0050.00317.84
8.2.10.0030.00618.23
8.2.00.0000.00817.93
8.1.280.0150.00625.92
8.1.270.0150.00418.98
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.18
8.1.230.0110.00019.21
8.1.220.0030.00617.91
8.1.210.0030.00518.77
8.1.200.0000.00917.48
8.1.190.0030.00517.48
8.1.180.0000.00918.10
8.1.170.0050.00318.96
8.1.160.0040.00422.08
8.1.150.0030.00518.95
8.1.140.0040.00419.39
8.1.130.0000.00717.78
8.1.120.0040.00417.54
8.1.110.0030.00517.61
8.1.100.0000.00817.64
8.1.90.0030.00517.70
8.1.80.0050.00317.54
8.1.70.0040.00417.54
8.1.60.0050.00517.85
8.1.50.0000.00817.64
8.1.40.0000.00917.62
8.1.30.0040.00417.87
8.1.20.0040.00417.84
8.1.10.0060.00317.71
8.1.00.0030.00517.62
8.0.300.0090.00018.77
8.0.290.0030.00617.00
8.0.280.0040.00418.47
8.0.270.0050.00217.41
8.0.260.0060.00017.37
8.0.250.0030.00317.10
8.0.240.0030.00617.10
8.0.230.0040.00317.18
8.0.220.0030.00517.04
8.0.210.0060.00317.02
8.0.200.0000.00817.06
8.0.190.0000.00817.14
8.0.180.0000.00817.06
8.0.170.0060.00317.00
8.0.160.0060.00317.11
8.0.150.0040.00817.03
8.0.140.0070.00416.94
8.0.130.0060.00013.59
8.0.120.0040.00417.10
8.0.110.0050.00316.95
8.0.100.0040.00416.98
8.0.90.0000.00717.12
8.0.80.0070.01617.12
8.0.70.0070.00017.06
8.0.60.0040.00416.94
8.0.50.0040.00416.97
8.0.30.0090.01417.43
8.0.20.0080.01317.40
8.0.10.0000.00717.27
8.0.00.0130.00716.80
7.4.330.0000.00515.03
7.4.320.0000.00716.91
7.4.300.0070.00016.74
7.4.290.0040.00416.87
7.4.280.0040.00416.73
7.4.270.0030.00316.85
7.4.260.0040.00416.74
7.4.250.0040.00416.81
7.4.240.0040.00416.69
7.4.230.0000.00716.85
7.4.220.0040.01516.77
7.4.210.0130.01016.80
7.4.200.0040.00416.71
7.4.160.0150.00616.86
7.4.150.0150.01117.40
7.4.140.0110.00917.86
7.4.130.0100.00716.81
7.4.120.0080.01116.85
7.4.110.0100.01416.89
7.4.100.0060.01216.64
7.4.90.0130.00616.69
7.4.80.0100.01419.39
7.4.70.0060.01216.88
7.4.60.0070.01016.63
7.4.50.0000.00616.58
7.4.40.0060.01416.64
7.4.30.0040.01516.69
7.4.00.0070.01015.31
7.3.330.0040.00413.37
7.3.320.0030.00513.52
7.3.310.0070.00016.56
7.3.300.0000.00716.52
7.3.290.0110.00516.52
7.3.280.0080.00916.53
7.3.270.0090.00917.40
7.3.260.0150.00616.80
7.3.250.0060.01316.71
7.3.240.0060.01016.80
7.3.230.0090.00916.75
7.3.210.0090.00916.80
7.3.200.0150.00819.39
7.3.190.0040.01216.84
7.3.180.0120.00616.57
7.3.170.0040.01516.65
7.3.160.0070.01016.76
7.3.10.0070.00416.79
7.3.00.0040.00916.75
7.2.330.0080.01116.94
7.2.320.0070.01117.00
7.2.310.0170.00916.92
7.2.300.0120.00917.06
7.2.290.0120.00616.96
7.2.130.0040.00817.04
7.2.120.0030.01217.15
7.2.110.0110.00416.79
7.2.100.0070.00716.62
7.2.90.0060.01017.44
7.2.80.0030.00917.11
7.2.70.0110.00717.29
7.2.60.0070.01016.96
7.2.50.0080.00616.86
7.2.40.0070.00417.11
7.2.30.0030.01017.25
7.2.20.0030.01017.20
7.2.10.0060.00617.27
7.2.00.0090.00218.31
7.1.250.0100.00316.07
7.1.200.0070.00315.96
7.1.100.0100.00318.50
7.1.70.0080.00417.48
7.1.60.0090.01519.46
7.1.50.0060.01016.84
7.1.00.0000.08022.43
7.0.200.0050.00516.82
7.0.140.0030.07322.13
7.0.60.0030.08719.94
7.0.50.0130.07717.92
7.0.40.0070.05020.29
7.0.30.0270.05720.21
7.0.20.0170.06020.24
7.0.10.0030.05020.07
7.0.00.0130.06720.09
5.6.280.0000.07721.01
5.6.210.0070.07320.70
5.6.200.0070.07018.22
5.6.190.0030.08720.35
5.6.180.4070.04720.77
5.6.170.0230.04020.45
5.6.160.0070.08720.43
5.6.150.0070.05018.22
5.6.140.0030.05318.31
5.6.130.0170.07318.20
5.6.120.0170.07321.17
5.6.110.0130.07721.01
5.6.100.0170.07721.02
5.6.90.0130.07721.11
5.6.80.0030.08020.51
5.6.70.4570.04020.43
5.5.350.0130.08720.36
5.5.340.0100.06317.99
5.5.330.0030.05320.30
5.5.320.3030.04320.51
5.5.310.0200.04320.24
5.5.300.0070.03717.94
5.5.290.0000.09318.01
5.5.280.0030.09020.89
5.5.270.0100.05020.89
5.5.260.0070.08020.70
5.5.250.0100.07720.80
5.5.240.0300.06720.18
5.4.450.0370.04319.55
5.4.440.0230.07319.31
5.4.430.0130.07019.21
5.4.420.0200.05019.40
5.4.410.0130.05719.18
5.4.400.0230.05318.87
5.4.390.0200.05318.49
5.4.380.0230.05718.79
5.4.370.0200.05718.74
5.4.360.0130.06318.58
5.4.350.0330.05718.63
5.4.340.0170.07018.50
5.4.320.0200.06018.55
5.4.310.0200.06318.56
5.4.300.0300.05018.60
5.4.290.0300.05718.63
5.4.280.0330.06018.55
5.4.270.0230.08018.49
5.4.260.0270.05318.78
5.4.250.0170.06318.71
5.4.240.0300.06018.77
5.4.230.0270.06318.59
5.4.220.0230.08018.73
5.4.210.0370.06718.79
5.4.200.0430.05716.52
5.4.190.0400.07018.53
5.4.180.0400.06718.82
5.4.170.0370.07318.58
5.4.160.0170.08018.60
5.4.150.0430.06018.79
5.4.140.0370.06716.26
5.4.130.0230.06716.32
5.4.120.0400.05716.47
5.4.110.0400.05316.23
5.4.100.0230.05716.28
5.4.90.0200.07016.26
5.4.80.0170.06016.45
5.4.70.0230.06016.18
5.4.60.0270.05016.31
5.4.50.0270.04716.22
5.4.40.0500.05316.46
5.4.30.0300.06016.31
5.4.20.0300.05016.45
5.4.10.0230.05016.17
5.4.00.0200.05715.75
5.3.290.0300.06314.89
5.3.280.0330.05714.62
5.3.270.0370.07014.70
5.3.260.0270.07014.70
5.3.250.0370.06714.75
5.3.240.0370.05714.71
5.3.230.0300.06714.73
5.3.220.0270.06314.63
5.3.210.0370.06714.66
5.3.200.0230.06314.89
5.3.190.0270.06014.63
5.3.180.0300.05714.65
5.3.170.0300.06714.64
5.3.160.0230.06714.79
5.3.150.0300.05314.89
5.3.140.0230.05714.80
5.3.130.0430.04314.59
5.3.120.0230.06314.87
5.3.110.0370.04714.72
5.3.100.0270.06014.18
5.3.90.0270.05014.25
5.3.80.0270.05014.22
5.3.70.0200.05714.10
5.3.60.0400.05314.13
5.3.50.0370.04314.01
5.3.40.0170.06314.13
5.3.30.0270.04713.95
5.3.20.0200.05313.87
5.3.10.0270.06313.74
5.3.00.0230.06013.72
5.2.170.0200.05311.46
5.2.160.0230.04311.29
5.2.150.0200.05011.23
5.2.140.0200.04711.29
5.2.130.0200.04311.28
5.2.120.0300.04011.18
5.2.110.0230.03311.17
5.2.100.0270.04011.27
5.2.90.0200.04711.16
5.2.80.0300.03311.33
5.2.70.0130.05311.13
5.2.60.0200.04711.21
5.2.50.0100.05311.04
5.2.40.0230.03011.08
5.2.30.0130.04711.05
5.2.20.0200.04011.00
5.2.10.0170.04011.00
5.2.00.0100.04710.83
5.1.60.0170.03310.23
5.1.50.0130.03710.08
5.1.40.0100.04010.16
5.1.30.0170.04310.48
5.1.20.0130.04010.45
5.1.10.0230.02710.11
5.1.00.0130.04710.29
5.0.50.0070.0338.68
5.0.40.0130.0378.44
5.0.30.0030.0508.23
5.0.20.0070.0308.34
5.0.10.0130.0238.20
5.0.00.0130.0378.37
4.4.90.0030.0275.91
4.4.80.0070.0235.90
4.4.70.0000.0305.92
4.4.60.0070.0205.96
4.4.50.0030.0235.88
4.4.40.0100.0336.01
4.4.30.0070.0275.89
4.4.20.0070.0235.92
4.4.10.0070.0235.96
4.4.00.0070.0376.06
4.3.110.0070.0205.80
4.3.100.0070.0235.80
4.3.90.0100.0175.79
4.3.80.0030.0375.82
4.3.70.0070.0205.82
4.3.60.0100.0275.79
4.3.50.0070.0235.82
4.3.40.0070.0435.79
4.3.30.0070.0204.85
4.3.20.0000.0274.85
4.3.10.0130.0234.85
4.3.00.0030.0279.38

preferences:
39.49 ms | 401 KiB | 5 Q