<?php
class A {}
class B extends A {}
$b = new B();
echo get_parent_class($b);
get_class('Character');
$name = 'Character';
$arguments = array();
$reflect = new \ReflectionClass($name);
print_r($reflect);
print_r($name);
print_r($arguments);
$o = $reflect->newInstanceArgs($arguments);
A
Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, string given in /in/mSgQA:10
Stack trace:
#0 {main}
thrown in /in/mSgQA on line 10
Process exited with code 255.
A
Warning: get_class() expects parameter 1 to be object, string given in /in/mSgQA on line 10
Fatal error: Uncaught ReflectionException: Class Character does not exist in /in/mSgQA:15
Stack trace:
#0 /in/mSgQA(15): ReflectionClass->__construct('Character')
#1 {main}
thrown in /in/mSgQA on line 15
Process exited with code 255.
A
Warning: get_class() expects parameter 1 to be object, string given in /in/mSgQA on line 10
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Character does not exist' in /in/mSgQA:15
Stack trace:
#0 /in/mSgQA(15): ReflectionClass->__construct('Character')
#1 {main}
thrown in /in/mSgQA on line 15
Process exited with code 255.