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_dump(Arr::dotRev(Arr::dot(array( 'app' => array ( 'Widgets' => array ( ), 'config' => array ( 'enviornments' => array ( 'development' => array ( 0 => 'development.meta.php', ), 'maintanence' => array ( 0 => 'maintanence.meta.php', ), 'production' => array ( 0 => 'production.meta.php', ), ), 'subdomains' => array ( 'blog' => array ( 0 => 'blog.meta.php', ), 'files' => array ( 0 => 'files.meta.php', ), 'i' => array ( 0 => 'i.meta.php', ), 'www' => array ( 0 => 'paths.php', 1 => 'www.meta.php', ), ), 0 => 'app.php', 1 => 'database.php', 2 => 'paths.php', ), 'controllers' => array ( 'blog' => array ( ), 'files' => array ( ), 'i' => array ( ), 'www' => array ( ), ), 'models' => array ( 'blog' => array ( ), 'files' => array ( ), 'i' => array ( ), 'www' => array ( ), ), 'views' => array ( 'blog' => array ( ), 'files' => array ( ), 'i' => array ( ), 'www' => array ( ), ), 0 => 'routing.php', ), 'bootstrap' => array ( 0 => 'autoload.php', ), 'engine' => array ( 'Assets' => array ( 0 => 'Asset.php', 1 => 'Assets.php', ), 'Auth' => array ( ), 'Console' => array ( 0 => 'Factory.php', 1 => 'Manager.php', ), 'Core' => array ( 'App' => array ( 0 => 'Application.php', 1 => 'Enviornments.php', ), 'Errors' => array ( 0 => 'Error.php', 1 => 'ErrorMessages.php', 2 => 'Errors.php', ), 'Settings' => array ( 0 => 'Factory.php', 1 => 'Settings.php', ), 0 => 'Constants.php', 1 => 'Functions.php', ), 'Database' => array ( 'QueryBuilder' => array ( 0 => 'Builder.php', 1 => 'Factory.php', ), 0 => 'Database.php', ), 'Filesystem' => array ( 'Exception' => array ( 0 => 'FileNotFound.php', 1 => 'Filesytem.php', ), 0 => 'Directory.php', 1 => 'File.php', 2 => 'FilePartInterface.php', 3 => 'Filesystem.php', ), 'Html' => array ( 'Table' => array ( 0 => 'AbstractTablePart.php', 1 => 'TableBody.php', 2 => 'TableBuilder.php', 3 => 'TableFooter.php', 4 => 'TableHeader.php', 5 => 'TableRow.php', ), 0 => 'Assets.php', 1 => 'HtmlFactory.php', 2 => 'HtmlTag.php', 3 => 'HtmlTags.php', ), 'Http' => array ( 'Request' => array ( 0 => 'Factory.php', 1 => 'HttpRequest.php', 2 => 'HttpResponse.php', ), 'Route' => array ( 0 => 'Router.php', ), ), 'Logger' => array ( 'Loggers' => array ( 0 => 'ConsoleLogger.php', 1 => 'DevWebLogger.php', 2 => 'NullLogger.php', 3 => 'StandardLogger.php', 4 => 'WebLogger.php', ), 0 => 'AbstractLogger.php', 1 => 'LoggerInterface.php', 2 => 'LoggerLevel.php', ), 'Request' => array ( 0 => 'Factory.php', 1 => 'Request.php', ), 'Support' => array ( 'DataTypes' => array ( 0 => 'Arr.php', ), 'Interfaces' => array ( 0 => 'Arrayable.php', 1 => 'Renderable.php', ), 'Traits' => array ( ), 0 => 'ArrayUtils.php', 1 => 'Constants.php', 2 => 'DataUtils.php', 3 => 'Factory.php', 4 => 'StaticInstance.php', 5 => 'StringUtils.php', 6 => 'Utilities.php', ), 'Views' => array ( 0 => 'AbstractTemplate.php', 1 => 'CompiledTemplate.php', 2 => 'NativeTemplate.php', 3 => 'TemplatingErrorExcpetion.php', 4 => 'ViewNotFoundException.php', ), 'Widgets' => array ( 'FileStructure' => array ( 0 => 'Factory.php', 1 => 'FileStructure.php', ), ), ), 'library' => array ( ), 'public' => array ( 'blog' => array ( ), 'files' => array ( ), 'i' => array ( ), 'www' => array ( 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.99318.43
8.3.50.0171.98521.94
8.3.40.0101.99218.66
8.3.30.0171.98719.09
8.3.20.0031.99920.13
8.3.10.0071.99423.52
8.3.00.0031.99819.50
8.2.180.0101.99416.50
8.2.170.0131.98822.96
8.2.160.0002.00320.47
8.2.150.0071.99624.18
8.2.140.0002.00324.66
8.2.130.0031.99826.16
8.2.120.0071.99622.23
8.2.110.0032.00122.11
8.2.100.0031.99817.63
8.2.90.0071.99719.30
8.2.80.0002.00217.97
8.2.70.0031.99817.75
8.2.60.0101.99117.93
8.2.50.0072.00018.07
8.2.40.0071.99418.34
8.2.30.0071.99418.11
8.2.20.0002.00317.76
8.2.10.0031.99918.30
8.2.00.0071.99717.86
8.1.280.0171.98725.92
8.1.270.0031.99822.14
8.1.260.0131.98926.35
8.1.250.0031.99828.09
8.1.240.0002.00224.02
8.1.230.0071.99719.00
8.1.220.0071.99417.78
8.1.210.0071.99518.77
8.1.200.0002.00317.38
8.1.190.0071.99717.13
8.1.180.0032.00118.10
8.1.170.0031.99718.70
8.1.160.0031.99922.03
8.1.150.0031.99919.03
8.1.140.0002.00317.54
8.1.130.0002.00617.94
8.1.120.0031.99917.62
8.1.110.0002.00317.59
8.1.100.0002.00717.54
8.1.90.0031.99917.58
8.1.80.0002.00217.55
8.1.70.0031.99917.57
8.1.60.0032.00017.69
8.1.50.0002.00217.52
8.1.40.0071.99517.52
8.1.30.0002.00117.57
8.1.20.0101.99117.76
8.1.10.0002.00317.65
8.1.00.0002.00217.63
8.0.300.0002.00318.77
8.0.290.0031.99816.75
8.0.280.0031.99918.47
8.0.270.0031.99917.35
8.0.260.0031.99918.43
8.0.250.0032.00016.93
8.0.240.0071.99616.99
8.0.230.0002.00416.94
8.0.220.0002.00316.70
8.0.210.0002.00116.79
8.0.200.0031.99916.81
8.0.190.0101.99116.81
8.0.180.0071.99616.90
8.0.170.0032.00116.90
8.0.160.0002.00316.77
8.0.150.0031.99816.79
8.0.140.0002.00416.82
8.0.130.0071.99013.34
8.0.120.0071.99516.73
8.0.110.0071.99416.84
8.0.100.0031.99816.66
8.0.90.0002.00216.88
8.0.80.0131.98716.77
8.0.70.0002.00216.84
8.0.60.0101.99316.85
8.0.50.0131.98916.77
8.0.30.0161.97816.89
8.0.20.0101.99217.40
8.0.10.0032.00016.95
8.0.00.0071.99016.66
7.4.330.0102.00315.02
7.4.320.0002.00216.51
7.4.300.0002.00216.42
7.4.290.0031.99816.35
7.4.280.0031.99916.41
7.4.270.0031.99816.54
7.4.260.0032.00016.34
7.4.250.0101.99316.37
7.4.240.0051.99816.47
7.4.230.0002.00516.55
7.4.220.0032.00016.61
7.4.210.0081.99116.52
7.4.200.0171.98716.41
7.4.160.0071.99616.41
7.4.150.0071.99917.40
7.4.140.0101.98817.86
7.4.130.0151.98616.52
7.4.120.0151.98816.43
7.4.110.0262.40016.53
7.4.100.0192.44016.46
7.4.90.0162.46016.35
7.4.80.0192.40219.39
7.4.70.0262.41616.46
7.4.60.0072.46316.37
7.4.50.0072.49216.33
7.4.40.0132.44416.59
7.4.30.0072.46716.49
7.4.00.0102.48814.54
7.3.330.0161.94813.23
7.3.320.0002.00213.41
7.3.310.0002.00216.27
7.3.300.0071.99416.35
7.3.290.0061.99716.28
7.3.280.0131.98816.31
7.3.270.0361.98517.40
7.3.260.0101.99016.36
7.3.250.0331.96116.47
7.3.240.0231.97816.13
7.3.230.0062.46516.39
7.3.210.0102.45716.46
7.3.200.0102.43419.39
7.3.190.0182.43716.47
7.3.180.0072.46416.60
7.3.170.0132.46116.48
7.3.160.0192.45216.39
7.2.330.0072.44516.78
7.2.320.0062.39316.82
7.2.310.0232.38616.57
7.2.300.0202.43316.74
7.2.290.0202.41616.42
7.2.60.0102.48516.52
7.2.00.0072.49419.12
7.1.200.0032.49415.81
7.1.100.0032.49818.13
7.1.70.0032.49816.99
7.1.60.0102.49119.32
7.1.50.0102.49217.13
7.1.00.0132.48722.24
7.0.200.0032.49816.72
7.0.140.0072.49321.93
7.0.60.0172.46720.04
7.0.50.0072.47717.85
7.0.40.0172.46719.99
7.0.30.2402.24319.98
7.0.20.0302.45319.91
7.0.10.0132.47319.88
7.0.00.0032.47019.72
5.6.280.0032.49721.23
5.6.210.0032.48320.86
5.6.200.0002.47318.31
5.6.190.0102.45020.51
5.6.180.0272.44320.48
5.6.170.0372.41320.46
5.6.160.0032.48020.57
5.6.150.0032.48018.26
5.6.140.0072.47318.38
5.6.130.0032.47718.30
5.6.120.0032.47721.28
5.6.110.0002.48721.16
5.6.100.0072.48021.12
5.6.90.0132.46721.10
5.6.80.0032.48020.51
5.6.70.0032.47020.64
5.5.350.0272.45320.49
5.5.340.0072.48017.96
5.5.330.0072.46320.43
5.5.320.0372.43720.39
5.5.310.0302.45720.30
5.5.300.0072.46318.09
5.5.290.0102.47718.10
5.5.280.0032.48020.87
5.5.270.0032.48021.01
5.5.260.0102.47020.78
5.5.250.0132.30020.93
5.5.240.0172.46320.49
5.4.450.0102.45319.25
5.4.440.1132.35719.39
5.4.430.1202.31719.71
5.4.420.1071.82319.55
5.4.410.0632.30019.43
5.4.400.0932.36319.12
5.4.390.0802.29318.95
5.4.380.0902.38019.32
5.4.370.0972.29719.35
5.4.360.0702.14019.21
5.4.350.1002.22719.35
5.4.340.0101.99112.15
5.4.320.0131.99012.66
5.4.310.0151.98712.66
5.4.300.0091.99112.66
5.4.290.0091.99212.66
5.4.280.0161.98512.56
5.4.270.0051.99612.55
5.4.260.0151.98712.56
5.4.250.0111.99312.55
5.4.240.0091.99412.56
5.4.230.0071.99312.55
5.4.220.0171.98512.55
5.4.210.0161.98612.55
5.4.200.0191.98212.55
5.4.190.0131.98712.55
5.4.180.0121.98912.55
5.4.170.0141.98812.56
5.4.160.0111.98912.55
5.4.150.0121.98912.55
5.4.140.0071.99412.23
5.4.130.0221.98112.22
5.4.120.0221.98112.18
5.4.110.0181.98412.18
5.4.100.0111.99012.18
5.4.90.0171.98512.17
5.4.80.0151.98612.18
5.4.70.0131.99012.18
5.4.60.0071.99512.17
5.4.50.0111.98912.17
5.4.40.0061.99312.16
5.4.30.0161.98512.16
5.4.20.0121.99312.16
5.4.10.0071.99512.16
5.4.00.0051.99511.64
5.3.290.0111.98812.85
5.3.280.0181.98612.77
5.3.270.0101.99212.78
5.3.260.0051.99512.78
5.3.250.0061.99612.78
5.3.240.0071.99412.78
5.3.230.0081.99512.77
5.3.220.0161.98512.74
5.3.210.0141.98612.75
5.3.200.0111.99012.74
5.3.190.0101.99212.74
5.3.180.0201.98012.74
5.3.170.0071.99412.74
5.3.160.0101.99112.73
5.3.150.0121.98812.74
5.3.140.0101.99112.73
5.3.130.0131.99012.72
5.3.120.0171.98512.72
5.3.110.0071.99512.72
5.3.100.0071.99712.21
5.3.90.0161.98412.20
5.3.80.0111.99012.18
5.3.70.0081.99112.18
5.3.60.0161.98412.17
5.3.50.0051.99512.12
5.3.40.0111.98912.12
5.3.30.0141.98812.08
5.3.20.0071.99611.86
5.3.10.0071.99411.82
5.3.00.0121.98911.80
5.2.170.0040.0309.23
5.2.160.0080.0369.23
5.2.150.0030.0319.23
5.2.140.0060.0339.23
5.2.130.0060.0269.19
5.2.120.0050.0279.19
5.2.110.0030.0459.20
5.2.100.0070.0269.18
5.2.90.0060.0359.18
5.2.80.0050.0299.18
5.2.70.0050.0289.18
5.2.60.0030.0309.14
5.2.50.0070.0279.11
5.2.40.0060.0269.08
5.2.30.0030.0329.06
5.2.20.0130.0359.04
5.2.10.0020.0308.95
5.2.00.0090.0248.82
5.1.60.0030.0248.10
5.1.50.0040.0298.10
5.1.40.0060.0268.08
5.1.30.0060.0258.42
5.1.20.0140.0278.45
5.1.10.0070.0238.18
5.1.00.0070.0278.18
5.0.50.0060.0176.66
5.0.40.0020.0216.50
5.0.30.0020.0326.33
5.0.20.0030.0196.29
5.0.10.0020.0216.27
5.0.00.0040.0296.26
4.4.90.0060.0134.78
4.4.80.0050.0134.76
4.4.70.0050.0214.75
4.4.60.0050.0134.75
4.4.50.0050.0184.77
4.4.40.0060.0254.71
4.4.30.0020.0164.76
4.4.20.0030.0154.85
4.4.10.0030.0154.85
4.4.00.0030.0264.76
4.3.110.0030.0154.67
4.3.100.0020.0154.66
4.3.90.0050.0194.63
4.3.80.0050.0284.59
4.3.70.0060.0114.63
4.3.60.0040.0134.63
4.3.50.0020.0164.63
4.3.40.0040.0224.54
4.3.30.0020.0153.30
4.3.20.0010.0173.28
4.3.10.0020.0163.24
4.3.00.0170.0207.01

preferences:
44.37 ms | 401 KiB | 5 Q