Fatal Error RecursiveIteratorIterator not found

As the title says, when I instantiate the class, I get this message:

Fatal error: Class 'Envato\RecursiveIteratorIterator' not found in C:\Users\rgr\Apache\htdocs\Roland Groza [ 3.0 ]\class\envato\envato.php on line 359

You can view the class here: class ;

I create an instance from another file:

require("envato.php");
$test = new Envato\EnvatoAPIWrapper();
echo "User Vitals : ".$test->get_user_vitals("chaoscod3r")."<br>";

The class is wrapped in a namespace, so this may have something to do with it, but I wasn’t sure, since several years have passed since I did not encode PHP. Hope someone has an idea what I'm doing wrong :)

+5
source share
2 answers

To access classes other than names, such as the PHP and SPL inner classes inside the namespace, you must use the fully qualified class name, for example:

new \RecursiveIteratorIterator();

or import it explicitly at the beginning:

use \RecursiveIteratorIterator;

and then use it as usual.

+10

...

\RecursiveIteratorIterator;

, PHP , RecursiveIteratorIterator , ( \)

+1

All Articles