xref: /PHP-8.0/ext/spl/tests/bug77431.phpt (revision 68195bd4)
1--TEST--
2Bug #77431 (SplFileInfo::__construct() accepts NUL bytes)
3--FILE--
4<?php
5new SplFileInfo("bad\0good");
6?>
7--EXPECTF--
8Fatal error: Uncaught ValueError: SplFileInfo::__construct(): Argument #1 ($filename) must not contain any null bytes in %s:%d
9Stack trace:
10#0 %s(%d): SplFileInfo->__construct('bad\x00good')
11#1 {main}
12  thrown in %s on line %d
13