Home > PHP > Function > SPL > class_parents()

class_parents()

class_parents - Return the parent classes of the given class

Syntax

array class_parents (mixed $class, bool $autoload)

Arguments

  • class - An object (class instance) or a string (class name).
  • autoload - Whether to allow this function to load the class automatically through the __autoloadmagic method.

Description

This function returns an array with the name of the parent classes of the given class.

Version

PHP 5.1.0

Return value

An array on success, or FALSE on error.