← All docs

get_object_vars()

Returns the accessible non-static properties of an object.

get_object_vars()

function get_object_vars(mixed $object): array

Returns the accessible non-static properties of an object.

Parameters:

  • $object (mixed)

Returns: array

Availability

Examples:

// Full example: examples/get-object-vars/main.php $vars = get_object_vars($object); echo $vars[‘name’];

Internals

For how get_object_vars is implemented in the compiler, see the internals page.