3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(&$data) { foreach ($data as $key => $value) { if (is_array($value)) { func($data[$key]); } } } $data = [ ['k' => [0]], ['k' => [1]], ]; ob_start(); debug_zval_dump($data[1]['k']); echo explode("\n", ob_get_clean())[0]."\n"; // refcount(2) func($data); ob_start(); debug_zval_dump($data[1]['k']); echo explode("\n", ob_get_clean())[0]."\n"; // refcount(3) array_replace_recursive($data[0], $data[1]); echo json_encode($data);

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.120.0060.00318.78
8.3.110.0060.00320.94
8.3.100.0080.00424.06
8.3.90.0060.00326.77
8.3.80.0120.00317.97
8.3.70.0140.00718.13
8.3.60.0110.00316.25
8.3.50.0070.01121.02
8.3.40.0090.00918.61
8.3.30.0180.00018.67
8.3.20.0040.00420.16
8.3.10.0040.00423.70
8.3.00.0000.00723.48
8.2.240.0060.00317.37
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0000.01426.77
8.2.200.0070.00318.41
8.2.190.0080.00816.58
8.2.180.0120.00618.24
8.2.170.0040.01122.96
8.2.160.0130.00020.52
8.2.150.0040.00724.18
8.2.140.0000.00724.66
8.2.130.0070.01019.85
8.2.120.0040.00426.35
8.2.110.0090.00019.34
8.2.100.0070.00417.84
8.2.90.0040.00419.01
8.2.80.0050.00317.97
8.2.70.0090.00517.38
8.2.60.0040.00418.16
8.2.50.0040.00418.07
8.2.40.0000.00822.23
8.2.30.0070.00019.55
8.2.20.0040.00417.81
8.2.10.0060.00318.18
8.2.00.0040.00418.04
8.1.300.0070.01320.14
8.1.290.0090.00630.84
8.1.280.0070.01125.92
8.1.270.0130.00023.88
8.1.260.0070.00028.09
8.1.250.0000.00728.09
8.1.240.0000.00921.28
8.1.230.0090.00317.52
8.1.220.0030.00517.79
8.1.210.0040.00418.77
8.1.200.0110.00017.35
8.1.190.0040.00419.01
8.1.180.0030.00618.10
8.1.170.0030.00618.71
8.1.160.0050.00220.80
8.1.150.0040.00418.83
8.1.140.0050.00319.48
8.1.130.0070.00017.61
8.1.120.0040.00417.39
8.1.110.0000.00717.45
8.1.100.0000.00717.50
8.1.90.0040.00417.46
8.1.80.0040.00417.45
8.1.70.0000.00717.38
8.1.60.0000.00717.50
8.1.50.0050.00317.57
8.1.40.0050.00317.58
8.1.30.0000.00817.54
8.1.20.0000.00817.61
8.1.10.0000.00817.55
8.1.00.0070.00017.48
8.0.300.0000.00718.77
8.0.290.0030.00516.75
8.0.280.0000.00718.45
8.0.270.0030.00317.24
8.0.260.0000.00617.21
8.0.250.0000.00716.83
8.0.240.0070.00016.94
8.0.230.0030.00316.88
8.0.220.0020.00516.80
8.0.210.0040.00416.93
8.0.200.0060.00316.92
8.0.190.0000.00716.83
8.0.180.0030.00716.78
8.0.170.0040.00416.95
8.0.160.0000.00716.88
8.0.150.0000.00816.82
8.0.140.0000.00716.73
8.0.130.0030.00313.30
8.0.120.0000.00816.76
8.0.110.0000.00716.78
8.0.100.0000.00716.93
8.0.90.0050.00316.96
8.0.80.0090.00616.88
8.0.70.0000.00716.88
8.0.60.0040.00416.91
8.0.50.0070.00016.78
8.0.30.0080.01017.03
8.0.20.0110.01017.40
8.0.10.0040.00416.88
8.0.00.0130.00816.75
7.4.330.0030.00316.71
7.4.320.0060.00016.46
7.4.300.0030.00316.45
7.4.290.0050.00216.50
7.4.280.0090.00016.50
7.4.270.0000.00716.46
7.4.260.0030.00316.58
7.4.250.0030.00516.57
7.4.240.0020.00616.53
7.4.230.0000.00716.63
7.4.220.0090.00916.56
7.4.210.0090.00916.55
7.4.200.0000.00716.43
7.4.160.0030.01516.55
7.4.150.0070.01117.40
7.4.140.0050.01317.86
7.4.130.0140.00516.59
7.4.120.0080.00916.49
7.4.110.0090.00916.50
7.4.100.0140.00416.62
7.4.90.0160.00316.50
7.4.80.0130.00619.39
7.4.70.0100.00716.50
7.4.60.0080.01116.61
7.4.50.0000.01416.42
7.4.40.0030.01916.54
7.4.30.0150.00316.50
7.4.00.0090.00915.05
7.3.330.0020.00213.40
7.3.320.0000.00613.20
7.3.310.0080.00016.37
7.3.300.0050.00216.30
7.3.290.0100.00716.34
7.3.280.0110.00616.39
7.3.270.0080.00917.40
7.3.260.0090.00916.33
7.3.250.0100.00716.53
7.3.240.0100.00716.42
7.3.230.0030.01516.56
7.3.210.0160.00616.60
7.3.200.0140.00319.39
7.3.190.0030.01416.59
7.3.180.0080.00816.30
7.3.170.0110.00616.46
7.3.160.0050.01416.37
7.3.120.0100.00614.83
7.3.110.0060.01014.60
7.3.100.0100.00714.75
7.3.90.0060.00814.95
7.3.80.0070.00914.94
7.3.70.0070.00514.85
7.3.60.0100.00214.77
7.3.50.0060.00914.75
7.3.40.0070.00314.68
7.3.30.0040.00914.71
7.3.20.0090.00616.73
7.3.10.0070.00616.67
7.3.00.0110.00516.41
7.2.330.0100.00716.70
7.2.320.0090.01216.55
7.2.310.0070.01016.75
7.2.300.0100.01316.59
7.2.290.0090.00916.79
7.2.250.0090.00615.09
7.2.240.0050.01315.23
7.2.230.0060.00914.99
7.2.220.0040.01014.87
7.2.210.0020.01214.88
7.2.200.0060.00614.97
7.2.190.0100.00514.76
7.2.180.0100.00314.89
7.2.170.0050.00815.14
7.2.160.0030.01015.00
7.2.150.0070.00716.84
7.2.140.0010.01117.08
7.2.130.0110.00816.90
7.2.120.0040.00916.90
7.2.110.0110.00816.58
7.2.100.0070.01016.72
7.2.90.0080.00716.69
7.2.80.0080.00716.75
7.2.70.0110.00416.85
7.2.60.0040.01116.76
7.2.50.0090.00916.72
7.2.40.0120.00616.85
7.2.30.0080.00816.92
7.2.20.0090.00816.75
7.2.10.0090.00816.72
7.2.00.0060.01017.55
7.1.330.0060.00815.88
7.1.320.0070.00715.83
7.1.310.0070.01015.82
7.1.300.0030.01115.84
7.1.290.0070.00915.92
7.1.280.0070.00315.72
7.1.270.0100.00515.78
7.1.260.0060.00615.75
7.1.250.0080.00715.71
7.1.240.0070.00415.62
7.1.230.0060.00915.68
7.1.220.0090.00615.51
7.1.210.0090.00315.52
7.1.200.0080.00515.86
7.1.190.0000.01015.79
7.1.180.0100.00015.57
7.1.170.0040.00815.94
7.1.160.0000.01315.61
7.1.150.0070.00315.80
7.1.140.0070.00715.71
7.1.130.0000.01015.95
7.1.120.0040.00715.86
7.1.110.0060.00615.98
7.1.100.0060.00516.93
7.1.90.0090.00315.86
7.1.80.0100.00315.92
7.1.70.0060.00316.54
7.1.60.0050.00917.48
7.1.50.0060.00816.48
7.1.40.0030.01315.64
7.1.30.0100.00315.71
7.1.20.0030.00615.70
7.1.10.0040.00815.77
7.1.00.0030.04518.99
7.0.330.0040.00715.48
7.0.320.0030.00915.19
7.0.310.0070.01015.47
7.0.300.0080.00415.37
7.0.290.0040.00715.44
7.0.280.0030.00915.43
7.0.270.0100.00015.11
7.0.260.0070.00715.50
7.0.250.0060.00615.51
7.0.240.0070.00715.26
7.0.230.0000.00915.26
7.0.220.0070.00715.34
7.0.210.0080.00615.47
7.0.200.0060.00616.00
7.0.190.0070.01015.52
7.0.180.0090.00415.47
7.0.170.0040.00815.46
7.0.160.0040.00815.15
7.0.150.0030.00915.44
7.0.140.0000.00815.46
7.0.130.0090.00315.22
7.0.120.0070.03618.72
7.0.110.0030.04218.80
7.0.100.0030.04018.76
7.0.90.0050.02718.70
7.0.80.0060.03518.58
7.0.70.0040.04118.53
7.0.60.0050.04018.65
7.0.50.0070.04018.94
7.0.40.0070.03717.98
7.0.30.0030.03818.00
7.0.20.0000.04318.06
7.0.10.0020.04118.02
7.0.00.0040.03118.00
5.6.400.0030.01014.30
5.6.390.0060.00914.45
5.6.380.0040.01114.42
5.6.370.0120.00314.18
5.6.360.0030.01014.35
5.6.350.0030.01014.61
5.6.340.0060.00614.60
5.6.330.0090.00014.52
5.6.320.0030.00614.59
5.6.310.0060.00914.38
5.6.300.0080.00413.94
5.6.290.0000.01514.65
5.6.280.0030.02017.81
5.6.270.0030.01014.78
5.6.260.0090.03317.70
5.6.250.0020.03517.95
5.6.240.0030.04117.59
5.6.230.0000.04517.76
5.6.220.0050.04117.71
5.6.210.0070.03917.64
5.6.200.0050.03917.67
5.6.190.0030.04417.63
5.6.180.0020.04117.65
5.6.170.0070.03217.57
5.6.160.0000.04317.52
5.6.150.0090.03517.86
5.6.140.0030.04417.55
5.6.130.0030.04217.53
5.6.120.0050.03717.59
5.6.110.0020.04317.64
5.6.100.0050.03817.81
5.6.90.0030.04117.44
5.6.80.0050.03817.34
5.6.70.0040.04117.12
5.6.60.0070.03717.27
5.6.50.0050.04017.42
5.6.40.0090.03617.29
5.6.30.0030.04017.19
5.6.20.0030.04017.26
5.6.10.0100.03217.44
5.6.00.0000.03417.22
5.5.380.0070.04317.63
5.5.370.0000.06317.51
5.5.360.0000.08017.57
5.5.350.0000.06317.67
5.5.340.0070.07017.91
5.5.330.0000.07318.10
5.5.320.0000.07718.13
5.5.310.0030.07318.12
5.5.300.0030.06718.10
5.5.290.0170.06318.09
5.5.280.0000.07318.13
5.5.270.0070.07318.09
5.5.260.0070.07017.92
5.5.250.0030.07317.74
5.5.240.0070.06317.51
5.5.230.0030.07317.29
5.5.220.0070.06017.30
5.5.210.0000.07317.47
5.5.200.0000.07017.27
5.5.190.0000.07717.44
5.5.180.0100.06717.42
5.5.160.0070.06717.48
5.5.150.0000.06017.28
5.5.140.0100.05317.26
5.5.130.0030.07017.28
5.5.120.0030.06317.40
5.5.110.0000.07017.23
5.5.100.0070.06717.15
5.5.90.0000.06317.38
5.5.80.0030.05717.34
5.5.70.0030.07317.34
5.5.60.0000.07017.48
5.5.50.0030.05717.15
5.5.40.0030.05717.14
5.5.30.0000.07017.33
5.5.20.0000.07717.48
5.5.10.0000.07317.30
5.5.00.0100.06317.16

preferences:
33.22 ms | 403 KiB | 5 Q