<?php
if (class_exists('RecursiveDirectoryIterator')) {
$i1 = new RecursiveDirectoryIterator('/tmp');
$i2 = new RecursiveDirectoryIterator('/home');
foreach($i1 as $f) {}
foreach($i2 as $f) {}
var_dump($i1 == $i2);
} else {
var_dump('Class RecursiveDirectoryIterator does not exist');
}
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(): open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/tmp:/in:/etc) in /in/pggLd:5
Stack trace:
#0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home')
#1 {main}
thrown in /in/pggLd on line 5
Process exited with code 255.
Output for 8.0.13
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/home): Failed to open directory: Permission denied in /in/pggLd:5
Stack trace:
#0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home')
#1 {main}
thrown in /in/pggLd on line 5
Process exited with code 255.
Output for 7.0.4, 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/home): failed to open dir: Permission denied in /in/pggLd:5
Stack trace:
#0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home')
#1 {main}
thrown in /in/pggLd on line 5
Process exited with code 255.
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/home): failed to open dir: Permission denied' in /in/pggLd:5
Stack trace:
#0 /in/pggLd(5): RecursiveDirectoryIterator->__construct('/home')
#1 {main}
thrown in /in/pggLd on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
string(47) "Class RecursiveDirectoryIterator does not exist"