All 3 of get_object_vars, get_class_vars and reflection getDefaultProperties will reveal the name of the array. For serialization I recommend:
<?php
$cName = get_class($this);
$varTemplate= get_class_vars($cName)
foreach ($varTemplate as $name => $defaultVal) {
$vars[$name] = $this->$name; }
?>
No scan the $vars and create serialization string how you wish.
This protects against erroneous prior deserializing in maintaining the integrity of the class template and ignoring unintended object properties.