3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = array( 'grand_total' => array( 'after' => array(), 'before' => array(), '_code' => 'grand_total', ), 'discount' => array( 'after' => array(), 'before' => array('grand_total'), '_code' => 'discount', ), ); reset($configArray); $element = current($configArray); foreach ($configArray as $code => $data) { foreach ($data['before'] as $beforeCode) { if (!isset($configArray[$beforeCode])) { continue; } $configArray[$code]['before'] = array_unique( array_merge( $configArray[$code]['before'], $configArray[$beforeCode]['before'] ) ); $configArray[$beforeCode]['after'] = array_merge( $configArray[$beforeCode]['after'], array($code), $data['after'] ); $configArray[$beforeCode]['after'] = array_unique($configArray[$beforeCode]['after']); } foreach ($data['after'] as $afterCode) { if (!isset($configArray[$afterCode])) { continue; } $configArray[$code]['after'] = array_unique( array_merge( $configArray[$code]['after'], $configArray[$afterCode]['after'] ) ); $configArray[$afterCode]['before'] = array_merge( $configArray[$afterCode]['before'], array($code), $data['before'] ); $configArray[$afterCode]['before'] = array_unique($configArray[$afterCode]['before']); } } function compareTotals($a, $b) { $aCode = $a['_code']; $bCode = $b['_code']; if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) { $res = -1; } elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) { $res = 1; } else { $res = 0; } return $res; } uasort($configArray, 'compareTotals'); print_r(array_keys($configArray));

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.70.0140.00716.58
8.3.60.0120.00318.19
8.3.50.0140.00722.04
8.3.40.0040.01218.79
8.3.30.0100.00319.22
8.3.20.0080.00020.18
8.3.10.0040.00420.30
8.3.00.0030.00619.26
8.2.180.0120.00316.50
8.2.170.0090.00922.96
8.2.160.0070.01420.55
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00520.95
8.2.110.0030.00720.46
8.2.100.0060.00617.84
8.2.90.0040.00417.75
8.2.80.0000.00818.86
8.2.70.0040.00417.63
8.2.60.0040.00417.75
8.2.50.0040.00417.93
8.2.40.0060.00317.80
8.2.30.0030.00619.38
8.2.20.0000.00717.66
8.2.10.0040.00418.05
8.2.00.0070.00317.77
8.1.280.0130.00725.92
8.1.270.0050.00324.04
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0090.00019.26
8.1.230.0110.00017.77
8.1.220.0030.00617.78
8.1.210.0060.00318.77
8.1.200.0000.00917.35
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0000.00717.65
8.1.160.0040.00422.02
8.1.150.0000.00718.89
8.1.140.0040.00417.52
8.1.130.0030.00317.80
8.1.120.0050.00217.56
8.1.110.0040.00417.47
8.1.100.0040.00417.56
8.1.90.0030.00317.48
8.1.80.0030.00317.51
8.1.70.0030.00317.40
8.1.60.0000.00917.64
8.1.50.0000.00817.63
8.1.40.0070.00017.52
8.1.30.0030.00617.61
8.1.20.0000.00717.58
8.1.10.0070.00017.61
8.1.00.0050.00317.43
8.0.300.0050.00318.93
8.0.290.0040.00416.75
8.0.280.0020.00518.48
8.0.270.0000.00717.29
8.0.260.0030.00317.16
8.0.250.0070.00016.99
8.0.240.0000.00816.88
8.0.230.0070.00017.02
8.0.220.0030.00316.93
8.0.210.0030.00316.88
8.0.200.0060.00316.96
8.0.190.0050.00317.00
8.0.180.0040.00416.90
8.0.170.0040.00416.97
8.0.160.0040.00417.00
8.0.150.0000.00716.93
8.0.140.0000.00716.84
8.0.130.0040.00413.31
8.0.120.0060.00316.80
8.0.110.0050.00316.88
8.0.100.0030.00316.74
8.0.90.0000.00816.80
8.0.80.0170.00316.96
8.0.70.0060.00316.93
8.0.60.0040.00416.99
8.0.50.0000.00716.86
8.0.30.0080.01317.05
8.0.20.0090.01117.40
8.0.10.0070.00017.03
8.0.00.0080.01016.69
7.4.330.0060.00015.16
7.4.320.0040.00416.64
7.4.300.0030.00316.63
7.4.290.0030.00316.46
7.4.280.0030.00516.60
7.4.270.0030.00316.44
7.4.260.0000.00716.59
7.4.250.0040.00416.40
7.4.240.0020.00516.58
7.4.230.0030.00316.35
7.4.220.0080.01116.73
7.4.210.0110.00816.66
7.4.200.0040.00416.45
7.4.160.0060.01016.43
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0150.00316.49
7.4.120.0050.01116.55
7.4.110.0060.01116.69
7.4.100.0090.00916.43
7.4.90.0090.00916.38
7.4.80.0110.00619.39
7.4.70.0100.00716.51
7.4.60.0100.00716.59
7.4.50.0000.00516.56
7.4.40.0030.01516.25
7.4.30.0060.01016.50
7.4.00.0070.01014.84
7.3.330.0030.00313.39
7.3.320.0000.00513.27
7.3.310.0030.00316.43
7.3.300.0070.00016.26
7.3.290.0030.01616.41
7.3.280.0070.01016.40
7.3.270.0100.01317.40
7.3.260.0070.01016.65
7.3.250.0080.00916.68
7.3.240.0090.00916.48
7.3.230.0070.01016.39
7.3.210.0030.01616.41
7.3.200.0060.01019.39
7.3.190.0110.00616.57
7.3.180.0060.01016.54
7.3.170.0090.00916.66
7.3.160.0210.00016.50
7.3.120.0060.01214.73
7.3.110.0120.00615.09
7.3.100.0060.00315.07
7.3.90.0090.00314.86
7.3.80.0040.01114.87
7.3.70.0070.01015.07
7.3.60.0060.00614.69
7.3.50.0060.00915.05
7.3.40.0040.00714.86
7.3.30.0030.00714.84
7.3.20.0080.00416.64
7.3.10.0100.00416.51
7.3.00.0090.00916.69
7.2.330.0170.00016.79
7.2.320.0130.00316.83
7.2.310.0170.00316.54
7.2.300.0090.00616.84
7.2.290.0000.01616.85
7.2.250.0070.01115.09
7.2.240.0070.01415.36
7.2.230.0090.00315.22
7.2.220.0000.01315.20
7.2.210.0080.00815.30
7.2.200.0100.00615.18
7.2.190.0100.00314.96
7.2.180.0080.00715.18
7.2.170.0060.00615.02
7.2.130.0070.01316.51
7.2.120.0220.00016.50
7.2.110.0160.00416.30
7.2.100.0130.00816.19
7.2.90.0190.00416.67
7.2.80.0080.01316.56
7.2.70.0140.00716.70
7.2.60.0090.00916.21
7.2.50.0090.00616.50
7.2.40.0060.01516.58
7.2.30.0060.00916.47
7.2.20.0140.00516.55
7.2.10.0110.00716.52
7.2.00.0110.01018.08
7.1.330.0000.01415.60
7.1.320.0040.00715.89
7.1.310.0070.00715.79
7.1.300.0070.00715.65
7.1.290.0070.00715.88
7.1.280.0030.01415.88
7.1.270.0060.00615.80
7.1.260.0070.00315.75
7.1.250.0110.01215.35
7.1.200.0040.00815.77
7.1.100.0050.00518.02
7.1.70.0000.01017.23
7.1.60.0140.00019.61
7.1.50.0040.01117.04
7.1.00.0070.07322.37
7.0.200.0520.00314.61
7.0.140.0030.07022.09
7.0.60.0100.08019.80
7.0.50.0100.05717.88
7.0.40.0100.06320.18
7.0.30.0530.06320.20
7.0.20.0400.07320.28
7.0.10.0200.04020.18
7.0.00.0000.04720.16
5.6.280.0030.07320.79
5.6.210.0070.08020.77
5.6.200.0070.08018.16
5.6.190.0130.08320.77
5.6.180.0200.05020.60
5.6.170.0200.04320.52
5.6.160.0100.08020.56
5.6.150.0000.04718.17
5.6.140.0070.04018.20
5.6.130.0130.07718.28
5.6.120.0030.09021.00
5.6.110.0130.06321.00
5.6.100.0030.08721.04
5.6.90.0170.07321.01
5.6.80.0170.07020.30
5.6.70.4630.03320.54
5.5.350.0170.06020.53
5.5.340.0030.05018.02
5.5.330.0100.08020.41
5.5.320.0330.08720.27
5.5.310.0230.08020.37
5.5.300.0070.03717.98
5.5.290.0100.07317.98
5.5.280.0070.04020.63
5.5.270.0130.07720.69
5.5.260.0200.07020.77
5.5.250.0000.07020.70
5.5.240.2230.05720.30
5.4.450.0400.06019.16
5.4.440.0530.04719.46
5.4.430.0630.03719.54
5.4.420.0200.04719.38
5.4.410.0300.04719.38
5.4.400.0370.04318.84
5.4.390.0270.04719.24
5.4.380.0270.05718.78
5.4.370.0200.05718.78
5.4.360.0370.04318.61
5.4.350.0300.04318.54
5.4.340.0230.04718.71
5.4.320.0090.03512.52
5.4.310.0070.04812.50
5.4.300.0110.04212.52
5.4.290.0060.03912.51
5.4.280.0060.04212.41
5.4.270.0140.04512.41
5.4.260.0100.05612.41
5.4.250.0060.03912.41
5.4.240.0040.03912.40
5.4.230.0040.03912.39
5.4.220.0060.03712.40
5.4.210.0090.03412.40
5.4.200.0050.03912.40
5.4.190.0130.03912.39
5.4.180.0060.05212.39
5.4.170.0090.05012.40
5.4.160.0060.05112.40
5.4.150.0120.04712.40
5.4.140.0090.03812.07
5.4.130.0090.04712.07
5.4.120.0070.04812.02
5.4.110.0100.03412.02
5.4.100.0060.03812.02
5.4.90.0060.03912.02
5.4.80.0130.03012.02
5.4.70.0070.04012.02
5.4.60.0060.03512.02
5.4.50.0060.03612.01
5.4.40.0040.04012.01
5.4.30.0080.03312.00
5.4.20.0080.03312.00
5.4.10.0090.03112.00
5.4.00.0060.03511.49
5.3.290.0100.03512.80
5.3.280.0060.03912.71
5.3.270.0090.03612.72
5.3.260.0060.04112.71
5.3.250.0070.04312.71
5.3.240.0100.03612.71
5.3.230.0100.04112.70
5.3.220.0090.03412.68
5.3.210.0060.03912.68
5.3.200.0060.03712.68
5.3.190.0050.03812.68
5.3.180.0070.03612.67
5.3.170.0100.03612.67
5.3.160.0070.03612.68
5.3.150.0060.03712.68
5.3.140.0070.04512.66
5.3.130.0100.03512.66
5.3.120.0090.03612.66
5.3.110.0050.04712.66
5.3.100.0080.03612.14
5.3.90.0040.03912.12
5.3.80.0030.04012.11
5.3.70.0050.03812.11
5.3.60.0070.03612.09
5.3.50.0050.03712.04
5.3.40.0060.04612.04
5.3.30.0080.03512.00
5.3.20.0080.03811.79
5.3.10.0050.03511.75
5.3.00.0070.03611.73
5.2.170.0050.0329.24
5.2.160.0040.0319.24
5.2.150.0060.0309.24
5.2.140.0040.0319.23
5.2.130.0070.0289.20
5.2.120.0060.0279.20
5.2.110.0030.0329.21
5.2.100.0020.0319.20
5.2.90.0050.0289.20
5.2.80.0080.0279.19
5.2.70.0040.0379.20
5.2.60.0030.0329.15
5.2.50.0030.0329.12
5.2.40.0070.0259.10
5.2.30.0060.0279.06
5.2.20.0040.0299.06
5.2.10.0040.0298.96
5.2.00.0070.0268.83
5.1.60.0050.0238.11
5.1.50.0040.0248.11
5.1.40.0040.0248.09
5.1.30.0050.0268.43
5.1.20.0070.0248.46
5.1.10.0060.0258.18
5.1.00.0040.0268.18
5.0.50.0030.0216.67
5.0.40.0030.0206.53
5.0.30.0070.0286.35
5.0.20.0030.0206.31
5.0.10.0050.0196.29
5.0.00.0050.0296.29
4.4.90.0030.0154.78
4.4.80.0030.0154.75
4.4.70.0050.0134.75
4.4.60.0020.0164.75
4.4.50.0040.0144.77
4.4.40.0040.0244.71
4.4.30.0040.0144.76
4.4.20.0030.0154.85
4.4.10.0030.0164.85
4.4.00.0040.0244.75
4.3.110.0030.0164.67
4.3.100.0040.0134.66
4.3.90.0040.0144.63
4.3.80.0050.0234.58
4.3.70.0030.0144.63
4.3.60.0050.0124.63
4.3.50.0050.0134.62
4.3.40.0060.0264.54
4.3.30.0030.0153.34
4.3.20.0030.0153.32
4.3.10.0020.0163.28
4.3.00.0070.01313.95

preferences:
48.26 ms | 401 KiB | 5 Q