1--TEST-- 2Glob wrapper bypasses open_basedir 3--INI-- 4open_basedir=/does_not_exist 5--SKIPIF-- 6<?php 7if (!in_array("glob", stream_get_wrappers())) echo "skip"; 8?> 9--FILE-- 10<?php 11 12foreach ( [ __DIR__, "glob://".__DIR__ ] as $spec) { 13 echo "** Opening $spec\n"; 14 $dir = opendir($spec); 15 if (!$dir) { 16 echo "Failed to open $spec\n"; 17 continue; 18 } 19 if (false === readdir($dir)) { 20 echo "No files in $spec\n"; 21 continue; 22 } 23} 24?> 25--EXPECTF-- 26** Opening %s 27 28Warning: opendir(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (/does_not_exist) in %s%eglob-wrapper.php on line 5 29 30Warning: opendir(%s): Failed to open directory: Operation not permitted in %s%eglob-wrapper.php on line 5 31Failed to open %s 32** Opening glob://%s 33No files in glob://%s 34