<?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.4, 8.3.6
- 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.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
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.18
- 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.28
- 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:
173.23 ms | 403 KiB | 182 Q