summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorIlija Tovilo <ilija.tovilo@me.com>2020-04-09 22:36:37 +0200
committerIlija Tovilo <ilija.tovilo@me.com>2020-07-09 23:52:17 +0200
commit9fa1d1330138ac424f990ff03e62721120aaaec3 (patch)
treeca3550c82b86ccf844745fbe80c77134ed5cbef4 /Zend/zend_opcode.c
parentc60d0dc2f41f1d4817414e37a39ae87c5677e31a (diff)
downloadphp-git-9fa1d1330138ac424f990ff03e62721120aaaec3.tar.gz
Implement match expression
RFC: https://wiki.php.net/rfc/match_expression_v2 Closes GH-5371.
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 983b362046..06f2b9b19d 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -763,7 +763,9 @@ static zend_bool keeps_op1_alive(zend_op *opline) {
/* These opcodes don't consume their OP1 operand,
* it is later freed by something else. */
if (opline->opcode == ZEND_CASE
+ || opline->opcode == ZEND_CASE_STRICT
|| opline->opcode == ZEND_SWITCH_LONG
+ || opline->opcode == ZEND_MATCH
|| opline->opcode == ZEND_FETCH_LIST_R
|| opline->opcode == ZEND_COPY_TMP) {
return 1;
@@ -1039,6 +1041,7 @@ ZEND_API int pass_two(zend_op_array *op_array)
break;
case ZEND_SWITCH_LONG:
case ZEND_SWITCH_STRING:
+ case ZEND_MATCH:
{
/* absolute indexes to relative offsets */
HashTable *jumptable = Z_ARRVAL_P(CT_CONSTANT(opline->op2));
@@ -1108,6 +1111,7 @@ ZEND_API binary_op_type get_binary_op(int opcode)
case ZEND_CONCAT:
return (binary_op_type) concat_function;
case ZEND_IS_IDENTICAL:
+ case ZEND_CASE_STRICT:
return (binary_op_type) is_identical_function;
case ZEND_IS_NOT_IDENTICAL:
return (binary_op_type) is_not_identical_function;