summaryrefslogtreecommitdiff
path: root/Zend/tests/bug80184.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug80184.phpt')
-rw-r--r--Zend/tests/bug80184.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/bug80184.phpt b/Zend/tests/bug80184.phpt
new file mode 100644
index 0000000000..1d12799f0c
--- /dev/null
+++ b/Zend/tests/bug80184.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #80184: Complex expression in while / if statements resolves to false incorrectly
+--FILE--
+<?php
+
+$callbacks = [
+ function () { echo "First item!\n"; },
+ function () { echo "Second item!\n"; },
+ function () { echo "Third item!\n"; },
+ function () { echo "Fourth item!\n"; },
+];
+
+while ($callback = array_shift($callbacks) and ($callback() || true));
+
+?>
+--EXPECT--
+First item!
+Second item!
+Third item!
+Fourth item!