3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Arr { public static function dot($array, $prepend = '') { $output = array(); foreach($array as $k => $v) { if(is_array($v)) { $output = array_merge($output, static::dot($v, $prepend . $k . '.')); } else { $output[$prepend . $k] = $v; } } return $output; } public static function dotRev($array, $count = 1, $keySearchPrepend = '') { $output = array(); foreach($array as $ks => $v) { $ks2 = explode('.', $ks); $k = static::lastV($ks2); if(count($ks2) > $count) { $output[$k] = static::dotRev($array, $count + 1, $keySearchPrepend . $k . '.'); } else { if($ks !== $keySearchPrepend . $k) continue; $output[$k] = $v; } } } public static function firstV($array) { if(count($array) < 1) return null; $values = array_values($array); return $values[0]; } public static function lastV($array) { if(count($array) < 1) return null; $values = array_values($array); return $values[(count($values) - 1)]; } public static function firstK($array) { if(count($array) < 1) return null; $values = array_keys($array); return $values[0]; } public static function lastK($array) { if(count($array) < 1) return null; $values = array_keys($array); return $values[(count($values) - 1)]; } } var_export(Arr::dotRev(array ( 'app.config.enviornments.development.0' => 'development.meta.php', 'app.config.enviornments.maintanence.0' => 'maintanence.meta.php', 'app.config.enviornments.production.0' => 'production.meta.php', 'app.config.subdomains.blog.0' => 'blog.meta.php', 'app.config.subdomains.files.0' => 'files.meta.php', 'app.config.subdomains.i.0' => 'i.meta.php', 'app.config.subdomains.www.0' => 'paths.php', 'app.config.subdomains.www.1' => 'www.meta.php', 'app.config.0' => 'app.php', 'app.config.1' => 'database.php', 'app.config.2' => 'paths.php', 'app.0' => 'routing.php', 'bootstrap.0' => 'autoload.php', 'engine.Assets.0' => 'Asset.php', 'engine.Assets.1' => 'Assets.php', 'engine.Console.0' => 'Factory.php', 'engine.Console.1' => 'Manager.php', 'engine.Core.App.0' => 'Application.php', 'engine.Core.App.1' => 'Enviornments.php', 'engine.Core.Errors.0' => 'Error.php', 'engine.Core.Errors.1' => 'ErrorMessages.php', 'engine.Core.Errors.2' => 'Errors.php', 'engine.Core.Settings.0' => 'Factory.php', 'engine.Core.Settings.1' => 'Settings.php', 'engine.Core.0' => 'Constants.php', 'engine.Core.1' => 'Functions.php', 'engine.Database.QueryBuilder.0' => 'Builder.php', 'engine.Database.QueryBuilder.1' => 'Factory.php', 'engine.Database.0' => 'Database.php', 'engine.Filesystem.Exception.0' => 'FileNotFound.php', 'engine.Filesystem.Exception.1' => 'Filesytem.php', 'engine.Filesystem.0' => 'Directory.php', 'engine.Filesystem.1' => 'File.php', 'engine.Filesystem.2' => 'FilePartInterface.php', 'engine.Filesystem.3' => 'Filesystem.php', 'engine.Html.Table.0' => 'AbstractTablePart.php', 'engine.Html.Table.1' => 'TableBody.php', 'engine.Html.Table.2' => 'TableBuilder.php', 'engine.Html.Table.3' => 'TableFooter.php', 'engine.Html.Table.4' => 'TableHeader.php', 'engine.Html.Table.5' => 'TableRow.php', 'engine.Html.0' => 'Assets.php', 'engine.Html.1' => 'HtmlFactory.php', 'engine.Html.2' => 'HtmlTag.php', 'engine.Html.3' => 'HtmlTags.php', 'engine.Http.Request.0' => 'Factory.php', 'engine.Http.Request.1' => 'HttpRequest.php', 'engine.Http.Request.2' => 'HttpResponse.php', 'engine.Http.Route.0' => 'Router.php', 'engine.Logger.Loggers.0' => 'ConsoleLogger.php', 'engine.Logger.Loggers.1' => 'DevWebLogger.php', 'engine.Logger.Loggers.2' => 'NullLogger.php', 'engine.Logger.Loggers.3' => 'StandardLogger.php', 'engine.Logger.Loggers.4' => 'WebLogger.php', 'engine.Logger.0' => 'AbstractLogger.php', 'engine.Logger.1' => 'LoggerInterface.php', 'engine.Logger.2' => 'LoggerLevel.php', 'engine.Request.0' => 'Factory.php', 'engine.Request.1' => 'Request.php', 'engine.Support.DataTypes.0' => 'Arr.php', 'engine.Support.Interfaces.0' => 'Arrayable.php', 'engine.Support.Interfaces.1' => 'Renderable.php', 'engine.Support.0' => 'ArrayUtils.php', 'engine.Support.1' => 'Constants.php', 'engine.Support.2' => 'DataUtils.php', 'engine.Support.3' => 'Factory.php', 'engine.Support.4' => 'StaticInstance.php', 'engine.Support.5' => 'StringUtils.php', 'engine.Support.6' => 'Utilities.php', 'engine.Views.0' => 'AbstractTemplate.php', 'engine.Views.1' => 'CompiledTemplate.php', 'engine.Views.2' => 'NativeTemplate.php', 'engine.Views.3' => 'TemplatingErrorExcpetion.php', 'engine.Views.4' => 'ViewNotFoundException.php', 'engine.Widgets.FileStructure.0' => 'Factory.php', 'engine.Widgets.FileStructure.1' => 'FileStructure.php', 'public.www.0' => 'index.php', 0 => '.htaccess', 1 => 'debug.txt', 2 => 'debug2.txt', 3 => 'debug3.txt', 4 => 'output.txt', 5 => 'test.php', )));

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.0101.99218.43
8.3.50.0131.98822.06
8.3.40.0171.98618.70
8.3.30.0101.99219.22
8.3.20.0032.00020.35
8.3.10.0071.99723.66
8.3.00.0101.99219.25
8.2.180.0131.98818.54
8.2.170.0032.00022.96
8.2.160.0131.99020.52
8.2.150.0031.99824.18
8.2.140.0071.99724.66
8.2.130.0131.98926.16
8.2.120.0071.99422.27
8.2.110.0101.99321.03
8.2.100.0032.00317.84
8.2.90.0031.99917.88
8.2.80.0032.00017.97
8.2.70.0002.00217.63
8.2.60.0032.00018.05
8.2.50.0002.00318.07
8.2.40.0031.99920.00
8.2.30.0032.00118.14
8.2.20.0031.99717.82
8.2.10.0071.99718.13
8.2.00.0032.00017.75
8.1.280.0171.98425.92
8.1.270.0032.00023.79
8.1.260.0101.99126.35
8.1.250.0071.99728.09
8.1.240.0101.99122.46
8.1.230.0072.00017.77
8.1.220.0002.00217.74
8.1.210.0002.00318.77
8.1.200.0071.99617.35
8.1.190.0032.00017.47
8.1.180.0071.99718.10
8.1.170.0032.00420.42
8.1.160.0032.00122.19
8.1.150.0002.00319.00
8.1.140.0031.99717.44
8.1.130.0071.99617.96
8.1.120.0031.99817.51
8.1.110.0031.99917.58
8.1.100.0101.99117.59
8.1.90.0031.99817.56
8.1.80.0032.00117.47
8.1.70.0032.00017.49
8.1.60.0002.00217.72
8.1.50.0031.99817.66
8.1.40.0032.00117.64
8.1.30.0031.99817.75
8.1.20.0071.99717.72
8.1.10.0002.00317.59
8.1.00.0101.99117.49
8.0.300.0002.00318.77
8.0.290.0031.99816.75
8.0.280.0031.99618.49
8.0.270.0031.99817.26
8.0.260.0031.99918.45
8.0.250.0002.00216.97
8.0.240.0002.00416.80
8.0.230.0031.99916.92
8.0.220.0002.00316.86
8.0.210.0071.99516.80
8.0.200.0002.00216.99
8.0.190.0002.00416.93
8.0.180.0101.99516.95
8.0.170.0071.99516.96
8.0.160.0031.99816.86
8.0.150.0002.00416.74
8.0.140.0032.00016.75
8.0.130.0032.00013.42
8.0.120.0002.00216.86
8.0.110.0002.00416.70
8.0.100.0032.00116.89
8.0.90.0032.00016.87
8.0.80.0101.99116.73
8.0.70.0032.00016.86
8.0.60.0031.99816.84
8.0.50.0002.00416.85
8.0.30.0081.99317.07
8.0.20.0181.98217.40
8.0.10.0002.00317.02
8.0.00.0161.98516.78
7.4.330.0051.99915.09
7.4.320.0032.00016.55
7.4.300.0032.00016.53
7.4.290.0002.00016.47
7.4.280.0071.99516.43
7.4.270.0002.00316.55
7.4.260.0031.99916.48
7.4.250.0071.99516.30
7.4.240.0002.00316.45
7.4.230.0131.98816.35
7.4.220.0061.99616.54
7.4.210.0101.99416.64
7.4.200.0002.00416.62
7.4.160.0131.98916.56
7.4.150.0072.00117.40
7.4.140.0111.99317.86
7.4.130.0131.99316.51
7.4.120.0081.99016.44
7.4.110.0292.42616.61
7.4.100.0162.45116.52
7.4.90.0102.44016.53
7.4.80.0261.76619.39
7.4.70.0102.45716.41
7.4.60.0062.46516.41
7.4.50.0032.49616.39
7.4.40.0132.45016.55
7.4.30.0132.43716.30
7.4.00.0032.49014.91
7.3.330.0201.97313.28
7.3.320.0071.99613.29
7.3.310.0031.99916.29
7.3.300.0002.00316.31
7.3.290.0131.99216.32
7.3.280.0101.99816.31
7.3.270.0131.98717.40
7.3.260.0161.98116.34
7.3.250.0032.00716.46
7.3.240.0131.98716.26
7.3.230.0132.46416.46
7.3.210.0102.46816.28
7.3.200.0132.44919.39
7.3.190.0132.40016.40
7.3.180.0102.36916.29
7.3.170.0132.46816.27
7.3.160.0102.45116.52
7.2.330.0102.44616.79
7.2.320.0182.42016.43
7.2.310.0292.42116.55
7.2.300.0102.45516.81
7.2.290.0192.43916.71
7.1.70.0002.50117.22
7.1.60.0032.49819.32
7.1.50.0102.48517.14
7.1.00.0102.49022.21
7.0.200.0002.50116.88
7.0.140.0032.49721.96
7.0.60.0172.46719.88
7.0.50.0102.47317.80
7.0.40.0032.45019.87
7.0.30.0432.42719.88
7.0.20.0132.45019.97
7.0.10.0102.47719.84
7.0.00.0072.41719.79
5.6.280.0102.49021.13
5.6.210.0072.48020.75
5.6.200.0102.46318.26
5.6.190.0102.47020.30
5.6.180.0202.46320.56
5.6.170.0332.45320.41
5.6.160.0072.47320.48
5.6.150.0072.47718.32
5.6.140.0032.48318.36
5.6.130.0172.46318.28
5.6.120.0072.48021.11
5.6.110.0072.47021.11
5.6.100.0072.40720.98
5.6.90.0032.48021.20
5.6.80.0102.47020.55
5.6.70.4372.04320.45
5.5.350.0232.46020.43
5.5.340.0232.42018.13
5.5.330.0132.47320.11
5.5.320.0372.42720.27
5.5.310.0172.46320.22
5.5.300.0132.47318.09
5.5.290.0072.47718.02
5.5.280.0032.48320.85
5.5.270.0102.48020.99
5.5.260.0102.47021.06
5.5.250.0132.47020.88
5.5.240.0302.45720.34
5.4.450.0102.47319.21
5.4.440.0832.26719.50
5.4.430.0902.23719.24
5.4.420.0832.37019.30
5.4.410.1032.33019.48
5.4.400.0872.34019.20
5.4.390.1272.29719.33
5.4.380.1072.32019.31
5.4.370.1402.23319.31
5.4.360.0202.16019.18
5.4.350.0871.89019.14
5.4.340.0061.99512.12
5.4.320.0071.99512.63
5.4.310.0181.98712.63
5.4.300.0091.99412.63
5.4.290.0071.99412.63
5.4.280.0081.99212.52
5.4.270.0111.98912.53
5.4.260.0091.99212.52
5.4.250.0101.99312.52
5.4.240.0061.99412.52
5.4.230.0101.99112.52
5.4.220.0071.99312.52
5.4.210.0071.99412.52
5.4.200.0061.99512.52
5.4.190.0082.00912.52
5.4.180.0151.98812.51
5.4.170.0082.00212.52
5.4.160.0051.99512.52
5.4.150.0071.99512.52
5.4.140.0051.99712.20
5.4.130.0071.99312.18
5.4.120.0081.99312.14
5.4.110.0101.99412.14
5.4.100.0121.99112.14
5.4.90.0031.99812.14
5.4.80.0061.99312.14
5.4.70.0081.99312.14
5.4.60.0071.99412.14
5.4.50.0061.99512.14
5.4.40.0091.99312.13
5.4.30.0091.99212.12
5.4.20.0021.99812.12
5.4.10.0091.99112.13
5.4.00.0091.99211.61
5.3.290.0061.99612.80
5.3.280.0121.98812.73
5.3.270.0111.99012.75
5.3.260.0041.99812.75
5.3.250.0091.99112.75
5.3.240.0061.99412.75
5.3.230.0031.99812.74
5.3.220.0051.99712.71
5.3.210.0101.99112.71
5.3.200.0091.99412.70
5.3.190.0491.96612.71
5.3.180.0311.97912.71
5.3.170.0141.98912.71
5.3.160.0071.99312.71
5.3.150.0061.99612.70
5.3.140.0021.99912.70
5.3.130.0091.99412.69
5.3.120.0071.99212.69
5.3.110.0031.99812.69
5.3.100.0091.99012.18
5.3.90.0111.99112.16
5.3.80.0081.99412.15
5.3.70.0061.99912.15
5.3.60.0051.99612.14
5.3.50.0021.99812.09
5.3.40.0091.99312.09
5.3.30.0091.99212.04
5.3.20.0061.99611.82
5.3.10.0061.99811.79
5.3.00.0101.99111.77
5.2.170.0040.0309.23
5.2.160.0030.0299.23
5.2.150.0020.0339.23
5.2.140.0060.0319.22
5.2.130.0040.0299.18
5.2.120.0030.0299.19
5.2.110.0020.0339.20
5.2.100.0030.0349.19
5.2.90.0020.0359.18
5.2.80.0020.0329.18
5.2.70.0060.0289.18
5.2.60.0060.0299.13
5.2.50.0070.0299.10
5.2.40.0050.0279.08
5.2.30.0080.0329.06
5.2.20.0060.0319.05
5.2.10.0030.0328.95
5.2.00.0030.0318.82
5.1.60.0020.0258.10
5.1.50.0040.0268.10
5.1.40.0040.0348.07
5.1.30.0040.0248.43
5.1.20.0060.0258.45
5.1.10.0040.0278.18
5.1.00.0070.0268.17
5.0.50.0030.0206.65
5.0.40.0030.0196.51
5.0.30.0050.0296.32
5.0.20.0040.0186.29
5.0.10.0020.0216.26
5.0.00.0020.0316.25
4.4.90.0020.0154.78
4.4.80.0030.0144.76
4.4.70.0040.0134.75
4.4.60.0030.0144.75
4.4.50.0060.0204.77
4.4.40.0030.0244.71
4.4.30.0030.0174.76
4.4.20.0030.0144.85
4.4.10.0040.0174.85
4.4.00.0030.0274.75
4.3.110.0030.0224.67
4.3.100.0020.0154.67
4.3.90.0040.0214.63
4.3.80.0050.0214.59
4.3.70.0000.0174.63
4.3.60.0070.0164.63
4.3.50.0020.0164.63
4.3.40.0010.0254.54
4.3.30.0030.0193.30
4.3.20.0010.0173.28
4.3.10.0030.0223.24
4.3.00.0830.0207.01

preferences:
61.86 ms | 401 KiB | 5 Q