Skip to content

Commit 5cf2659

Browse files
authored
Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815)
1 parent ec0331f commit 5cf2659

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

build/gen_stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ public function initializeZval(string $zvalName, iterable $allConstInfos): strin
16491649
if ($this->type->isNull()) {
16501650
$code .= "\tZVAL_NULL(&$zvalName);\n";
16511651
} elseif ($this->type->isBool()) {
1652-
$code .= "\tZVAL_BOOL(&$zvalName, " . ($cConstValue ?: ($this->value ? "true" : "false")) . ");\n";
1652+
$code .= "\t" . ($this->value ? 'ZVAL_TRUE' : 'ZVAL_FALSE') . "(&$zvalName);\n";
16531653
} elseif ($this->type->isInt()) {
16541654
$code .= "\tZVAL_LONG(&$zvalName, " . ($cConstValue ?: $this->value) . ");\n";
16551655
} elseif ($this->type->isFloat()) {

ext/dba/dba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ PHP_FUNCTION(dba_key_split)
10001000
}
10011001
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &zkey) == SUCCESS) {
10021002
if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_FALSE)) {
1003-
RETURN_BOOL(0);
1003+
RETURN_FALSE;
10041004
}
10051005
}
10061006
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &key, &key_len) == FAILURE) {

ext/dom/php_dom_arginfo.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/oci8/oci8_statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,9 @@ int php_oci_bind_post_exec(zval *data)
11051105
} else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) {
11061106
/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temporary value) */
11071107
if (Z_LVAL_P(zv) == 0)
1108-
ZVAL_BOOL(zv, FALSE);
1108+
ZVAL_FALSE(zv);
11091109
else if (Z_LVAL_P(zv) == 1)
1110-
ZVAL_BOOL(zv, TRUE);
1110+
ZVAL_TRUE(zv);
11111111
}
11121112

11131113
return 0;

ext/soap/soap_arginfo.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)