xref: /PHP-8.1/ext/spl/tests/dit_001_noglob.phpt (revision a555cc0b)
1--TEST--
2SPL: Problem with casting to string (no glob version)
3--SKIPIF--
4<?php
5if (defined('GLOB_ERR')) print "skip GLOB_ERR defined";
6--FILE--
7<?php
8$d = new DirectoryIterator('.');
9var_dump($d);
10var_dump(is_string($d));
11preg_match('/x/', $d);
12var_dump(is_string($d));
13?>
14--EXPECTF--
15object(DirectoryIterator)#%d (3) {
16  %s"pathName"%s"SplFileInfo":private]=>
17  %s(%d) ".%c%s"
18  %s"fileName"%s"SplFileInfo":private]=>
19  %s(%d) "%s"
20  %s"subPathName"%s"RecursiveDirectoryIterator":private]=>
21  %s(0) ""
22}
23bool(false)
24bool(false)
25