xref: /php-src/ext/spl/tests/bug54291.phpt (revision 68195bd4)
1--TEST--
2Bug #54291 (Crash iterating DirectoryIterator for dir name starting with \0)
3--FILE--
4<?php
5$dir = new DirectoryIterator("\x00/abc");
6$dir->isFile();
7?>
8--EXPECTF--
9Fatal error: Uncaught ValueError: DirectoryIterator::__construct(): Argument #1 ($directory) must not contain any null bytes in %s:%d
10Stack trace:
11#0 %s(%d): DirectoryIterator->__construct('\x00/abc')
12#1 {main}
13  thrown in %s on line %d
14