diff options
author | Zoe Slattery <zoe@php.net> | 2009-05-29 07:52:04 +0000 |
---|---|---|
committer | Zoe Slattery <zoe@php.net> | 2009-05-29 07:52:04 +0000 |
commit | e660f91c267fa5cd8fee59f5429464726abb2f06 (patch) | |
tree | bedec665bb518db0d055b5c0139f7acb1fdf9e11 /tests/lang/engine_assignExecutionOrder_009.phpt | |
parent | 953cf4c2174bfd71a966a387a2173ec336810066 (diff) | |
download | php-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.phpt | 36 |
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) |