<?php
function a() {
$myArray = array();
$myArray[1] = array(1,2,3,4,5,6,7,8,9,10);
$myArray[2] = array(1,2,3,4,5,6,7,8,9,10);
$myArray[3] = array(1,2,3,4,5,6,7,8,9,10);
debug_zval_dump($myArray[1]);
}
function b() {
$myArray = array();
$myArray[1] = array(1,2,3);
$myArray[2] = array(1,2,3);
$myArray[3] = array(1,2,3);
$myArray[4] = array(1,2,3);
$myArray[5] = array(1,2,3);
$myArray[6] = array(1,2,3);
$myArray[7] = array(1,2,3);
$myArray[8] = array(1,2,3);
$myArray[9] = array(1,2,3);
$myArray[10] = array(1,2,3);
debug_zval_dump($myArray[1]);
}
a();b();
- Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- array(10) refcount(3){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
}
array(3) refcount(3){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
array(10) refcount(3){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
}
array(3) refcount(3){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
- Output for 7.0.0 - 7.0.20
- array(10) refcount(2){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
}
array(3) refcount(2){
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
- Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
- array(10) refcount(2){
[0]=>
long(1) refcount(1)
[1]=>
long(2) refcount(1)
[2]=>
long(3) refcount(1)
[3]=>
long(4) refcount(1)
[4]=>
long(5) refcount(1)
[5]=>
long(6) refcount(1)
[6]=>
long(7) refcount(1)
[7]=>
long(8) refcount(1)
[8]=>
long(9) refcount(1)
[9]=>
long(10) refcount(1)
}
array(3) refcount(2){
[0]=>
long(1) refcount(1)
[1]=>
long(2) refcount(1)
[2]=>
long(3) refcount(1)
}
preferences:
182.07 ms | 402 KiB | 183 Q