3v4l.org

run code in 300+ PHP versions simultaneously
<?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";
based on kGNuG
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.23, 7.4.0 - 7.4.12, 8.0.0
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, ))