PHP: Hypertext Preprocessor (original) (raw)
ReflectionClass::export
(PHP 5, PHP 7)
ReflectionClass::export — Exports a class
Warning
This function has been_DEPRECATED_ as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged.
Parameters
argument
The reflection to export.
return
Setting to [true](reserved.constants.php#constant.true)
will return the export, as opposed to emitting it. Setting to [false](reserved.constants.php#constant.false)
(the default) will do the opposite.
Return Values
If the return
parameter is set to [true](reserved.constants.php#constant.true)
, then the export is returned as a string, otherwise [null](reserved.constants.php#constant.null)
is returned.
Examples
Example #1 Basic usage of ReflectionClass::export()
`<?php
class Apple {
public $var1;
public $var2 = 'Orange';
public function
type() {
return 'Apple';
}
}
ReflectionClass::export('Apple');
?>`
The above example will output something similar to:
Class [ class Apple ] { @@ php shell code 1-8
Constants [0] { }
Static properties [0] { }
Static methods [0] { }
Properties [2] { Property [ public $var1 ] Property [ public $var2 ] }
Methods [1] { Method [ public method type ] { @@ php shell code 5 - 7 } } }
See Also
- ReflectionClass::getName() - Gets class name
- ReflectionClass::__toString() - Returns the string representation of the ReflectionClass object
Found A Problem?
There are no user contributed notes for this page.