ReflectionClass::export
(PHP 5, PHP 7)
Exports a class
Removed-8-0-0
Description
ReflectionClass::export(mixed $argument, bool $return = false): string
Exports a reflected class.
Parameters
argumentName
returnReturn
Return Values
Return
Examples
Basic usage of ReflectionClass::export
php
<?php
class Apple {
public $var1;
public $var2 = 'Orange';
public function type() {
return 'Apple';
}
}
ReflectionClass::export('Apple');
?>The above example will output something similar to:
output
Class [ <user> class Apple ] {
@@ php shell code 1-8
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [2] {
Property [ <default> public $var1 ]
Property [ <default> public $var2 ]
}
- Methods [1] {
Method [ <user> public method type ] {
@@ php shell code 5 - 7
}
}
}See Also
ReflectionClass::getNameReflectionClass::__toString