<?php
$fixed = SplFixedArray::fromArray(range(1, 3));
$fixed->undefined = 'undefined';
$serialized = serialize($fixed);
$unserialized = unserialize($serialized);
var_dump($unserialized);
var_export($unserialized); echo "\n";
// for comparison
var_dump($fixed);
var_export($fixed); echo "\n";
- Output for 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- Deprecated: Creation of dynamic property SplFixedArray::$undefined is deprecated in /in/IMnI5 on line 4
Deprecated: Creation of dynamic property SplFixedArray::$undefined is deprecated in /in/IMnI5 on line 7
object(SplFixedArray)#2 (4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
["undefined"]=>
string(9) "undefined"
}
\SplFixedArray::__set_state(array(
0 => 1,
1 => 2,
2 => 3,
'undefined' => 'undefined',
))
object(SplFixedArray)#1 (4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
["undefined"]=>
string(9) "undefined"
}
\SplFixedArray::__set_state(array(
0 => 1,
1 => 2,
2 => 3,
'undefined' => 'undefined',
))
- Output for 8.2.0 - 8.2.29
- Deprecated: Creation of dynamic property SplFixedArray::$undefined is deprecated in /in/IMnI5 on line 4
Deprecated: Creation of dynamic property SplFixedArray::$undefined is deprecated in /in/IMnI5 on line 7
object(SplFixedArray)#2 (4) {
["undefined"]=>
string(9) "undefined"
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
\SplFixedArray::__set_state(array(
'undefined' => 'undefined',
0 => 1,
1 => 2,
2 => 3,
))
object(SplFixedArray)#1 (4) {
["undefined"]=>
string(9) "undefined"
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
\SplFixedArray::__set_state(array(
'undefined' => 'undefined',
0 => 1,
1 => 2,
2 => 3,
))
- Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33
- object(SplFixedArray)#2 (4) {
[0]=>
string(9) "undefined"
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
}
SplFixedArray::__set_state(array(
0 => 'undefined',
1 => 1,
2 => 2,
3 => 3,
))
object(SplFixedArray)#1 (4) {
["undefined"]=>
string(9) "undefined"
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
SplFixedArray::__set_state(array(
'undefined' => 'undefined',
0 => 1,
1 => 2,
2 => 3,
))
preferences:
136 ms | 412 KiB | 5 Q