xref: /PHP-7.4/ext/standard/tests/array/bug69198.phpt (revision fc775f69)
1--TEST--
2Bug #69198 (Compact function generate array with length but no content)
3--FILE--
4<?php
5if (false) {
6	    $willNeverBeDefined = true;
7}
8$result = compact('willNeverBeDefined');
9var_dump($result, empty($result), $result === array(), empty($willNeverBeDefined));
10?>
11--EXPECTF--
12Notice: compact(): Undefined variable: willNeverBeDefined in %s on line %d
13array(0) {
14}
15bool(true)
16bool(true)
17bool(true)
18