3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $p = array( 'abc' => array('test' => array('a')), 'test123' => 'b', ); } class B extends A { public static $p = array( 'abc' => array('test' => array('c')), 'test1' => 'd', ); public static function mergeRecursive($depth = null) { $arrays = func_get_args(); if (!is_array($depth)) array_shift($arrays); else $depth = null; $firstArray = array_shift($arrays); foreach ($arrays as &$array) { if ($depth == 1) { $firstArray = array_merge($firstArray, $array); } else { foreach ($array as $key => &$value) { if (is_int($key)) { $firstArray[] = &$value; } else if (isset($firstArray[$key]) && is_array($firstArray[$key]) && is_array($array[$key])) { $firstArray[$key] = self::mergeRecursive($depth - 1, $firstArray[$key], $value); } else { $firstArray[$key] = &$value; } } } } return $firstArray; } } var_dump((new ReflectionClass('A'))->getDefaultProperties()); $r = new ReflectionClass('B'); $result = array(); do { $result = B::mergeRecursive(2, $r->getDefaultProperties(), $result); } while($r = $r->getParentClass()); $r = new ReflectionClass('A'); var_dump($r->getDefaultProperties());

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.55
8.3.50.0070.01222.08
8.3.40.0140.00718.77
8.3.30.0090.00619.13
8.3.20.0000.00820.34
8.3.10.0000.00823.72
8.3.00.0040.00418.00
8.2.180.0070.01116.75
8.2.170.0120.00922.96
8.2.160.0100.00320.47
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00421.00
8.2.110.0090.00022.19
8.2.100.0050.00818.03
8.2.90.0000.00819.20
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0000.00918.05
8.2.50.0000.00818.07
8.2.40.0000.00718.34
8.2.30.0000.01018.19
8.2.20.0030.00517.67
8.2.10.0000.00818.22
8.2.00.0050.00317.66
8.1.280.0110.00425.92
8.1.270.0060.00323.83
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0110.00019.17
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0060.00317.47
8.1.190.0060.00317.35
8.1.180.0030.00518.10
8.1.170.0050.00318.43
8.1.160.0000.00722.01
8.1.150.0060.00318.90
8.1.140.0070.00017.45
8.1.130.0070.00017.83
8.1.120.0000.00817.40
8.1.110.0000.00717.45
8.1.100.0000.00817.53
8.1.90.0050.00217.36
8.1.80.0070.00017.35
8.1.70.0040.00417.34
8.1.60.0040.00417.58
8.1.50.0000.00817.56
8.1.40.0080.00017.47
8.1.30.0000.00817.56
8.1.20.0040.00417.68
8.1.10.0030.00517.60
8.1.00.0030.00617.53
8.0.300.0040.00420.81
8.0.290.0060.00316.75
8.0.280.0030.00518.42
8.0.270.0040.00417.18
8.0.260.0030.00317.17
8.0.250.0030.00316.96
8.0.240.0080.00016.86
8.0.230.0030.00316.94
8.0.220.0000.00716.86
8.0.210.0040.00416.96
8.0.200.0070.00017.02
8.0.190.0110.00016.96
8.0.180.0000.00717.00
8.0.170.0050.00316.91
8.0.160.0000.00816.89
8.0.150.0040.00416.88
8.0.140.0080.00016.83
8.0.130.0030.00313.24
8.0.120.0030.00616.89
8.0.110.0000.00716.82
8.0.100.0050.00316.67
8.0.90.0000.00716.86
8.0.80.0150.00416.85
8.0.70.0000.00816.70
8.0.60.0050.00316.78
8.0.50.0030.00516.68
8.0.30.0160.00816.86
8.0.20.0100.01517.40
8.0.10.0000.00716.86
8.0.00.0150.00616.85
7.4.330.0000.00515.00
7.4.320.0000.00616.50
7.4.300.0060.00016.51
7.4.290.0030.00316.43
7.4.280.0080.00016.51
7.4.270.0070.00016.63
7.4.260.0070.00016.47
7.4.250.0000.00716.39
7.4.240.0040.00416.62
7.4.230.0030.00316.62
7.4.220.0060.01216.65
7.4.210.0100.01016.48
7.4.200.0040.00416.49
7.4.160.0040.01216.50
7.4.150.0150.00917.40
7.4.140.0040.01417.86
7.4.130.0130.00316.63
7.4.120.0080.00816.66
7.4.110.0150.00816.49
7.4.100.0040.01516.43
7.4.90.0120.00616.44
7.4.80.0090.01819.39
7.4.70.0150.01016.56
7.4.60.0120.01216.46
7.4.50.0000.00516.42
7.4.40.0080.00916.54
7.4.30.0120.00516.64
7.4.00.0070.01114.82
7.3.330.0030.00313.31
7.3.320.0000.00613.15
7.3.310.0030.00316.38
7.3.300.0040.00416.41
7.3.290.0090.00616.46
7.3.280.0050.01316.38
7.3.270.0150.01217.40
7.3.260.0190.00316.61
7.3.250.0080.01216.47
7.3.240.0090.01616.58
7.3.230.0170.00716.63
7.3.210.0030.01416.40
7.3.200.0080.00819.39
7.3.190.0110.01116.57
7.3.180.0080.01316.59
7.3.170.0030.01516.40
7.3.160.0060.01116.68
7.3.120.0070.00715.01
7.3.110.0060.01214.85
7.3.100.0080.00815.06
7.3.90.0000.01114.89
7.3.80.0120.00314.78
7.3.70.0060.00614.82
7.3.60.0040.01115.02
7.3.50.0090.00614.82
7.3.40.0040.00814.89
7.3.30.0070.00314.93
7.3.20.0000.01016.69
7.3.10.0000.01416.73
7.3.00.0060.01016.64
7.2.330.0110.00816.66
7.2.320.0030.01516.83
7.2.310.0100.01316.50
7.2.300.0100.00716.86
7.2.290.0160.00316.62
7.2.250.0070.01015.10
7.2.240.0030.01715.24
7.2.230.0070.00415.23
7.2.220.0030.00915.23
7.2.210.0100.00714.92
7.2.200.0000.01414.95
7.2.190.0090.00314.98
7.2.180.0030.00915.20
7.2.170.0110.00715.23
7.2.130.0150.00416.66
7.2.120.0100.00316.91
7.2.110.0030.00617.04
7.2.100.0120.00616.95
7.2.90.0090.00616.80
7.2.80.0110.00416.71
7.2.70.0060.00616.94
7.2.60.0060.00816.71
7.2.50.0090.00616.63
7.2.40.0110.00417.02
7.2.30.0140.00317.01
7.2.20.0100.00716.61
7.2.10.0060.00916.94
7.2.00.0050.00918.33
7.1.330.0130.00016.03
7.1.320.0070.00715.84
7.1.310.0030.01015.75
7.1.300.0040.01215.74
7.1.290.0070.00415.86
7.1.280.0070.00316.05
7.1.270.0030.01015.80
7.1.260.0000.01515.83
7.1.250.0080.00815.69
7.1.240.0000.01215.54
7.1.230.0000.01515.94
7.1.220.0120.00615.56
7.1.210.0060.00615.73
7.1.200.0050.00515.75
7.1.190.0060.00915.75
7.1.180.0140.00315.41
7.1.170.0070.00315.75
7.1.160.0040.00415.61
7.1.150.0030.01015.72
7.1.140.0040.00415.90
7.1.130.0040.01115.91
7.1.120.0070.00315.67
7.1.110.0060.00615.85
7.1.100.0020.01116.94
7.1.90.0040.01115.85
7.1.80.0060.00815.87
7.1.70.0040.00716.62
7.1.60.0120.00617.79
7.1.50.0050.00916.45
7.1.40.0040.01115.75
7.1.30.0030.00615.83
7.1.20.0100.00715.79
7.1.10.0070.00715.70
7.1.00.0080.04019.02
7.0.330.0000.00915.48
7.0.320.0060.00915.28
7.0.310.0040.00415.25
7.0.300.0040.01215.05
7.0.290.0060.00315.26
7.0.280.0000.01115.35
7.0.270.0040.00415.45
7.0.260.0080.00415.33
7.0.250.0080.00415.14
7.0.240.0090.00615.05
7.0.230.0090.00915.43
7.0.220.0080.00315.38
7.0.210.0060.00915.37
7.0.200.0010.01015.96
7.0.190.0070.01015.18
7.0.180.0190.00015.54
7.0.170.0150.00315.52
7.0.160.0040.00815.46
7.0.150.0030.00515.20
7.0.140.0030.04218.74
7.0.130.0000.01215.51
7.0.120.0030.01015.21
7.0.110.0090.00315.52
7.0.100.0120.04017.71
7.0.90.0120.04217.66
7.0.80.0050.04617.65
7.0.70.0070.03917.46
7.0.60.0100.04317.54
7.0.50.0080.02517.93
7.0.40.0120.04416.78
7.0.30.0020.04216.76
7.0.20.0070.02616.63
7.0.10.0070.02716.65
7.0.00.0050.02916.66
5.6.380.0030.01114.29
5.6.370.0000.01513.93
5.6.360.0030.01014.74
5.6.350.0080.00313.98
5.6.340.0030.01014.45
5.6.330.0040.01114.33
5.6.320.0040.00814.60
5.6.310.0080.00814.45
5.6.300.0050.00514.24
5.6.290.0100.00314.20
5.6.280.0020.04217.72
5.6.270.0100.00314.61
5.6.260.0000.01414.22
5.6.250.0030.04617.51
5.6.240.0080.04317.38
5.6.230.0110.02617.46
5.6.220.0080.04317.55
5.6.210.0060.04717.53
5.6.200.0100.03017.71
5.6.190.0110.03117.73
5.6.180.0070.04017.88
5.6.170.0080.04517.76
5.6.160.0050.02917.71
5.6.150.0060.04817.64
5.6.140.0070.04517.60
5.6.130.0100.04417.78
5.6.120.0120.04217.76
5.6.110.0140.03717.68
5.6.100.0100.04017.59
5.6.90.0190.03217.87
5.6.80.0030.05017.17
5.6.70.0060.04317.27
5.6.60.0090.04217.26
5.6.50.0110.04217.32
5.6.40.0030.04617.31
5.6.30.0140.03317.42
5.6.20.0080.04017.38
5.6.10.0090.02717.37
5.6.00.0080.04017.45
5.5.380.0060.04015.77
5.5.370.0040.03115.79
5.5.360.0080.04215.82
5.5.350.0060.02615.84
5.5.340.0060.04116.06
5.5.330.0030.02815.89
5.5.320.0050.02916.00
5.5.310.0040.04715.96
5.5.300.0020.04516.03
5.5.290.0100.04015.99
5.5.280.0090.04115.93
5.5.270.0070.04215.76
5.5.260.0030.03315.88
5.5.250.0050.04215.93
5.5.240.0060.04515.70
5.5.230.0070.04015.57
5.5.220.0060.04215.73
5.5.210.0120.01815.60
5.5.200.0030.02715.70
5.5.190.0080.04015.68
5.5.180.0050.03315.63
5.5.170.0070.00011.00
5.5.160.0050.03615.65
5.5.150.0050.03815.64
5.5.140.0080.03815.73
5.5.130.0060.04615.76
5.5.120.0040.02815.78
5.5.110.0020.04515.57
5.5.100.0000.03015.54
5.5.90.0100.03715.71
5.5.80.0050.04515.62
5.5.70.0070.03515.66
5.5.60.0030.04415.71
5.5.50.0090.03515.69
5.5.40.0020.04515.67
5.5.30.0000.03315.77
5.5.20.0050.04315.59
5.5.10.0080.04015.48
5.5.00.0120.03315.62
5.4.450.0020.03015.26
5.4.440.0050.04315.27
5.4.430.0110.03815.21
5.4.420.0050.04015.41
5.4.410.0050.04215.13
5.4.400.0110.02915.06
5.4.390.0070.04215.04
5.4.380.0140.03415.11
5.4.370.0100.03815.03
5.4.360.0100.03715.16
5.4.350.0080.03115.08
5.4.340.0050.02715.16
5.4.330.0000.00610.99
5.4.320.0080.04015.10
5.4.310.0140.03315.12
5.4.300.0110.03214.99
5.4.290.0050.04214.98
5.4.280.0030.04814.89
5.4.270.0110.03614.91
5.4.260.0030.04415.07
5.4.250.0100.02015.21
5.4.240.0030.04315.19
5.4.230.0050.03815.03
5.4.220.0080.03815.17
5.4.210.0050.03915.08
5.4.200.0090.03615.09
5.4.190.0030.03514.93
5.4.180.0080.03115.04
5.4.170.0020.02515.14
5.4.160.0070.02215.07
5.4.150.0070.03914.96
5.4.140.0060.03713.91
5.4.130.0060.03813.70
5.4.120.0030.03913.88
5.4.110.0050.04013.62
5.4.100.0050.03213.91
5.4.90.0030.03613.89
5.4.80.0070.03913.84
5.4.70.0070.03913.73
5.4.60.0070.02013.66
5.4.50.0060.03913.68
5.4.40.0000.04213.84
5.4.30.0020.02613.71
5.4.20.0040.02413.77
5.4.10.0000.04213.86
5.4.00.0160.02713.41
5.3.290.0060.04012.82
5.3.280.0050.04212.76
5.3.270.0070.03812.77
5.3.260.0040.03512.75
5.3.250.0070.03712.82
5.3.240.0070.03512.77
5.3.230.0050.04012.78
5.3.220.0020.02812.75
5.3.210.0080.03812.80
5.3.200.0060.03812.80
5.3.190.0060.03912.75
5.3.180.0060.04012.70
5.3.170.0020.03812.73
5.3.160.0070.03012.77
5.3.150.0050.03812.71
5.3.140.0050.04012.77
5.3.130.0010.04112.75
5.3.120.0020.04112.80
5.3.110.0060.02112.74
5.3.100.0100.03112.53
5.3.90.0080.03512.47
5.3.80.0050.04212.46
5.3.70.0080.03312.50
5.3.60.0060.03612.47
5.3.50.0020.02212.45
5.3.40.0020.04212.43
5.3.30.0030.04012.44
5.3.20.0050.03812.27
5.3.10.0070.03512.34
5.3.00.0030.03212.34
5.2.170.0070.03211.07
5.2.160.0070.03710.99
5.2.150.0030.03811.02
5.2.140.0060.03411.06
5.2.130.0080.03011.02
5.2.120.0030.02711.00
5.2.110.0030.03311.05
5.2.100.0050.02011.08
5.2.90.0020.03610.98
5.2.80.0030.03411.01
5.2.70.0030.02211.06
5.2.60.0000.03310.98
5.2.50.0030.03011.04
5.2.40.0030.02610.99
5.2.30.0030.03210.95
5.2.20.0030.02010.87
5.2.10.0030.03110.92
5.2.00.0020.03610.81
5.1.60.0020.01710.48
5.1.50.0050.02710.49
5.1.40.0100.02210.45
5.1.30.0000.03010.56
5.1.20.0020.02910.68
5.1.10.0070.01210.51
5.1.00.0030.02810.54
5.0.50.0020.0189.77
5.0.40.0000.0159.59
5.0.30.0010.0369.63
5.0.20.0050.0129.60
5.0.10.0020.0269.58
5.0.00.0020.0339.60
4.4.90.0030.0159.52
4.4.80.0020.0099.52
4.4.70.0020.0189.52
4.4.60.0000.0219.52
4.4.50.0000.0229.52
4.4.40.0020.0159.52
4.4.30.0040.0089.52
4.4.20.0020.0109.52
4.4.10.0020.0189.52
4.4.00.0030.0209.52
4.3.110.0030.0199.52
4.3.100.0030.0189.52
4.3.90.0000.0219.52
4.3.80.0000.0289.52
4.3.70.0030.0179.52
4.3.60.0040.0169.52
4.3.50.0060.0149.52
4.3.40.0030.0259.52
4.3.30.0000.0189.52
4.3.20.0030.0179.52
4.3.10.0020.0139.52
4.3.00.0000.0189.52

preferences:
40.13 ms | 401 KiB | 5 Q