3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo\bar; class bat { }; 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 .= '\\'; } var_dump($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.3.60.0110.00716.61
8.3.50.0100.01121.92
8.3.40.0030.01018.89
8.3.30.0110.00418.59
8.3.20.0100.00020.22
8.3.10.0040.00423.61
8.3.00.0090.00019.13
8.2.180.0180.00416.38
8.2.170.0040.01122.96
8.2.160.0000.01420.53
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00317.50
8.2.120.0070.00026.35
8.2.110.0100.00022.10
8.2.100.0120.00017.90
8.2.90.0000.00818.95
8.2.80.0030.00517.97
8.2.70.0060.00317.38
8.2.60.0000.00717.80
8.2.50.0030.00518.07
8.2.40.0030.00519.42
8.2.30.0000.00720.63
8.2.20.0060.00317.52
8.2.10.0000.00817.84
8.2.00.0000.00817.90
8.1.280.0060.00925.92
8.1.270.0000.00923.80
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00022.45
8.1.230.0080.00317.42
8.1.220.0030.00617.74
8.1.210.0040.00718.77
8.1.200.0040.00417.10
8.1.190.0070.00517.23
8.1.180.0050.00318.10
8.1.170.0070.00018.69
8.1.160.0050.00221.95
8.1.150.0000.00818.79
8.1.140.0000.00819.47
8.1.130.0030.00317.58
8.1.120.0070.00217.37
8.1.110.0000.00717.24
8.1.100.0000.00717.20
8.1.90.0000.00817.32
8.1.80.0030.00517.24
8.1.70.0070.00017.24
8.1.60.0040.00417.36
8.1.50.0040.00417.45
8.1.40.0060.00317.25
8.1.30.0090.00017.55
8.1.20.0000.00717.46
8.1.10.0030.00517.34
8.1.00.0040.00417.30
8.0.300.0040.00418.77
8.0.290.0050.00216.63
8.0.280.0040.00418.32
8.0.270.0070.00017.08
8.0.260.0030.00317.11
8.0.250.0050.00216.90
8.0.240.0040.00416.88
8.0.230.0000.00816.81
8.0.220.0040.00416.71
8.0.210.0040.00416.75
8.0.200.0000.00716.94
8.0.190.0070.00016.79
8.0.180.0040.00416.77
8.0.170.0030.00616.85
8.0.160.0040.00416.87
8.0.150.0070.00016.85
8.0.140.0000.00716.73
8.0.130.0100.00313.22
8.0.120.0060.00316.69
8.0.110.0000.00816.73
8.0.100.0050.00216.71
8.0.90.0030.00316.84
8.0.80.0100.00816.84
8.0.70.0040.00416.79
8.0.60.0030.00616.67
8.0.50.0040.00416.88
8.0.30.0060.01117.13
8.0.20.0130.01517.40
8.0.10.0000.00716.82
8.0.00.0080.01016.56
7.4.330.0000.00616.77
7.4.320.0000.00716.65
7.4.300.0000.00616.74
7.4.290.0000.00716.77
7.4.280.0050.00316.80
7.4.270.0070.00016.72
7.4.260.0040.00716.70
7.4.250.0050.00316.79
7.4.240.0040.00416.73
7.4.230.0070.00016.57
7.4.220.0150.00416.85
7.4.210.0100.00516.75
7.4.200.0030.00316.52
7.4.160.0130.00416.80
7.4.150.0110.00717.40
7.4.140.0130.00817.86
7.4.130.0080.01416.84
7.4.120.0100.00716.76
7.4.110.0000.01816.78
7.4.100.0130.00716.77
7.4.90.0140.00416.55
7.4.80.0140.00319.39
7.4.70.0120.01016.64
7.4.60.0120.00616.59
7.4.50.0070.00716.52
7.4.40.0060.01116.60
7.4.30.0060.01116.83
7.4.00.0100.00715.01
7.3.330.0000.00513.50
7.3.320.0060.00013.34
7.3.310.0050.00216.37
7.3.300.0070.00016.54
7.3.290.0040.00416.41
7.3.280.0140.00616.48
7.3.270.0120.00617.40
7.3.260.0070.01016.71
7.3.250.0090.00816.68
7.3.240.0160.00116.43
7.3.230.0120.00616.56
7.3.210.0070.01316.49
7.3.200.0110.00616.80
7.3.190.0140.00616.79
7.3.180.0070.01016.50
7.3.170.0130.00316.73
7.3.160.0060.00916.41
7.3.10.0170.01016.61
7.3.00.0070.01416.72
7.2.330.0090.00916.79
7.2.320.0230.00716.63
7.2.310.0140.00416.89
7.2.300.0120.00616.99
7.2.290.0090.00916.88
7.2.130.0120.01516.57
7.2.120.0120.00316.86
7.2.110.0120.00416.84
7.2.100.0080.01417.10
7.2.90.0080.00517.08
7.2.80.0100.00716.85
7.2.70.0190.00317.02
7.2.60.0180.00316.95
7.2.50.0110.01417.05
7.2.40.0180.00016.82
7.2.30.0090.00917.24
7.2.20.0150.00616.84
7.2.10.0130.00717.20
7.2.00.0070.00818.46
7.1.250.0150.00915.62
7.1.200.0060.00915.81
7.1.100.0030.00918.24
7.1.70.0000.00817.37
7.1.60.0090.00919.12
7.1.50.0040.01917.30
7.1.00.0030.07722.46
7.0.200.0000.00716.64
7.0.60.0100.06719.96
7.0.50.0070.03717.95
7.0.40.0200.06720.14
7.0.30.0270.07020.23
7.0.20.0300.08020.25
7.0.10.0100.08020.26
7.0.00.0000.10020.25
5.6.280.0000.03321.05
5.6.210.0100.07720.47
5.6.200.0070.06318.19
5.6.190.0070.04020.43
5.6.180.0400.04720.46
5.6.170.0430.08020.48
5.6.160.0030.04720.44
5.6.150.0070.06718.16
5.6.140.0030.05318.29
5.6.130.0100.07318.26
5.6.120.0130.08320.90
5.6.110.0070.05020.98
5.6.100.0130.07320.96
5.6.90.0100.06721.08
5.6.80.0130.08320.41
5.5.350.4200.03720.47
5.5.340.0100.08017.98
5.5.330.0070.08720.44
5.5.320.0070.04320.35
5.5.310.0230.05720.24
5.5.300.0070.05017.98
5.5.290.0100.05317.95
5.5.280.0170.07320.85
5.5.270.0070.05320.74
5.5.260.0100.08020.73
5.5.250.0170.08020.63
5.5.240.0170.05720.07

preferences:
32.45 ms | 401 KiB | 5 Q