xref: /PHP-8.2/ext/standard/tests/array/bug69198.phpt (revision c37a1cd6)
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--
12Warning: compact(): Undefined variable $willNeverBeDefined in %s on line %d
13array(0) {
14}
15bool(true)
16bool(true)
17bool(true)
18