3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo\bar; 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()); 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.3.60.0110.00418.56
8.3.50.0120.00721.92
8.3.40.0040.01118.65
8.3.30.0040.01118.40
8.3.20.0050.00220.07
8.3.10.0080.00023.48
8.3.00.0050.00319.13
8.2.180.0110.00716.38
8.2.170.0120.00322.96
8.2.160.0070.00720.48
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00817.63
8.2.120.0000.00826.35
8.2.110.0070.00321.98
8.2.100.0080.00317.78
8.2.90.0040.00419.03
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0060.00317.91
8.2.50.0050.00318.07
8.2.40.0000.00819.25
8.2.30.0000.00720.49
8.2.20.0030.00617.48
8.2.10.0040.00417.92
8.2.00.0040.00417.90
8.1.280.0090.00925.92
8.1.270.0000.00823.96
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0040.00423.91
8.1.230.0080.00319.06
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0030.00517.23
8.1.180.0000.00718.10
8.1.170.0000.00818.52
8.1.160.0070.00021.89
8.1.150.0040.00418.75
8.1.140.0000.00819.50
8.1.130.0040.00417.53
8.1.120.0000.00917.20
8.1.110.0030.00517.20
8.1.100.0050.00217.25
8.1.90.0040.00417.34
8.1.80.0040.00417.25
8.1.70.0080.00017.26
8.1.60.0040.00417.41
8.1.50.0050.00317.40
8.1.40.0040.00717.27
8.1.30.0030.00517.52
8.1.20.0070.00017.55
8.1.10.0000.00817.28
8.1.00.0040.00417.27
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.31
8.0.270.0070.00017.11
8.0.260.0050.00317.00
8.0.250.0030.00316.77
8.0.240.0040.00416.75
8.0.230.0040.00416.85
8.0.220.0030.00316.75
8.0.210.0030.00316.64
8.0.200.0070.00016.77
8.0.190.0040.00416.89
8.0.180.0040.00416.79
8.0.170.0050.00316.81
8.0.160.0050.00316.78
8.0.150.0000.00816.82
8.0.140.0030.00516.79
8.0.130.0040.00413.30
8.0.120.0030.00616.83
8.0.110.0000.00716.81
8.0.100.0000.00816.85
8.0.90.0070.00016.89
8.0.80.0150.00316.85
8.0.70.0040.00416.77
8.0.60.0000.00816.84
8.0.50.0000.00716.74
8.0.30.0160.00317.11
8.0.20.0120.00817.40
8.0.10.0070.00016.81
8.0.00.0080.01016.71
7.4.330.0250.00972.13
7.4.320.0210.00671.95
7.4.300.0300.00772.00
7.4.290.0230.00772.09
7.4.280.0370.00371.86
7.4.270.0320.00371.94
7.4.260.0390.01071.91
7.4.250.0260.00771.82
7.4.240.0270.00472.01
7.4.230.0330.00072.03
7.4.220.0740.03471.85
7.4.210.0530.01872.04
7.4.200.0270.00372.15
7.4.160.0590.01671.83
7.4.150.0710.01371.87
7.4.140.0550.03072.01
7.4.130.0610.02372.06
7.4.120.0610.01972.16
7.4.110.0570.02072.02
7.4.100.0720.02472.15
7.4.90.0670.03072.17
7.4.80.0520.02671.96
7.4.70.0670.03071.94
7.4.60.0680.01071.99
7.4.50.0270.01772.14
7.4.40.0530.02372.04
7.4.30.0700.03072.16
7.4.00.0170.02770.46
7.3.330.0540.010121.77
7.3.320.0600.003121.63
7.3.310.0120.01871.82
7.3.300.0290.00471.69
7.3.290.0200.00771.84
7.3.280.0530.02071.77
7.3.270.0670.03071.68
7.3.260.0540.03071.94
7.3.250.0610.02671.76
7.3.240.0580.02771.96
7.3.230.0450.02971.79
7.3.210.0470.02771.75
7.3.200.0580.02671.84
7.3.190.0590.01671.89
7.3.180.0510.02671.95
7.3.170.0640.02071.84
7.3.160.0540.02471.95
7.2.330.0670.02571.95
7.2.320.0620.02171.94
7.2.310.0600.03972.25
7.2.300.0530.02372.11
7.2.290.0550.02371.98
7.2.60.1020.02078.57
7.2.00.0200.00381.10
7.1.200.1100.00377.64
7.1.100.0190.00679.89
7.1.70.0930.00778.80
7.1.60.0070.02379.11
7.1.50.0370.01478.86
7.1.00.0130.08084.34
7.0.201.8230.01073.61
7.0.60.0330.08775.59
7.0.50.0170.04373.52
7.0.40.0100.05020.40
7.0.30.0270.04020.24
7.0.20.0400.07020.05
7.0.10.0170.08320.08
7.0.00.0170.06020.25
5.6.280.0270.05385.61
5.6.210.0370.09385.37
5.6.200.0370.08782.84
5.6.190.0230.05085.20
5.6.180.0730.07785.11
5.6.170.0530.06385.11
5.6.160.0200.05785.05
5.6.150.0300.09382.83
5.6.140.0300.09382.86
5.6.130.0230.05382.82
5.6.120.0270.09085.75
5.6.110.0370.07385.68
5.6.100.0470.08085.82
5.6.90.0370.06785.69
5.6.80.0430.08785.22
5.5.350.3600.06385.18
5.5.340.0230.05782.63
5.5.330.0200.06784.88
5.5.320.0170.10784.91
5.5.310.0330.05784.83
5.5.300.0300.09382.60
5.5.290.0230.09082.65
5.5.280.0200.05085.37
5.5.270.0230.07785.39
5.5.260.0270.08385.60
5.5.250.0400.05785.43
5.5.240.0470.08385.08

preferences:
56.15 ms | 401 KiB | 5 Q