@ 2015-10-12T05:29:28Z <?php
var_dump([
$original_set = [ 'arrayobject' => new arrayobject( [3] ), 'reference?' => [5] ],
$original_serialized = serialize( $original_set ),
$original_unserialized = unserialize( $original_serialized ),
$withreference_serialized = preg_replace( '/a:1:{i:0;i:5;}}/', 'R:4;}', $original_serialized ),
$withreference_unserialized = unserialize( $withreference_serialized ),
$withreference_unserialized['reference?'][9] = 8,
$withreference_unserialized,
$withreference_unserialized['arrayobject'][9] === $withreference_unserialized['reference?'][9]
? 'looks like a reference' : 'does not look like a reference' ,
]) ;
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 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.6 Fatal error: Uncaught InvalidArgumentException: Passed variable is not an array or object in /in/cYUIa:8
Stack trace:
#0 [internal function]: ArrayObject->__unserialize(Array)
#1 /in/cYUIa(8): unserialize('a:2:{s:11:"arra...')
#2 {main}
thrown in /in/cYUIa on line 8
Process exited with code 255 . Output for 7.3.32 - 7.3.33 array(8) {
[0]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[1]=>
string(110) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";a:1:{i:0;i:5;}}"
[2]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[3]=>
string(100) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";R:4;}"
[4]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
NULL
}
[5]=>
int(8)
[6]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[9]=>
int(8)
}
}
[7]=>
string(30) "does not look like a reference"
}
Output for 7.3.16 - 7.3.31 Notice: Undefined offset: 9 in /in/cYUIa on line 11
array(8) {
[0]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[1]=>
string(110) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";a:1:{i:0;i:5;}}"
[2]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[3]=>
string(100) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";R:4;}"
[4]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
NULL
}
[5]=>
int(8)
[6]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[9]=>
int(8)
}
}
[7]=>
string(30) "does not look like a reference"
}
Output for 7.1.10 - 7.1.25 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.1 Notice: Undefined offset: 9 in /in/cYUIa on line 11
array(8) {
[0]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[1]=>
string(110) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";a:1:{i:0;i:5;}}"
[2]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[3]=>
string(100) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";R:4;}"
[4]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(3)
}
}
[5]=>
int(8)
[6]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(2) {
[0]=>
int(3)
[9]=>
int(8)
}
}
[7]=>
string(30) "does not look like a reference"
}
Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.7 Process exited with code 139 . Output for 5.4.2 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.8 - 5.6.21 array(8) {
[0]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[1]=>
string(110) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";a:1:{i:0;i:5;}}"
[2]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
array(1) {
[0]=>
int(3)
}
}
["reference?"]=>
array(1) {
[0]=>
int(5)
}
}
[3]=>
string(100) "a:2:{s:11:"arrayobject";C:11:"ArrayObject":29:{x:i:0;a:1:{i:0;i:3;};m:a:0:{}}s:10:"reference?";R:4;}"
[4]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
&array(2) {
[0]=>
int(3)
[9]=>
int(8)
}
}
["reference?"]=>
&array(2) {
[0]=>
int(3)
[9]=>
int(8)
}
}
[5]=>
int(8)
[6]=>
array(2) {
["arrayobject"]=>
object(ArrayObject)#3 (1) {
["storage":"ArrayObject":private]=>
&array(2) {
[0]=>
int(3)
[9]=>
int(8)
}
}
["reference?"]=>
&array(2) {
[0]=>
int(3)
[9]=>
int(8)
}
}
[7]=>
string(22) "looks like a reference"
}
preferences:dark mode live preview
185.42 ms | 405 KiB | 240 Q