â ī¸ Warning â ī¸ Deprecated Code! This video tutorial contains outdated code.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
Using the get_parent_class function
The get_parent_class() function will return the parent class name for the specified subclass.
demo.php
<?php
include_once("class1.php");
$myObj = new subclass1();
echo "Parent class: ".get_parent_class($myObj);
?>
class1.php
<?php
class class1 {
}
class subclass1 extends class1 {
}
?>