summaryrefslogtreecommitdiff
path: root/tests/lang/engine_assignExecutionOrder_009.phpt
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-05-29 07:52:04 +0000
committerZoe Slattery <zoe@php.net>2009-05-29 07:52:04 +0000
commite660f91c267fa5cd8fee59f5429464726abb2f06 (patch)
treebedec665bb518db0d055b5c0139f7acb1fdf9e11 /tests/lang/engine_assignExecutionOrder_009.phpt
parent953cf4c2174bfd71a966a387a2173ec336810066 (diff)
downloadphp-git-e660f91c267fa5cd8fee59f5429464726abb2f06.tar.gz
Engine execution order tests
Diffstat (limited to 'tests/lang/engine_assignExecutionOrder_009.phpt')
-rw-r--r--tests/lang/engine_assignExecutionOrder_009.phpt36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/lang/engine_assignExecutionOrder_009.phpt b/tests/lang/engine_assignExecutionOrder_009.phpt
new file mode 100644
index 0000000000..e1d5b71c69
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_009.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Execution ordering with comparison operators.
+--FILE--
+<?php
+function f($x) {
+ echo "f($x) ";
+ return $x;
+}
+
+echo "Function call args:\n";
+var_dump(f($i=0) < f(++$i));
+var_dump(f($i=0) <= f(++$i));
+var_dump(f($i=0) > f(++$i));
+var_dump(f($i=0) >= f(++$i));
+
+echo "\nArray indices:\n";
+$a[1][2] = 0;
+$a[3][4] = 1;
+$i=0;
+var_dump($a[$i=1][++$i] < $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] <= $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] > $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] >= $a[++$i][++$i]);
+?>
+--EXPECTF--
+Function call args:
+f(0) f(1) bool(true)
+f(0) f(1) bool(true)
+f(0) f(1) bool(false)
+f(0) f(1) bool(false)
+
+Array indices:
+bool(true)
+bool(true)
+bool(false)
+bool(false)