Use php_var_unserialize_has_properties and simplify unserialize function