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 .= '\\'; } $filter = new \RegexIterator(new \ArrayIterator(\get_declared_classes()), '/^' .\preg_quote($in_namespace). '.*$/'); return \iterator_to_array($filter); } } namespace foo\bar\baz { class qux { } } namespace { var_dump(\foo\bar\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.75
8.3.50.0110.00721.97
8.3.40.0110.00418.67
8.3.30.0040.01118.67
8.3.20.0080.00020.34
8.3.10.0040.00423.71
8.3.00.0080.00019.37
8.2.180.0150.00316.63
8.2.170.0060.00922.96
8.2.160.0000.01420.39
8.2.150.0030.00624.18
8.2.140.0000.00724.66
8.2.130.0060.00317.25
8.2.120.0040.00426.35
8.2.110.0080.00322.25
8.2.100.0080.00317.68
8.2.90.0080.00019.09
8.2.80.0080.00017.97
8.2.70.0090.00017.37
8.2.60.0030.00517.91
8.2.50.0080.00018.07
8.2.40.0080.00019.20
8.2.30.0040.00420.65
8.2.20.0050.00517.45
8.2.10.0030.00517.91
8.2.00.0000.00817.80
8.1.280.0070.00725.92
8.1.270.0000.00823.69
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00022.55
8.1.230.0080.00417.42
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.22
8.1.190.0000.00916.97
8.1.180.0000.00818.10
8.1.170.0000.00718.57
8.1.160.0080.00021.95
8.1.150.0050.00218.75
8.1.140.0030.00619.37
8.1.130.0000.00717.49
8.1.120.0040.00717.34
8.1.110.0040.00417.33
8.1.100.0000.00717.36
8.1.90.0000.00817.22
8.1.80.0090.00017.34
8.1.70.0000.00717.37
8.1.60.0040.00417.46
8.1.50.0080.00017.39
8.1.40.0030.00617.27
8.1.30.0030.00517.46
8.1.20.0050.00317.57
8.1.10.0040.00417.35
8.1.00.0040.00417.22
8.0.300.0050.00318.77
8.0.290.0000.00816.63
8.0.280.0030.00318.23
8.0.270.0030.00317.08
8.0.260.0000.00617.02
8.0.250.0070.00016.88
8.0.240.0000.00716.80
8.0.230.0040.00416.81
8.0.220.0030.00516.81
8.0.210.0000.00816.84
8.0.200.0050.00216.77
8.0.190.0000.00716.86
8.0.180.0070.00016.88
8.0.170.0030.00516.80
8.0.160.0050.00216.89
8.0.150.0040.00416.89
8.0.140.0040.00416.74
8.0.130.0060.00013.19
8.0.120.0000.00816.84
8.0.110.0050.00316.88
8.0.100.0040.00416.88
8.0.90.0080.00016.89
8.0.80.0070.01316.79
8.0.70.0000.00716.70
8.0.60.0050.00216.71
8.0.50.0050.00216.69
8.0.30.0130.00717.06
8.0.20.0100.01217.40
8.0.10.0000.00716.92
8.0.00.0100.00816.61
7.4.330.0050.00016.86
7.4.320.0030.00316.86
7.4.300.0030.00316.70
7.4.290.0030.00316.86
7.4.280.0040.00416.85
7.4.270.0000.00816.74
7.4.260.0000.00716.83
7.4.250.0000.00716.86
7.4.240.0030.00316.80
7.4.230.0000.00716.65
7.4.220.0120.00916.79
7.4.210.0080.00816.87
7.4.200.0000.00716.87
7.4.160.0100.00716.74
7.4.150.0150.01517.40
7.4.140.0090.00917.86
7.4.130.0100.00816.96
7.4.120.0140.00516.84
7.4.110.0090.00916.73
7.4.100.0140.00716.89
7.4.90.0070.01016.76
7.4.80.0070.01019.39
7.4.70.0010.00116.77
7.4.60.0030.01316.96
7.4.50.0090.00916.76
7.4.40.0030.01316.73
7.4.30.0040.01316.92
7.4.00.0080.00615.12
7.3.330.0030.00313.52
7.3.320.0000.00513.51
7.3.310.0040.00416.48
7.3.300.0030.00316.57
7.3.290.0000.00716.66
7.3.280.0080.00816.58
7.3.270.0130.00317.40
7.3.260.0120.00616.89
7.3.250.0110.00716.63
7.3.240.0070.01116.46
7.3.230.0070.01016.69
7.3.210.0110.00716.55
7.3.200.0030.01316.61
7.3.190.0070.01116.77
7.3.180.0130.00316.68
7.3.170.0090.00916.51
7.3.160.0090.00916.52
7.3.120.0120.00615.25
7.3.110.0040.01515.07
7.3.100.0060.01315.07
7.3.90.0060.00615.11
7.3.80.0000.01314.74
7.3.70.0030.00614.97
7.3.60.0000.01215.12
7.3.50.0000.01515.09
7.3.40.0040.01115.02
7.3.30.0060.00915.17
7.3.20.0040.00816.81
7.3.10.0090.00316.94
7.3.00.0070.00716.76
7.2.330.0070.01016.71
7.2.320.0070.01016.76
7.2.310.0100.00716.74
7.2.300.0090.01216.85
7.2.290.0090.00917.00
7.2.250.0030.01615.17
7.2.240.0060.01215.21
7.2.230.0090.00615.38
7.2.220.0070.00714.89
7.2.210.0120.00315.06
7.2.200.0060.00615.39
7.2.190.0040.01115.24
7.2.180.0060.00315.32
7.2.170.0040.01415.30
7.2.60.0060.01016.81
7.2.00.0060.00319.78
7.1.330.0090.00616.18
7.1.320.0030.01315.69
7.1.310.0090.00615.96
7.1.300.0050.00515.95
7.1.290.0040.00416.16
7.1.280.0090.00015.83
7.1.270.0000.00916.17
7.1.260.0060.00615.62
7.1.200.0040.01115.98
7.1.100.0000.01118.57
7.1.70.0000.00817.40
7.1.60.0070.01119.12
7.1.50.0040.01816.90
7.1.00.0070.07322.52
7.0.200.0040.00716.98
7.0.60.0130.06019.97
7.0.50.0100.07718.00
7.0.40.0200.07719.98
7.0.30.0300.08320.11
7.0.20.0300.08020.08
7.0.10.0070.05720.18
7.0.00.0130.07720.14
5.6.280.0030.03021.07
5.6.210.0030.04320.54
5.6.200.0000.04718.22
5.6.190.0070.04020.58
5.6.180.0430.04020.57
5.6.170.0300.07020.51
5.6.160.0030.04320.46
5.6.150.0000.08018.19
5.6.140.0070.08018.15
5.6.130.0130.07718.17
5.6.120.0030.09020.97
5.6.110.0030.04321.08
5.6.100.0030.08721.03
5.6.90.0070.08720.98
5.6.80.0170.07320.34
5.5.350.3470.03020.40
5.5.340.0100.03317.97
5.5.330.0100.07720.47
5.5.320.0030.04020.51
5.5.310.0170.04320.37
5.5.300.0070.08017.98
5.5.290.0100.07017.95
5.5.280.0070.08020.88
5.5.270.0070.08720.72
5.5.260.0070.04320.76
5.5.250.0030.04320.57
5.5.240.0330.06320.23

preferences:
59.83 ms | 401 KiB | 5 Q