Skip to content

Instantly share code, notes, and snippets.

<?php
class ReactionRatingService
{
public function calculateBoostPoints()
{
while ($reaction = $reactions) {
$reactionRatings = $this->validFunction();
$totalWeight = 0;
$runningScore = 0;
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a5ecd41..b5b1b8d 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -194,6 +194,12 @@ static zend_string *zend_new_interned_string_request(zend_string *str)
return ret;
}
+ if (GC_REFCOUNT(str) > 1) {
+ GC_DELREF(str);
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a5ecd41..b5b1b8d 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -194,6 +194,12 @@ static zend_string *zend_new_interned_string_request(zend_string *str)
return ret;
}
+ if (GC_REFCOUNT(str) > 1) {
+ GC_DELREF(str);
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a5ecd41..b5b1b8d 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -194,6 +194,12 @@ static zend_string *zend_new_interned_string_request(zend_string *str)
return ret;
}
+ if (GC_REFCOUNT(str) > 1) {
+ GC_DELREF(str);
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index a5ecd41..b5b1b8d 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -194,6 +194,12 @@ static zend_string *zend_new_interned_string_request(zend_string *str)
return ret;
}
+ if (GC_REFCOUNT(str) > 1) {
+ GC_DELREF(str);
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index e108b7a..6a560f6 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -3018,6 +3018,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp |= t1 & (MAY_BE_RC1|MAY_BE_RCN);
}
}
+#if 0 /* Infer typeinfo by usage ??? */
j = ssa_vars[ssa_ops[i].result_def].use_chain;
@laruence
laruence / cfg.flags.diff
Created October 18, 2017 08:31
cfg.flags.diff
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 8d99418..fcd20c8 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -1890,7 +1890,7 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
/* Build CFG */
checkpoint = zend_arena_checkpoint(ctx->arena);
- if (zend_build_cfg(&ctx->arena, op_array, ZEND_CFG_SPLIT_AT_LIVE_RANGES, &cfg, NULL) != SUCCESS) {
+ if (zend_build_cfg(&ctx->arena, op_array, ZEND_CFG_SPLIT_AT_LIVE_RANGES, &cfg) != SUCCESS) {
@laruence
laruence / zero_argument.diff
Last active September 11, 2017 09:43
zero_argument.diff
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index fdaabde..d308b17 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -235,7 +235,7 @@ static const func_info_t func_infos[] = {
F0("define", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_NULL), // TODO: inline
FC("defined", zend_b_s_info), // TODO: inline
FN("get_class", MAY_BE_FALSE | MAY_BE_STRING),
- FN("get_called_class", MAY_BE_FALSE | MAY_BE_STRING),
+ IN("get_called_class", MAY_BE_FALSE | MAY_BE_STRING),
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 3737125..6d40260 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -44,10 +44,12 @@
# define ZEND_SSA_RC_INFERENCE_FLAG ZEND_SSA_RC_INFERENCE
# define RC_MAY_BE_1(info) (((info) & (MAY_BE_RC1|MAY_BE_REF)) != 0)
# define RC_MAY_BE_N(info) (((info) & (MAY_BE_RCN|MAY_BE_REF)) != 0)
+# define RC_MAY_BE_RC(info) (RC_MAY_BE_1(info)||RC_MAY_BE_N(info))
#else
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index a60c2ad..b79ba36 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -7448,6 +7448,9 @@ static int zend_jit_send_val(dasm_State **Dst, const zend_op *opline, zend_op_ar
goto fallback;
}
+ op1_addr = zend_jit_decode_op(op_array, opline->op1_type, opline->op1, opline, ra, ra ? ssa->ops[opline - op_array->opcodes].op1_use : -1);
+ arg_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, opline->result.var);