diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-27 10:39:21 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-27 10:40:41 +0200 |
commit | a6c9c7c2b8cfd4db8fcdcb66b908feac31b600af (patch) | |
tree | aa58af21678aa7da13c6c100fbe77f2055df2bb9 /ext/opcache/Optimizer/zend_inference.c | |
parent | d71f859a56757df16e20d72b22366a02ff9fec54 (diff) | |
download | php-git-a6c9c7c2b8cfd4db8fcdcb66b908feac31b600af.tar.gz |
Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a
notice and converting the resource to the resource handle. The only
exception is the [$resource => null] syntax, where this was treated
as an illegal offset type instead. However, this also only happened
for VM evaluations, the AST evaluator did handle resources correctly.
Diffstat (limited to 'ext/opcache/Optimizer/zend_inference.c')
-rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 43961a6158..f89b133b92 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3243,7 +3243,7 @@ static int zend_update_type_info(const zend_op_array *op_array, if (opline->op2_type == IS_UNUSED) { tmp |= MAY_BE_ARRAY_KEY_LONG; } else { - if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_DOUBLE)) { + if (t2 & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_DOUBLE|MAY_BE_RESOURCE)) { tmp |= MAY_BE_ARRAY_KEY_LONG; } if (t2 & (MAY_BE_STRING)) { |