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--FILE--
9<?php
10
11foreach ( [ __DIR__, "glob://".__DIR__ ] as $spec) {
12  echo "** Opening $spec\n";
13  $dir = opendir($spec);
14  if (!$dir) {
15    echo "Failed to open $spec\n";
16    continue;
17  }
18  if (false === readdir($dir)) {
19    echo "No files in $spec\n";
20    continue;
21  }
22}
23--EXPECTF--
24** Opening %s
25
26Warning: 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
27
28Warning: opendir(%s): failed to open dir: Operation not permitted in %s%eglob-wrapper.php on line 5
29Failed to open %s
30** Opening glob://%s
31
32Warning: 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
33
34Warning: opendir(glob://%s): failed to open dir: operation failed in %s%eglob-wrapper.php on line 5
35Failed to open glob://%s
36