3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo\bar { class bat { }; } namespace foo\bar\baz { class qux { } } namespace test { function get_declared_classes($in_namespace = null) { if ($in_namespace === null) { return \get_declared_classes(); } if ($in_namespace{0} == '\\') { $in_namespace = substr($in_namespace, 1); } if (substr($in_namespace, -1) != '\\') { $in_namespace .= '\\'; } $filter = new \RegexIterator(new \ArrayIterator(\get_declared_classes()), '/^' .\preg_quote($in_namespace). '.*$/'); return \iterator_to_array($filter); } var_dump(get_declared_classes("foo\\bar")); }

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.5.30.0080.00817.05
8.5.20.0090.00719.80
8.5.10.0080.01120.16
8.5.00.0100.01120.01
8.4.180.0140.00719.80
8.4.170.0130.00820.37
8.4.160.0120.00923.84
8.4.150.0070.00516.86
8.4.140.0140.00817.86
8.4.130.0140.00518.72
8.4.120.0060.00520.53
8.4.110.0060.00522.44
8.4.100.0120.01017.74
8.4.90.0050.00522.39
8.4.80.0070.00217.93
8.4.70.0040.00718.81
8.4.60.0120.00918.65
8.4.50.0160.00422.41
8.4.40.0030.01524.29
8.4.30.0040.01517.82
8.4.20.0120.00817.71
8.4.10.0170.00317.58
8.3.300.0070.01420.66
8.3.290.0110.00820.82
8.3.280.0080.01318.62
8.3.270.0110.00816.46
8.3.260.0110.00816.52
8.3.250.0080.00818.88
8.3.240.0110.00816.86
8.3.230.0100.00916.63
8.3.220.0050.00217.09
8.3.210.0050.00816.51
8.3.200.0040.00416.68
8.3.190.0080.01017.10
8.3.180.0070.01118.21
8.3.170.0050.00216.91
8.3.160.0040.01420.16
8.3.150.0180.00018.81
8.3.140.0000.00817.07
8.3.130.0050.00318.38
8.3.120.0060.00318.60
8.3.110.0080.00020.94
8.3.100.0130.00324.06
8.3.90.0140.00426.77
8.3.80.0060.00317.97
8.3.70.0070.01416.50
8.3.60.0110.00416.50
8.3.50.0100.00821.95
8.3.40.0000.01418.52
8.3.30.0040.01118.76
8.3.20.0030.00620.34
8.3.10.0070.00023.68
8.3.00.0030.00519.13
8.2.300.0030.00722.18
8.2.290.0140.00620.42
8.2.280.0130.00518.14
8.2.270.0060.01216.92
8.2.260.0110.00716.68
8.2.250.0030.00618.27
8.2.240.0060.00318.80
8.2.230.0080.00022.58
8.2.220.0090.00037.54
8.2.210.0000.00826.77
8.2.200.0040.00416.38
8.2.190.0000.01618.29
8.2.180.0110.01116.63
8.2.170.0070.00722.96
8.2.160.0110.00420.30
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00417.38
8.2.120.0040.00426.35
8.2.110.0030.00622.25
8.2.100.0050.00517.80
8.2.90.0040.00418.92
8.2.80.0030.00617.97
8.2.70.0040.00417.25
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0000.00819.52
8.2.30.0040.00420.50
8.2.20.0030.00517.60
8.2.10.0070.00017.94
8.2.00.0040.00417.84
8.1.340.0100.01021.59
8.1.330.0120.00721.52
8.1.320.0060.00216.34
8.1.310.0150.00318.36
8.1.300.0100.00019.71
8.1.290.0060.00330.84
8.1.280.0070.01025.92
8.1.270.0090.00023.87
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.59
8.1.230.0120.00017.54
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0110.00017.22
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0000.00721.95
8.1.150.0040.00418.75
8.1.140.0040.00419.45
8.1.130.0000.00717.49
8.1.120.0030.00617.42
8.1.110.0000.00817.23
8.1.100.0040.00417.31
8.1.90.0050.00317.35
8.1.80.0050.00317.24
8.1.70.0050.00217.32
8.1.60.0000.00717.46
8.1.50.0000.00817.29
8.1.40.0030.00517.36
8.1.30.0000.00817.45
8.1.20.0000.00817.55
8.1.10.0040.00417.31
8.1.00.0050.00317.33
8.0.300.0030.00618.77
8.0.290.0000.00716.63
8.0.280.0000.00618.29
8.0.270.0030.00317.04
8.0.260.0000.00617.11
8.0.250.0070.00016.90
8.0.240.0080.00016.94
8.0.230.0000.00916.79
8.0.220.0000.00716.74
8.0.210.0000.00716.85
8.0.200.0070.00016.78
8.0.190.0000.00716.89
8.0.180.0060.00316.88
8.0.170.0000.00816.84
8.0.160.0080.00016.74
8.0.150.0000.00716.84
8.0.140.0050.00316.84
8.0.130.0040.00713.28
8.0.120.0060.00316.72
8.0.110.0000.00716.79
8.0.100.0040.00416.78
8.0.90.0000.00716.83
8.0.80.0060.01016.71
8.0.70.0040.00416.78
8.0.60.0070.00016.63
8.0.50.0070.00016.76
8.0.30.0110.00816.84
8.0.20.0090.00917.40
8.0.10.0040.00416.82
8.0.00.0100.00916.64
7.4.330.0030.00316.75
7.4.320.0060.00016.79
7.4.300.0000.00616.75
7.4.290.0070.00016.75
7.4.280.0030.00616.75
7.4.270.0040.00416.78
7.4.260.0060.00316.77
7.4.250.0030.00616.71
7.4.240.0050.00216.80
7.4.230.0000.00716.85
7.4.220.0120.01216.89
7.4.210.0060.00916.76
7.4.200.0050.00316.52
7.4.160.0110.00616.79
7.4.150.0090.01217.40
7.4.140.0100.00917.86
7.4.130.0100.00816.73
7.4.120.0110.00816.75
7.4.110.0070.01416.73
7.4.100.0090.00916.92
7.4.90.0090.00916.70
7.4.80.0100.00719.39
7.4.70.0100.00916.93
7.4.60.0070.01016.67
7.4.50.0040.01516.84
7.4.40.0070.00816.48
7.4.30.0160.00816.69
7.4.00.0100.00515.16
7.3.330.0000.00613.41
7.3.320.0030.00313.33
7.3.310.0070.00016.68
7.3.300.0000.00716.55
7.3.290.0000.00816.54
7.3.280.0100.00816.52
7.3.270.0100.00917.40
7.3.260.0070.01116.88
7.3.250.0120.00616.67
7.3.240.0110.00616.56
7.3.230.0060.01316.89
7.3.210.0100.00716.61
7.3.200.0130.00316.71
7.3.190.0000.01816.77
7.3.180.0100.00716.69
7.3.170.0070.01516.77
7.3.160.0070.01016.73
7.3.120.0060.00614.96
7.3.110.0100.00715.29
7.3.100.0070.01015.20
7.3.90.0130.00315.19
7.3.80.0030.01015.36
7.3.70.0070.00714.89
7.3.60.0030.01415.11
7.3.50.0060.00914.80
7.3.40.0000.01215.01
7.3.30.0160.00015.05
7.3.20.0060.00916.54
7.3.10.0090.00617.08
7.3.00.0090.00616.74
7.2.330.0180.00616.70
7.2.320.0100.01016.96
7.2.310.0030.01316.89
7.2.300.0070.01016.86
7.2.290.0130.00716.74
7.2.250.0100.01015.13
7.2.240.0130.00715.48
7.2.230.0070.01115.19
7.2.220.0080.00415.17
7.2.210.0060.00915.39
7.2.200.0080.00415.27
7.2.190.0030.01315.39
7.2.180.0000.01215.51
7.2.170.0030.01015.35
7.2.60.0180.00417.08
7.2.00.0030.00719.86
7.1.330.0060.01016.24
7.1.320.0060.00316.20
7.1.310.0040.01416.02
7.1.300.0120.00315.73
7.1.290.0070.00716.06
7.1.280.0000.01416.14
7.1.270.0100.00315.95
7.1.260.0090.00616.25
7.1.200.0040.00416.10
7.1.100.0050.00518.33
7.1.70.0000.00817.42
7.1.60.0070.01119.12
7.1.50.0000.02217.31
7.1.00.0070.07322.45
7.0.200.0040.00417.05
7.0.60.0100.08019.94
7.0.50.0130.07317.90
7.0.40.0100.08019.98
7.0.30.0370.07020.21
7.0.20.0270.08320.07
7.0.10.0200.06320.11
7.0.00.0070.05020.10
5.6.280.0030.03020.79
5.6.210.0000.07020.47
5.6.200.0130.05018.21
5.6.190.0070.04320.41
5.6.180.0470.06020.50
5.6.170.0230.08020.54
5.6.160.0030.04320.48
5.6.150.0100.06718.24
5.6.140.0100.07018.18
5.6.130.0100.06018.12
5.6.120.0100.04321.15
5.6.110.0200.07021.12
5.6.100.0130.07021.14
5.6.90.0070.08320.97
5.6.80.0070.08720.40
5.5.350.2370.05720.43
5.5.340.0030.04317.98
5.5.330.0070.08320.40
5.5.320.0030.04020.31
5.5.310.0270.03320.30
5.5.300.0070.08718.07
5.5.290.0100.07317.91
5.5.280.0130.04020.80
5.5.270.0100.08320.68
5.5.260.0130.04320.68
5.5.250.0170.07320.58
5.5.240.0270.07720.24

preferences:
65.01 ms | 1644 KiB | 5 Q