xref: /PHP-8.2/Zend/tests/bug80184.phpt (revision 6ea870f5)
1--TEST--
2Bug #80184: Complex expression in while / if statements resolves to false incorrectly
3--FILE--
4<?php
5
6$callbacks = [
7	function () { echo "First item!\n"; },
8	function () { echo "Second item!\n"; },
9	function () { echo "Third item!\n"; },
10	function () { echo "Fourth item!\n"; },
11];
12
13while ($callback = array_shift($callbacks) and ($callback() || true));
14
15?>
16--EXPECT--
17First item!
18Second item!
19Third item!
20Fourth item!
21