3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruit = array(); $fruit[] = array('id' => 1, 'name' => 'Banana 1'); $fruit[] = array('id' => 1, 'name' => 'Pear 1'); $fruit[] = array('id' => 1, 'name' => 'Mango 1'); $fruit[] = array('id' => 2, 'name' => 'Banana 2'); $fruit[] = array('id' => 2, 'name' => 'Pear 2'); $fruit[] = array('id' => 2, 'name' => 'Mango 2'); $render = array(); $render = array_merge($render, array('fruit' => $fruit)); $render = array_merge_recursive($render, array('pieces' => get_pieces(1))); $render = array_merge($render, array('fruit' => $fruit)); $render = array_merge_recursive($render, array('pieces' => get_pieces(2))); function get_pieces($id) { $pieces = array(); switch ($id) { case 1: $pieces[] = array('number' => 1); $pieces[] = array('number' => 2); break; case 2: $pieces[] = array('number' => 3); $pieces[] = array('number' => 4, 'qwerty' => 1); break; } return $pieces; } var_dump($render);

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.130.0000.00818.47
8.3.120.0090.00920.68
8.3.110.0060.00320.94
8.3.100.0000.00916.65
8.3.90.0000.01526.77
8.3.80.0090.00016.63
8.3.70.0040.01116.63
8.3.60.0150.00616.50
8.3.50.0100.01019.09
8.3.40.0070.00718.60
8.3.30.0120.00418.73
8.3.20.0050.00221.85
8.3.10.0050.00323.43
8.3.00.0080.00021.72
8.2.250.0150.00318.47
8.2.240.0060.00317.34
8.2.230.0080.00022.58
8.2.220.0080.00024.06
8.2.210.0040.00426.77
8.2.200.0050.00318.54
8.2.190.0040.01216.58
8.2.180.0080.00818.38
8.2.170.0090.00622.96
8.2.160.0120.00618.91
8.2.150.0080.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00719.30
8.2.120.0020.00526.35
8.2.110.0050.00521.00
8.2.100.0130.00317.72
8.2.90.0000.00919.09
8.2.80.0090.00017.97
8.2.70.0060.00317.50
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0040.00420.65
8.2.30.0030.00619.26
8.2.20.0000.00717.96
8.2.10.0030.00618.07
8.2.00.0040.00418.25
8.1.300.0160.00317.76
8.1.290.0030.00630.84
8.1.280.0110.00425.92
8.1.270.0040.00422.19
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0000.00922.71
8.1.230.0060.01017.83
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0030.00517.10
8.1.180.0050.00318.10
8.1.170.0030.00518.66
8.1.160.0000.00718.89
8.1.150.0000.00718.96
8.1.140.0000.00719.02
8.1.130.0000.00717.75
8.1.120.0040.00417.33
8.1.110.0070.00017.48
8.1.100.0000.00817.48
8.1.90.0040.00417.50
8.1.80.0040.00417.38
8.1.70.0000.00817.36
8.1.60.0000.01017.48
8.1.50.0000.00817.38
8.1.40.0050.00217.50
8.1.30.0000.00717.55
8.1.20.0030.00517.69
8.1.10.0050.00217.48
8.1.00.0000.00817.46
8.0.300.0080.00018.77
8.0.290.0090.00316.63
8.0.280.0000.00718.40
8.0.270.0000.00717.14
8.0.260.0060.00017.20
8.0.250.0030.00316.94
8.0.240.0030.00316.97
8.0.230.0070.00016.88
8.0.220.0040.00416.73
8.0.210.0030.00716.81
8.0.200.0030.00316.91
8.0.190.0040.00416.88
8.0.180.0070.00016.86
8.0.170.0040.00416.76
8.0.160.0080.00016.79
8.0.150.0070.00016.71
8.0.140.0000.00716.81
8.0.130.0050.00013.34
8.0.120.0040.00416.72
8.0.110.0030.00616.68
8.0.100.0000.00716.86
8.0.90.0000.00716.88
8.0.80.0120.00316.86
8.0.70.0000.00716.87
8.0.60.0040.00416.83
8.0.50.0000.00816.79
8.0.30.0050.01517.10
8.0.20.0110.01117.40
8.0.10.0040.00416.88
8.0.00.0090.01416.65
7.4.330.0050.00015.55
7.4.320.0000.00616.52
7.4.300.0040.00416.48
7.4.290.0070.00016.36
7.4.280.0080.00016.64
7.4.270.0050.00316.50
7.4.260.0000.00716.51
7.4.250.0040.00416.46
7.4.240.0070.00016.43
7.4.230.0000.00716.31
7.4.220.0000.00716.70
7.4.210.0090.00616.54
7.4.200.0030.00616.42
7.4.160.0090.00716.38
7.4.150.0190.00617.40
7.4.140.0130.00717.86
7.4.130.0110.00616.50
7.4.120.0130.00816.48
7.4.110.0060.01016.41
7.4.100.0160.00616.58
7.4.90.0230.00016.61
7.4.80.0110.00519.39
7.4.70.0090.00916.52
7.4.60.0080.00916.34
7.4.50.0030.01316.20
7.4.40.0070.01516.42
7.4.00.0030.01315.07
7.3.330.0030.00313.39
7.3.320.0030.00313.35
7.3.310.0000.00716.36
7.3.300.0000.00716.34
7.3.290.0050.01216.36
7.3.280.0040.01116.46
7.3.270.0120.01617.40
7.3.260.0110.00716.48
7.3.250.0110.00816.45
7.3.240.0130.00716.44
7.3.230.0070.01316.57
7.3.210.0070.01116.64
7.3.200.0070.01116.58
7.3.190.0070.01016.30
7.3.180.0100.00616.63
7.3.170.0170.00016.74
7.3.160.0120.00916.50
7.3.120.0120.00315.07
7.3.110.0030.01014.67
7.3.100.0070.00714.69
7.3.90.0130.00314.76
7.3.80.0070.00414.97
7.3.70.0040.01114.72
7.3.60.0090.00614.84
7.3.50.0050.00614.63
7.3.40.0070.00914.60
7.3.30.0090.00414.62
7.3.20.0080.00815.56
7.3.10.0030.01015.72
7.3.00.0090.00515.71
7.2.330.0060.01516.51
7.2.320.0040.01516.45
7.2.310.0080.01216.62
7.2.300.0070.01016.75
7.2.290.0100.00616.71
7.2.240.0080.00715.26
7.2.230.0080.00714.95
7.2.220.0020.01115.01
7.2.210.0020.01314.91
7.2.200.0070.00715.07
7.2.190.0070.00515.12
7.2.180.0070.00815.12
7.2.170.0070.00814.97
7.2.160.0070.00714.78
7.2.150.0030.01315.99
7.2.140.0110.00416.15
7.2.130.0050.01015.92
7.2.120.0030.01215.98
7.2.110.0050.00716.06
7.2.100.0060.01015.96
7.2.90.0110.00715.95
7.2.80.0090.00716.21
7.2.70.0060.00716.14
7.2.60.0060.01216.16
7.2.50.0090.00915.93
7.2.40.0060.01016.11
7.2.30.0030.01416.15
7.2.20.0110.00816.08
7.2.10.0090.00815.96
7.2.00.0320.00817.17
7.1.330.0080.00514.97
7.1.320.0060.00814.95
7.1.310.0080.00714.96
7.1.300.0070.00714.88
7.1.290.0060.00814.91
7.1.280.0070.00414.97
7.1.270.0070.00814.79
7.1.260.0080.00514.73
7.1.250.0050.01414.95
7.1.240.0070.01013.81
7.1.230.0140.00313.81
7.1.220.0120.00513.60
7.1.210.0040.01314.00
7.1.200.0110.00614.84
7.1.190.0290.00614.04
7.1.180.0100.00713.81
7.1.170.0100.00713.63
7.1.160.0100.01013.87
7.1.150.0170.00313.80
7.1.140.0140.00713.94
7.1.130.0030.01313.83
7.1.120.0360.01116.14
7.1.110.0310.01015.69
7.1.100.0380.01215.59
7.1.90.0340.01415.46
7.1.80.0330.01315.54
7.1.70.0380.00814.98
7.1.60.0440.01228.53
7.1.50.0350.01328.25
7.1.40.0460.01227.90
7.1.30.0540.01227.94
7.1.20.0520.01128.05
7.1.10.0390.01414.39
7.1.00.0300.01114.63
7.0.330.0120.00513.63
5.6.400.0150.00314.42
5.6.390.0060.01014.18
5.6.380.0100.00814.74

preferences:
33.4 ms | 403 KiB | 5 Q