1.2.1034. Reflection Export() Is Deprecated¶
export() method in Reflection classes is now deprecated. It is obsolete since PHP 7.4 and will disappear in PHP 8.0.
The Reflector interface, which is implemented by all reflection classes, specifies two methods: __toString() and export().
<?php
ReflectionFunction::export('foo');
// same as
echo new ReflectionFunction('foo'), "\n";
$str = ReflectionFunction::export('foo', true);
// same as
$str = (string) new ReflectionFunction('foo');
?>
See also Reflection export() methods and Reflection.
1.2.1034.1. Connex PHP features¶
1.2.1034.1.1. Suggestions¶
Cast the object to string
Remove the call to export()
1.2.1034.1.2. Specs¶
Short name |
Php/ReflectionExportIsDeprecated |
Rulesets |
|
Exakat since |
1.9.0 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Changed Behavior |
PHP 7.4 |
Precision |
Very high |
Available in |