mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Allow constant folding bw_not on string
This will not actually error.
This commit is contained in:
parent
4aa73bbfc4
commit
4df15e8245
1 changed files with 4 additions and 0 deletions
|
@ -8373,6 +8373,10 @@ static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zva
|
|||
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, zval *op)
|
||||
{
|
||||
if (opcode == ZEND_BW_NOT) {
|
||||
/* BW_NOT on string does not convert the string into an integer. */
|
||||
if (Z_TYPE_P(op) == IS_STRING) {
|
||||
return 0;
|
||||
}
|
||||
return Z_TYPE_P(op) <= IS_TRUE || !zend_is_op_long_compatible(op);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue