summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-07-15 04:11:13 +0000
committerAndi Gutmans <andi@php.net>2002-07-15 04:11:13 +0000
commitf7d9b9f1ae44e9109347cbba7288569fd4b720a5 (patch)
treee9e839e8a3eaa475d4e9f7aeeae9c58c6e7aa5a8 /Zend
parentcb1c98762e5d128647112b48ddf992ea0ce0537f (diff)
downloadphp-git-f7d9b9f1ae44e9109347cbba7288569fd4b720a5.tar.gz
- Really implement bool increment/decrement as flip-flop.
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_operators.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index fef83c6d48..1de3364d21 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1451,9 +1451,7 @@ ZEND_API int increment_function(zval *op1)
{
switch (op1->type) {
case IS_BOOL:
- if (!op1->value.lval) {
- op1->value.lval = 1;
- }
+ op1->value.lval = !op1->value.lval;
break;
case IS_LONG:
if(op1->value.lval == LONG_MAX) {
@@ -1518,11 +1516,7 @@ ZEND_API int decrement_function(zval *op1)
switch (op1->type) {
case IS_BOOL:
- if (op1->value.lval) {
- op1->value.lval = 0;
- } else {
- op1->value.lval = 1;
- }
+ op1->value.lval = !op1->value.lval;
break;
case IS_LONG:
if(op1->value.lval == LONG_MIN) {