From 4ee275fd59fc9ec33361789e44a16dd030a7e819 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 28 Mar 2026 14:21:35 +0000 Subject: [PATCH 001/300] Fix GH-21548: Dom\XMLDocument::C14N() emits duplicate xmlns declarations after setAttributeNS(). The xmlns attribute unlinking code in dom_relink_ns_decls_element was clobbering attr->prev instead of updating the predecessor's next pointer, leaving non-first xmlns attributes reachable in the properties list. C14N then output them both as nsDef entries and as attributes. close GH-21566 --- NEWS | 4 ++++ ext/dom/node.c | 2 +- ext/dom/tests/modern/xml/gh21548.phpt | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ext/dom/tests/modern/xml/gh21548.phpt diff --git a/NEWS b/NEWS index dc0e430775f1..8ed1497997a7 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug GH-19983 (GC assertion failure with fibers, generators and destructors). (iliaal) +- DOM: + . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns + declarations after setAttributeNS()). (David Carlier) + - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) diff --git a/ext/dom/node.c b/ext/dom/node.c index 9c1a508d669e..83404d0f598d 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2132,7 +2132,7 @@ static void dom_relink_ns_decls_element(HashTable *links, xmlNodePtr node) ns->_private = attr; if (attr->prev) { - attr->prev = attr->next; + attr->prev->next = attr->next; } else { node->properties = attr->next; } diff --git a/ext/dom/tests/modern/xml/gh21548.phpt b/ext/dom/tests/modern/xml/gh21548.phpt new file mode 100644 index 000000000000..55299c8d6e67 --- /dev/null +++ b/ext/dom/tests/modern/xml/gh21548.phpt @@ -0,0 +1,17 @@ +--TEST-- +GH-21548 (Dom\XMLDocument::C14N() emits duplicate xmlns declarations after setAttributeNS()) +--CREDITS-- +Toon Verwerft (veewee) +--EXTENSIONS-- +dom +--FILE-- +'); +$doc->documentElement->setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns1", "urn:a"); + +echo $doc->C14N() . PHP_EOL; + +?> +--EXPECT-- + From d4f069102253dcb9f6274af139001f8184eb826c Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 25 Mar 2026 16:54:32 +0100 Subject: [PATCH 002/300] Fix incorrect RC-handling for ZEND_EXT_STMT op1 Fixes GH-21504 Closes GH-21528 --- NEWS | 1 + Zend/tests/gh21504.inc | 3 +++ Zend/tests/gh21504.phpt | 12 ++++++++++++ Zend/zend_compile.c | 3 +++ 4 files changed, 19 insertions(+) create mode 100644 Zend/tests/gh21504.inc create mode 100644 Zend/tests/gh21504.phpt diff --git a/NEWS b/NEWS index 59848d6ab272..9d69dbaf818a 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ PHP NEWS destructors). (iliaal) . Fixed ZEND_API mismatch on zend_ce_closure forward decl for Windows+Clang. (henderkes) + . Fixed bug GH-21504 (Incorrect RC-handling for ZEND_EXT_STMT op1). (ilutov) - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) diff --git a/Zend/tests/gh21504.inc b/Zend/tests/gh21504.inc new file mode 100644 index 000000000000..71dc5c2e61f6 --- /dev/null +++ b/Zend/tests/gh21504.inc @@ -0,0 +1,3 @@ + var_dump(...); diff --git a/Zend/tests/gh21504.phpt b/Zend/tests/gh21504.phpt new file mode 100644 index 000000000000..5fd9eaff91ab --- /dev/null +++ b/Zend/tests/gh21504.phpt @@ -0,0 +1,12 @@ +--TEST-- +GH-21504: Incorrect RC-handling for ZEND_EXT_STMT op1 +--FILE-- + +--EXPECT-- +string(4) "1234" diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 80f85f421a33..8c748fc8ccc4 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1934,6 +1934,9 @@ static void zend_do_extended_stmt(znode* result) /* {{{ */ opline->opcode = ZEND_EXT_STMT; if (result) { + if (result->op_type == IS_CONST) { + Z_TRY_ADDREF(result->u.constant); + } SET_NODE(opline->op1, result); } } From 3748255726b84b80ec128485b3885bd801df0049 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 1 Apr 2026 19:54:10 +0300 Subject: [PATCH 003/300] Update IR (#21594) IR commit: 88a61bfde4657c4f639bcacae1e4cb77e1c23de4 --- ext/opcache/jit/ir/ir.c | 18 --------- ext/opcache/jit/ir/ir_aarch64.dasc | 2 +- ext/opcache/jit/ir/ir_builder.h | 2 +- ext/opcache/jit/ir/ir_gcm.c | 11 +++--- ext/opcache/jit/ir/ir_private.h | 2 +- ext/opcache/jit/ir/ir_ra.c | 39 ++++++++++-------- ext/opcache/jit/ir/ir_sccp.c | 63 +++++++++++++++++++++++++++++- ext/opcache/jit/ir/ir_x86.dasc | 2 +- 8 files changed, 93 insertions(+), 46 deletions(-) diff --git a/ext/opcache/jit/ir/ir.c b/ext/opcache/jit/ir/ir.c index f6058c5abe52..a02332e0d39c 100644 --- a/ext/opcache/jit/ir/ir.c +++ b/ext/opcache/jit/ir/ir.c @@ -1443,24 +1443,6 @@ bool ir_use_list_add(ir_ctx *ctx, ir_ref to, ir_ref ref) } } -static int ir_ref_cmp(const void *p1, const void *p2) -{ - return *(ir_ref*)p1 - *(ir_ref*)p2; -} - -void ir_use_list_sort(ir_ctx *ctx, ir_ref ref) -{ - ir_use_list *use_list; - uint32_t n; - - IR_ASSERT(ref > 0); - use_list = &ctx->use_lists[ref]; - n = use_list->count; - if (n > 1) { - qsort(ctx->use_edges + use_list->refs, n, sizeof(ir_ref), ir_ref_cmp); - } -} - void ir_replace(ir_ctx *ctx, ir_ref ref, ir_ref new_ref) { int i, j, n, *p, use; diff --git a/ext/opcache/jit/ir/ir_aarch64.dasc b/ext/opcache/jit/ir/ir_aarch64.dasc index 5a6718b77c1c..bdf6b027b9fe 100644 --- a/ext/opcache/jit/ir/ir_aarch64.dasc +++ b/ext/opcache/jit/ir/ir_aarch64.dasc @@ -720,7 +720,7 @@ get_arg_hints: break; case IR_PARAM: constraints->def_reg = ir_get_param_reg(ctx, ref); - flags = 0; + flags = (constraints->def_reg != IR_REG_NONE) ? IR_USE_SHOULD_BE_IN_REG : 0; break; case IR_PI: case IR_PHI: diff --git a/ext/opcache/jit/ir/ir_builder.h b/ext/opcache/jit/ir/ir_builder.h index 03add7590655..084216a06343 100644 --- a/ext/opcache/jit/ir/ir_builder.h +++ b/ext/opcache/jit/ir/ir_builder.h @@ -654,7 +654,7 @@ void _ir_TAILCALL_3(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_re void _ir_TAILCALL_4(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4); void _ir_TAILCALL_5(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5); void _ir_TAILCALL_6(ir_ctx *ctx, ir_type type, ir_ref func, ir_ref arg1, ir_ref arg2, ir_ref arg3, ir_ref arg4, ir_ref arg5, ir_ref arg6); -ir_ref _ir_TAILCALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args); +void _ir_TAILCALL_N(ir_ctx *ctx, ir_type type, ir_ref func, uint32_t count, ir_ref *args); ir_ref _ir_ALLOCA(ir_ctx *ctx, ir_ref size); void _ir_AFREE(ir_ctx *ctx, ir_ref size); ir_ref _ir_VLOAD(ir_ctx *ctx, ir_type type, ir_ref var); diff --git a/ext/opcache/jit/ir/ir_gcm.c b/ext/opcache/jit/ir/ir_gcm.c index 7edb012f6172..1b45eb834ce6 100644 --- a/ext/opcache/jit/ir/ir_gcm.c +++ b/ext/opcache/jit/ir/ir_gcm.c @@ -408,8 +408,6 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b) } /* Reconstruct IR: Update DEF->USE lists, CFG mapping and etc */ - ctx->use_lists = ir_mem_realloc(ctx->use_lists, ctx->insns_count * sizeof(ir_use_list)); - ctx->cfg_map = ir_mem_realloc(ctx->cfg_map, ctx->insns_count * sizeof(uint32_t)); n = ctx->use_lists[ref].refs; for (i = 0; i < clones_count; i++) { clone = clones[i].ref; @@ -428,6 +426,7 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b) uint32_t u = clones[i].use; while (u != (uint32_t)-1) { + uint32_t src = uses[u].block; use = uses[u].ref; ctx->use_edges[n++] = use; u = uses[u].next; @@ -437,9 +436,11 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b) ir_ref k, l = insn->inputs_count; if (insn->op == IR_PHI) { - for (k = 1; k <= l; k++) { - if (ir_insn_op(insn, k) == ref) { - j = ctx->cfg_map[ir_insn_op(&ctx->ir_base[insn->op1], k - 1)]; + ir_insn *merge = &ctx->ir_base[insn->op1]; + for (k = 2; k <= l; k++) { + j = ctx->cfg_map[ir_insn_op(merge, k - 1)]; + if (j == src) { + IR_ASSERT(ir_insn_op(insn, k) == ref); if (j != clones[i].block) { uint32_t dom_depth = ctx->cfg_blocks[clones[i].block].dom_depth; while (ctx->cfg_blocks[j].dom_depth > dom_depth) { diff --git a/ext/opcache/jit/ir/ir_private.h b/ext/opcache/jit/ir/ir_private.h index 96b81a0fcd72..9e3a3a171b46 100644 --- a/ext/opcache/jit/ir/ir_private.h +++ b/ext/opcache/jit/ir/ir_private.h @@ -1047,7 +1047,6 @@ void ir_use_list_remove_one(ir_ctx *ctx, ir_ref def, ir_ref use); void ir_use_list_replace_all(ir_ctx *ctx, ir_ref def, ir_ref use, ir_ref new_use); void ir_use_list_replace_one(ir_ctx *ctx, ir_ref def, ir_ref use, ir_ref new_use); bool ir_use_list_add(ir_ctx *ctx, ir_ref def, ir_ref use); -void ir_use_list_sort(ir_ctx *ctx, ir_ref def); IR_ALWAYS_INLINE ir_ref ir_next_control(const ir_ctx *ctx, ir_ref ref) { @@ -1100,6 +1099,7 @@ void ir_iter_add_uses(ir_ctx *ctx, ir_ref ref, ir_bitqueue *worklist); void ir_iter_replace(ir_ctx *ctx, ir_ref ref, ir_ref new_ref, ir_bitqueue *worklist); void ir_iter_update_op(ir_ctx *ctx, ir_ref ref, uint32_t idx, ir_ref new_val, ir_bitqueue *worklist); void ir_iter_opt(ir_ctx *ctx, ir_bitqueue *worklist); +void ir_iter_cleanup(ir_ctx *ctx); /*** IR Basic Blocks info ***/ #define IR_IS_BB_START(op) \ diff --git a/ext/opcache/jit/ir/ir_ra.c b/ext/opcache/jit/ir/ir_ra.c index 4a893410d499..aff9aa7bab3f 100644 --- a/ext/opcache/jit/ir/ir_ra.c +++ b/ext/opcache/jit/ir/ir_ra.c @@ -3190,6 +3190,7 @@ static ir_reg ir_allocate_blocked_reg(ir_ctx *ctx, ir_live_interval *ival, ir_li return IR_REG_NONE; } if (split_pos >= blockPos[reg]) { +try_next_available_register: IR_REGSET_EXCL(available, reg); if (IR_REGSET_IS_EMPTY(available)) { fprintf(stderr, "LSRA Internal Error: Unsolvable conflict. Allocation is not possible\n"); @@ -3222,31 +3223,33 @@ static ir_reg ir_allocate_blocked_reg(ir_ctx *ctx, ir_live_interval *ival, ir_li IR_LOG_LSRA_CONFLICT(" ---- Conflict with active", other, overlap); split_pos = ir_last_use_pos_before(other, ival->range.start, IR_USE_MUST_BE_IN_REG | IR_USE_SHOULD_BE_IN_REG); - if (split_pos == 0) { - split_pos = ival->range.start; - } - split_pos = ir_find_optimal_split_position(ctx, other, split_pos, ival->range.start, 1); - if (split_pos > other->range.start) { - child = ir_split_interval_at(ctx, other, split_pos); - if (prev) { - prev->list_next = other->list_next; + if (split_pos) { + split_pos = ir_find_optimal_split_position(ctx, other, split_pos, ival->range.start, 1); + if (split_pos > other->range.start) { + child = ir_split_interval_at(ctx, other, split_pos); + if (prev) { + prev->list_next = other->list_next; + } else { + *active = other->list_next; + } + IR_LOG_LSRA(" ---- Finish", other, ""); } else { - *active = other->list_next; + goto try_next_available_register; } - IR_LOG_LSRA(" ---- Finish", other, ""); } else { child = other; - other->reg = IR_REG_NONE; - if (prev) { - prev->list_next = other->list_next; - } else { - *active = other->list_next; - } - IR_LOG_LSRA(" ---- Spill and Finish", other, " (it must not be in reg)"); } split_pos = ir_first_use_pos_after(child, ival->range.start, IR_USE_MUST_BE_IN_REG | IR_USE_SHOULD_BE_IN_REG) - 1; // TODO: ??? if (split_pos > child->range.start && split_pos < child->end) { + if (child == other) { + other->reg = IR_REG_NONE; + if (prev) { + prev->list_next = other->list_next; + } else { + *active = other->list_next; + } + } ir_live_pos opt_split_pos = ir_find_optimal_split_position(ctx, child, ival->range.start, split_pos, 1); if (opt_split_pos > child->range.start) { split_pos = opt_split_pos; @@ -3259,6 +3262,8 @@ static ir_reg ir_allocate_blocked_reg(ir_ctx *ctx, ir_live_interval *ival, ir_li // TODO: this may cause endless loop ir_add_to_unhandled(unhandled, child); IR_LOG_LSRA(" ---- Queue", child, ""); + } else { + goto try_next_available_register; } } break; diff --git a/ext/opcache/jit/ir/ir_sccp.c b/ext/opcache/jit/ir/ir_sccp.c index 6478ec697562..921790fd92bd 100644 --- a/ext/opcache/jit/ir/ir_sccp.c +++ b/ext/opcache/jit/ir/ir_sccp.c @@ -603,7 +603,7 @@ static IR_NEVER_INLINE void ir_sccp_analyze(const ir_ctx *ctx, ir_sccp_val *_val bool may_benefit = 0; bool has_top = 0; - if (_values[i].op != IR_TOP) { + if (_values[i].op != IR_TOP || insn->op == IR_COPY) { may_benefit = 1; } @@ -987,6 +987,7 @@ static void ir_sccp_remove_if(ir_ctx *ctx, const ir_sccp_val *_values, ir_ref re insn->optx = IR_OPTX(IR_END, IR_VOID, 1); next_insn = &ctx->ir_base[dst]; next_insn->op = IR_BEGIN; + next_insn->op2 = IR_UNUSED; } } @@ -2726,7 +2727,16 @@ static bool ir_optimize_phi(ir_ctx *ctx, ir_ref merge_ref, ir_insn *merge, ir_re } return 1; - } else if (cond->op != IR_OVERFLOW && insn->op2 <= cond_ref && insn->op3 <= cond_ref) { + } else if (insn->op2 <= cond_ref && insn->op3 <= cond_ref + && cond->op != IR_OVERFLOW + // TODO: temporary disable IF-conversion for RLOAD. + // We don't track anti-dependencies in GCM and Local Scheduling. + // As result COND may be scheduled below the following RSTORE. + // See: https://github.com/dstogov/ir/issues/132 + && cond->op != IR_RLOAD + && !((cond->op >= IR_EQ && cond->op <= IR_UNORDERED) + && ((!IR_IS_CONST_REF(cond->op1) && ctx->ir_base[cond->op1].op == IR_RLOAD) + || (!IR_IS_CONST_REF(cond->op2) && ctx->ir_base[cond->op2].op == IR_RLOAD)))) { /* COND * * prev prev @@ -2968,9 +2978,11 @@ static bool ir_try_split_if(ir_ctx *ctx, ir_ref ref, ir_insn *insn, ir_bitqueue if_false->optx = IR_OPTX(IR_BEGIN, IR_VOID, 1); if_false->op1 = end1_ref; + if_false->op2 = IR_UNUSED; if_true->optx = IR_OPTX(IR_BEGIN, IR_VOID, 1); if_true->op1 = end2_ref; + if_true->op2 = IR_UNUSED; ir_bitqueue_add(worklist, if_false_ref); ir_bitqueue_add(worklist, if_true_ref); @@ -3008,6 +3020,7 @@ static bool ir_try_split_if(ir_ctx *ctx, ir_ref ref, ir_insn *insn, ir_bitqueue if_true->optx = IR_BEGIN; if_true->op1 = IR_UNUSED; + if_true->op2 = IR_UNUSED; ctx->flags2 &= ~IR_CFG_REACHABLE; @@ -3157,9 +3170,11 @@ static bool ir_try_split_if_cmp(ir_ctx *ctx, ir_ref ref, ir_insn *insn, ir_bitqu if_false->optx = IR_OPTX(IR_BEGIN, IR_VOID, 1); if_false->op1 = end1_ref; + if_false->op2 = IR_UNUSED; if_true->optx = IR_OPTX(IR_BEGIN, IR_VOID, 1); if_true->op1 = end2_ref; + if_true->op2 = IR_UNUSED; ir_bitqueue_add(worklist, if_false_ref); ir_bitqueue_add(worklist, if_true_ref); @@ -3201,6 +3216,7 @@ static bool ir_try_split_if_cmp(ir_ctx *ctx, ir_ref ref, ir_insn *insn, ir_bitqu if_true->optx = IR_BEGIN; if_true->op1 = IR_UNUSED; + if_true->op2 = IR_UNUSED; ctx->flags2 &= ~IR_CFG_REACHABLE; @@ -3487,7 +3503,9 @@ static void ir_iter_optimize_if(ir_ctx *ctx, ir_ref ref, ir_insn *insn, ir_bitqu if_true = &ctx->ir_base[if_true_ref]; if_false = &ctx->ir_base[if_false_ref]; if_true->op = IR_BEGIN; + if_true->op2 = IR_UNUSED; if_false->op = IR_BEGIN; + if_false->op2 = IR_UNUSED; if (ir_ref_is_true(ctx, condition)) { if_false->op1 = IR_UNUSED; ir_use_list_remove_one(ctx, ref, if_false_ref); @@ -3750,6 +3768,47 @@ void ir_iter_opt(ir_ctx *ctx, ir_bitqueue *worklist) } } +void ir_iter_cleanup(ir_ctx *ctx) +{ + ir_bitqueue iter_worklist; + ir_bitqueue cfg_worklist; + ir_ref i, n; + ir_insn *insn; + + ir_bitqueue_init(&cfg_worklist, ctx->insns_count); + ir_bitqueue_init(&iter_worklist, ctx->insns_count); + + /* Remove unused nodes */ + for (i = IR_UNUSED + 1, insn = ctx->ir_base + i; i < ctx->insns_count;) { + if (IR_IS_FOLDABLE_OP(insn->op)) { + if (insn->op != IR_NOP && ctx->use_lists[i].count == 0) { + ir_iter_remove_insn(ctx, i, &iter_worklist); + } + } else if (insn->op == IR_IF || insn->op == IR_MERGE) { + ir_bitqueue_add(&cfg_worklist, i); + } + n = insn->inputs_count; + n = ir_insn_inputs_to_len(n); + i += n; + insn += n; + } + + while ((i = ir_bitqueue_pop(&iter_worklist)) >= 0) { + insn = &ctx->ir_base[i]; + if (IR_IS_FOLDABLE_OP(insn->op)) { + if (ctx->use_lists[i].count == 0) { + ir_iter_remove_insn(ctx, i, &iter_worklist); + } + } + } + + /* Cleanup Control Flow */ + ir_iter_opt(ctx, &cfg_worklist); + + ir_bitqueue_free(&iter_worklist); + ir_bitqueue_free(&cfg_worklist); +} + int ir_sccp(ir_ctx *ctx) { ir_bitqueue sccp_worklist, iter_worklist; diff --git a/ext/opcache/jit/ir/ir_x86.dasc b/ext/opcache/jit/ir/ir_x86.dasc index 049c341cc8fe..9cd41c37ffef 100644 --- a/ext/opcache/jit/ir/ir_x86.dasc +++ b/ext/opcache/jit/ir/ir_x86.dasc @@ -1666,7 +1666,7 @@ get_arg_hints: break; case IR_PARAM: constraints->def_reg = ir_get_param_reg(ctx, ref); - flags = 0; + flags = (constraints->def_reg != IR_REG_NONE) ? IR_USE_SHOULD_BE_IN_REG : 0; break; case IR_PI: case IR_PHI: From 455ae2880e44bb8372afcdd9cb3b52f1042fa59e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 1 Apr 2026 23:40:25 +0200 Subject: [PATCH 004/300] Fix function JIT JMPNZ smart branch When a smart branch and jump live in separate basic blocks, the JIT can't skip the jitting of the jump, as it may be reachable through another predecessor. When the smart branch is executed using zend_jit_handler(), we're manually writing the result of the branch to the given temporary so that the jump will work as expected. That happens in zend_jit_set_cond(). However, this was only correctly handled for JMPZ branches. The current opline was compared to opline following the jump, which would set the var to 1 if equal, i.e. the branch was not taken, meaning var was not zero. For JMPNZ we need to do the opposite. Fixes GH-21593 --- NEWS | 1 + ext/opcache/jit/zend_jit.c | 2 +- ext/opcache/jit/zend_jit_ir.c | 5 +-- ext/opcache/tests/jit/gh21593.phpt | 49 ++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 ext/opcache/tests/jit/gh21593.phpt diff --git a/NEWS b/NEWS index b9dffade35db..2472825c0dab 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ PHP NEWS - Opcache: . Fixed bug GH-21158 (JIT: Assertion jit->ra[var].flags & (1<<0) failed in zend_jit_use_reg). (Arnaud) + . Fixed bug GH-21593 (Borked function JIT JMPNZ smart branch). (ilutov) - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 19e5520b1569..da73c98c4355 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -2748,7 +2748,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op if (i == end && (opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ)) != 0) { /* smart branch split across basic blocks */ - if (!zend_jit_set_cond(&ctx, opline + 2, opline->result.var)) { + if (!zend_jit_set_cond(&ctx, opline, opline + 2, opline->result.var)) { goto jit_failure; } } diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 2bad605c537d..4251d6b891c9 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -4105,11 +4105,12 @@ static int zend_jit_cond_jmp(zend_jit_ctx *jit, const zend_op *next_opline, int return 1; } -static int zend_jit_set_cond(zend_jit_ctx *jit, const zend_op *next_opline, uint32_t var) +static int zend_jit_set_cond(zend_jit_ctx *jit, const zend_op *opline, const zend_op *next_opline, uint32_t var) { ir_ref ref; - ref = ir_ADD_U32(ir_ZEXT_U32(jit_CMP_IP(jit, IR_EQ, next_opline)), ir_CONST_U32(IS_FALSE)); + ir_op op = (opline->result_type & IS_SMART_BRANCH_JMPZ) ? IR_EQ : IR_NE; + ref = ir_ADD_U32(ir_ZEXT_U32(jit_CMP_IP(jit, op, next_opline)), ir_CONST_U32(IS_FALSE)); // EX_VAR(var) = ... ir_STORE(ir_ADD_OFFSET(jit_FP(jit), var + offsetof(zval, u1.type_info)), ref); diff --git a/ext/opcache/tests/jit/gh21593.phpt b/ext/opcache/tests/jit/gh21593.phpt new file mode 100644 index 000000000000..d37500195737 --- /dev/null +++ b/ext/opcache/tests/jit/gh21593.phpt @@ -0,0 +1,49 @@ +--TEST-- +GH-21593: Function JIT JMPNZ smart branch +--CREDITS-- +paulmhh +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit=function +--FILE-- +a)) { + echo "1\n"; + } +} + +function test2($a) { + if (!isset($a?->a)) { + echo "2\n"; + } +} + +function test3($a) { + if (empty($a?->a)) { + echo "3\n"; + } +} + +function test4($a) { + if (!empty($a?->a)) { + echo "4\n"; + } +} + +$a = new stdClass; +$a->a = 'a'; + +test1($a); +test2($a); +test3($a); +test4($a); + +?> +--EXPECT-- +1 +4 From 818bc8a17738ac2a44f7f3978b21429429bb7f9e Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:47:39 +0800 Subject: [PATCH 005/300] ext/pgsql: Remove unnecessary `+1` in memcpy when appending newline (GH-21597) --- ext/pgsql/pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 3f4b606b5106..2ddbf0af2309 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3429,7 +3429,7 @@ static zend_result pgsql_copy_from_query(PGconn *pgsql, PGresult *pgsql_result, int result; if (ZSTR_LEN(tmp) > 0 && ZSTR_VAL(tmp)[ZSTR_LEN(tmp) - 1] != '\n') { char *zquery = emalloc(ZSTR_LEN(tmp) + 2); - memcpy(zquery, ZSTR_VAL(tmp), ZSTR_LEN(tmp) + 1); + memcpy(zquery, ZSTR_VAL(tmp), ZSTR_LEN(tmp)); zquery[ZSTR_LEN(tmp)] = '\n'; zquery[ZSTR_LEN(tmp) + 1] = '\0'; result = PQputCopyData(pgsql, zquery, ZSTR_LEN(tmp) + 1); From 266f85f4e89957a02142f5fc9baea723d57bd90b Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Thu, 2 Apr 2026 17:04:56 +0200 Subject: [PATCH 006/300] replace ERR_NUM_ERRORS with PHP_OPENSSL_ERR_BUFFER_SIZE (#21579) --- ext/openssl/openssl.c | 6 +++--- ext/openssl/php_openssl.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index bc00b6b189b9..4baa19988891 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -218,9 +218,9 @@ void php_openssl_store_errors(void) errors = OPENSSL_G(errors); do { - errors->top = (errors->top + 1) % ERR_NUM_ERRORS; + errors->top = (errors->top + 1) % PHP_OPENSSL_ERR_BUFFER_SIZE; if (errors->top == errors->bottom) { - errors->bottom = (errors->bottom + 1) % ERR_NUM_ERRORS; + errors->bottom = (errors->bottom + 1) % PHP_OPENSSL_ERR_BUFFER_SIZE; } errors->buffer[errors->top] = error_code; } while ((error_code = ERR_get_error())); @@ -4042,7 +4042,7 @@ PHP_FUNCTION(openssl_error_string) RETURN_FALSE; } - OPENSSL_G(errors)->bottom = (OPENSSL_G(errors)->bottom + 1) % ERR_NUM_ERRORS; + OPENSSL_G(errors)->bottom = (OPENSSL_G(errors)->bottom + 1) % PHP_OPENSSL_ERR_BUFFER_SIZE; val = OPENSSL_G(errors)->buffer[OPENSSL_G(errors)->bottom]; if (val) { diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 92ccd9a546f9..e565707a3c40 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -36,6 +36,8 @@ extern zend_module_entry openssl_module_entry; #define PHP_OPENSSL_API_VERSION 0x30200 #endif +#define PHP_OPENSSL_ERR_BUFFER_SIZE 16 + #define OPENSSL_RAW_DATA 1 #define OPENSSL_ZERO_PADDING 2 #define OPENSSL_DONT_ZERO_PAD_KEY 4 @@ -65,7 +67,7 @@ extern zend_module_entry openssl_module_entry; #endif struct php_openssl_errors { - int buffer[ERR_NUM_ERRORS]; + int buffer[PHP_OPENSSL_ERR_BUFFER_SIZE]; int top; int bottom; }; From eab1c01b481d6bf9c9f04514c244e17293f7cdbf Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 16:56:12 +0100 Subject: [PATCH 007/300] ext/standard/tests/filters: add missing CTYPE extension requirement (#21581) --- ext/standard/tests/filters/user_filter_seek_01.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/standard/tests/filters/user_filter_seek_01.phpt b/ext/standard/tests/filters/user_filter_seek_01.phpt index cb4e9fe72267..31ec95ca6aa6 100644 --- a/ext/standard/tests/filters/user_filter_seek_01.phpt +++ b/ext/standard/tests/filters/user_filter_seek_01.phpt @@ -1,5 +1,7 @@ --TEST-- php_user_filter with seek method - always seekable (stateless filter) +--EXTENSIONS-- +ctype --FILE-- Date: Thu, 2 Apr 2026 18:49:33 +0200 Subject: [PATCH 008/300] [RFC] Add DocComments for function parameters (#21279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RFC: https://wiki.php.net/rfc/parameter-doccomments --------- Co-authored-by: Christian Schneider Co-authored-by: Tim Düsterhus Co-authored-by: Daniel Scherzer --- NEWS | 1 + UPGRADING | 2 + Zend/zend_API.c | 1 + Zend/zend_compile.c | 2 + Zend/zend_compile.h | 1 + Zend/zend_language_parser.y | 6 +- Zend/zend_opcode.c | 3 + ext/opcache/zend_persist.c | 3 + ext/opcache/zend_persist_calc.c | 3 + ext/reflection/php_reflection.c | 16 ++ ext/reflection/php_reflection.stub.php | 2 + ext/reflection/php_reflection_arginfo.h | 12 +- ext/reflection/php_reflection_decl.h | 8 +- ...flectionParameter_getDocComment_basic.phpt | 248 ++++++++++++++++++ ...ctionParameter_getDocComment_indented.phpt | 84 ++++++ ...arameter_getDocComment_property_hooks.phpt | 143 ++++++++++ 16 files changed, 524 insertions(+), 11 deletions(-) create mode 100644 ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt create mode 100644 ext/reflection/tests/ReflectionParameter_getDocComment_indented.phpt create mode 100644 ext/reflection/tests/ReflectionParameter_getDocComment_property_hooks.phpt diff --git a/NEWS b/NEWS index 44f53eb99c7a..bb7df3d41c97 100644 --- a/NEWS +++ b/NEWS @@ -100,6 +100,7 @@ PHP NEWS (ilutov) . Fixed bug GH-21362 (ReflectionMethod::invoke/invokeArgs() did not verify Closure instance identity for Closure::__invoke()). (Ilia Alshanetsky) + . Added ReflectionParameter::getDocComment(). (chschneider) - Session: . Fixed bug 71162 (updateTimestamp never called when session data is empty). diff --git a/UPGRADING b/UPGRADING index 8c312f1814a0..560e0a5eca87 100644 --- a/UPGRADING +++ b/UPGRADING @@ -144,6 +144,8 @@ PHP 8.6 UPGRADE NOTES . ReflectionConstant::inNamespace() . Added ReflectionProperty::isReadable() and ReflectionProperty::isWritable(). RFC: https://wiki.php.net/rfc/isreadable-iswriteable + . Added ReflectionParameter::getDocComment(). + RFC: https://wiki.php.net/rfc/parameter-doccomments - Intl: . `grapheme_strrev()` returns strrev for grapheme cluster unit. diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 211a5d14e6c3..bd3f89a24502 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2997,6 +2997,7 @@ ZEND_API void zend_convert_internal_arg_info(zend_arg_info *new_arg_info, const new_arg_info->name = NULL; new_arg_info->default_value = NULL; } + new_arg_info->doc_comment = NULL; new_arg_info->type = arg_info->type; zend_convert_internal_arg_info_type(&new_arg_info->type, persistent); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ab6f2fb1e98f..6734db09a2e9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -8027,6 +8027,7 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 } else { arg_infos->type = (zend_type) ZEND_TYPE_INIT_CODE(fallback_return_type, 0, 0); } + arg_infos->doc_comment = NULL; arg_infos++; op_array->fn_flags |= ZEND_ACC_HAS_RETURN_TYPE; @@ -8125,6 +8126,7 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32 arg_info->name = zend_string_copy(name); arg_info->type = (zend_type) ZEND_TYPE_INIT_NONE(0); arg_info->default_value = NULL; + arg_info->doc_comment = doc_comment_ast ? zend_string_copy(zend_ast_get_str(doc_comment_ast)) : NULL; if (attributes_ast) { zend_compile_attributes( diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 5414467f3f87..abe2a53fe744 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -515,6 +515,7 @@ typedef struct _zend_arg_info { zend_string *name; zend_type type; zend_string *default_value; + zend_string *doc_comment; } zend_arg_info; /* the following structure repeats the layout of zend_internal_arg_info, diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index e2686c7e1c5a..57ebf02fe024 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -821,9 +821,9 @@ parameter: { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $1 | $3 | $4, $2, $5, NULL, NULL, $6 ? zend_ast_create_zval_from_str($6) : NULL, $7); } | optional_cpp_modifiers optional_type_without_static - is_reference is_variadic T_VARIABLE backup_doc_comment '=' expr optional_property_hook_list - { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $1 | $3 | $4, $2, $5, $8, - NULL, $6 ? zend_ast_create_zval_from_str($6) : NULL, $9); } + is_reference is_variadic T_VARIABLE '=' expr backup_doc_comment optional_property_hook_list + { $$ = zend_ast_create_ex(ZEND_AST_PARAM, $1 | $3 | $4, $2, $5, $7, + NULL, $8 ? zend_ast_create_zval_from_str($8) : NULL, $9); } ; optional_type_without_static: diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 24b480ad71e6..35de02b55729 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -648,6 +648,9 @@ ZEND_API void destroy_op_array(zend_op_array *op_array) if (arg_info[i].name) { zend_string_release_ex(arg_info[i].name, 0); } + if (arg_info[i].doc_comment) { + zend_string_release_ex(arg_info[i].doc_comment, 0); + } zend_type_release(arg_info[i].type, /* persistent */ false); } efree(arg_info); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 9bc2496837ce..568db085bb2c 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -652,6 +652,9 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc zend_accel_store_interned_string(arg_info[i].name); } zend_persist_type(&arg_info[i].type); + if (arg_info[i].doc_comment) { + zend_accel_store_interned_string(arg_info[i].doc_comment); + } } if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { arg_info++; diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 0b0ff51d0d4d..657cc03eb390 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -306,6 +306,9 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) ADD_INTERNED_STRING(arg_info[i].name); } zend_persist_type_calc(&arg_info[i].type); + if (arg_info[i].doc_comment) { + ADD_INTERNED_STRING(arg_info[i].doc_comment); + } } } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 957339b869ef..9665d1453284 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2649,6 +2649,22 @@ ZEND_METHOD(ReflectionParameter, __toString) /* }}} */ +/* {{{ Returns the doc comment for this parameter */ +ZEND_METHOD(ReflectionParameter, getDocComment) +{ + reflection_object *intern; + parameter_reference *param; + + ZEND_PARSE_PARAMETERS_NONE(); + + GET_REFLECTION_OBJECT_PTR(param); + if (param->arg_info->doc_comment) { + RETURN_STR_COPY(param->arg_info->doc_comment); + } + RETURN_FALSE; +} +/* }}} */ + /* {{{ Returns this parameter's name */ ZEND_METHOD(ReflectionParameter, getName) { diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index b0273a3174f8..dd605100f8ba 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -652,6 +652,8 @@ public function __construct($function, int|string $param) {} public function __toString(): string {} + public function getDocComment(): string|false {} + /** @tentative-return-type */ public function getName(): string {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index 66605a22bbd6..65571f38d43c 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit php_reflection.stub.php instead. - * Stub hash: 267472e2b726ca5e788eb5cc3e946bc9aa7c9c41 + * Stub hash: c80946cc8c8215bb6527e09bb71b3a97a76a6a98 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 1, IS_ARRAY, 0) @@ -526,6 +526,9 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter___toString arginfo_class_ReflectionFunction___toString +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionParameter_getDocComment, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() + #define arginfo_class_ReflectionParameter_getName arginfo_class_ReflectionFunctionAbstract_getName #define arginfo_class_ReflectionParameter_isPassedByReference arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -721,13 +724,12 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionConstant_isDeprecated arginfo_class_ReflectionFunctionAbstract_hasTentativeReturnType -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionConstant_getFileName, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionConstant_getFileName arginfo_class_ReflectionParameter_getDocComment ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionConstant_getExtension, 0, 0, ReflectionExtension, 1) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionConstant_getExtensionName arginfo_class_ReflectionConstant_getFileName +#define arginfo_class_ReflectionConstant_getExtensionName arginfo_class_ReflectionParameter_getDocComment #define arginfo_class_ReflectionConstant___toString arginfo_class_ReflectionFunction___toString @@ -921,6 +923,7 @@ ZEND_METHOD(ReflectionClassConstant, hasType); ZEND_METHOD(ReflectionClassConstant, getType); ZEND_METHOD(ReflectionParameter, __construct); ZEND_METHOD(ReflectionParameter, __toString); +ZEND_METHOD(ReflectionParameter, getDocComment); ZEND_METHOD(ReflectionParameter, getName); ZEND_METHOD(ReflectionParameter, isPassedByReference); ZEND_METHOD(ReflectionParameter, canBePassedByValue); @@ -1237,6 +1240,7 @@ static const zend_function_entry class_ReflectionParameter_methods[] = { ZEND_RAW_FENTRY("__clone", zim_ReflectionClass___clone, arginfo_class_ReflectionParameter___clone, ZEND_ACC_PRIVATE, NULL, NULL) ZEND_ME(ReflectionParameter, __construct, arginfo_class_ReflectionParameter___construct, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionParameter, __toString, arginfo_class_ReflectionParameter___toString, ZEND_ACC_PUBLIC) + ZEND_ME(ReflectionParameter, getDocComment, arginfo_class_ReflectionParameter_getDocComment, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionParameter, getName, arginfo_class_ReflectionParameter_getName, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionParameter, isPassedByReference, arginfo_class_ReflectionParameter_isPassedByReference, ZEND_ACC_PUBLIC) ZEND_ME(ReflectionParameter, canBePassedByValue, arginfo_class_ReflectionParameter_canBePassedByValue, ZEND_ACC_PUBLIC) diff --git a/ext/reflection/php_reflection_decl.h b/ext/reflection/php_reflection_decl.h index a5e8affd0beb..a87e1635419b 100644 --- a/ext/reflection/php_reflection_decl.h +++ b/ext/reflection/php_reflection_decl.h @@ -1,12 +1,12 @@ /* This is a generated file, edit php_reflection.stub.php instead. - * Stub hash: 267472e2b726ca5e788eb5cc3e946bc9aa7c9c41 */ + * Stub hash: c80946cc8c8215bb6527e09bb71b3a97a76a6a98 */ -#ifndef ZEND_PHP_REFLECTION_DECL_267472e2b726ca5e788eb5cc3e946bc9aa7c9c41_H -#define ZEND_PHP_REFLECTION_DECL_267472e2b726ca5e788eb5cc3e946bc9aa7c9c41_H +#ifndef ZEND_PHP_REFLECTION_DECL_c80946cc8c8215bb6527e09bb71b3a97a76a6a98_H +#define ZEND_PHP_REFLECTION_DECL_c80946cc8c8215bb6527e09bb71b3a97a76a6a98_H typedef enum zend_enum_PropertyHookType { ZEND_ENUM_PropertyHookType_Get = 1, ZEND_ENUM_PropertyHookType_Set = 2, } zend_enum_PropertyHookType; -#endif /* ZEND_PHP_REFLECTION_DECL_267472e2b726ca5e788eb5cc3e946bc9aa7c9c41_H */ +#endif /* ZEND_PHP_REFLECTION_DECL_c80946cc8c8215bb6527e09bb71b3a97a76a6a98_H */ diff --git a/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt new file mode 100644 index 000000000000..46e47bf60324 --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt @@ -0,0 +1,248 @@ +--TEST-- +Test ReflectionParameter::getDocComment() usage. +--INI-- +opcache.save_comments=1 +--FILE-- +property = $value; } +} +} + +function global_function( + /** + * My Doc Comment for $a + * + */ + $a, $b, $c, + /** + * My Doc Comment for $d + */ + $d, + // Not a doc comment + /**Not a doc comment */ + $e, + /** + * Doc comment for $f + */ + $f, + $g /** Doc comment for $g after parameter */, + /** Doc comment for $h */ + $h /** Doc comment for $h after parameter */, +) {} + +$closure = function( + /** + * My Doc Comment for $a + * + */ + $a, $b, $c, + /** + * My Doc Comment for $d + */ + $d, + // Not a doc comment + /**Not a doc comment */ + $e, + /** + * Doc comment for $f + */ + $f, + $g /** Doc comment for $g after parameter */, + /** Doc comment for $h */ + $h /** Doc comment for $h after parameter */, +) {}; + +$arrow_function = fn( + /** + * My Doc Comment for $a + * + */ + $a, $b, $c, + /** + * My Doc Comment for $d + */ + $d, + // Not a doc comment + /**Not a doc comment */ + $e, + /** + * Doc comment for $f + */ + $f, + $g /** Doc comment for $g after parameter */, + /** Doc comment for $h */ + $h /** Doc comment for $h after parameter */, +) => true; + +foreach([ + 'A::method' => (new ReflectionClass('A'))->getMethod('method'), + 'global_function' => new ReflectionFunction('global_function'), + 'closure' => new ReflectionFunction($closure), + 'arrow_function' => new ReflectionFunction($arrow_function), + 'property hook' => (new ReflectionClass('A'))->getProperty('property')->getHook(PropertyHookType::Set), + ] as $function => $rc) { + $rps = $rc->getParameters(); + foreach($rps as $rp) { + echo "\n---> Doc comment for $function parameter $" . $rp->getName() . ":\n"; + var_dump($rp->getDocComment()); + } +} + +?> +--EXPECTF-- +---> Doc comment for A::method parameter $a: +string(%d) "/** + * My Doc Comment for $a + * + */" + +---> Doc comment for A::method parameter $b: +bool(false) + +---> Doc comment for A::method parameter $c: +bool(false) + +---> Doc comment for A::method parameter $d: +string(%d) "/** + * My Doc Comment for $d + */" + +---> Doc comment for A::method parameter $e: +bool(false) + +---> Doc comment for A::method parameter $f: +string(%d) "/** + * Doc comment for $f + */" + +---> Doc comment for A::method parameter $g: +string(%d) "/** Doc comment for $g after parameter */" + +---> Doc comment for A::method parameter $h: +string(%d) "/** Doc comment for $h after parameter */" + +---> Doc comment for global_function parameter $a: +string(%d) "/** + * My Doc Comment for $a + * + */" + +---> Doc comment for global_function parameter $b: +bool(false) + +---> Doc comment for global_function parameter $c: +bool(false) + +---> Doc comment for global_function parameter $d: +string(%d) "/** + * My Doc Comment for $d + */" + +---> Doc comment for global_function parameter $e: +bool(false) + +---> Doc comment for global_function parameter $f: +string(%d) "/** + * Doc comment for $f + */" + +---> Doc comment for global_function parameter $g: +string(%d) "/** Doc comment for $g after parameter */" + +---> Doc comment for global_function parameter $h: +string(%d) "/** Doc comment for $h after parameter */" + +---> Doc comment for closure parameter $a: +string(%d) "/** + * My Doc Comment for $a + * + */" + +---> Doc comment for closure parameter $b: +bool(false) + +---> Doc comment for closure parameter $c: +bool(false) + +---> Doc comment for closure parameter $d: +string(%d) "/** + * My Doc Comment for $d + */" + +---> Doc comment for closure parameter $e: +bool(false) + +---> Doc comment for closure parameter $f: +string(%d) "/** + * Doc comment for $f + */" + +---> Doc comment for closure parameter $g: +string(%d) "/** Doc comment for $g after parameter */" + +---> Doc comment for closure parameter $h: +string(%d) "/** Doc comment for $h after parameter */" + +---> Doc comment for arrow_function parameter $a: +string(%d) "/** + * My Doc Comment for $a + * + */" + +---> Doc comment for arrow_function parameter $b: +bool(false) + +---> Doc comment for arrow_function parameter $c: +bool(false) + +---> Doc comment for arrow_function parameter $d: +string(%d) "/** + * My Doc Comment for $d + */" + +---> Doc comment for arrow_function parameter $e: +bool(false) + +---> Doc comment for arrow_function parameter $f: +string(%d) "/** + * Doc comment for $f + */" + +---> Doc comment for arrow_function parameter $g: +string(%d) "/** Doc comment for $g after parameter */" + +---> Doc comment for arrow_function parameter $h: +string(%d) "/** Doc comment for $h after parameter */" + +---> Doc comment for property hook parameter $value: +string(%d) "/** Doc Comment for property hook parameter $value */" + diff --git a/ext/reflection/tests/ReflectionParameter_getDocComment_indented.phpt b/ext/reflection/tests/ReflectionParameter_getDocComment_indented.phpt new file mode 100644 index 000000000000..ede7a00e0edd --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_getDocComment_indented.phpt @@ -0,0 +1,84 @@ +--TEST-- +Test ReflectionParameter::getDocComment() usage when methods are indented. +--INI-- +opcache.save_comments=1 +--FILE-- +property = $value; } + } +} + +foreach([ + 'A::method' => (new ReflectionClass('A'))->getMethod('method'), + 'property hook' => (new ReflectionClass('A'))->getProperty('property')->getHook(PropertyHookType::Set), + ] as $function => $rc) { + $rps = $rc->getParameters(); + foreach($rps as $rp) { + echo "\n---> Doc comment for $function parameter $" . $rp->getName() . ":\n"; + var_dump($rp->getDocComment()); + } +} + +?> +--EXPECTF-- +---> Doc comment for A::method parameter $a: +string(%d) "/** + * My Doc Comment for $a + * + */" + +---> Doc comment for A::method parameter $b: +bool(false) + +---> Doc comment for A::method parameter $c: +bool(false) + +---> Doc comment for A::method parameter $d: +string(%d) "/** + * My Doc Comment for $d + */" + +---> Doc comment for A::method parameter $e: +bool(false) + +---> Doc comment for A::method parameter $f: +string(%d) "/** + * Doc comment for $f + */" + +---> Doc comment for A::method parameter $g: +string(%d) "/** Doc comment for $g after parameter */" + +---> Doc comment for A::method parameter $h: +string(%d) "/** Doc comment for $h after parameter */" + +---> Doc comment for property hook parameter $value: +string(%d) "/** Doc Comment for property hook parameter $value */" diff --git a/ext/reflection/tests/ReflectionParameter_getDocComment_property_hooks.phpt b/ext/reflection/tests/ReflectionParameter_getDocComment_property_hooks.phpt new file mode 100644 index 000000000000..5689a2c46aca --- /dev/null +++ b/ext/reflection/tests/ReflectionParameter_getDocComment_property_hooks.phpt @@ -0,0 +1,143 @@ +--TEST-- +Test ReflectionParameter::getDocComment() usage for property with hook. +--INI-- +opcache.save_comments=1 +--FILE-- +getProperty('foo'); +echo "\n---> Doc comment for A::property $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Get); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Set); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rp = $rh->getParameters()[0]; +echo "\n---> Doc comment for A::property \$foo::set parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +// --------- + +$rp = $rc->getConstructor()->getParameters()[1]; +echo "\n---> Doc comment for A::constructor parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rp = $rc->getProperty('bar'); +echo "\n---> Doc comment for A::property $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Get); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Set); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rp = $rh->getParameters()[0]; +echo "\n---> Doc comment for A::property \$bar::set parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +// --------- + +$rp = $rc->getConstructor()->getParameters()[2]; +echo "\n---> Doc comment for A::constructor parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rp = $rc->getProperty('baz'); +echo "\n---> Doc comment for A::property $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Get); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rh = $rp->getHook(PropertyHookType::Set); +echo "\n---> Doc comment for A::property " . $rh->getName() . ":\n"; +var_dump($rh->getDocComment()); + +$rp = $rh->getParameters()[0]; +echo "\n---> Doc comment for A::property \$baz::set parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +$rp = $rc->getConstructor()->getParameters()[0]; +echo "\n---> Doc comment for A::constructor parameter $" . $rp->getName() . ":\n"; +var_dump($rp->getDocComment()); + +?> +--EXPECTF-- +---> Doc comment for A::property $foo: +string(11) "/** $foo */" + +---> Doc comment for A::property $foo::get: +string(13) "/** getter */" + +---> Doc comment for A::property $foo::set: +string(13) "/** setter */" + +---> Doc comment for A::property $foo::set parameter $value: +string(13) "/** $value */" + +---> Doc comment for A::constructor parameter $bar: +string(11) "/** $bar */" + +---> Doc comment for A::property $bar: +string(11) "/** $bar */" + +---> Doc comment for A::property $bar::get: +string(13) "/** getter */" + +---> Doc comment for A::property $bar::set: +string(13) "/** setter */" + +---> Doc comment for A::property $bar::set parameter $value: +string(13) "/** $value */" + +---> Doc comment for A::constructor parameter $baz: +bool(false) + +---> Doc comment for A::property $baz: +bool(false) + +---> Doc comment for A::property $baz::get: +string(13) "/** getter */" + +---> Doc comment for A::property $baz::set: +string(13) "/** setter */" + +---> Doc comment for A::property $baz::set parameter $value: +string(13) "/** $value */" + +---> Doc comment for A::constructor parameter $foo: +string(11) "/** $foo */" From 3619caa0b1a9781aef6c8a59e0fa0f5da001b6f8 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 2 Apr 2026 19:40:00 +0200 Subject: [PATCH 009/300] ext/{pdo_pgsql,pgsql}: Enable HAVE_PG_RESULT_MEMORY_SIZE (#21595) PQresultMemorySize is available since libpq 12. On Windows libpq 16.2 is used at time of writing: https://github.com/winlibs/postgresql --- ext/pdo_pgsql/config.w32 | 1 + ext/pgsql/config.w32 | 1 + 2 files changed, 2 insertions(+) diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32 index 5fc25f215900..87ad0a661b53 100644 --- a/ext/pdo_pgsql/config.w32 +++ b/ext/pdo_pgsql/config.w32 @@ -7,6 +7,7 @@ if (PHP_PDO_PGSQL != "no") { CHECK_HEADER("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;")) { EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c pgsql_sql_parser.c"); + AC_DEFINE('HAVE_PG_RESULT_MEMORY_SIZE', 1, "Define to 1 if libpq has the 'PQresultMemorySize' function (PostgreSQL 12 or later)."); AC_DEFINE('HAVE_PDO_PGSQL', 1, "Define to 1 if the PHP extension 'pdo_pgsql' is available."); ADD_EXTENSION_DEP('pdo_pgsql', 'pdo'); diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32 index 14eb5a07a0e9..4c8d6f3bd715 100644 --- a/ext/pgsql/config.w32 +++ b/ext/pgsql/config.w32 @@ -6,6 +6,7 @@ if (PHP_PGSQL != "no") { if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) && CHECK_HEADER("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) { EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + AC_DEFINE('HAVE_PG_RESULT_MEMORY_SIZE', 1, "Define to 1 if libpq has the 'PQresultMemorySize' function (PostgreSQL 12 or later)."); AC_DEFINE('HAVE_PGSQL', 1, "Define to 1 if the PHP extension 'pgsql' is available."); ADD_FLAG("CFLAGS_PGSQL", "/D PGSQL_EXPORTS"); ADD_EXTENSION_DEP('pgsql', 'pcre'); From 32c1931f18109655bc074dd5cda3248b838de636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 2 Apr 2026 21:19:27 +0200 Subject: [PATCH 010/300] standard: Add `enum SortDirection` (#21501) RFC: https://wiki.php.net/rfc/sort_direction_enum --- NEWS | 1 + UPGRADING | 4 ++++ .../ReflectionExtension_getClassNames_basic.phpt | 1 + ext/standard/array.c | 1 + ext/standard/basic_functions.c | 1 + ext/standard/basic_functions.stub.php | 5 +++++ ext/standard/basic_functions_arginfo.h | 13 ++++++++++++- ext/standard/basic_functions_decl.h | 13 +++++++++---- ext/standard/php_array.h | 2 ++ 9 files changed, 36 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index bb7df3d41c97..1759f6e2ee76 100644 --- a/NEWS +++ b/NEWS @@ -142,6 +142,7 @@ PHP NEWS . Fixed bug GH-13204 (glob() fails if square bracket is in current directory). (ndossche) . Add array size maximum to array_diff(). (ndossche) + . Add enum SortDirection. (timwolla) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index 560e0a5eca87..467387a9ea3c 100644 --- a/UPGRADING +++ b/UPGRADING @@ -163,6 +163,10 @@ PHP 8.6 UPGRADE NOTES 7. New Classes and Interfaces ======================================== +- Standard: + . enum SortDirection + RFC: https://wiki.php.net/rfc/sort_direction_enum + ======================================== 8. Removed Extensions and SAPIs ======================================== diff --git a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt index 47813255381e..9d1210705096 100644 --- a/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt +++ b/ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt @@ -15,6 +15,7 @@ foreach ($classNames as $className) { AssertionError Directory RoundingMode +SortDirection StreamBucket __PHP_Incomplete_Class php_user_filter diff --git a/ext/standard/array.c b/ext/standard/array.c index f391829c676a..7aafe6ea0a17 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -60,6 +60,7 @@ /* }}} */ ZEND_DECLARE_MODULE_GLOBALS(array) +PHPAPI zend_class_entry *sort_direction_ce; /* {{{ php_array_init_globals */ static void php_array_init_globals(zend_array_globals *array_globals) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a7417f2a3903..04505db15833 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -297,6 +297,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */ assertion_error_ce = register_class_AssertionError(zend_ce_error); rounding_mode_ce = register_class_RoundingMode(); + sort_direction_ce = register_class_SortDirection(); BASIC_MINIT_SUBMODULE(var) BASIC_MINIT_SUBMODULE(file) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 6d0c565fc2d4..1f3d5617f8df 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -90,6 +90,11 @@ */ const SORT_FLAG_CASE = UNKNOWN; +enum SortDirection { + case Ascending; + case Descending; +} + /** * @var int * @cvalue PHP_CASE_LOWER diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index d0109fa27c96..991d76d91fc1 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: f5583557f058e4862750d1262296d7f59cb0eed0 + * Stub hash: 749c71a6220260eb3fb593b982a9d97821e0539b * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -3980,6 +3980,17 @@ static void register_basic_functions_symbols(int module_number) attribute_Deprecated_const_ASSERT_EXCEPTION_0->args[1].name = ZSTR_KNOWN(ZEND_STR_MESSAGE); } +static zend_class_entry *register_class_SortDirection(void) +{ + zend_class_entry *class_entry = zend_register_internal_enum("SortDirection", IS_UNDEF, NULL); + + zend_enum_add_case_cstr(class_entry, "Ascending", NULL); + + zend_enum_add_case_cstr(class_entry, "Descending", NULL); + + return class_entry; +} + static zend_class_entry *register_class___PHP_Incomplete_Class(void) { zend_class_entry ce, *class_entry; diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index 139b47f2444d..fce41100fc79 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,13 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: f5583557f058e4862750d1262296d7f59cb0eed0 */ + * Stub hash: 749c71a6220260eb3fb593b982a9d97821e0539b */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_f5583557f058e4862750d1262296d7f59cb0eed0_H -#define ZEND_BASIC_FUNCTIONS_DECL_f5583557f058e4862750d1262296d7f59cb0eed0_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H +#define ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H + +typedef enum zend_enum_SortDirection { + ZEND_ENUM_SortDirection_Ascending = 1, + ZEND_ENUM_SortDirection_Descending = 2, +} zend_enum_SortDirection; typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_HalfAwayFromZero = 1, @@ -15,4 +20,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_f5583557f058e4862750d1262296d7f59cb0eed0_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H */ diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index 2205082e91df..a7eae0777d99 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -63,6 +63,8 @@ PHPAPI bool php_array_pick_keys(php_random_algo_with_state engine, zval *input, #define ARRAY_FILTER_USE_BOTH 1 #define ARRAY_FILTER_USE_KEY 2 +extern PHPAPI zend_class_entry *sort_direction_ce; + ZEND_BEGIN_MODULE_GLOBALS(array) bucket_compare_func_t *multisort_func; bool compare_deprecation_thrown; From 660996662a2649c73b6908deb7fec6d3b84a67a0 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 23 Mar 2026 01:04:24 +0100 Subject: [PATCH 011/300] Switch sqlite tests from "" to '' and re-enable for FreeBSD FreeBSD builds without DQS (double-quote support). Transform tests so we can re-eanble them for FreeBSD. Add separate tests for DQS. Closes GH-21495 --- .github/actions/freebsd/action.yml | 6 ++-- ext/pdo_sqlite/tests/bug38334.phpt | 8 +++--- ext/pdo_sqlite/tests/bug_42589.phpt | 2 +- .../tests/pdo_sqlite_createaggregate.phpt | 2 +- .../tests/pdo_sqlite_createcollation.phpt | 2 +- .../tests/pdo_sqlite_createfunction.phpt | 2 +- .../pdo_sqlite_createfunction_with_flags.phpt | 2 +- ext/pdo_sqlite/tests/pdo_sqlite_dqs.phpt | 27 ++++++++++++++++++ .../tests/pdo_sqlite_lastinsertid.phpt | 2 +- ext/pdo_sqlite/tests/pdo_sqlite_parser.phpt | 19 +++++++++++-- .../tests/pdo_sqlite_transaction.phpt | 2 +- ...pdo_sqlite_createafunction_trampoline.phpt | 8 +++--- .../pdo_sqlite_createaggregate.phpt | 2 +- .../pdo_sqlite_createcollation.phpt | 2 +- ...pdo_sqlite_createcollation_trampoline.phpt | 2 +- .../pdo_sqlite_createfunction_with_flags.phpt | 2 +- .../subclasses/pdo_sqlite_getattr_busy.phpt | 2 +- .../pdo_sqlite_getsetattr_explain.phpt | 28 +++++++++---------- .../tests/subclasses/pdosqlite_001.phpt | 4 +-- .../tests/subclasses/pdosqlite_002.phpt | 4 +-- ext/sqlite3/tests/bug72668.phpt | 6 ++-- .../tests/sqlite3_29_createfunction.phpt | 6 ++-- .../sqlite3_37_createfunction_flags.phpt | 6 ++-- ext/sqlite3/tests/sqlite3_dqs.phpt | 28 +++++++++++++++++++ ext/sqlite3/tests/sqlite3_explain.phpt | 28 +++++++++---------- ext/sqlite3/tests/sqlite3_rename_column.phpt | 2 +- ext/sqlite3/tests/sqlite3_stmt_busy.phpt | 2 +- .../sqlite3_trampoline_createfunction.phpt | 4 +-- 28 files changed, 139 insertions(+), 71 deletions(-) create mode 100644 ext/pdo_sqlite/tests/pdo_sqlite_dqs.phpt create mode 100644 ext/sqlite3/tests/sqlite3_dqs.phpt diff --git a/.github/actions/freebsd/action.yml b/.github/actions/freebsd/action.yml index 3b6d0c4e8617..197362d9f52b 100644 --- a/.github/actions/freebsd/action.yml +++ b/.github/actions/freebsd/action.yml @@ -46,7 +46,7 @@ runs: pkgconf \ webp \ libavif \ - `#sqlite3` \ + sqlite3 \ curl \ $OPCACHE_TLS_TESTS_DEPS @@ -57,9 +57,7 @@ runs: --enable-debug \ --enable-option-checking=fatal \ --enable-fpm \ - `#--with-pdo-sqlite` \ - --without-sqlite3 \ - --without-pdo-sqlite \ + --with-pdo-sqlite \ --without-pear \ --with-bz2 \ --with-avif \ diff --git a/ext/pdo_sqlite/tests/bug38334.phpt b/ext/pdo_sqlite/tests/bug38334.phpt index b4e9a378d717..eefd997cc71a 100644 --- a/ext/pdo_sqlite/tests/bug38334.phpt +++ b/ext/pdo_sqlite/tests/bug38334.phpt @@ -7,11 +7,11 @@ pdo_sqlite $db = new PDO('sqlite::memory:'); $db->exec('CREATE TABLE test_38334 (i INTEGER , f DOUBLE, s VARCHAR(255))'); -$db->exec('INSERT INTO test_38334 VALUES (42, 46.7, "test")'); +$db->exec("INSERT INTO test_38334 VALUES (42, 46.7, 'test')"); var_dump($db->query('SELECT * FROM test_38334')->fetch(PDO::FETCH_ASSOC)); // Check handling of integers larger than 32-bit. -$db->exec('INSERT INTO test_38334 VALUES (10000000000, 0.0, "")'); +$db->exec("INSERT INTO test_38334 VALUES (10000000000, 0.0, '')"); $i = $db->query('SELECT i FROM test_38334 WHERE f = 0.0')->fetchColumn(0); if (PHP_INT_SIZE >= 8) { var_dump($i === 10000000000); @@ -20,8 +20,8 @@ if (PHP_INT_SIZE >= 8) { } // Check storing of strings into integer/float columns. -$db->exec('INSERT INTO test_38334 VALUES ("test", "test", "x")'); -var_dump($db->query('SELECT * FROM test_38334 WHERE s = "x"')->fetch(PDO::FETCH_ASSOC)); +$db->exec("INSERT INTO test_38334 VALUES ('test', 'test', 'x')"); +var_dump($db->query("SELECT * FROM test_38334 WHERE s = 'x'")->fetch(PDO::FETCH_ASSOC)); ?> --EXPECT-- diff --git a/ext/pdo_sqlite/tests/bug_42589.phpt b/ext/pdo_sqlite/tests/bug_42589.phpt index 46ded8d027a6..39b87b106521 100644 --- a/ext/pdo_sqlite/tests/bug_42589.phpt +++ b/ext/pdo_sqlite/tests/bug_42589.phpt @@ -15,7 +15,7 @@ if(!in_array('ENABLE_COLUMN_METADATA', $options, true)) $db = new PDO("sqlite::memory:"); $db->exec('CREATE TABLE test_42589 (field1 VARCHAR(10))'); -$db->exec('INSERT INTO test_42589 VALUES("test")'); +$db->exec("INSERT INTO test_42589 VALUES('test')"); $result = $db->query('SELECT * FROM test_42589 t1 LEFT JOIN test_42589 t2 ON t1.field1 = t2.field1'); $meta1 = $result->getColumnMeta(0); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt index 1a620d6b9d5f..cba2c49556f7 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate.phpt @@ -9,7 +9,7 @@ $db = new PDO('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createaggregate (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createaggregate VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_createaggregate VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->sqliteCreateAggregate('testing', function(&$a, $b) { $a .= $b; return $a; }, function(&$v) { return $v; }); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt index 14a2c2e0d023..eb5ea6c97b7d 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt @@ -10,7 +10,7 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->query('CREATE TABLE test_pdo_sqlite_createcollation (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createcollation VALUES (NULL, "1"), (NULL, "2"), (NULL, "10")'); +$db->query("INSERT INTO test_pdo_sqlite_createcollation VALUES (NULL, '1'), (NULL, '2'), (NULL, '10')"); $db->sqliteCreateCollation('MYCOLLATE', function($a, $b) { return strnatcmp($a, $b); }); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt index b2cb073cb58f..49daabf5a7a9 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction.phpt @@ -9,7 +9,7 @@ $db = new PDO('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createfunction (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createfunction VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_createfunction VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->sqliteCreateFunction('testing', function($v) { return strtolower($v); }); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_with_flags.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_with_flags.phpt index 6f507789dbf2..9f0c777e83d8 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_with_flags.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_with_flags.phpt @@ -13,7 +13,7 @@ $db = new PDO('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createfunction_with_flags (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createfunction_with_flags VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_createfunction_with_flags VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->sqliteCreateFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_dqs.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_dqs.phpt new file mode 100644 index 000000000000..8ae668428484 --- /dev/null +++ b/ext/pdo_sqlite/tests/pdo_sqlite_dqs.phpt @@ -0,0 +1,27 @@ +--TEST-- +PDO_sqlite: Testing DQS support +--EXTENSIONS-- +pdo_sqlite +--SKIPIF-- +exec('SELECT "test"'); +} catch (\PDOException) { + die('skip SQLite is lacking DQS'); +} +?> +--FILE-- +exec('CREATE TABLE test (s1 VARCHAR(255), s2 VARCHAR(255))'); +$db->exec('INSERT INTO test VALUES (\'test\', "test")'); +var_dump($db->query('SELECT * FROM test')->fetch(PDO::FETCH_ASSOC)); +?> +--EXPECT-- +array(2) { + ["s1"]=> + string(4) "test" + ["s2"]=> + string(4) "test" +} diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt index 7e55ed60d5f1..0f1cba84dcce 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_lastinsertid.phpt @@ -7,7 +7,7 @@ pdo_sqlite $db = new PDO('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_lastinsertid (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_lastinsertid VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_lastinsertid VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); var_dump($db->query('SELECT * FROM test_pdo_sqlite_lastinsertid')); var_dump($db->errorInfo()); var_dump($db->lastInsertId()); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_parser.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_parser.phpt index d5eda8d9b827..c1eed6f3adc8 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_parser.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_parser.phpt @@ -31,9 +31,8 @@ foreach ($queries as $k => $query) { // One parameter $queries = [ "SELECT * FROM {$table} WHERE '1' = ?", - "SELECT * FROM {$table} WHERE \"?\" IN (?, \"?\")", + "SELECT * FROM {$table} WHERE '?' IN (?, '?')", "SELECT * FROM {$table} WHERE `a``?` = ?", - "SELECT * FROM {$table} WHERE \"a`?\" = ?", "SELECT * FROM {$table} WHERE [a`?] = ?", ]; @@ -43,6 +42,22 @@ foreach ($queries as $k => $query) { var_dump($stmt->fetch(PDO::FETCH_NUM) === [0 => 1]); } +// Check if DQS are enabled. +$dqs = true; +try { + $db->exec('SELECT "test"'); +} catch (\PDOException) { + $dqs = false; +} + +if ($dqs) { + $stmt = $db->prepare("SELECT * FROM {$table} WHERE \"a`?\" = ?"); + $stmt->execute([1]); + var_dump($stmt->fetch(PDO::FETCH_NUM) === [0 => 1]); +} else { + var_dump(true); +} + ?> --CLEAN-- query('CREATE TABLE test_pdo_sqlite_transaction (id INT AUTO INCREMENT, nam $db->commit(); $db->beginTransaction(); -$db->query('INSERT INTO test_pdo_sqlite_transaction VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_transaction VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->rollback(); $r = $db->query('SELECT COUNT(*) FROM test_pdo_sqlite_transaction'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt index adcb130e0b9c..a1286e2e026d 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt @@ -20,11 +20,11 @@ class TrampolineTest { var_dump($db->createFunction('strtoupper', [new TrampolineTest(), 'strtoupper'])); -foreach ($db->query('SELECT strtoupper("test")') as $row) { +foreach ($db->query("SELECT strtoupper('test')") as $row) { var_dump($row); } -foreach ($db->query('SELECT strtoupper("test")') as $row) { +foreach ($db->query("SELECT strtoupper('test')") as $row) { var_dump($row); } @@ -33,14 +33,14 @@ foreach ($db->query('SELECT strtoupper("test")') as $row) { bool(true) Trampoline for strtoupper array(2) { - ["strtoupper("test")"]=> + ["strtoupper('test')"]=> string(4) "TEST" [0]=> string(4) "TEST" } Trampoline for strtoupper array(2) { - ["strtoupper("test")"]=> + ["strtoupper('test')"]=> string(4) "TEST" [0]=> string(4) "TEST" diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt index 1f96da8e1fa3..af04daaec7fa 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt @@ -10,7 +10,7 @@ $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createaggregate (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createaggregate VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_createaggregate VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->createAggregate('testing', function(&$a, $b) { $a .= $b; return $a; }, function(&$v) { return $v; }); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt index d043dda7a526..4ba37ec6aa6e 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt @@ -11,7 +11,7 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->query('CREATE TABLE test_pdo_sqlite_createcollation (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createcollation VALUES (NULL, "1"), (NULL, "2"), (NULL, "10")'); +$db->query("INSERT INTO test_pdo_sqlite_createcollation VALUES (NULL, '1'), (NULL, '2'), (NULL, '10')"); $db->createCollation('MYCOLLATE', function($a, $b) { return strnatcmp($a, $b); }); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt index 1635fd700771..7f2b309ebf4c 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt @@ -9,7 +9,7 @@ $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createcollation_trampoline (s VARCHAR(4))'); -$stmt = $db->query('INSERT INTO test_pdo_sqlite_createcollation_trampoline VALUES ("a1"), ("a10"), ("a2")'); +$stmt = $db->query("INSERT INTO test_pdo_sqlite_createcollation_trampoline VALUES ('a1'), ('a10'), ('a2')"); class TrampolineTest { public function __call(string $name, array $arguments) { diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt index c828817d2c3a..5178daefa6d5 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt @@ -11,7 +11,7 @@ if (!defined('Pdo\Sqlite::DETERMINISTIC')) die('skip system sqlite is too old'); // This test was copied from the pdo_sqlite test for sqliteCreateCollation $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE test_pdo_sqlite_createfunction_with_flags (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO test_pdo_sqlite_createfunction_with_flags VALUES (NULL, "PHP"), (NULL, "PHP6")'); +$db->query("INSERT INTO test_pdo_sqlite_createfunction_with_flags VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); $db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getattr_busy.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getattr_busy.phpt index 230fb7390ae5..c1f82e96c07b 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getattr_busy.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getattr_busy.phpt @@ -8,7 +8,7 @@ pdo_sqlite $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE test_busy (a string);'); -$db->query('INSERT INTO test_busy VALUES ("interleaved"), ("statements")'); +$db->query("INSERT INTO test_busy VALUES ('interleaved'), ('statements')"); $st = $db->prepare('SELECT a FROM test_busy'); var_dump($st->getAttribute(Pdo\Sqlite::ATTR_BUSY_STATEMENT)); $st->execute(); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt index 383457f3a79e..d2a6c2a5f52b 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt @@ -13,7 +13,7 @@ if (!defined('Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN')) die('skip system sqlite does n $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE test_explain (a string);'); -$stmt = $db->prepare('INSERT INTO test_explain VALUES ("first insert"), ("second_insert")'); +$stmt = $db->prepare("INSERT INTO test_explain VALUES ('first insert'), ('second_insert')"); $stmt->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN); var_dump($stmt->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN); $r = $stmt->execute(); @@ -24,7 +24,7 @@ var_dump($stmt->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite:: $r = $stmts->execute(); var_dump($stmts->fetchAll(PDO::FETCH_ASSOC)); -$stmt = $db->prepare('INSERT INTO test_explain VALUES ("first insert"), ("second_insert")'); +$stmt = $db->prepare("INSERT INTO test_explain VALUES ('first insert'), ('second_insert')"); $stmt->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, Pdo\Sqlite::EXPLAIN_MODE_PREPARED); $stmt->execute(); $stmts->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, Pdo\Sqlite::EXPLAIN_MODE_PREPARED); @@ -88,7 +88,7 @@ array(%d) { ["opcode"]=> string(13) "InitCoroutine" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(%d) ["p3"]=> @@ -109,7 +109,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(2) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -126,7 +126,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -147,7 +147,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(2) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -164,7 +164,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -183,7 +183,7 @@ array(%d) { ["opcode"]=> string(12) "EndCoroutine" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -221,7 +221,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(%d) ["p3"]=> @@ -242,7 +242,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(1) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -259,11 +259,11 @@ array(%d) { ["opcode"]=> string(10) "MakeRecord" ["p1"]=> - int(2) + int(%d) ["p2"]=> int(1) ["p3"]=> - int(4) + int(%d) ["p4"]=> string(1) "C" ["p5"]=> @@ -280,9 +280,9 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(4) + int(%d) ["p3"]=> - int(1) + int(%d) ["p4"]=> string(12) "test_explain" ["p5"]=> diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt index ea88a6316b64..52233745820d 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt @@ -9,8 +9,8 @@ $db = new Pdo\Sqlite('sqlite::memory:'); $db->query('CREATE TABLE pdosqlite_001 (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO pdosqlite_001 VALUES (NULL, "PHP")'); -$db->query('INSERT INTO pdosqlite_001 VALUES (NULL, "PHP6")'); +$db->query("INSERT INTO pdosqlite_001 VALUES (NULL, 'PHP')"); +$db->query("INSERT INTO pdosqlite_001 VALUES (NULL, 'PHP6')"); $db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt index 28534f4a2365..f2de79b6c847 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt @@ -11,8 +11,8 @@ if (!$db instanceof Pdo\Sqlite) { } $db->query('CREATE TABLE pdosqlite_002 (id INT AUTO INCREMENT, name TEXT)'); -$db->query('INSERT INTO pdosqlite_002 VALUES (NULL, "PHP")'); -$db->query('INSERT INTO pdosqlite_002 VALUES (NULL, "PHP6")'); +$db->query("INSERT INTO pdosqlite_002 VALUES (NULL, 'PHP')"); +$db->query("INSERT INTO pdosqlite_002 VALUES (NULL, 'PHP6')"); $db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); diff --git a/ext/sqlite3/tests/bug72668.phpt b/ext/sqlite3/tests/bug72668.phpt index 40ede8883cc2..7f33338eb5e6 100644 --- a/ext/sqlite3/tests/bug72668.phpt +++ b/ext/sqlite3/tests/bug72668.phpt @@ -12,20 +12,20 @@ $db = new SQLite3(':memory:'); $db->createFunction('my_udf_md5', 'my_udf_md5'); try { - $result = $db->query('SELECT my_udf_md5("test")'); + $result = $db->query("SELECT my_udf_md5('test')"); var_dump($result); } catch(\Exception $e) { echo "Exception: ".$e->getMessage(); } try { - $result = $db->querySingle('SELECT my_udf_md5("test")'); + $result = $db->querySingle("SELECT my_udf_md5('test')"); var_dump($result); } catch(\Exception $e) { echo "Exception: ".$e->getMessage(); } -$statement = $db->prepare('SELECT my_udf_md5("test")'); +$statement = $db->prepare("SELECT my_udf_md5('test')"); try { $result = $statement->execute(); var_dump($result); diff --git a/ext/sqlite3/tests/sqlite3_29_createfunction.phpt b/ext/sqlite3/tests/sqlite3_29_createfunction.phpt index ef28b3b62def..1a511ee13996 100644 --- a/ext/sqlite3/tests/sqlite3_29_createfunction.phpt +++ b/ext/sqlite3/tests/sqlite3_29_createfunction.phpt @@ -9,14 +9,14 @@ require_once(__DIR__ . '/new_db.inc'); $func = 'strtoupper'; var_dump($db->createfunction($func, $func)); -var_dump($db->querySingle('SELECT strtoupper("test")')); +var_dump($db->querySingle("SELECT strtoupper('test')")); $func2 = 'strtolower'; var_dump($db->createfunction($func2, $func2)); -var_dump($db->querySingle('SELECT strtolower("TEST")')); +var_dump($db->querySingle("SELECT strtolower('TEST')")); var_dump($db->createfunction($func, $func2)); -var_dump($db->querySingle('SELECT strtoupper("tEst")')); +var_dump($db->querySingle("SELECT strtoupper('tEst')")); ?> diff --git a/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt b/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt index 4297d622e939..962075bf1478 100644 --- a/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt +++ b/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt @@ -13,14 +13,14 @@ require_once(__DIR__ . '/new_db.inc'); $func = 'strtoupper'; var_dump($db->createfunction($func, $func, 1, SQLITE3_DETERMINISTIC)); -var_dump($db->querySingle('SELECT strtoupper("test")')); +var_dump($db->querySingle("SELECT strtoupper('test')")); $func2 = 'strtolower'; var_dump($db->createfunction($func2, $func2, 1, SQLITE3_DETERMINISTIC)); -var_dump($db->querySingle('SELECT strtolower("TEST")')); +var_dump($db->querySingle("SELECT strtolower('TEST')")); var_dump($db->createfunction($func, $func2, 1, SQLITE3_DETERMINISTIC)); -var_dump($db->querySingle('SELECT strtoupper("tEst")')); +var_dump($db->querySingle("SELECT strtoupper('tEst')")); ?> diff --git a/ext/sqlite3/tests/sqlite3_dqs.phpt b/ext/sqlite3/tests/sqlite3_dqs.phpt new file mode 100644 index 000000000000..1efa8ad475fe --- /dev/null +++ b/ext/sqlite3/tests/sqlite3_dqs.phpt @@ -0,0 +1,28 @@ +--TEST-- +SQLite3 DQS +--EXTENSIONS-- +sqlite3 +--SKIPIF-- +enableExceptions(true); + $db->exec('SELECT "test"'); +} catch (\SQLite3Exception) { + die('skip SQLite is lacking DQS'); +} +?> +--FILE-- +exec('CREATE TABLE test (s1 VARCHAR(255), s2 VARCHAR(255))'); +$db->exec('INSERT INTO test VALUES (\'test\', "test")'); +var_dump($db->prepare('SELECT * FROM test')->execute()->fetchArray(SQLITE3_ASSOC)); +?> +--EXPECT-- +array(2) { + ["s1"]=> + string(4) "test" + ["s2"]=> + string(4) "test" +} diff --git a/ext/sqlite3/tests/sqlite3_explain.phpt b/ext/sqlite3/tests/sqlite3_explain.phpt index 40648588733c..1f9d4fc940e4 100644 --- a/ext/sqlite3/tests/sqlite3_explain.phpt +++ b/ext/sqlite3/tests/sqlite3_explain.phpt @@ -14,7 +14,7 @@ if ($version <= 3043000) die("skip for sqlite3 < 3.43.0"); require_once(__DIR__ . '/new_db.inc'); $db->exec('CREATE TABLE test_explain (a string);'); -$stmt = $db->prepare('INSERT INTO test_explain VALUES ("first insert"), ("second_insert")'); +$stmt = $db->prepare("INSERT INTO test_explain VALUES ('first insert'), ('second_insert')"); $stmt->setExplain(Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN); var_dump($stmt->explain() == Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN); $r = $stmt->execute(); @@ -28,7 +28,7 @@ $result = []; while (($arr = $r->fetchArray(SQLITE3_ASSOC)) !== false) $result[] = $arr; var_dump($result); -$stmt = $db->prepare('INSERT INTO test_explain VALUES ("first insert"), ("second_insert")'); +$stmt = $db->prepare("INSERT INTO test_explain VALUES ('first insert'), ('second_insert')"); $stmt->setExplain(Sqlite3Stmt::EXPLAIN_MODE_PREPARED); $stmt->execute(); $stmts = $db->prepare('SELECT * FROM test_explain'); @@ -81,7 +81,7 @@ array(%d) { ["opcode"]=> string(%d) "%s" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(%d) ["p3"]=> @@ -102,7 +102,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(2) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -119,7 +119,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -140,7 +140,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(2) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -157,7 +157,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -176,7 +176,7 @@ array(%d) { ["opcode"]=> string(12) "EndCoroutine" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(0) ["p3"]=> @@ -214,7 +214,7 @@ array(%d) { ["opcode"]=> string(5) "Yield" ["p1"]=> - int(3) + int(%d) ["p2"]=> int(%d) ["p3"]=> @@ -235,7 +235,7 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(1) + int(%d) ["p3"]=> int(0) ["p4"]=> @@ -252,11 +252,11 @@ array(%d) { ["opcode"]=> string(10) "MakeRecord" ["p1"]=> - int(2) + int(%d) ["p2"]=> int(1) ["p3"]=> - int(4) + int(%d) ["p4"]=> string(1) "C" ["p5"]=> @@ -273,9 +273,9 @@ array(%d) { ["p1"]=> int(0) ["p2"]=> - int(4) + int(%d) ["p3"]=> - int(1) + int(%d) ["p4"]=> string(12) "test_explain" ["p5"]=> diff --git a/ext/sqlite3/tests/sqlite3_rename_column.phpt b/ext/sqlite3/tests/sqlite3_rename_column.phpt index 6b4e23bc7186..a3a4caef3ce6 100644 --- a/ext/sqlite3/tests/sqlite3_rename_column.phpt +++ b/ext/sqlite3/tests/sqlite3_rename_column.phpt @@ -14,7 +14,7 @@ if (SQLite3::version()['versionNumber'] < 3025000) { $db = new SQLite3(':memory:'); $db->exec('CREATE TABLE tbl (orig text)'); -$db->exec('insert into tbl values ("one"), ("two")'); +$db->exec("insert into tbl values ('one'), ('two')"); $res1 = $db->prepare('select * from tbl')->execute(); $res2 = $db->prepare('select * from tbl')->execute(); diff --git a/ext/sqlite3/tests/sqlite3_stmt_busy.phpt b/ext/sqlite3/tests/sqlite3_stmt_busy.phpt index 8110d374afe6..33eb759772be 100644 --- a/ext/sqlite3/tests/sqlite3_stmt_busy.phpt +++ b/ext/sqlite3/tests/sqlite3_stmt_busy.phpt @@ -12,7 +12,7 @@ if ($version['versionNumber'] < 3007004) die("skip"); require_once(__DIR__ . '/new_db.inc'); $db->exec('CREATE TABLE test_busy (a string);'); -$db->exec('INSERT INTO test_busy VALUES ("interleaved"), ("statements")'); +$db->exec("INSERT INTO test_busy VALUES ('interleaved'), ('statements')"); $st = $db->prepare('SELECT a FROM test_busy'); var_dump($st->busy()); $r = $st->execute(); diff --git a/ext/sqlite3/tests/sqlite3_trampoline_createfunction.phpt b/ext/sqlite3/tests/sqlite3_trampoline_createfunction.phpt index 81245f5b4bef..52d5b726415e 100644 --- a/ext/sqlite3/tests/sqlite3_trampoline_createfunction.phpt +++ b/ext/sqlite3/tests/sqlite3_trampoline_createfunction.phpt @@ -16,8 +16,8 @@ class TrampolineTest { $o = new TrampolineTest(); $callback = [$o, 'strtoupper']; var_dump($db->createfunction('strtoupper', $callback)); -var_dump($db->querySingle('SELECT strtoupper("test")')); -var_dump($db->querySingle('SELECT strtoupper("test")')); +var_dump($db->querySingle("SELECT strtoupper('test')")); +var_dump($db->querySingle("SELECT strtoupper('test')")); ?> --EXPECT-- From 9c082438f4cf922e0d56319ebf404314a074107b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 31 Mar 2026 13:10:41 -0400 Subject: [PATCH 012/300] Fix GH-21478: Forward property operations to real instance for initialized lazy proxies Closes GH-21480 --- NEWS | 2 + Zend/tests/lazy_objects/gh18038-002.phpt | 1 - Zend/tests/lazy_objects/gh18038-004.phpt | 1 - Zend/tests/lazy_objects/gh18038-007.phpt | 1 - Zend/tests/lazy_objects/gh18038-009.phpt | 1 - Zend/tests/lazy_objects/gh20875.phpt | 8 --- Zend/tests/lazy_objects/gh21478-isset.phpt | 30 +++++++++ .../gh21478-proxy-get-override.phpt | 30 +++++++++ .../gh21478-proxy-get-ref-forward.phpt | 32 +++++++++ Zend/tests/lazy_objects/gh21478-set.phpt | 32 +++++++++ Zend/tests/lazy_objects/gh21478-unset.phpt | 30 +++++++++ Zend/tests/lazy_objects/gh21478.phpt | 32 +++++++++ Zend/zend_object_handlers.c | 65 +++++++++++++++++++ 13 files changed, 253 insertions(+), 12 deletions(-) create mode 100644 Zend/tests/lazy_objects/gh21478-isset.phpt create mode 100644 Zend/tests/lazy_objects/gh21478-proxy-get-override.phpt create mode 100644 Zend/tests/lazy_objects/gh21478-proxy-get-ref-forward.phpt create mode 100644 Zend/tests/lazy_objects/gh21478-set.phpt create mode 100644 Zend/tests/lazy_objects/gh21478-unset.phpt create mode 100644 Zend/tests/lazy_objects/gh21478.phpt diff --git a/NEWS b/NEWS index 2472825c0dab..c9933ff6b265 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fixed bug GH-19983 (GC assertion failure with fibers, generators and destructors). (iliaal) + . Fixed bug GH-21478 (Forward property operations to real instance for + initialized lazy proxies). (iliaal) - DOM: . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns diff --git a/Zend/tests/lazy_objects/gh18038-002.phpt b/Zend/tests/lazy_objects/gh18038-002.phpt index 4c12f21de811..d363731c62a0 100644 --- a/Zend/tests/lazy_objects/gh18038-002.phpt +++ b/Zend/tests/lazy_objects/gh18038-002.phpt @@ -34,5 +34,4 @@ var_dump($obj->prop); --EXPECT-- init string(19) "RealInstance::__set" -string(12) "Proxy::__set" int(2) diff --git a/Zend/tests/lazy_objects/gh18038-004.phpt b/Zend/tests/lazy_objects/gh18038-004.phpt index 8810efb6bec2..c1495c5a6d8d 100644 --- a/Zend/tests/lazy_objects/gh18038-004.phpt +++ b/Zend/tests/lazy_objects/gh18038-004.phpt @@ -36,7 +36,6 @@ var_dump($real->prop); --EXPECTF-- init string(19) "RealInstance::__get" -string(12) "Proxy::__get" Warning: Undefined property: RealInstance::$prop in %s on line %d NULL diff --git a/Zend/tests/lazy_objects/gh18038-007.phpt b/Zend/tests/lazy_objects/gh18038-007.phpt index 9925190a1980..4c7c0d0b4b0a 100644 --- a/Zend/tests/lazy_objects/gh18038-007.phpt +++ b/Zend/tests/lazy_objects/gh18038-007.phpt @@ -36,6 +36,5 @@ var_dump(isset($real->prop[''])); --EXPECT-- init string(21) "RealInstance::__isset" -string(14) "Proxy::__isset" bool(false) bool(false) diff --git a/Zend/tests/lazy_objects/gh18038-009.phpt b/Zend/tests/lazy_objects/gh18038-009.phpt index 3c165a71ccff..11067cdb970b 100644 --- a/Zend/tests/lazy_objects/gh18038-009.phpt +++ b/Zend/tests/lazy_objects/gh18038-009.phpt @@ -36,6 +36,5 @@ var_dump(isset($real->prop)); --EXPECT-- init string(21) "RealInstance::__isset" -string(14) "Proxy::__isset" bool(false) bool(false) diff --git a/Zend/tests/lazy_objects/gh20875.phpt b/Zend/tests/lazy_objects/gh20875.phpt index 72e16011320c..ff036edabd59 100644 --- a/Zend/tests/lazy_objects/gh20875.phpt +++ b/Zend/tests/lazy_objects/gh20875.phpt @@ -31,14 +31,6 @@ Warning: Undefined variable $a in %s on line %d Warning: Undefined variable $v in %s on line %d -Notice: Indirect modification of overloaded property A::$b has no effect in %s on line %d - -Warning: Undefined variable $x in %s on line %d - -Notice: Object of class stdClass could not be converted to int in %s on line %d - -Warning: Undefined variable $v in %s on line %d - Notice: Indirect modification of overloaded property A::$f has no effect in %s on line %d Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d diff --git a/Zend/tests/lazy_objects/gh21478-isset.phpt b/Zend/tests/lazy_objects/gh21478-isset.phpt new file mode 100644 index 000000000000..9138984af01b --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478-isset.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-21478: __isset on lazy proxy should not double-invoke when real instance guard is set +--FILE-- +{$name}); + } +} + +class Bar extends Foo {} + +$rc = new ReflectionClass(Bar::class); +$proxy = $rc->newLazyProxy(function () { + echo "Init\n"; + return new Foo(); +}); + +$real = $rc->initializeLazyObject($proxy); +isset($real->x); + +?> +--EXPECT-- +Init +__isset($x) on Foo diff --git a/Zend/tests/lazy_objects/gh21478-proxy-get-override.phpt b/Zend/tests/lazy_objects/gh21478-proxy-get-override.phpt new file mode 100644 index 000000000000..520c8f662353 --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478-proxy-get-override.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-21478: Proxy's own __get runs when accessed directly (not from real instance) +--FILE-- +newLazyProxy(function () { + return new Foo(); +}); +$rc->initializeLazyObject($proxy); + +$proxy->x; + +?> +--EXPECT-- +Bar x diff --git a/Zend/tests/lazy_objects/gh21478-proxy-get-ref-forward.phpt b/Zend/tests/lazy_objects/gh21478-proxy-get-ref-forward.phpt new file mode 100644 index 000000000000..fa737cf18f2e --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478-proxy-get-ref-forward.phpt @@ -0,0 +1,32 @@ +--TEST-- +GH-21478: No assertion failure when &__get forwards through initialized lazy proxy +--FILE-- +{$name}; + } +} + +class Bar extends Foo {} + +$rc = new ReflectionClass(Bar::class); +$proxy = $rc->newLazyProxy(function () { + echo "Init\n"; + return new Foo(); +}); + +$real = $rc->initializeLazyObject($proxy); +$a = &$real->x; +var_dump($a); +?> +--EXPECTF-- +Init +Foo::__get($x) on Foo + +Warning: Undefined property: Foo::$x in %s on line %d +NULL diff --git a/Zend/tests/lazy_objects/gh21478-set.phpt b/Zend/tests/lazy_objects/gh21478-set.phpt new file mode 100644 index 000000000000..0b2f872de11a --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478-set.phpt @@ -0,0 +1,32 @@ +--TEST-- +GH-21478: __set on lazy proxy should not double-invoke when real instance guard is set +--FILE-- +{$name} = $value; + } +} + +#[AllowDynamicProperties] +class Bar extends Foo {} + +$rc = new ReflectionClass(Bar::class); +$proxy = $rc->newLazyProxy(function () { + echo "Init\n"; + return new Foo(); +}); + +$real = $rc->initializeLazyObject($proxy); +$real->x = 1; + +?> +--EXPECT-- +Init +__set($x) on Foo diff --git a/Zend/tests/lazy_objects/gh21478-unset.phpt b/Zend/tests/lazy_objects/gh21478-unset.phpt new file mode 100644 index 000000000000..5febbd235d82 --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478-unset.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-21478: __unset on lazy proxy should not double-invoke when real instance guard is set +--FILE-- +{$name}); + } +} + +class Bar extends Foo {} + +$rc = new ReflectionClass(Bar::class); +$proxy = $rc->newLazyProxy(function () { + echo "Init\n"; + return new Foo(); +}); + +$real = $rc->initializeLazyObject($proxy); +unset($real->x); + +?> +--EXPECT-- +Init +__unset($x) on Foo diff --git a/Zend/tests/lazy_objects/gh21478.phpt b/Zend/tests/lazy_objects/gh21478.phpt new file mode 100644 index 000000000000..aaa226a9a09a --- /dev/null +++ b/Zend/tests/lazy_objects/gh21478.phpt @@ -0,0 +1,32 @@ +--TEST-- +GH-21478 (Property access on lazy proxy may invoke magic method despite real instance guards) +--FILE-- +{$name}; + } +} + +class Bar extends Foo {} + +$rc = new ReflectionClass(Bar::class); +$proxy = $rc->newLazyProxy(function () { + echo "Init\n"; + return new Foo(); +}); + +$real = $rc->initializeLazyObject($proxy); +$real->x; + +?> +--EXPECTF-- +Init +__get($x) on Foo + +Warning: Undefined property: Foo::$x in %s on line %d diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 648e57dfe7e7..28fd8254249c 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -886,6 +886,28 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int retval = &EG(uninitialized_zval); + /* For initialized lazy proxies: if the real instance's magic method + * guard is already set for this property, we are inside a recursive + * call from the real instance's __get/__isset. Forward directly to + * the real instance to avoid double invocation. (GH-21478) */ + if (UNEXPECTED(zend_object_is_lazy_proxy(zobj) + && zend_lazy_object_initialized(zobj))) { + zend_object *instance = zend_lazy_object_get_instance(zobj); + if (instance->ce->ce_flags & ZEND_ACC_USE_GUARDS) { + uint32_t *instance_guard = zend_get_property_guard(instance, name); + uint32_t guard_type = ((type == BP_VAR_IS) && zobj->ce->__isset) + ? IN_ISSET : IN_GET; + if ((*instance_guard) & guard_type) { + retval = zend_std_read_property(instance, name, type, cache_slot, rv); + if (retval == &EG(uninitialized_zval)) { + ZVAL_NULL(rv); + retval = rv; + } + return retval; + } + } + } + /* magic isset */ if ((type == BP_VAR_IS) && zobj->ce->__isset) { zval tmp_result; @@ -1203,6 +1225,20 @@ found:; goto exit; } + /* For initialized lazy proxies: if the real instance's __set guard + * is already set, we are inside a recursive call from the real + * instance's __set. Forward directly to avoid double invocation. */ + if (UNEXPECTED(zend_object_is_lazy_proxy(zobj) + && zend_lazy_object_initialized(zobj))) { + zend_object *instance = zend_lazy_object_get_instance(zobj); + if (instance->ce->ce_flags & ZEND_ACC_USE_GUARDS) { + uint32_t *instance_guard = zend_get_property_guard(instance, name); + if ((*instance_guard) & IN_SET) { + return zend_std_write_property(instance, name, value, cache_slot); + } + } + } + /* magic set */ if (zobj->ce->__set) { if (!guard) { @@ -1595,6 +1631,21 @@ ZEND_API void zend_std_unset_property(zend_object *zobj, zend_string *name, void return; } + /* For initialized lazy proxies: if the real instance's __unset guard + * is already set, we are inside a recursive call from the real + * instance's __unset. Forward directly to avoid double invocation. */ + if (UNEXPECTED(zend_object_is_lazy_proxy(zobj) + && zend_lazy_object_initialized(zobj))) { + zend_object *instance = zend_lazy_object_get_instance(zobj); + if (instance->ce->ce_flags & ZEND_ACC_USE_GUARDS) { + uint32_t *instance_guard = zend_get_property_guard(instance, name); + if ((*instance_guard) & IN_UNSET) { + zend_std_unset_property(instance, name, cache_slot); + return; + } + } + } + /* magic unset */ if (zobj->ce->__unset) { if (!guard) { @@ -2412,6 +2463,20 @@ ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has goto exit; } + /* For initialized lazy proxies: if the real instance's __isset guard + * is already set, we are inside a recursive call from the real + * instance's __isset. Forward directly to avoid double invocation. */ + if (UNEXPECTED(zend_object_is_lazy_proxy(zobj) + && zend_lazy_object_initialized(zobj))) { + zend_object *instance = zend_lazy_object_get_instance(zobj); + if (instance->ce->ce_flags & ZEND_ACC_USE_GUARDS) { + uint32_t *instance_guard = zend_get_property_guard(instance, name); + if ((*instance_guard) & IN_ISSET) { + return zend_std_has_property(instance, name, has_set_exists, cache_slot); + } + } + } + if (!zobj->ce->__isset) { goto lazy_init; } From 50ad45851c597e745d4351d8b7dd930d8853aae5 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 3 Apr 2026 18:46:03 +0700 Subject: [PATCH 013/300] Prefer C11 atomics over ZEND_WIN32 locking mechanism (#21620) --- Zend/zend_atomic.c | 2 +- Zend/zend_atomic.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/zend_atomic.c b/Zend/zend_atomic.c index 5f6a7793beea..4151e5e539de 100644 --- a/Zend/zend_atomic.c +++ b/Zend/zend_atomic.c @@ -57,7 +57,7 @@ ZEND_API void zend_atomic_int_store(zend_atomic_int *obj, int desired) { zend_atomic_int_store_ex(obj, desired); } -#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) +#if (defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)) && !defined(HAVE_C11_ATOMICS) /* On these platforms it is non-const due to underlying APIs. */ ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj) { return zend_atomic_bool_load_ex(obj); diff --git a/Zend/zend_atomic.h b/Zend/zend_atomic.h index 56422a721fdb..bcbc6681c928 100644 --- a/Zend/zend_atomic.h +++ b/Zend/zend_atomic.h @@ -39,7 +39,7 @@ * and alignment purposes. */ -#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) +#if (defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)) && !defined(HAVE_C11_ATOMICS) typedef struct zend_atomic_bool_s { volatile char value; } zend_atomic_bool; @@ -68,7 +68,7 @@ typedef struct zend_atomic_int_s { BEGIN_EXTERN_C() -#ifdef ZEND_WIN32 +#if defined(ZEND_WIN32) && !defined(HAVE_C11_ATOMICS) #ifndef InterlockedExchange8 #define InterlockedExchange8 _InterlockedExchange8 @@ -123,7 +123,7 @@ static zend_always_inline bool zend_atomic_int_compare_exchange_ex(zend_atomic_i } } -/* On this platform it is non-const due to Iterlocked API*/ +/* On this platform it is non-const due to Interlocked API */ static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { /* Or'ing with false won't change the value. */ return InterlockedOr8(&obj->value, false); @@ -376,7 +376,7 @@ ZEND_API bool zend_atomic_int_compare_exchange(zend_atomic_int *obj, int *expect ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired); ZEND_API void zend_atomic_int_store(zend_atomic_int *obj, int desired); -#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) +#if (defined(ZEND_WIN32) && !defined(HAVE_C11_ATOMICS)) || defined(HAVE_SYNC_ATOMICS) /* On these platforms it is non-const due to underlying APIs. */ ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj); ZEND_API int zend_atomic_int_load(zend_atomic_int *obj); From 7cfde6edba5163db1f8e83cb3bbf3f982d2c64fd Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 3 Apr 2026 16:38:13 +0200 Subject: [PATCH 014/300] Ignore ZPP in gcovr (GH-21623) The ZPP macros materialize into optimized code with many error branches that aren't useful to test for every function. Ignore these lines completely by using the gcovr --exclude-lines-by-pattern flag. For codecov to pick up on this change, we generate the xml file manually and point to it in the codecov action. Also move the ignore paths from codecov.yml to Makefile.gcov. --- .github/workflows/test-suite.yml | 5 +++++ build/Makefile.gcov | 10 +++++++--- codecov.yml | 15 --------------- 3 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 codecov.yml diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9eeff1455f8f..ef213a539937 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -413,10 +413,15 @@ jobs: with: enableOpcache: true jitType: tracing + - name: Generate coverage report + if: ${{ !cancelled() }} + run: make gcovr-xml - uses: codecov/codecov-action@v5 if: ${{ !cancelled() }} with: + disable_search: true fail_ci_if_error: true + files: gcovr.xml token: ${{ secrets.CODECOV_TOKEN }} verbose: true COMMUNITY: diff --git a/build/Makefile.gcov b/build/Makefile.gcov index de85893398cd..d389cecdd192 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -22,8 +22,12 @@ GCOVR_EXCLUDES = \ 'ext/fileinfo/libmagic/.*' \ 'ext/gd/libgd/.*' \ 'ext/hash/sha3/.*' \ + 'ext/lexbor/lexbor/.*' \ 'ext/mbstring/libmbfl/.*' \ - 'ext/pcre/pcre2lib/.*' + 'ext/pcre/pcre2lib/.*' \ + 'ext/uri/uriparser/.*' + +GCOVR_EXCLUDE_LINES_BY_PATTERN = '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' lcov: lcov-html @@ -49,14 +53,14 @@ gcovr-html: @rm -rf gcovr_html/ @mkdir gcovr_html gcovr -sr . -o gcovr_html/index.html --html --html-details \ - --exclude-directories 'ext/date/lib$$' \ + --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml gcovr -sr . -o gcovr.xml --xml \ - --exclude-directories 'ext/date/lib$$' \ + --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) .PHONY: gcovr-html lcov-html php_lcov.info diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 4c7648e738cd..000000000000 --- a/codecov.yml +++ /dev/null @@ -1,15 +0,0 @@ -ignore: - # bundled libraries - - "ext/lexbor/lexbor/core" - - "ext/lexbor/lexbor/css" - - "ext/lexbor/lexbor/dom" - - "ext/lexbor/lexbor/encoding" - - "ext/lexbor/lexbor/html" - - "ext/lexbor/lexbor/ns" - - "ext/lexbor/lexbor/ports" - - "ext/lexbor/lexbor/punycode" - - "ext/lexbor/lexbor/tag" - - "ext/lexbor/lexbor/unicode" - - "ext/lexbor/lexbor/url" - - "ext/pcre/pcre2lib" - - "ext/uri/uriparser" From 7782b8876bc0f61b0e8bcce262e22896e423b22e Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 24 Jan 2026 23:52:14 +0100 Subject: [PATCH 015/300] Fix NULL deref when enabling TLS fails and the peer name needs to be reset The code tries to read the context on NULL when `php_stream_xport_crypto_setup` fails because by then `stream` is reset to NULL. This is also UB, so can cause miscompiles. ``` ==1217==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000090 (pc 0x55d829ed3acf bp 0x7fff045f5770 sp 0x7fff045f4df0 T0) ==1217==The signal is caused by a READ memory access. ==1217==Hint: address points to the zero page. #0 0x55d829ed3acf in php_stream_url_wrap_http_ex /work/php-src/ext/standard/http_fopen_wrapper.c:580 #1 0x55d829ed857e in php_stream_url_wrap_http /work/php-src/ext/standard/http_fopen_wrapper.c:1204 #2 0x55d82a15073d in _php_stream_open_wrapper_ex /work/php-src/main/streams/streams.c:2270 #3 0x55d829e78fa6 in zif_file_get_contents /work/php-src/ext/standard/file.c:409 #4 0x55d829bbfe39 in zif_phar_file_get_contents /work/php-src/ext/phar/func_interceptors.c:226 #5 0x55d82a0b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #6 0x55d82a3e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #7 0x55d82a540995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #8 0x55d82a5558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #9 0x55d82a6ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #10 0x55d82a0ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #11 0x55d82a0ecccb in php_execute_script /work/php-src/main/main.c:2685 #12 0x55d82a6bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #13 0x55d82a6c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #14 0x7f9e770491c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #15 0x7f9e7704928a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x55d829209b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21468. Closes GH-21031. --- NEWS | 4 + ext/openssl/tests/gh21031.phpt | 82 +++++++++++++++++++++ ext/openssl/tests/sni_server_cs_expired.pem | 57 ++++++++++++++ ext/standard/http_fopen_wrapper.c | 12 ++- 4 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 ext/openssl/tests/gh21031.phpt create mode 100644 ext/openssl/tests/sni_server_cs_expired.pem diff --git a/NEWS b/NEWS index c9933ff6b265..1e72166bf934 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,10 @@ PHP NEWS . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) +- Streams: + . Fixed bug GH-21468 (Segfault in file_get_contents w/ a https URL + and a proxy set). (ndossche) + 09 Apr 2026, PHP 8.4.20 - Bz2: diff --git a/ext/openssl/tests/gh21031.phpt b/ext/openssl/tests/gh21031.phpt new file mode 100644 index 000000000000..a35fab927270 --- /dev/null +++ b/ext/openssl/tests/gh21031.phpt @@ -0,0 +1,82 @@ +--TEST-- +GH-21031 (Fix NULL deref when enabling TLS fails and the peer name needs to be reset) +--EXTENSIONS-- +openssl +--SKIPIF-- + +--FILE-- + [ + 'SNI_server_certs' => [ + "cs.php.net" => __DIR__ . "/sni_server_cs_expired.pem", + ] + ]]); + + $server = stream_socket_server('tls://127.0.0.1:0', $errno, $errstr, $serverFlags, $ctx); + phpt_notify_server_start($server); + + $conn = stream_socket_accept($server, 3); + fclose($conn); + + phpt_wait(); +CODE; + +$proxyCode = <<<'CODE' + $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; + $server = stream_socket_server("tcp://127.0.0.1:0", $errornum, $errorstr, $flags); + phpt_notify_server_start($server); + + $upstream = stream_socket_client("tcp://{{ ADDR }}", $errornum, $errorstr, 30, STREAM_CLIENT_CONNECT); + stream_set_blocking($upstream, false); + + $conn = stream_socket_accept($server); + stream_set_blocking($conn, true); + + // reading CONNECT request headers + while (($line = fgets($conn)) !== false) { + if (rtrim($line) === '') break; // empty line means end of headers + } + + // successful CONNECT response + fwrite($conn, "HTTP/1.0 200 Connection established\r\n\r\n"); + + fclose($conn); + fclose($upstream); + phpt_wait(); +CODE; + +$clientCode = <<<'CODE' + $clientCtx = stream_context_create([ + 'ssl' => [ + 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'verify_peer' => true, + 'verify_peer_name' => true, + ], + "http" => [ + "proxy" => "tcp://{{ ADDR }}" + ], + ]); + + var_dump(file_get_contents("https://cs.php.net/", false, $clientCtx)); + + phpt_notify('proxy'); + phpt_notify('server'); +CODE; + +include 'ServerClientTestCase.inc'; +ServerClientTestCase::getInstance()->run($clientCode, [ + 'server' => $serverCode, + 'proxy' => $proxyCode, +]); +?> +--EXPECTF-- +Warning: file_get_contents(https://cs.php.net/): Failed to open stream: Cannot connect to HTTPS server through proxy in %s +bool(false) diff --git a/ext/openssl/tests/sni_server_cs_expired.pem b/ext/openssl/tests/sni_server_cs_expired.pem new file mode 100644 index 000000000000..9f5a201b26d1 --- /dev/null +++ b/ext/openssl/tests/sni_server_cs_expired.pem @@ -0,0 +1,57 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAvy5NhzktzEdsHTbGB6vqYANms5rn1zXFmTJrGlWCwoIsNmTf +ahvZkrC1cCXTZ7fbPB8XQbpAtz2ZSU7OcwBW9B8okYUPo9zi/ptwcrgsQsN0hrcD +8MBRUccevwime5fLvg8E9RJ/68y9y3BnRcVWYO2sAK9juTfidNjETU3Bb05oXv8D +SD/6onXQu4uXDgsQ3cRXeld9UB0xazmQXyyiIqXc/cpTAnaEVYzn28aj7NlUbzNq +511UXMXY44x9EcXWpPVZ7heNcJNzY5DCNzmtXKrt9yiMpWQcPXEzsESVxAMqib9u +TFOlvVX17LIPxBG656PjTD9J1h6kBbMCUxzs7wIDAQABAoIBAQC85lBeY0X4ST3v +I7bJz7kWQ2YP4uhfAdeLhoDDFWjNLffniwYhfwEc6xNri0R2f/jUT9gX7qORKwEx +qPdeNCC2t67LElGg1FlJv2Z9Q7MgCKYzkdQH5s6y4e9kTHTLO/JpiceZKz1QTQ3f +XOH9032E6nIAf0wmr6xHTgOwajrN8VI5BuPEMVmEwIw3AtYeqVuPCNKyGR4HUVkC +2bAydnGngbRJRnNzmKcWJancxpHDGBSFqPyuXMFC7Jgo3ZmyCbGp99vuXVk/sW9x +5aj94M9nRE0guk05ivH2/JZao2uLYkIgjFWlhNxKdWgWRk8DEuN4djC8mKS9YH1q +crYRToMhAoGBAOspUTtKP54mpZmyhxuDqj02JaJRzNTskPHsiF1UhtXuw7uT+ryV +ekUFLNXoFmn9mbx1WVaUvGH4qjilvQOxz7u++lz0ApqJEfyM3jc/cC40Y5zcuGSu +Etbg+SyDoytlgMCIydJyrS7NNALSo5p5oG6XY2f8yd/DCAmo8LzypaHRAoGBANAf +R1SlBMc/bOsi6GrJxcBVSCFMiKYiO5woL5aUKa9yM+UQuQ/6xbQ7Q+sOlt0FH3xo +AJ2L60qTdjyXVtjOdtXs5ZC4l+C6AfnCx6yLr+fNc4SOYXEfqS4LZylgwKd9KyVB +asspIW9Idbgebmi6vPyt9LDkIp0h1VuFGjkvQJK/AoGBAI4pbS0dprXyARyYW6sb +fpgAmuG099IkrT9DUfCx/81myTclr2fAKal+BmvOIXaz0/OlMXvw8K19iVIzh7+r +B70lJ+93p/dKM/BsLI5TsHqOO0YB/QsIXOVAHgJ2FfdPJnW+e9vYba+kZ/Po6PSi +4ITaykJ8BIJcQgis89QWEGFxAoGBAJhQO+jzuDKF9ZWEf6ofrw0anOZZ16wWY5/e +PS2rk3JmVxpuibHrKqPDt+ogTELHDAsFJmYmz3VNxHuFmrajK49Wh4/JuMVr/CQo +6+8YcA1qa/94IFIlBLDBAafjujsZvOjQHnM+z8xcsGKmStF00Pjv6qNG4xoyd646 +FD4DmfOLAoGAWXehpopZKXE9gRAni881ucK6WqxPPBoofbozi09D0MmfarIVaSkv +jNVVHBfLWd7IEXTjiipPBeUqq6Jc3pscN1Vp4rrl8jTmVTdazEv0LuzpdUFqmNo2 +M+xw17uz9D9Q32/aW1Lar0PdIaL/wGEDEyzEBFwrGppcENLilPz8gzU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIFIjCCAwqgAwIBAgICEAIwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix +EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w +ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjEyWhcNMjYwNDAy +MTgzNjEyWjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE +CgwHUEhQLm5ldDETMBEGA1UEAwwKY3MucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAL8uTYc5LcxHbB02xger6mADZrOa59c1xZkyaxpVgsKC +LDZk32ob2ZKwtXAl02e32zwfF0G6QLc9mUlOznMAVvQfKJGFD6Pc4v6bcHK4LELD +dIa3A/DAUVHHHr8IpnuXy74PBPUSf+vMvctwZ0XFVmDtrACvY7k34nTYxE1NwW9O +aF7/A0g/+qJ10LuLlw4LEN3EV3pXfVAdMWs5kF8soiKl3P3KUwJ2hFWM59vGo+zZ +VG8zauddVFzF2OOMfRHF1qT1We4XjXCTc2OQwjc5rVyq7fcojKVkHD1xM7BElcQD +Kom/bkxTpb1V9eyyD8QRuuej40w/SdYepAWzAlMc7O8CAwEAAaOCAQkwggEFMAkG +A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu +U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFHPfd8dK +Lz1R0Ck4WV1B9AWXd5DSMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa +oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH +UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG +A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQB6WSIHEyDXLZxH +hZjqSNQOA7Wc9Z2FCAiD29xYkGTL8WuPVGGP1mu4B92ytj+PMWwqSReDa7eTGLE7 +O7ozw9l+c+gNmHFNikSsGjlV2E8CToQOFMny+jAQYMSXf8UbTp9xDfgG02t/71hv +SLWqdeHMLcR0xi0nBQH0vDOkwUbuWYqFa3jejHieGhykHM6CkIk6lqnyOEO+ooIF +ZsLprrg1ss/mXCPI6niP0hze55ERKdxI7Rk8sZ4pVkf2SUWqZrUS0aJ+Ymmwi6Xd +2V7izq5N30PkJS8MtqII4FAjRBIkwPh0sy8PmW/DzkYU+lYQnDfYLKDFKcj8xJK/ +o8oZUBsQltrSj0KlM9QuqxCTCBCy1nXZ9WHOhq+jdLiTc1Oi60uEHcUMrLK8aYc4 +HqIvZS6C2iwMI0d1OP3VxmAbMQ9yqRi+FbLYavJ3H40jrU9SYqdxa0BrTaz8MJNE +6AEwgQDPChczSghvHME+Fs4mtGCY3TesbNZKVahQRjaFIhMZIZ4RP4CRc0bJOBG+ +8Me4+KHNsD2ki5b03wAN6C1P2QrMzI+gH9fXLZYp761ciDAsX6YIzrhHHYLxYpJH +BkQKKs8dCQWE5IzgVrdlvC3Z1/l9om66wHqqx7nKnPfYs/Sfnwe9MpCD6xJrXiTm +WS7NM6fbQpO9APNr7o0ZOjbbWFzlNw== +-----END CERTIFICATE----- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 9fefe153622f..89125ed0765e 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -540,6 +540,10 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1); if (php_stream_write(stream, ZSTR_VAL(header.s), ZSTR_LEN(header.s)) != ZSTR_LEN(header.s)) { + if (reset_ssl_peer_name) { + php_stream_context_unset_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_name"); + } + php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy"); php_stream_close(stream); stream = NULL; @@ -561,16 +565,18 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, /* enable SSL transport layer */ if (stream) { + php_stream_context *old_context = PHP_STREAM_CONTEXT(stream); + if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 || php_stream_xport_crypto_enable(stream, 1) < 0) { php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy"); php_stream_close(stream); stream = NULL; } - } - if (reset_ssl_peer_name) { - php_stream_context_unset_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_name"); + if (reset_ssl_peer_name) { + php_stream_context_unset_option(old_context, "ssl", "peer_name"); + } } } From 678382427fad8457ed4d5dc77654e8aa06bf5f82 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Apr 2026 18:52:09 +0100 Subject: [PATCH 016/300] Zend: mark callable zval* as const (#21582) --- Zend/zend_API.c | 10 +++++----- Zend/zend_API.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index bd3f89a24502..7363a4a12039 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4031,7 +4031,7 @@ static zend_always_inline bool zend_is_callable_check_func(const zval *callable, } /* }}} */ -ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object) /* {{{ */ +ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object) /* {{{ */ { try_again: switch (Z_TYPE_P(callable)) { @@ -4089,7 +4089,7 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_objec } /* }}} */ -ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */ +ZEND_API zend_string *zend_get_callable_name(const zval *callable) /* {{{ */ { return zend_get_callable_name_ex(callable, NULL); } @@ -4206,7 +4206,7 @@ ZEND_API bool zend_is_callable_at_frame( } /* }}} */ -ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */ +ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */ { /* Determine callability at the first parent user frame. */ const zend_execute_data *frame = EG(current_execute_data); @@ -4221,13 +4221,13 @@ ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t return ret; } -ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */ +ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */ { return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL); } /* }}} */ -ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */ +ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */ { if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) { return FAILURE; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 60acbd63044d..e56ded4e8f1b 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -410,13 +410,13 @@ ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *prope #define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1) ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); -ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object); -ZEND_API zend_string *zend_get_callable_name(zval *callable); +ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object); +ZEND_API zend_string *zend_get_callable_name(const zval *callable); ZEND_API bool zend_is_callable_at_frame( const zval *callable, zend_object *object, const zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); -ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); -ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); +ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); +ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name); ZEND_API const char *zend_get_module_version(const char *module_name); ZEND_API zend_result zend_get_module_started(const char *module_name); @@ -701,7 +701,7 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name, * fci->params = NULL; * The callable_name argument may be NULL. */ -ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error); +ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error); /** Clear arguments connected with zend_fcall_info *fci * If free_mem is not zero then the params array gets free'd as well @@ -2482,7 +2482,7 @@ static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, b return 1; } -static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline) +static zend_always_inline bool zend_parse_arg_func(const zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline) { if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) { dest_fci->size = 0; From b621f80dce5c63e9e0ff5dfbf5d3da927e77871a Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 3 Apr 2026 18:59:49 +0100 Subject: [PATCH 017/300] ext/mbstring: use new INI API and remove unnecessary casts (#21393) --- ext/mbstring/mbstring.c | 56 ++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 95b624ef1d2d..c5987f3c9e7a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1216,17 +1216,17 @@ PHP_FUNCTION(mb_language) ZEND_PARSE_PARAMETERS_END(); if (name == NULL) { - RETVAL_STRING((char *)mbfl_no_language2name(MBSTRG(language))); + RETVAL_STRING(mbfl_no_language2name(MBSTRG(language))); } else { - zend_string *ini_name = ZSTR_INIT_LITERAL("mbstring.language", 0); + zend_string *ini_name = ZSTR_INIT_LITERAL("mbstring.language", false); if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) { zend_argument_value_error(1, "must be a valid language, \"%s\" given", ZSTR_VAL(name)); - zend_string_release_ex(ini_name, 0); + zend_string_release_ex(ini_name, false); RETURN_THROWS(); } // TODO Make return void RETVAL_TRUE; - zend_string_release_ex(ini_name, 0); + zend_string_release_ex(ini_name, false); } } /* }}} */ @@ -1509,7 +1509,7 @@ PHP_FUNCTION(mb_preferred_mime_name) php_error_docref(NULL, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name); RETVAL_FALSE; } else { - RETVAL_STRING((char *)preferred_name); + RETVAL_STRING(preferred_name); } } /* }}} */ @@ -3517,7 +3517,7 @@ PHP_FUNCTION(mb_detect_encoding) RETURN_FALSE; } - RETVAL_STRING((char *)ret->name); + RETVAL_STRING(ret->name); } /* }}} */ @@ -3563,7 +3563,7 @@ PHP_FUNCTION(mb_encoding_aliases) array_init(return_value); if (encoding->aliases != NULL) { for (const char **alias = encoding->aliases; *alias; ++alias) { - add_next_index_string(return_value, (char *)*alias); + add_next_index_string(return_value, *alias); } } } @@ -4768,7 +4768,7 @@ PHP_FUNCTION(mb_send_mail) str_headers = smart_str_extract(&str); - zend_string *force_extra_parameters = zend_ini_str_ex("mail.force_extra_parameters", strlen("mail.force_extra_parameters"), false, NULL); + zend_string *force_extra_parameters = zend_ini_str_literal("mail.force_extra_parameters"); if (force_extra_parameters) { extra_cmd = php_escape_shell_cmd(force_extra_parameters); } else if (extra_cmd) { @@ -4804,7 +4804,7 @@ PHP_FUNCTION(mb_get_info) { zend_string *type = NULL; size_t n; - char *name; + const char *name; zval row; const mbfl_encoding **entry; const mbfl_language *lang = mbfl_no2language(MBSTRG(language)); @@ -4819,26 +4819,26 @@ PHP_FUNCTION(mb_get_info) if (!type || zend_string_equals_literal_ci(type, "all")) { array_init(return_value); if (MBSTRG(current_internal_encoding)) { - add_assoc_string(return_value, "internal_encoding", (char *)MBSTRG(current_internal_encoding)->name); + add_assoc_string(return_value, "internal_encoding", MBSTRG(current_internal_encoding)->name); } if (MBSTRG(http_input_identify)) { - add_assoc_string(return_value, "http_input", (char *)MBSTRG(http_input_identify)->name); + add_assoc_string(return_value, "http_input", MBSTRG(http_input_identify)->name); } if (MBSTRG(current_http_output_encoding)) { - add_assoc_string(return_value, "http_output", (char *)MBSTRG(current_http_output_encoding)->name); + add_assoc_string(return_value, "http_output", MBSTRG(current_http_output_encoding)->name); } add_assoc_str(return_value, "http_output_conv_mimetypes", - zend_ini_str("mbstring.http_output_conv_mimetypes", sizeof("mbstring.http_output_conv_mimetypes") - 1, 0) + zend_string_copy(zend_ini_str_literal("mbstring.http_output_conv_mimetypes")) ); - name = (char *)mbfl_no_encoding2name(lang->mail_charset); + name = mbfl_no_encoding2name(lang->mail_charset); add_assoc_string(return_value, "mail_charset", name); - name = (char *)mbfl_no_encoding2name(lang->mail_header_encoding); + name = mbfl_no_encoding2name(lang->mail_header_encoding); add_assoc_string(return_value, "mail_header_encoding", name); - name = (char *)mbfl_no_encoding2name(lang->mail_body_encoding); + name = mbfl_no_encoding2name(lang->mail_body_encoding); add_assoc_string(return_value, "mail_body_encoding", name); add_assoc_long(return_value, "illegal_chars", MBSTRG(illegalchars)); @@ -4849,7 +4849,7 @@ PHP_FUNCTION(mb_get_info) add_assoc_string(return_value, "encoding_translation", "Off"); } - name = (char *)mbfl_no_language2name(MBSTRG(language)); + name = mbfl_no_language2name(MBSTRG(language)); add_assoc_string(return_value, "language", name); // TODO Seems to always have one entry at least? @@ -4880,31 +4880,25 @@ PHP_FUNCTION(mb_get_info) } } else if (zend_string_equals_literal_ci(type, "internal_encoding")) { ZEND_ASSERT(MBSTRG(current_internal_encoding)); - RETURN_STRING((char *)MBSTRG(current_internal_encoding)->name); + RETURN_STRING(MBSTRG(current_internal_encoding)->name); } else if (zend_string_equals_literal_ci(type, "http_input")) { if (MBSTRG(http_input_identify)) { - RETURN_STRING((char *)MBSTRG(http_input_identify)->name); + RETURN_STRING(MBSTRG(http_input_identify)->name); } RETURN_NULL(); } else if (zend_string_equals_literal_ci(type, "http_output")) { ZEND_ASSERT(MBSTRG(current_http_output_encoding)); - RETURN_STRING((char *)MBSTRG(current_http_output_encoding)->name); + RETURN_STRING(MBSTRG(current_http_output_encoding)->name); } else if (zend_string_equals_literal_ci(type, "http_output_conv_mimetypes")) { - RETURN_STR( - zend_ini_str( - "mbstring.http_output_conv_mimetypes", - sizeof("mbstring.http_output_conv_mimetypes") - 1, - false - ) - ); + RETURN_STR_COPY(zend_ini_str_literal("mbstring.http_output_conv_mimetypes")); } else if (zend_string_equals_literal_ci(type, "mail_charset")) { - name = (char *)mbfl_no_encoding2name(lang->mail_charset); + name = mbfl_no_encoding2name(lang->mail_charset); RETURN_STRING(name); } else if (zend_string_equals_literal_ci(type, "mail_header_encoding")) { - name = (char *)mbfl_no_encoding2name(lang->mail_header_encoding); + name = mbfl_no_encoding2name(lang->mail_header_encoding); RETURN_STRING(name); } else if (zend_string_equals_literal_ci(type, "mail_body_encoding")) { - name = (char *)mbfl_no_encoding2name(lang->mail_body_encoding); + name = mbfl_no_encoding2name(lang->mail_body_encoding); RETURN_STRING(name); } else if (zend_string_equals_literal_ci(type, "illegal_chars")) { RETURN_LONG(MBSTRG(illegalchars)); @@ -4915,7 +4909,7 @@ PHP_FUNCTION(mb_get_info) RETURN_STRING("Off"); } } else if (zend_string_equals_literal_ci(type, "language")) { - name = (char *)mbfl_no_language2name(MBSTRG(language)); + name = mbfl_no_language2name(MBSTRG(language)); RETURN_STRING(name); } else if (zend_string_equals_literal_ci(type, "detect_order")) { // TODO Seems to always have one entry at least? From 5216ca8822ac69cb29abf6c73e085c31802e3421 Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:24:56 +0200 Subject: [PATCH 018/300] Fix build warning on LibreSSL (#21050) When trying to build on LibreSSL, I encounter the following build warning (this was observed on master, but applies to 8.4 too): ``` /work/php-src/ext/openssl/openssl.c: In function 'zif_openssl_x509_parse': /work/php-src/ext/openssl/openssl.c:1101:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 1101 | purp = X509_PURPOSE_get0(i); | ^ /work/php-src/ext/openssl/openssl.c:1110:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 1110 | pname = useshortnames ? X509_PURPOSE_get0_sname(purp) : X509_PURPOSE_get0_name(purp); ``` --- ext/openssl/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 1c1073345a16..fa104a1a43cb 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2206,7 +2206,7 @@ PHP_FUNCTION(openssl_x509_parse) for (i = 0; i < X509_PURPOSE_get_count(); i++) { int id, purpset; char * pname; - X509_PURPOSE * purp; + const X509_PURPOSE * purp; zval subsub; array_init(&subsub); From 1aff27101775f6fcb1d8454149f5463837034ac8 Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:26:13 +0200 Subject: [PATCH 019/300] Fix memory leak on failure in openssl_x509_parse() (#21005) Only one of the two arrays (subitem) is destroyed, and critext is not. This leads to a memory leak if the loop bails out: ``` Direct leak of 56 byte(s) in 1 object(s) allocated from: #0 0x7f309fe699c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x563b9709ca05 in tracked_malloc /work/php-src/Zend/zend_alloc.c:3018 #2 0x563b9709b969 in _emalloc /work/php-src/Zend/zend_alloc.c:2780 #3 0x563b9737dc7b in _zend_new_array /work/php-src/Zend/zend_hash.c:290 #4 0x563b960f40fc in zif_openssl_x509_parse /work/php-src/ext/openssl/openssl.c:1120 #5 0x563b96eb7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #6 0x563b971e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #7 0x563b97340995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #8 0x563b973558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #9 0x563b974ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #10 0x563b96eec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #11 0x563b96eecccb in php_execute_script /work/php-src/main/main.c:2685 #12 0x563b974bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #13 0x563b974c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #14 0x7f309f1641c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #15 0x7f309f16428a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x563b96009b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` --- ext/openssl/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index d447d0ced687..755c2019977b 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1177,6 +1177,7 @@ PHP_FUNCTION(openssl_x509_parse) err_subitem: zval_ptr_dtor(&subitem); + zval_ptr_dtor(&critext); err: zend_array_destroy(Z_ARR_P(return_value)); if (cert_str) { From 880a6fcf8e7ea37b5fd852110ed63c1c128e4bc8 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 25 Jan 2026 23:24:47 +0100 Subject: [PATCH 020/300] Fix memory leak regression in openssl_pbkdf2() We're fetching the digest using the new method, but if an alias is used, the method is fetched via EVP_MD_fetch() which requires lifetime management. This is observable when using "sha-256" instead of "sha256" as an algorithm name. This is a regression in comparison to PHP 8.4. Closes GH-21039. --- NEWS | 3 +++ ext/openssl/openssl.c | 6 ++++-- ext/openssl/tests/openssl_pbkdf2_basic.phpt | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index eb098f11c042..09e58c4d9dc9 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,9 @@ PHP NEWS zend_jit_use_reg). (Arnaud) . Fixed bug GH-21593 (Borked function JIT JMPNZ smart branch). (ilutov) +- OpenSSL: + . Fix memory leak regression in openssl_pbkdf2(). (ndossche) + - DOM: . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns declarations after setAttributeNS()). (David Carlier) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index a39682963172..9986fd602046 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2450,12 +2450,14 @@ PHP_FUNCTION(openssl_pbkdf2) if (PKCS5_PBKDF2_HMAC(password, (int)password_len, (unsigned char *)salt, (int)salt_len, (int)iterations, digest, (int)key_length, (unsigned char*)ZSTR_VAL(out_buffer)) == 1) { ZSTR_VAL(out_buffer)[key_length] = 0; - RETURN_NEW_STR(out_buffer); + RETVAL_NEW_STR(out_buffer); } else { php_openssl_store_errors(); zend_string_release_ex(out_buffer, 0); - RETURN_FALSE; + RETVAL_FALSE; } + + php_openssl_release_evp_md(digest); } /* }}} */ diff --git a/ext/openssl/tests/openssl_pbkdf2_basic.phpt b/ext/openssl/tests/openssl_pbkdf2_basic.phpt index fd253ac78bb2..ba79f9415ba8 100644 --- a/ext/openssl/tests/openssl_pbkdf2_basic.phpt +++ b/ext/openssl/tests/openssl_pbkdf2_basic.phpt @@ -19,6 +19,8 @@ var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216))); var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096))); var_dump(bin2hex(openssl_pbkdf2("pass\0word", "sa\0lt", 16, 4096))); +var_dump(bin2hex(openssl_pbkdf2("password", "salt", 16, 4096, "sha-256"))); + ?> --EXPECT-- string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6" @@ -26,3 +28,4 @@ string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957" string(40) "4b007901b765489abead49d926f721d065a429c1" string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038" string(32) "56fa6aa75548099dcc37d7f03425e0c3" +string(32) "c5e478d59288c841aa530db6845c4c8d" From c349c32301df253f60214e4136783033f7c1493c Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Fri, 3 Apr 2026 20:14:14 +0100 Subject: [PATCH 021/300] Openssl little optims (#21424) - reuse BIO object in certificate chain loops. Avoid repeated BIO_new/BIO_free per iteration in PKCS12, PKCS7, and CMS read functions. Allocate once before the loop, BIO_reset between iterations, free after. - Avoid double zval_get_long() call in threads option parsing. - Reuse already computed string length instead of calling strlen() again. --- ext/openssl/openssl.c | 54 ++++++++++++++++++++++++++---------- ext/openssl/openssl_pwhash.c | 4 +-- ext/openssl/xp_ssl.c | 2 +- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 2c9b5e1e8adb..fa3fd39ed857 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1531,6 +1531,10 @@ PHP_FUNCTION(openssl_pkcs12_read) if (pkey) { bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto cleanup; + } + if (PEM_write_bio_PrivateKey(bio_out, pkey, NULL, NULL, 0, 0, NULL)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); @@ -1545,13 +1549,16 @@ PHP_FUNCTION(openssl_pkcs12_read) cert_num = sk_X509_num(ca); if (ca && cert_num) { array_init(&zextracerts); + bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto cleanup; + } for (i = 0; i < cert_num; i++) { zval zextracert; X509* aCA = sk_X509_pop(ca); if (!aCA) break; - bio_out = BIO_new(BIO_s_mem()); if (PEM_write_bio_X509(bio_out, aCA)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); @@ -1559,9 +1566,10 @@ PHP_FUNCTION(openssl_pkcs12_read) add_index_zval(&zextracerts, i, &zextracert); } + BIO_reset(bio_out); X509_free(aCA); - BIO_free(bio_out); } + BIO_free(bio_out); sk_X509_free(ca); add_assoc_zval(zout, "extracerts", &zextracerts); @@ -2814,33 +2822,41 @@ PHP_FUNCTION(openssl_pkcs7_read) } if (certs != NULL) { + bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto clean_exit; + } for (i = 0; i < sk_X509_num(certs); i++) { X509* ca = sk_X509_value(certs, i); - bio_out = BIO_new(BIO_s_mem()); - if (bio_out && PEM_write_bio_X509(bio_out, ca)) { + if (PEM_write_bio_X509(bio_out, ca)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_free(bio_out); + BIO_reset(bio_out); } + BIO_free(bio_out); } if (crls != NULL) { + bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto clean_exit; + } for (i = 0; i < sk_X509_CRL_num(crls); i++) { X509_CRL* crl = sk_X509_CRL_value(crls, i); - bio_out = BIO_new(BIO_s_mem()); - if (bio_out && PEM_write_bio_X509_CRL(bio_out, crl)) { + if (PEM_write_bio_X509_CRL(bio_out, crl)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_free(bio_out); + BIO_reset(bio_out); } + BIO_free(bio_out); } RETVAL_TRUE; @@ -3481,33 +3497,43 @@ PHP_FUNCTION(openssl_cms_read) } if (certs != NULL) { + bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto clean_exit; + } + for (i = 0; i < sk_X509_num(certs); i++) { X509* ca = sk_X509_value(certs, i); - bio_out = BIO_new(BIO_s_mem()); - if (bio_out && PEM_write_bio_X509(bio_out, ca)) { + if (PEM_write_bio_X509(bio_out, ca)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_free(bio_out); + BIO_reset(bio_out); } + BIO_free(bio_out); } if (crls != NULL) { + bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + goto clean_exit; + } + for (i = 0; i < sk_X509_CRL_num(crls); i++) { X509_CRL* crl = sk_X509_CRL_value(crls, i); - bio_out = BIO_new(BIO_s_mem()); - if (bio_out && PEM_write_bio_X509_CRL(bio_out, crl)) { + if (PEM_write_bio_X509_CRL(bio_out, crl)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_free(bio_out); + BIO_reset(bio_out); } + BIO_free(bio_out); } RETVAL_TRUE; diff --git a/ext/openssl/openssl_pwhash.c b/ext/openssl/openssl_pwhash.c index dc125e3b516d..69e9dae3fa99 100644 --- a/ext/openssl/openssl_pwhash.c +++ b/ext/openssl/openssl_pwhash.c @@ -51,6 +51,7 @@ ZEND_EXTERN_MODULE_GLOBALS(openssl) static inline zend_result get_options(zend_array *options, uint32_t *memlimit, uint32_t *iterlimit, uint32_t *threads) { zval *opt; + zend_long sthreads; *iterlimit = PHP_OPENSSL_PWHASH_ITERLIMIT; *memlimit = PHP_OPENSSL_PWHASH_MEMLIMIT; @@ -76,8 +77,7 @@ static inline zend_result get_options(zend_array *options, uint32_t *memlimit, u } *iterlimit = siterlimit; } - if ((opt = zend_hash_str_find(options, "threads", strlen("threads"))) && (zval_get_long(opt) != 1)) { - zend_long sthreads = zval_get_long(opt); + if ((opt = zend_hash_str_find(options, "threads", strlen("threads"))) && ((sthreads = zval_get_long(opt)) != 1)) { if ((sthreads < PHP_OPENSSL_THREADS_MIN) || (sthreads > PHP_OPENSSL_THREADS_MAX)) { zend_value_error("Invalid number of threads"); return FAILURE; diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 8f9395e46022..5928994d12af 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1508,7 +1508,7 @@ static unsigned char *php_openssl_alpn_protos_parse(unsigned short *outlen, cons return NULL; } - out = emalloc(strlen(in) + 1); + out = emalloc(len + 1); for (i = 0; i <= len; ++i) { if (i == len || in[i] == ',') { From 23b151a2cada075eefd7f4470fa0393651490b8a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 21 Jan 2026 20:21:18 +0100 Subject: [PATCH 022/300] Fix NPD when i2d_PKCS12_bio is called on NULL bio Most functions in OpenSSL can handle NULL arguments, but apparently i2d_PKCS12_bio not. Prevent crashes by adding a NULL check. ASAN trace: ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==132158==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000058 (pc 0x7fc646e33b69 bp 0x7fff7fe53d30 sp 0x7fff7fe53d18 T0) ==132158==The signal is caused by a WRITE memory access. ==132158==Hint: address points to the zero page. #0 0x7fc646e33b69 in BIO_up_ref (/lib/x86_64-linux-gnu/libcrypto.so.3+0xedb69) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x7fc646e3eac2 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xf8ac2) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7fc646f126f0 (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1cc6f0) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7fc646f12aa6 in OSSL_ENCODER_to_bio (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1ccaa6) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x7fc647038adf in PEM_write_bio_PrivateKey_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2adf) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #5 0x7fc647038bc7 in PEM_write_bio_PrivateKey (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2bc7) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #6 0x55ed204f881e in zif_openssl_pkcs12_read /work/php-src/ext/openssl/openssl.c:1520 #7 0x55ed215aa81b in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER /work/php-src/Zend/zend_vm_execute.h:1355 #8 0x55ed217101a9 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116469 #9 0x55ed217253d0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #10 0x55ed21889bcb in zend_execute_script /work/php-src/Zend/zend.c:1980 #11 0x55ed212bc3db in php_execute_script_ex /work/php-src/main/main.c:2645 #12 0x55ed212bc7eb in php_execute_script /work/php-src/main/main.c:2685 #13 0x55ed2188f736 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #14 0x55ed21891d03 in main /work/php-src/sapi/cli/php_cli.c:1362 #15 0x7fc6469c61c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x7fc6469c628a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x55ed20409b54 in _start (/work/php-src/sapi/cli/php+0x609b54) (BuildId: 7ce2ce63d1ea0b60b6ee6599e1c6b5160f97af1e) ``` Closes GH-20995. --- ext/openssl/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index fa104a1a43cb..a06c2683a7da 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2790,7 +2790,7 @@ PHP_FUNCTION(openssl_pkcs12_export) if (p12 != NULL) { bio_out = BIO_new(BIO_s_mem()); - if (i2d_PKCS12_bio(bio_out, p12)) { + if (bio_out && i2d_PKCS12_bio(bio_out, p12)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); From eb6c48df6a8f72951a5c70332ce1c6954dd24e96 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 22 Jan 2026 21:56:56 +0100 Subject: [PATCH 023/300] Fix memory leak in check_cert() when X509_STORE_CTX_init() fails ASAN report: ``` Direct leak of 272 byte(s) in 1 object(s) allocated from: #0 0x7f4ce970d9c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f4ce8fa97c4 in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2237c4) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7f4ce910adbd in X509_STORE_CTX_new_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0x384dbd) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x563e4a51c26c in php_openssl_check_cert /work/php-src/ext/openssl/openssl_backend_common.c:748 #4 0x563e4a4f529c in zif_openssl_x509_checkpurpose /work/php-src/ext/openssl/openssl.c:1221 #5 0x563e4b2b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #6 0x563e4b5e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #7 0x563e4b740995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #8 0x563e4b7558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #9 0x563e4b8ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #10 0x563e4b2ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #11 0x563e4b2ecccb in php_execute_script /work/php-src/main/main.c:2685 #12 0x563e4b8bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #13 0x563e4b8c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #14 0x7f4ce8a081c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #15 0x7f4ce8a0828a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x563e4a409b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21009. --- ext/openssl/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index a06c2683a7da..14cc0b2923af 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2349,6 +2349,7 @@ static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain, return 0; } if (!X509_STORE_CTX_init(csc, ctx, x, untrustedchain)) { + X509_STORE_CTX_free(csc); php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "Certificate store initialization failed"); return 0; From 6b16390a5afe20f250a3d680ecc77ef7f95a4458 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 11:30:19 +0100 Subject: [PATCH 024/300] Fix crash in php_openssl_pkey_init_ec() when EVP_PKEY_CTX_new() fails Other locations of EVP_PKEY_CTX_new() pass the pointer into a function that can handle NULL pointer inputs; OR they check for a NULL pointer. EVP_PKEY_check() apparently cannot handle a NULL pointer argument: ``` ==3749==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000088 (pc 0x7f6f4550c0fb bp 0x7ffcbff3a9c0 sp 0x7ffcbff3a9b0 T0) ==3749==The signal is caused by a READ memory access. ==3749==Hint: address points to the zero page. #0 0x7f6f4550c0fb in EVP_PKEY_pairwise_check (/lib/x86_64-linux-gnu/libcrypto.so.3+0x20f0fb) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x561499d27117 in php_openssl_pkey_init_ec /work/php-src/ext/openssl/openssl_backend_v3.c:459 #2 0x561499cfe328 in zif_openssl_pkey_new /work/php-src/ext/openssl/openssl.c:2061 #3 0x56149aab7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #4 0x56149ade024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #5 0x56149af40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #6 0x56149af558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #7 0x56149b0ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #8 0x56149aaec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #9 0x56149aaecccb in php_execute_script /work/php-src/main/main.c:2685 #10 0x56149b0bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #11 0x56149b0c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #12 0x7f6f44f7f1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #13 0x7f6f44f7f28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #14 0x561499c09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: eb0a8e6b6d683fbdf45156dfed4d76f9110252b9) ``` Closes GH-21013. --- ext/openssl/openssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 14cc0b2923af..c1545dba203f 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4709,6 +4709,9 @@ static EVP_PKEY *php_openssl_pkey_init_ec(zval *data, bool *is_private) { } EVP_PKEY_CTX_free(ctx); ctx = EVP_PKEY_CTX_new(param_key, NULL); + if (!ctx) { + goto cleanup; + } } if (EVP_PKEY_check(ctx) || EVP_PKEY_public_check_quick(ctx)) { From b2f34721ab3964a1b1af71a6d6a8ec98cbc3ec7a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 19:21:44 +0100 Subject: [PATCH 025/300] Fix crash in openssl_digest() when EVP_MD_CTX_create() fails EVP_DigestInit() cannot handle a NULL argument: ``` ==8028==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000028 (pc 0x7fade0826b2d bp 0x7ffcae8236f0 sp 0x7ffcae8236c0 T0) ==8028==The signal is caused by a READ memory access. ==8028==Hint: address points to the zero page. #0 0x7fade0826b2d (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1e3b2d) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x5584fb314601 in zif_openssl_digest /work/php-src/ext/openssl/openssl.c:4459 #2 0x5584fc0b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #3 0x5584fc3e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #4 0x5584fc540995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #5 0x5584fc5558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #6 0x5584fc6ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #7 0x5584fc0ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #8 0x5584fc0ecccb in php_execute_script /work/php-src/main/main.c:2685 #9 0x5584fc6bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #10 0x5584fc6c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #11 0x7fade02c51c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #12 0x7fade02c528a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #13 0x5584fb209b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21019. --- ext/openssl/openssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index c1545dba203f..27cf106e93a7 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -7670,7 +7670,8 @@ PHP_FUNCTION(openssl_digest) sigbuf = zend_string_alloc(siglen, 0); md_ctx = EVP_MD_CTX_create(); - if (EVP_DigestInit(md_ctx, mdtype) && + if (md_ctx && + EVP_DigestInit(md_ctx, mdtype) && EVP_DigestUpdate(md_ctx, (unsigned char *)data, data_len) && EVP_DigestFinal (md_ctx, (unsigned char *)ZSTR_VAL(sigbuf), &siglen)) { if (raw_output) { From d0d9183d9d00aafe57d33872b3430a9a33d39e4e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 22:38:08 +0100 Subject: [PATCH 026/300] Fix crash in openssl_pkey_export() when BIO_new() fails ``` ==59541==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000058 (pc 0x7f9fafba9b69 bp 0x7ffe3fd87700 sp 0x7ffe3fd876e8 T0) ==59541==The signal is caused by a WRITE memory access. ==59541==Hint: address points to the zero page. #0 0x7f9fafba9b69 in BIO_up_ref (/lib/x86_64-linux-gnu/libcrypto.so.3+0xedb69) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x7f9fafbb4ac2 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xf8ac2) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7f9fafc886f0 (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1cc6f0) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7f9fafc88aa6 in OSSL_ENCODER_to_bio (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1ccaa6) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x7f9fafdaeadf in PEM_write_bio_PrivateKey_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2adf) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #5 0x7f9fafdaebc7 in PEM_write_bio_PrivateKey (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2bc7) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #6 0x555dbe4ff75f in zif_openssl_pkey_export /work/php-src/ext/openssl/openssl.c:2216 #7 0x555dbf2b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #8 0x555dbf5e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #9 0x555dbf740995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #10 0x555dbf7558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #11 0x555dbf8ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #12 0x555dbf2ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #13 0x555dbf2ecccb in php_execute_script /work/php-src/main/main.c:2685 #14 0x555dbf8bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #15 0x555dbf8c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #16 0x7f9faf73e1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x7f9faf73e28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #18 0x555dbe409b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21021. --- ext/openssl/openssl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 27cf106e93a7..05eef77c6817 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -5026,6 +5026,10 @@ PHP_FUNCTION(openssl_pkey_export) if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) { bio_out = BIO_new(BIO_s_mem()); + if (!bio_out) { + php_openssl_store_errors(); + goto cleanup; + } if (passphrase && req.priv_key_encrypt) { if (req.priv_key_encrypt_cipher) { @@ -5054,6 +5058,7 @@ PHP_FUNCTION(openssl_pkey_export) php_openssl_store_errors(); } } +cleanup: PHP_SSL_REQ_DISPOSE(&req); EVP_PKEY_free(key); BIO_free(bio_out); From 5f9b6ed83405717bf85e07e27320a24f704f0a80 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 22:41:51 +0100 Subject: [PATCH 027/300] Fix crash in openssl_pkcs12_read() when BIO_new() fails Example ASAN report: ``` ==55442==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000058 (pc 0x7f73a6413b69 bp 0x7ffe666f6010 sp 0x7ffe666f5ff8 T0) ==55442==The signal is caused by a WRITE memory access. ==55442==Hint: address points to the zero page. #0 0x7f73a6413b69 in BIO_up_ref (/lib/x86_64-linux-gnu/libcrypto.so.3+0xedb69) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x7f73a641eac2 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xf8ac2) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7f73a64f26f0 (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1cc6f0) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7f73a64f2aa6 in OSSL_ENCODER_to_bio (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1ccaa6) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x7f73a6618adf in PEM_write_bio_PrivateKey_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2adf) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #5 0x7f73a6618bc7 in PEM_write_bio_PrivateKey (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2f2bc7) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #6 0x559b16af882b in zif_openssl_pkcs12_read /work/php-src/ext/openssl/openssl.c:1520 #7 0x559b178b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #8 0x559b17be024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #9 0x559b17d40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #10 0x559b17d558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #11 0x559b17eba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #12 0x559b178ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #13 0x559b178ecccb in php_execute_script /work/php-src/main/main.c:2685 #14 0x559b17ebfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #15 0x559b17ec21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #16 0x7f73a5fa81c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x7f73a5fa828a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #18 0x559b16a09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21022. --- ext/openssl/openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 05eef77c6817..30ac08397edd 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2856,7 +2856,7 @@ PHP_FUNCTION(openssl_pkcs12_read) if (cert) { bio_out = BIO_new(BIO_s_mem()); - if (PEM_write_bio_X509(bio_out, cert)) { + if (bio_out && PEM_write_bio_X509(bio_out, cert)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); @@ -2869,7 +2869,7 @@ PHP_FUNCTION(openssl_pkcs12_read) if (pkey) { bio_out = BIO_new(BIO_s_mem()); - if (PEM_write_bio_PrivateKey(bio_out, pkey, NULL, NULL, 0, 0, NULL)) { + if (bio_out && PEM_write_bio_PrivateKey(bio_out, pkey, NULL, NULL, 0, 0, NULL)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zpkey, bio_buf->data, bio_buf->length); @@ -2890,7 +2890,7 @@ PHP_FUNCTION(openssl_pkcs12_read) if (!aCA) break; bio_out = BIO_new(BIO_s_mem()); - if (PEM_write_bio_X509(bio_out, aCA)) { + if (bio_out && PEM_write_bio_X509(bio_out, aCA)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); ZVAL_STRINGL(&zextracert, bio_buf->data, bio_buf->length); From 1ef9aa7e32fede48941c36144fb9eb8faf587033 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 24 Jan 2026 17:55:55 +0100 Subject: [PATCH 028/300] Fix crash in php_openssl_create_sni_server_ctx() when SSL_CTX_new() fails ``` ==41743==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000090 (pc 0x557f134d3acf bp 0x7ffd4d5bc1f0 sp 0x7ffd4d5bb870 T0) ==41743==The signal is caused by a READ memory access. ==41743==Hint: address points to the zero page. #0 0x557f134d3acf in php_stream_url_wrap_http_ex /work/php-src/ext/standard/http_fopen_wrapper.c:580 #1 0x557f134d857e in php_stream_url_wrap_http /work/php-src/ext/standard/http_fopen_wrapper.c:1204 #2 0x557f1375073d in _php_stream_open_wrapper_ex /work/php-src/main/streams/streams.c:2270 #3 0x557f13478fa6 in zif_file_get_contents /work/php-src/ext/standard/file.c:409 #4 0x557f131bfe39 in zif_phar_file_get_contents /work/php-src/ext/phar/func_interceptors.c:226 #5 0x557f136b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #6 0x557f139e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #7 0x557f13b40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #8 0x557f13b558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #9 0x557f13cba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #10 0x557f136ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #11 0x557f136ecccb in php_execute_script /work/php-src/main/main.c:2685 #12 0x557f13cbfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #13 0x557f13cc21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #14 0x7f14599cd1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #15 0x7f14599cd28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x557f12809b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21026. --- ext/openssl/xp_ssl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 60477094a1b6..1bc5c8c1e67b 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1416,6 +1416,10 @@ static SSL_CTX *php_openssl_create_sni_server_ctx(char *cert_path, char *key_pat /* The hello method is not inherited by SSL structs when assigning a new context * inside the SNI callback, so the just use SSLv23 */ SSL_CTX *ctx = SSL_CTX_new(SSLv23_server_method()); + if (!ctx) { + php_error_docref(NULL, E_WARNING, "Failed to create the SSL context"); + return NULL; + } if (SSL_CTX_use_certificate_chain_file(ctx, cert_path) != 1) { php_error_docref(NULL, E_WARNING, From 20903a8485161b969ceacc75de1dd74198e91fea Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Tue, 27 Jan 2026 22:44:12 +0100 Subject: [PATCH 029/300] Fix memory leak on error path in openssl_open() `pkey` must be released after it was allocated on the error paths. Otherwise we get leaks like this: ``` Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7ff8d76a1340 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77 #1 0x7ff8d7189136 in EVP_PKEY_new evp/p_lib.c:385 #2 0x7ff8d71178e4 in d2i_PrivateKey asn1/a_pkey.c:80 #3 0x7ff8d719ed07 in PEM_read_bio_PrivateKey pem/pem_pkey.c:135 #4 0x555c54726e80 in php_openssl_pem_read_bio_private_key /work/php-src/ext/openssl/openssl_backend_v1.c:738 #5 0x555c5471ee77 in php_openssl_pkey_from_zval /work/php-src/ext/openssl/openssl_backend_common.c:1297 #6 0x555c54712e3f in zif_openssl_open /work/php-src/ext/openssl/openssl.c:4331 #7 0x555c554b44e5 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #8 0x555c557dba0b in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2024 #9 0x555c5593cf57 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116514 #10 0x555c55951ec0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #11 0x555c55ab60cc in zend_execute_script /work/php-src/Zend/zend.c:1980 #12 0x555c554e8ecb in php_execute_script_ex /work/php-src/main/main.c:2645 #13 0x555c554e92db in php_execute_script /work/php-src/main/main.c:2685 #14 0x555c55abbc37 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #15 0x555c55abe204 in main /work/php-src/sapi/cli/php_cli.c:1362 #16 0x7ff8d6d061c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x7ff8d6d0628a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #18 0x555c54609db4 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609db4) (BuildId: 5cc444a6a9fc1a486ea698e72366c16bd5472605) ``` Closes GH-21054. --- ext/openssl/openssl.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 30ac08397edd..1b04164df413 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -7507,18 +7507,20 @@ PHP_FUNCTION(openssl_open) cipher = EVP_get_cipherbyname(method); if (!cipher) { php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm"); - RETURN_FALSE; + RETVAL_FALSE; + goto out_pkey; } cipher_iv_len = EVP_CIPHER_iv_length(cipher); if (cipher_iv_len > 0) { if (!iv) { zend_argument_value_error(6, "cannot be null for the chosen cipher algorithm"); - RETURN_THROWS(); + goto out_pkey; } if ((size_t)cipher_iv_len != iv_len) { php_error_docref(NULL, E_WARNING, "IV length is invalid"); - RETURN_FALSE; + RETVAL_FALSE; + goto out_pkey; } iv_buf = (unsigned char *)iv; } else { @@ -7540,8 +7542,9 @@ PHP_FUNCTION(openssl_open) } efree(buf); - EVP_PKEY_free(pkey); EVP_CIPHER_CTX_free(ctx); +out_pkey: + EVP_PKEY_free(pkey); } /* }}} */ From 2004b709c43b396c8229a8dac9f8310fcfb515d3 Mon Sep 17 00:00:00 2001 From: ndossche Date: Thu, 5 Mar 2026 13:27:03 +0100 Subject: [PATCH 030/300] Fix missing error propagation in openssl_x509_export_to_file() The file writes can have failed, but this error isn't visible for the application, fix it by propagating the error properly. Closes GH-21348. --- ext/openssl/openssl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 1b04164df413..7e6638f7fd24 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1567,14 +1567,11 @@ PHP_FUNCTION(openssl_x509_export_to_file) bio_out = BIO_new_file(file_path, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY)); if (bio_out) { - if (!notext && !X509_print(bio_out, cert)) { - php_openssl_store_errors(); - } - if (!PEM_write_bio_X509(bio_out, cert)) { + if ((notext || X509_print(bio_out, cert)) && PEM_write_bio_X509(bio_out, cert)) { + RETVAL_TRUE; + } else { php_openssl_store_errors(); } - - RETVAL_TRUE; } else { php_openssl_store_errors(); php_error_docref(NULL, E_WARNING, "Error opening file %s", file_path); From 4bb68c567fae1303883188b346d08ea014919b2e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 24 Jan 2026 22:59:16 +0100 Subject: [PATCH 031/300] Fix memory leaks when adding certificate to store fails When certificate `cert` exists, but is not added to the store, it causes memory leaks. The error handling was already existing but the freeing only happened on the success case. One could also ponder whether it is necessary to inform the user when adding a certificate failed or signal this in some way. Part of the leak report: ``` Direct leak of 384 byte(s) in 1 object(s) allocated from: #0 0x7fdbf1f9e9c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7fdbf183a7c4 in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2237c4) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7fdbf16f9d13 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xe2d13) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7fdbf16f9e19 in ASN1_item_new_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0xe2e19) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x7fdbf19a59f9 in X509_new_ex (/lib/x86_64-linux-gnu/libcrypto.so.3+0x38e9f9) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #5 0x5575bcd295cb in php_openssl_pem_read_bio_x509 /work/php-src/ext/openssl/openssl_backend_v3.c:876 #6 0x5575bcd2ef3d in php_openssl_load_stream_cafile /work/php-src/ext/openssl/xp_ssl.c:855 #7 0x5575bcd2f4da in php_openssl_enable_peer_verification /work/php-src/ext/openssl/xp_ssl.c:912 #8 0x5575bcd33104 in php_openssl_setup_crypto /work/php-src/ext/openssl/xp_ssl.c:1610 #9 0x5575bcd39c18 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2512 #10 0x5575bdb4c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #11 0x5575bdb5557d in php_stream_xport_crypto_setup /work/php-src/main/streams/transports.c:367 #12 0x5575bcd39f11 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2540 #13 0x5575bdb4c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #14 0x5575bdb54655 in php_stream_xport_connect /work/php-src/main/streams/transports.c:248 #15 0x5575bdb5365d in _php_stream_xport_create /work/php-src/main/streams/transports.c:145 #16 0x5575bd8d30b1 in php_stream_url_wrap_http_ex /work/php-src/ext/standard/http_fopen_wrapper.c:490 #17 0x5575bd8d857e in php_stream_url_wrap_http /work/php-src/ext/standard/http_fopen_wrapper.c:1204 #18 0x5575bdb5073d in _php_stream_open_wrapper_ex /work/php-src/main/streams/streams.c:2270 #19 0x5575bd878fa6 in zif_file_get_contents /work/php-src/ext/standard/file.c:409 #20 0x5575bd5bfe39 in zif_phar_file_get_contents /work/php-src/ext/phar/func_interceptors.c:226 #21 0x5575bdab7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #22 0x5575bdde024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #23 0x5575bdf40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #24 0x5575bdf558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #25 0x5575be0ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #26 0x5575bdaec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #27 0x5575bdaecccb in php_execute_script /work/php-src/main/main.c:2685 #28 0x5575be0bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #29 0x5575be0c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 ... etc ... ``` Closes GH-21030. --- ext/openssl/xp_ssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 1bc5c8c1e67b..c4423ce20411 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -859,8 +859,9 @@ static long php_openssl_load_stream_cafile(X509_STORE *cert_store, const char *c buffer_active = 0; if (cert && X509_STORE_add_cert(cert_store, cert)) { ++certs_added; - X509_free(cert); } + /* TODO: notify user when adding certificate failed? */ + X509_free(cert); goto cert_start; } From 1c946325890596ec22871d0ca7170c245fc93e3c Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:43:25 +0200 Subject: [PATCH 032/300] Fix SKIPIF of openssl_password.phpt (#20941) It's possible there is no argon2 provider at all. --- ext/openssl/tests/openssl_password.phpt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/openssl/tests/openssl_password.phpt b/ext/openssl/tests/openssl_password.phpt index 0dbc1ae42a3f..ca0d20f9bcc3 100644 --- a/ext/openssl/tests/openssl_password.phpt +++ b/ext/openssl/tests/openssl_password.phpt @@ -5,7 +5,10 @@ openssl --SKIPIF-- --FILE-- From 7831244633d0f514f3f07875f4cbc4e3343edef4 Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:43:31 +0200 Subject: [PATCH 033/300] openssl: Fix missing error propagation in openssl_x509_export() (#21375) The file writes can have failed, but this error isn't visible for the application, fix it by propagating the error properly. --- ext/openssl/openssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7e6638f7fd24..f5869a8999d2 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1869,8 +1869,7 @@ PHP_FUNCTION(openssl_x509_export) } if (!notext && !X509_print(bio_out, cert)) { php_openssl_store_errors(); - } - if (PEM_write_bio_X509(bio_out, cert)) { + } else if (PEM_write_bio_X509(bio_out, cert)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); From 4a16d22970b0b717879e37ced9ed43ed54a09d6e Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 3 Apr 2026 22:43:39 +0200 Subject: [PATCH 034/300] openssl: Fix error propagation in csr exports (#21403) If the print fails, then the write is still executed, resulting in a partial export without any way of the user knowing this happened. Fix this by only returning true if all writes succeed. --- ext/openssl/openssl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f5869a8999d2..22f25a48eedd 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3176,9 +3176,9 @@ PHP_FUNCTION(openssl_csr_export_to_file) bio_out = BIO_new_file(file_path, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY)); if (bio_out != NULL) { if (!notext && !X509_REQ_print(bio_out, csr)) { + /* TODO: warn? */ php_openssl_store_errors(); - } - if (!PEM_write_bio_X509_REQ(bio_out, csr)) { + } else if (!PEM_write_bio_X509_REQ(bio_out, csr)) { php_error_docref(NULL, E_WARNING, "Error writing PEM to file %s", file_path); php_openssl_store_errors(); } else { @@ -3227,9 +3227,7 @@ PHP_FUNCTION(openssl_csr_export) bio_out = BIO_new(BIO_s_mem()); if (!notext && !X509_REQ_print(bio_out, csr)) { php_openssl_store_errors(); - } - - if (PEM_write_bio_X509_REQ(bio_out, csr)) { + } else if (PEM_write_bio_X509_REQ(bio_out, csr)) { BUF_MEM *bio_buf; BIO_get_mem_ptr(bio_out, &bio_buf); From 5684949337009fdaed7487e49acab140c9e23df6 Mon Sep 17 00:00:00 2001 From: ndossche Date: Tue, 27 Jan 2026 12:03:51 +0100 Subject: [PATCH 035/300] Fix error check on X509V3_EXT_print() The docs I found of this function appear to be wrong, as it can also return -1 on failure. See also https://github.com/openssl/openssl/pull/29793 Closes GH-21047. --- ext/openssl/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 22f25a48eedd..f8be531d8dd8 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2252,7 +2252,7 @@ PHP_FUNCTION(openssl_x509_parse) goto err_subitem; } } - else if (X509V3_EXT_print(bio_out, extension, 0, 0)) { + else if (X509V3_EXT_print(bio_out, extension, 0, 0) > 0) { BIO_get_mem_ptr(bio_out, &bio_buf); add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length); } else { From e474d3c99f91adf41323c332381b4e2096b35b13 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:15:31 +0100 Subject: [PATCH 036/300] Fix crash in openssl_pkey_get_details() when BIO_new() fails PEM_write_bio_PUBKEY() cannot handle a NULL argument: ``` ==10779==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000058 (pc 0x7f426f79db69 bp 0x7fff0ec17940 sp 0x7fff0ec17928 T0) ==10779==The signal is caused by a WRITE memory access. ==10779==Hint: address points to the zero page. #0 0x7f426f79db69 in BIO_up_ref (/lib/x86_64-linux-gnu/libcrypto.so.3+0xedb69) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #1 0x7f426f7a8ac2 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xf8ac2) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7f426f87c6f0 (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1cc6f0) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7f426f87caa6 in OSSL_ENCODER_to_bio (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1ccaa6) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x7f426f99dc5e in PEM_write_bio_PUBKEY (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2edc5e) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #5 0x5637ebd00530 in zif_openssl_pkey_get_details /work/php-src/ext/openssl/openssl.c:2308 #6 0x5637ecab7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #7 0x5637ecde024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #8 0x5637ecf40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #9 0x5637ecf558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #10 0x5637ed0ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #11 0x5637ecaec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #12 0x5637ecaecccb in php_execute_script /work/php-src/main/main.c:2685 #13 0x5637ed0bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #14 0x5637ed0c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #15 0x7f426f3321c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x7f426f33228a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x5637ebc09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: eb0a8e6b6d683fbdf45156dfed4d76f9110252b9) ``` Closes GH-21015. --- ext/openssl/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f8be531d8dd8..3dd58f5591a0 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -5176,7 +5176,7 @@ PHP_FUNCTION(openssl_pkey_get_details) EVP_PKEY *pkey = Z_OPENSSL_PKEY_P(key)->pkey; BIO *out = BIO_new(BIO_s_mem()); - if (!PEM_write_bio_PUBKEY(out, pkey)) { + if (!out || !PEM_write_bio_PUBKEY(out, pkey)) { BIO_free(out); php_openssl_store_errors(); RETURN_FALSE; From 8c1137097468b993d3264c8159db81d71515672b Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 23 Jan 2026 14:54:12 +0100 Subject: [PATCH 037/300] Fix crash when ASN1_STRING_to_UTF8() fails This function returns -1 on failure. Not checking this causes a segfault if `cert_name` is still NULL, i.e. if the failure happens on the first iteration. If the failure happens on the second iteration, we get a use-after-free. NULL deref example: ``` ==189347==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f961f6f379d bp 0x7ffdc44afed0 sp 0x7ffdc44af658 T0) ==189347==The signal is caused by a READ memory access. ==189347==Hint: address points to the zero page. #0 0x7f961f6f379d (/lib/x86_64-linux-gnu/libc.so.6+0x18b79d) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #1 0x7f9620217826 in strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:389 #2 0x560faa92d119 in php_openssl_matches_san_list /work/php-src/ext/openssl/xp_ssl.c:478 #3 0x560faa92e912 in php_openssl_apply_peer_verification_policy /work/php-src/ext/openssl/xp_ssl.c:636 #4 0x560faa93565b in php_openssl_enable_crypto /work/php-src/ext/openssl/xp_ssl.c:1893 #5 0x560faa939c86 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2516 #6 0x560fab74c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #7 0x560fab7557c1 in php_stream_xport_crypto_enable /work/php-src/main/streams/transports.c:387 #8 0x560faa939f29 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2541 #9 0x560fab74c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #10 0x560fab754655 in php_stream_xport_connect /work/php-src/main/streams/transports.c:248 #11 0x560fab75365d in _php_stream_xport_create /work/php-src/main/streams/transports.c:145 #12 0x560fab54d725 in zif_stream_socket_client /work/php-src/ext/standard/streamsfuncs.c:158 #13 0x560fab6b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #14 0x560fab9e024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #15 0x560fabb40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #16 0x560fabb558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #17 0x560fabcba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #18 0x560fab6ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #19 0x560fab6ecccb in php_execute_script /work/php-src/main/main.c:2685 #20 0x560fabcbfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #21 0x560fabcc21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #22 0x7f961f5921c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #23 0x7f961f59228a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #24 0x560faa809b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` UAF example: ``` ==190632==ERROR: AddressSanitizer: heap-use-after-free on address 0x5020000690f0 at pc 0x7fc2cdb3596f bp 0x7ffce2ed98d0 sp 0x7ffce2ed9078 READ of size 3 at 0x5020000690f0 thread T0 #0 0x7fc2cdb3596e in strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:391 #1 0x558b6eb2d119 in php_openssl_matches_san_list /work/php-src/ext/openssl/xp_ssl.c:478 #2 0x558b6eb2e912 in php_openssl_apply_peer_verification_policy /work/php-src/ext/openssl/xp_ssl.c:636 #3 0x558b6eb3565b in php_openssl_enable_crypto /work/php-src/ext/openssl/xp_ssl.c:1893 #4 0x558b6eb39c86 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2516 #5 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #6 0x558b6f9557c1 in php_stream_xport_crypto_enable /work/php-src/main/streams/transports.c:387 #7 0x558b6eb39f29 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2541 #8 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #9 0x558b6f954655 in php_stream_xport_connect /work/php-src/main/streams/transports.c:248 #10 0x558b6f95365d in _php_stream_xport_create /work/php-src/main/streams/transports.c:145 #11 0x558b6f74d725 in zif_stream_socket_client /work/php-src/ext/standard/streamsfuncs.c:158 #12 0x558b6f8b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #13 0x558b6fbe024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #14 0x558b6fd40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #15 0x558b6fd558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #16 0x558b6feba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #17 0x558b6f8ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #18 0x558b6f8ecccb in php_execute_script /work/php-src/main/main.c:2685 #19 0x558b6febfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #20 0x558b6fec21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #21 0x7fc2cceb01c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #22 0x7fc2cceb028a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #23 0x558b6ea09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) 0x5020000690f0 is located 0 bytes inside of 9-byte region [0x5020000690f0,0x5020000690f9) freed by thread T0 here: #0 0x7fc2cdbb44d8 in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52 #1 0x558b6eb2d2fa in php_openssl_matches_san_list /work/php-src/ext/openssl/xp_ssl.c:496 #2 0x558b6eb2e912 in php_openssl_apply_peer_verification_policy /work/php-src/ext/openssl/xp_ssl.c:636 #3 0x558b6eb3565b in php_openssl_enable_crypto /work/php-src/ext/openssl/xp_ssl.c:1893 #4 0x558b6eb39c86 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2516 #5 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #6 0x558b6f9557c1 in php_stream_xport_crypto_enable /work/php-src/main/streams/transports.c:387 #7 0x558b6eb39f29 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2541 #8 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #9 0x558b6f954655 in php_stream_xport_connect /work/php-src/main/streams/transports.c:248 #10 0x558b6f95365d in _php_stream_xport_create /work/php-src/main/streams/transports.c:145 #11 0x558b6f74d725 in zif_stream_socket_client /work/php-src/ext/standard/streamsfuncs.c:158 #12 0x558b6f8b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #13 0x558b6fbe024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #14 0x558b6fd40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #15 0x558b6fd558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #16 0x558b6feba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #17 0x558b6f8ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #18 0x558b6f8ecccb in php_execute_script /work/php-src/main/main.c:2685 #19 0x558b6febfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #20 0x558b6fec21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #21 0x7fc2cceb01c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #22 0x7fc2cceb028a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #23 0x558b6ea09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) previously allocated by thread T0 here: #0 0x7fc2cdbb59c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7fc2cd2faeab in ASN1_mbstring_ncopy (/lib/x86_64-linux-gnu/libcrypto.so.3+0xcceab) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #2 0x7fc2cd2fb2e5 in ASN1_mbstring_copy (/lib/x86_64-linux-gnu/libcrypto.so.3+0xcd2e5) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #3 0x7fc2cd2fe2a5 in ASN1_STRING_to_UTF8 (/lib/x86_64-linux-gnu/libcrypto.so.3+0xd02a5) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade) #4 0x558b6eb2d0a8 in php_openssl_matches_san_list /work/php-src/ext/openssl/xp_ssl.c:477 #5 0x558b6eb2e912 in php_openssl_apply_peer_verification_policy /work/php-src/ext/openssl/xp_ssl.c:636 #6 0x558b6eb3565b in php_openssl_enable_crypto /work/php-src/ext/openssl/xp_ssl.c:1893 #7 0x558b6eb39c86 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2516 #8 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #9 0x558b6f9557c1 in php_stream_xport_crypto_enable /work/php-src/main/streams/transports.c:387 #10 0x558b6eb39f29 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2541 #11 0x558b6f94c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #12 0x558b6f954655 in php_stream_xport_connect /work/php-src/main/streams/transports.c:248 #13 0x558b6f95365d in _php_stream_xport_create /work/php-src/main/streams/transports.c:145 #14 0x558b6f74d725 in zif_stream_socket_client /work/php-src/ext/standard/streamsfuncs.c:158 #15 0x558b6f8b7ed2 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #16 0x558b6fbe024a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #17 0x558b6fd40995 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #18 0x558b6fd558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #19 0x558b6feba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #20 0x558b6f8ec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #21 0x558b6f8ecccb in php_execute_script /work/php-src/main/main.c:2685 #22 0x558b6febfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #23 0x558b6fec21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #24 0x7fc2cceb01c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #25 0x7fc2cceb028a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #26 0x558b6ea09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21017. --- ext/openssl/xp_ssl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index c4423ce20411..88c75253abaf 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -126,10 +126,6 @@ #define GET_VER_OPT_LONG(_name, _num) \ if (GET_VER_OPT(_name)) _num = zval_get_long(val) -/* Used for peer verification in windows */ -#define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) \ - ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i))) - #ifdef HAVE_IPV6 /* Used for IPv6 Address peer verification */ #define EXPAND_IPV6_ADDRESS(_str, _bytes) \ @@ -476,7 +472,10 @@ static bool php_openssl_matches_san_list(X509 *peer, const char *subject_name) / GENERAL_NAME *san = sk_GENERAL_NAME_value(alt_names, i); if (san->type == GEN_DNS) { - ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName); + if (ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName) < 0) { + /* TODO: warn ? */ + continue; + } if ((size_t)ASN1_STRING_length(san->d.dNSName) != strlen((const char*)cert_name)) { OPENSSL_free(cert_name); /* prevent null-byte poisoning*/ From 8b031ea6eda1b9c5bc3e8db479bbaf6283c1511f Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:15:10 +0100 Subject: [PATCH 038/300] Fix error check on X509_set_subject_name() This call can fail but this is not checked. The other setter call is checked however. Closes GH-21028. --- ext/openssl/openssl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 3dd58f5591a0..460474488224 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3376,7 +3376,10 @@ PHP_FUNCTION(openssl_csr_sign) PHP_OPENSSL_ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial); } - X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr)); + if (!X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr))) { + php_openssl_store_errors(); + goto cleanup; + } if (cert == NULL) { cert = new_cert; From 0f38bfdef2d9e5ccbb266658b29bd576e36ed8a8 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Fri, 3 Apr 2026 21:49:54 +0200 Subject: [PATCH 039/300] Fix GH-21617: sni_server self signed certifcate expired It changes the SNI tests to use certificate generator like other TLS tests. Closes GH-21628 --- ext/openssl/tests/gh9310.phpt | 59 +++++++++++------ .../openssl_x509_checkpurpose_basic.phpt | 2 +- .../openssl_x509_export_to_file_leak.phpt | 2 +- .../{sni_server_uk.pem => sni_server.pem} | 0 ext/openssl/tests/sni_server.phpt | 29 +++++++-- ext/openssl/tests/sni_server_ca.pem | 63 ------------------- ext/openssl/tests/sni_server_cs.pem | 57 ----------------- ext/openssl/tests/sni_server_cs_cert.pem | 30 --------- ext/openssl/tests/sni_server_cs_key.pem | 27 -------- ext/openssl/tests/sni_server_key_cert.phpt | 45 ++++++++++--- ext/openssl/tests/sni_server_uk_cert.pem | 30 --------- ext/openssl/tests/sni_server_uk_key.pem | 27 -------- ext/openssl/tests/sni_server_us.pem | 57 ----------------- ext/openssl/tests/sni_server_us_cert.pem | 30 --------- ext/openssl/tests/sni_server_us_key.pem | 27 -------- 15 files changed, 106 insertions(+), 379 deletions(-) rename ext/openssl/tests/{sni_server_uk.pem => sni_server.pem} (100%) delete mode 100644 ext/openssl/tests/sni_server_ca.pem delete mode 100644 ext/openssl/tests/sni_server_cs.pem delete mode 100644 ext/openssl/tests/sni_server_cs_cert.pem delete mode 100644 ext/openssl/tests/sni_server_cs_key.pem delete mode 100644 ext/openssl/tests/sni_server_uk_cert.pem delete mode 100644 ext/openssl/tests/sni_server_uk_key.pem delete mode 100644 ext/openssl/tests/sni_server_us.pem delete mode 100644 ext/openssl/tests/sni_server_us_cert.pem delete mode 100644 ext/openssl/tests/sni_server_us_key.pem diff --git a/ext/openssl/tests/gh9310.phpt b/ext/openssl/tests/gh9310.phpt index 07a7d442cec8..874ed4c781d3 100644 --- a/ext/openssl/tests/gh9310.phpt +++ b/ext/openssl/tests/gh9310.phpt @@ -23,7 +23,21 @@ $certificateGenerator->saveNewCertAndKey('gh9310', $certFile, $pkFile); copy($certFile, $baseDirCertFile); copy($pkFile, $baseDirPkFile); -copy(__DIR__ . '/sni_server_uk_cert.pem', $baseDir . '/sni_server_uk_cert.pem'); + +$sniCaFile = __DIR__ . '/gh9310_sni_ca.pem.tmp'; +$sniCsFile = __DIR__ . '/gh9310_sni_cs.pem.tmp'; +$sniUkCertFile = __DIR__ . '/gh9310_sni_uk_cert.pem.tmp'; +$sniUkKeyFile = __DIR__ . '/gh9310_sni_uk_key.pem.tmp'; +$sniUsCertFile = __DIR__ . '/gh9310_sni_us_cert.pem.tmp'; +$sniUsKeyFile = __DIR__ . '/gh9310_sni_us_key.pem.tmp'; +$baseDirSniUkCertFile = $baseDir . '/sni_uk_cert.pem'; + +$certificateGenerator->saveCaCert($sniCaFile); +$certificateGenerator->saveNewCertAsFileWithKey('cs.php.net', $sniCsFile); +$certificateGenerator->saveNewCertAndKey('uk.php.net', $sniUkCertFile, $sniUkKeyFile); +$certificateGenerator->saveNewCertAndKey('us.php.net', $sniUsCertFile, $sniUsKeyFile); + +copy($sniUkCertFile, $baseDirSniUkCertFile); $serverCodeTemplate = <<<'CODE' @@ -60,7 +74,7 @@ $sniServerCodeV1 = <<<'CODE' $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ - "cs.php.net" => __DIR__ . "/sni_server_cs.pem", + "cs.php.net" => '%s', ] ]]); @@ -69,6 +83,7 @@ $sniServerCodeV1 = <<<'CODE' stream_socket_accept($server); CODE; +$sniServerCodeV1 = sprintf($sniServerCodeV1, $sniCsFile); $sniServerCodeV2 = <<<'CODE' ini_set('log_errors', 'On'); @@ -77,8 +92,8 @@ $sniServerCodeV2 = <<<'CODE' $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ "uk.php.net" => [ - 'local_cert' => __DIR__ . '/gh9310/sni_server_uk_cert.pem', - 'local_pk' => __DIR__ . '/sni_server_uk_key.pem', + 'local_cert' => '%s', + 'local_pk' => '%s', ] ] ]]); @@ -88,6 +103,7 @@ $sniServerCodeV2 = <<<'CODE' stream_socket_accept($server); CODE; +$sniServerCodeV2 = sprintf($sniServerCodeV2, $baseDirSniUkCertFile, $sniUkKeyFile); $sniServerCodeV3 = <<<'CODE' ini_set('log_errors', 'On'); @@ -96,8 +112,8 @@ $sniServerCodeV3 = <<<'CODE' $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ "us.php.net" => [ - 'local_cert' => __DIR__ . '/sni_server_us_cert.pem', - 'local_pk' => __DIR__ . '/sni_server_us_key.pem', + 'local_cert' => '%s', + 'local_pk' => '%s', ] ] ]]); @@ -107,14 +123,15 @@ $sniServerCodeV3 = <<<'CODE' stream_socket_accept($server); CODE; +$sniServerCodeV3 = sprintf($sniServerCodeV3, $sniUsCertFile, $sniUsKeyFile); $sniClientCodeTemplate = <<<'CODE' $flags = STREAM_CLIENT_CONNECT; $ctxArr = [ - 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'cafile' => '%s', + 'peer_name' => '%s', ]; - $ctxArr['peer_name'] = '%s'; $ctx = stream_context_create(['ssl' => $ctxArr]); @stream_socket_client("tls://{{ ADDR }}", $errno, $errstr, 1, $flags, $ctx); CODE; @@ -131,13 +148,13 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); $serverCode = sprintf($serverCodeTemplate, $baseDirCertFile, $pkFile); ServerClientTestCase::getInstance()->run($clientCode, $serverCode); -$sniClientCode = sprintf($sniClientCodeTemplate, 'cs.php.net'); +$sniClientCode = sprintf($sniClientCodeTemplate, $sniCaFile, 'cs.php.net'); ServerClientTestCase::getInstance()->run($sniClientCode, $sniServerCodeV1); -$sniClientCode = sprintf($sniClientCodeTemplate, 'uk.php.net'); +$sniClientCode = sprintf($sniClientCodeTemplate, $sniCaFile, 'uk.php.net'); ServerClientTestCase::getInstance()->run($sniClientCode, $sniServerCodeV2); -$sniClientCode = sprintf($sniClientCodeTemplate, 'us.php.net'); +$sniClientCode = sprintf($sniClientCodeTemplate, $sniCaFile, 'us.php.net'); ServerClientTestCase::getInstance()->run($sniClientCode, $sniServerCodeV3); ?> @@ -149,7 +166,13 @@ $baseDir = __DIR__ . '/gh9310'; @unlink(__DIR__ . '/gh9310.key'); @unlink($baseDir . '/cert.crt'); @unlink($baseDir . '/private.key'); -@unlink($baseDir . '/sni_server_uk_cert.pem'); +@unlink($baseDir . '/sni_uk_cert.pem'); +@unlink(__DIR__ . '/gh9310_sni_ca.pem.tmp'); +@unlink(__DIR__ . '/gh9310_sni_cs.pem.tmp'); +@unlink(__DIR__ . '/gh9310_sni_uk_cert.pem.tmp'); +@unlink(__DIR__ . '/gh9310_sni_uk_key.pem.tmp'); +@unlink(__DIR__ . '/gh9310_sni_us_cert.pem.tmp'); +@unlink(__DIR__ . '/gh9310_sni_us_key.pem.tmp'); @rmdir($baseDir); ?> --EXPECTF-- @@ -169,15 +192,15 @@ PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(% PHP Warning: stream_socket_accept(): Unable to get real path of private key file `%sgh9310.key' in %s PHP Warning: stream_socket_accept(): Failed to enable crypto in %s PHP Warning: stream_socket_accept(): Accept failed: %s -PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%ssni_server_cs.pem) is not within the allowed path(s): (%sgh9310) in %s -PHP Warning: stream_socket_accept(): Failed setting local cert chain file `%ssni_server_cs.pem'; file not found in %s +PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%sgh9310_sni_cs.pem.tmp) is not within the allowed path(s): (%sgh9310) in %s +PHP Warning: stream_socket_accept(): Failed setting local cert chain file `%sgh9310_sni_cs.pem.tmp'; file not found in %s PHP Warning: stream_socket_accept(): Failed to enable crypto in %s PHP Warning: stream_socket_accept(): Accept failed: %s -PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%ssni_server_uk_key.pem) is not within the allowed path(s): (%sgh9310) in %s -PHP Warning: stream_socket_accept(): Failed setting local private key file `%ssni_server_uk_key.pem'; could not open file in %s +PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%sgh9310_sni_uk_key.pem.tmp) is not within the allowed path(s): (%sgh9310) in %s +PHP Warning: stream_socket_accept(): Failed setting local private key file `%sgh9310_sni_uk_key.pem.tmp'; could not open file in %s PHP Warning: stream_socket_accept(): Failed to enable crypto in %s PHP Warning: stream_socket_accept(): Accept failed: %s -PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%ssni_server_us_cert.pem) is not within the allowed path(s): (%sgh9310) in %s -PHP Warning: stream_socket_accept(): Failed setting local cert chain file `%ssni_server_us_cert.pem'; could not open file in %s +PHP Warning: stream_socket_accept(): open_basedir restriction in effect. File(%sgh9310_sni_us_cert.pem.tmp) is not within the allowed path(s): (%sgh9310) in %s +PHP Warning: stream_socket_accept(): Failed setting local cert chain file `%sgh9310_sni_us_cert.pem.tmp'; could not open file in %s PHP Warning: stream_socket_accept(): Failed to enable crypto in %s PHP Warning: stream_socket_accept(): Accept failed: %s diff --git a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt index d09317b1d22f..c1dba964bc67 100644 --- a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt +++ b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt @@ -17,7 +17,7 @@ $cert = "file://" . __DIR__ . "/cert.crt"; $bert = "file://" . __DIR__ . "/bug41033.pem"; $sert = "file://" . __DIR__ . "/san-cert.pem"; $cpca = __DIR__ . "/san-cert.pem"; -$utfl = __DIR__ . "/sni_server_uk.pem"; +$utfl = __DIR__ . "/sni_server.pem"; $rcrt = openssl_x509_read($cert); /* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose); */ diff --git a/ext/openssl/tests/openssl_x509_export_to_file_leak.phpt b/ext/openssl/tests/openssl_x509_export_to_file_leak.phpt index 5775c2597c3e..59a942d6a67e 100644 --- a/ext/openssl/tests/openssl_x509_export_to_file_leak.phpt +++ b/ext/openssl/tests/openssl_x509_export_to_file_leak.phpt @@ -5,7 +5,7 @@ openssl --FILE-- diff --git a/ext/openssl/tests/sni_server_uk.pem b/ext/openssl/tests/sni_server.pem similarity index 100% rename from ext/openssl/tests/sni_server_uk.pem rename to ext/openssl/tests/sni_server.pem diff --git a/ext/openssl/tests/sni_server.phpt b/ext/openssl/tests/sni_server.phpt index 7f9a4e82872b..db0b0190dab3 100644 --- a/ext/openssl/tests/sni_server.phpt +++ b/ext/openssl/tests/sni_server.phpt @@ -8,13 +8,25 @@ if (!function_exists("proc_open")) die("skip no proc_open"); ?> --FILE-- saveCaCert($caFile); +$certificateGenerator->saveNewCertAsFileWithKey('cs.php.net', $csFile); +$certificateGenerator->saveNewCertAsFileWithKey('uk.php.net', $ukFile); +$certificateGenerator->saveNewCertAsFileWithKey('us.php.net', $usFile); + $serverCode = <<<'CODE' $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ - "cs.php.net" => __DIR__ . "/sni_server_cs.pem", - "uk.php.net" => __DIR__ . "/sni_server_uk.pem", - "us.php.net" => __DIR__ . "/sni_server_us.pem" + "cs.php.net" => '%s', + "uk.php.net" => '%s', + "us.php.net" => '%s', ] ]]); @@ -25,11 +37,12 @@ $serverCode = <<<'CODE' @stream_socket_accept($server, 3); } CODE; +$serverCode = sprintf($serverCode, $csFile, $ukFile, $usFile); $clientCode = <<<'CODE' $flags = STREAM_CLIENT_CONNECT; $ctxArr = [ - 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'cafile' => '%s', 'capture_peer_cert' => true ]; @@ -51,10 +64,18 @@ $clientCode = <<<'CODE' $cert = stream_context_get_options($ctx)['ssl']['peer_certificate']; var_dump(openssl_x509_parse($cert)['subject']['CN']); CODE; +$clientCode = sprintf($clientCode, $caFile); include 'ServerClientTestCase.inc'; ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> +--CLEAN-- + --EXPECTF-- string(%d) "cs.php.net" string(%d) "uk.php.net" diff --git a/ext/openssl/tests/sni_server_ca.pem b/ext/openssl/tests/sni_server_ca.pem deleted file mode 100644 index b2522884565d..000000000000 --- a/ext/openssl/tests/sni_server_ca.pem +++ /dev/null @@ -1,63 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFejCCA2KgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwQzELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAMMB3Bo -cC5uZXQwHhcNMTcxMTIyMTQyODIzWhcNMjcxMTIwMTQyODIzWjBVMQswCQYDVQQG -EwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwHUEhQLm5ldDEQMA4GA1UE -CwwHb3BlbnNzbDEQMA4GA1UEAwwHcGhwLm5ldDCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAMeENPus84HfIaypUVybbn5ZZyu1gXSYZAnDYYHhOlHu5kFh -26ohnHnoheapXVRbUtDZgUW5BztA+vDhKkM5G3U4p+YsqcSA/IkF2JQBkJH1jrxs -XMDtXIA4/MzYAVtyySqoMsrbkSCDzvI8imsbZI9O1x02VgaqoaQ9JZvglt1nhTIY -YpTbTKGCzMmrnFGHITeBsVose1ACFIAtqKqvUaA6TxcCtVcrENY3T3N/vEmoHHBg -O7j9+UvYN/WRPNcv0aIOlro83O9xQuJdRCygPmcv/jkqWRKm2Pu0lEkvbMCvOJr/ -Fz/kQg/6EVmIMsR/dgOMIjWjmpeTx24UJaNHUdNCeUbxIyTIyl9ISLWLM0Ipoq3L -95ygH6FSESAOpc8rVE2A5YZCtKlwvogMx3C/tMH1gWwMlfxn0CopP4Jx6lngw3yn -IpP0hnuCauQikBkyhsGu4J0Lbx5BsyDWQLwjiq4s8EcEy0vTdAvhDMRUGvpnjWaa -zBDVVrzHaRFvp6ueh35xf+dYieGL5UTICyrrQX9wwSafHV90a87y6XU+RwA25Dmc -V/kTn8/xkFv/4CbZp+0yArKpwXjqBMsQFbkFjT+Ky9MN+nedoFUMl7slgjpBs6RI -T08Hoa7/kMZGtLCiGcRXlwiIhB00gDz2avUvFTxwik9ssjDqBJGzNbBvZGb/AgMB -AAGjZjBkMB0GA1UdDgQWBBTjyuOBGnHnb+x20diIHG3sPuJFGjAfBgNVHSMEGDAW -gBQ0s99BNsV4Dszph6PArogA8HP4TDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1Ud -DwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAFrQMmCoSe8uJbJLqPGMPW4ZE -0U81WWboc9FrSfezBYkTKuCjMTjQFv8oLp4pnuWZw22mHrOiz9izjNnXcR/rdVbG -Cip/JSHlTzHd3gnxSSd2diXvVrSb4zuLyN6WIficlsj3QdIP4Cdfv1pdHBTsRPbW -vuHpwYqqjxPBjqvoVZyZRyRM1pqpxLCvxOt4S3z4uZXyIH2UI7yWxI6MvdHBZg5m -TwiVi1gEQuRnYRy4sK9qJlBo5jERvzDr46W1e9Yz5sNMPfwWb64Hkkys3GqJt5am -OKxvgF3lvIK90vBjenGDfYEENP+0qdmdpHQkxGM2cl9iPqW8iyRGBVjdbzTIeRgB -u+CEbffSKWCpbm1Zcszv3FHMlsU4Px2pUTdLwEMgBQUPW/ngBMdRgVZE01GI7D1k -AM3hO347eehQTWoyuHgsnB2uaANEeR/XFBGDFmbs5ggAzxxRsH1FxoHXrv3iDIPW -9lKnSow+OZGcPKgaY5Nsregt4jO+pQqhzxlMa2QMfrMoGkEvrKNcDqeEI6KQa1SI -Zbq7sjf2w+VL0oQcse+gtg4q771dKy9V/XcfnPbiBAXfQqGj/v0LmZRn3ZRrkgzl -CaZocqVRJZbqu7/iu/p9pDRMR03vhBWPn7iM8VqzkhKjAlD0rolnQqvOAXyPpd/O -qYuYP+6Ymt/rUWXGVh0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIJAJcrLHeFQrGEMA0GCSqGSIb3DQEBCwUAMEMxCzAJBgNV -BAYTAkdCMRAwDgYDVQQIDAdFbmdsYW5kMRAwDgYDVQQKDAdQSFAubmV0MRAwDgYD -VQQDDAdwaHAubmV0MB4XDTE3MTExNTE5MTEwMVoXDTM4MDUyOTE5MTEwMVowQzEL -MAkGA1UEBhMCR0IxEDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQx -EDAOBgNVBAMMB3BocC5uZXQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQC4bIXbh+e+OCbLum2FYB8i6ZnOShp1teWNEE/8A4ot20wkPxLeXFSU1Egn+3BG -fxHKrWxV/FOiL7bims/SfwptFkgNZkwE52HVk49zgQevG38smsnIGuBMXMKebLPT -wlsIWRqCmZqEmh1wNcC9+qwoHoYjvJvMYfFvofiSc7qkTFsjoBVe+ho90vjYMznr -Bs9DlD88iXO0kKN0Bsu2igz68JWkUsoNeD6UKSir16SmQZxdFPCM0O0gxmOyz4NZ -w8pJ5XGDJyS82fVp13tYCOBFhK0QBvvzaz/gN6De5arefm6cer9TX0HE+VvGhx4T -2lqydFLfAVKTTNoZHOQk2mFVUm7dlMzLvsgNKdEZH6wAa12eBImCea+CyJNkbGLC -nrN6a93iGqTft75sbDyvzRk/BdnxadkAPlOxgK1qGrOgeS0+7chPMh24MRoKj5bU -lYGdcp7Y9qIW1hZXFfgPJO0yMOug/7J14jybp+YhymBIBTZYi1zbGqGNXdLPyp77 -9KTfyJE9KkbGegBvwqJmZTW8QoUDllopDjr1zaIqHWJqfAK7vGivu0iLVJHBRbRs -w9c48RCjfIh7AkvFKsdIDt9SMdZOdm9D8SXosYPM1zMFQsFFRPh/nKyl9QnhWbwd -Vs1tIFDrb10Z2sn0pF/V0F0gubR5rvYs+3h/dLciLVFobQIDAQABo2MwYTAdBgNV -HQ4EFgQUNLPfQTbFeA7M6YejwK6IAPBz+EwwHwYDVR0jBBgwFoAUNLPfQTbFeA7M -6YejwK6IAPBz+EwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJ -KoZIhvcNAQELBQADggIBAIkctDRCNcNVs2qP/O3zZsVZ1cqlqYNjcHIVHqNZRvVb -bPtInZ/i/6BbwA5QM/giKpl2aMwetUnezjHVD+7/m24Mfs1FWyPD3joCMIANj7hR -MNbmX1LQBMt/bD3E5trq9S9rZ++/ny4gn/z2jH3x+lzDMBDiam/wXbvSmyIUPUX6 -V8FFpkTBNERpurUvX1NEFLuiilWKrI7/u1qS11PGBcX3pNQNfhKNMtuFz74hAE7C -RE8756CGu2bZzydYCarUXSNTXqNm5ly2J0UN6Al4myFwj/6XnLnDhXDAI8CaqDMD -MwmxUzJvzuphNS085ZIntrSgPJESGozevEsf9bGD8GyoBQN/cSqOJCFfnJqxtKHb -wNa2F78SXYsiWkRb5EzoyCeon+0tygG6gLBouVY8ouCerExkH9qzRLLzFInxmCm2 -ill7c8Xmml4H2BxJE33dz/Qh7PM3eF2A2VriioLDj4+HOiWq/1BjdW6/Xiwx5iP2 -nC6Cex+lBt6HkP9WIiJbGxVeamF5jxNWWvLoUkrjFhpukjb5BPR9zFt7mAty9J/T -iQt26yylP4ucmL9KB6lv4ISW4Ri8mhMcYh6nF3tIYWZMCSQKqkyvymhKdLMZa20A -IME2oxnfZcmsfMpM6BYsN4XDfGBeYctqqt2AFRNLkI4wFkFFdPTMcTi1q0iRH2Xk ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_cs.pem b/ext/openssl/tests/sni_server_cs.pem deleted file mode 100644 index 9f5a201b26d1..000000000000 --- a/ext/openssl/tests/sni_server_cs.pem +++ /dev/null @@ -1,57 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAvy5NhzktzEdsHTbGB6vqYANms5rn1zXFmTJrGlWCwoIsNmTf -ahvZkrC1cCXTZ7fbPB8XQbpAtz2ZSU7OcwBW9B8okYUPo9zi/ptwcrgsQsN0hrcD -8MBRUccevwime5fLvg8E9RJ/68y9y3BnRcVWYO2sAK9juTfidNjETU3Bb05oXv8D -SD/6onXQu4uXDgsQ3cRXeld9UB0xazmQXyyiIqXc/cpTAnaEVYzn28aj7NlUbzNq -511UXMXY44x9EcXWpPVZ7heNcJNzY5DCNzmtXKrt9yiMpWQcPXEzsESVxAMqib9u -TFOlvVX17LIPxBG656PjTD9J1h6kBbMCUxzs7wIDAQABAoIBAQC85lBeY0X4ST3v -I7bJz7kWQ2YP4uhfAdeLhoDDFWjNLffniwYhfwEc6xNri0R2f/jUT9gX7qORKwEx -qPdeNCC2t67LElGg1FlJv2Z9Q7MgCKYzkdQH5s6y4e9kTHTLO/JpiceZKz1QTQ3f -XOH9032E6nIAf0wmr6xHTgOwajrN8VI5BuPEMVmEwIw3AtYeqVuPCNKyGR4HUVkC -2bAydnGngbRJRnNzmKcWJancxpHDGBSFqPyuXMFC7Jgo3ZmyCbGp99vuXVk/sW9x -5aj94M9nRE0guk05ivH2/JZao2uLYkIgjFWlhNxKdWgWRk8DEuN4djC8mKS9YH1q -crYRToMhAoGBAOspUTtKP54mpZmyhxuDqj02JaJRzNTskPHsiF1UhtXuw7uT+ryV -ekUFLNXoFmn9mbx1WVaUvGH4qjilvQOxz7u++lz0ApqJEfyM3jc/cC40Y5zcuGSu -Etbg+SyDoytlgMCIydJyrS7NNALSo5p5oG6XY2f8yd/DCAmo8LzypaHRAoGBANAf -R1SlBMc/bOsi6GrJxcBVSCFMiKYiO5woL5aUKa9yM+UQuQ/6xbQ7Q+sOlt0FH3xo -AJ2L60qTdjyXVtjOdtXs5ZC4l+C6AfnCx6yLr+fNc4SOYXEfqS4LZylgwKd9KyVB -asspIW9Idbgebmi6vPyt9LDkIp0h1VuFGjkvQJK/AoGBAI4pbS0dprXyARyYW6sb -fpgAmuG099IkrT9DUfCx/81myTclr2fAKal+BmvOIXaz0/OlMXvw8K19iVIzh7+r -B70lJ+93p/dKM/BsLI5TsHqOO0YB/QsIXOVAHgJ2FfdPJnW+e9vYba+kZ/Po6PSi -4ITaykJ8BIJcQgis89QWEGFxAoGBAJhQO+jzuDKF9ZWEf6ofrw0anOZZ16wWY5/e -PS2rk3JmVxpuibHrKqPDt+ogTELHDAsFJmYmz3VNxHuFmrajK49Wh4/JuMVr/CQo -6+8YcA1qa/94IFIlBLDBAafjujsZvOjQHnM+z8xcsGKmStF00Pjv6qNG4xoyd646 -FD4DmfOLAoGAWXehpopZKXE9gRAni881ucK6WqxPPBoofbozi09D0MmfarIVaSkv -jNVVHBfLWd7IEXTjiipPBeUqq6Jc3pscN1Vp4rrl8jTmVTdazEv0LuzpdUFqmNo2 -M+xw17uz9D9Q32/aW1Lar0PdIaL/wGEDEyzEBFwrGppcENLilPz8gzU= ------END RSA PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIFIjCCAwqgAwIBAgICEAIwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w -ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjEyWhcNMjYwNDAy -MTgzNjEyWjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE -CgwHUEhQLm5ldDETMBEGA1UEAwwKY3MucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAL8uTYc5LcxHbB02xger6mADZrOa59c1xZkyaxpVgsKC -LDZk32ob2ZKwtXAl02e32zwfF0G6QLc9mUlOznMAVvQfKJGFD6Pc4v6bcHK4LELD -dIa3A/DAUVHHHr8IpnuXy74PBPUSf+vMvctwZ0XFVmDtrACvY7k34nTYxE1NwW9O -aF7/A0g/+qJ10LuLlw4LEN3EV3pXfVAdMWs5kF8soiKl3P3KUwJ2hFWM59vGo+zZ -VG8zauddVFzF2OOMfRHF1qT1We4XjXCTc2OQwjc5rVyq7fcojKVkHD1xM7BElcQD -Kom/bkxTpb1V9eyyD8QRuuej40w/SdYepAWzAlMc7O8CAwEAAaOCAQkwggEFMAkG -A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu -U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFHPfd8dK -Lz1R0Ck4WV1B9AWXd5DSMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa -oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH -UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG -A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQB6WSIHEyDXLZxH -hZjqSNQOA7Wc9Z2FCAiD29xYkGTL8WuPVGGP1mu4B92ytj+PMWwqSReDa7eTGLE7 -O7ozw9l+c+gNmHFNikSsGjlV2E8CToQOFMny+jAQYMSXf8UbTp9xDfgG02t/71hv -SLWqdeHMLcR0xi0nBQH0vDOkwUbuWYqFa3jejHieGhykHM6CkIk6lqnyOEO+ooIF -ZsLprrg1ss/mXCPI6niP0hze55ERKdxI7Rk8sZ4pVkf2SUWqZrUS0aJ+Ymmwi6Xd -2V7izq5N30PkJS8MtqII4FAjRBIkwPh0sy8PmW/DzkYU+lYQnDfYLKDFKcj8xJK/ -o8oZUBsQltrSj0KlM9QuqxCTCBCy1nXZ9WHOhq+jdLiTc1Oi60uEHcUMrLK8aYc4 -HqIvZS6C2iwMI0d1OP3VxmAbMQ9yqRi+FbLYavJ3H40jrU9SYqdxa0BrTaz8MJNE -6AEwgQDPChczSghvHME+Fs4mtGCY3TesbNZKVahQRjaFIhMZIZ4RP4CRc0bJOBG+ -8Me4+KHNsD2ki5b03wAN6C1P2QrMzI+gH9fXLZYp761ciDAsX6YIzrhHHYLxYpJH -BkQKKs8dCQWE5IzgVrdlvC3Z1/l9om66wHqqx7nKnPfYs/Sfnwe9MpCD6xJrXiTm -WS7NM6fbQpO9APNr7o0ZOjbbWFzlNw== ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_cs_cert.pem b/ext/openssl/tests/sni_server_cs_cert.pem deleted file mode 100644 index b77c7b83e2ad..000000000000 --- a/ext/openssl/tests/sni_server_cs_cert.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFIjCCAwqgAwIBAgICEAIwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w -ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjEyWhcNMjYwNDAy -MTgzNjEyWjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE -CgwHUEhQLm5ldDETMBEGA1UEAwwKY3MucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAL8uTYc5LcxHbB02xger6mADZrOa59c1xZkyaxpVgsKC -LDZk32ob2ZKwtXAl02e32zwfF0G6QLc9mUlOznMAVvQfKJGFD6Pc4v6bcHK4LELD -dIa3A/DAUVHHHr8IpnuXy74PBPUSf+vMvctwZ0XFVmDtrACvY7k34nTYxE1NwW9O -aF7/A0g/+qJ10LuLlw4LEN3EV3pXfVAdMWs5kF8soiKl3P3KUwJ2hFWM59vGo+zZ -VG8zauddVFzF2OOMfRHF1qT1We4XjXCTc2OQwjc5rVyq7fcojKVkHD1xM7BElcQD -Kom/bkxTpb1V9eyyD8QRuuej40w/SdYepAWzAlMc7O8CAwEAAaOCAQkwggEFMAkG -A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu -U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFHPfd8dK -Lz1R0Ck4WV1B9AWXd5DSMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa -oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH -UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG -A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQB6WSIHEyDXLZxH -hZjqSNQOA7Wc9Z2FCAiD29xYkGTL8WuPVGGP1mu4B92ytj+PMWwqSReDa7eTGLE7 -O7ozw9l+c+gNmHFNikSsGjlV2E8CToQOFMny+jAQYMSXf8UbTp9xDfgG02t/71hv -SLWqdeHMLcR0xi0nBQH0vDOkwUbuWYqFa3jejHieGhykHM6CkIk6lqnyOEO+ooIF -ZsLprrg1ss/mXCPI6niP0hze55ERKdxI7Rk8sZ4pVkf2SUWqZrUS0aJ+Ymmwi6Xd -2V7izq5N30PkJS8MtqII4FAjRBIkwPh0sy8PmW/DzkYU+lYQnDfYLKDFKcj8xJK/ -o8oZUBsQltrSj0KlM9QuqxCTCBCy1nXZ9WHOhq+jdLiTc1Oi60uEHcUMrLK8aYc4 -HqIvZS6C2iwMI0d1OP3VxmAbMQ9yqRi+FbLYavJ3H40jrU9SYqdxa0BrTaz8MJNE -6AEwgQDPChczSghvHME+Fs4mtGCY3TesbNZKVahQRjaFIhMZIZ4RP4CRc0bJOBG+ -8Me4+KHNsD2ki5b03wAN6C1P2QrMzI+gH9fXLZYp761ciDAsX6YIzrhHHYLxYpJH -BkQKKs8dCQWE5IzgVrdlvC3Z1/l9om66wHqqx7nKnPfYs/Sfnwe9MpCD6xJrXiTm -WS7NM6fbQpO9APNr7o0ZOjbbWFzlNw== ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_cs_key.pem b/ext/openssl/tests/sni_server_cs_key.pem deleted file mode 100644 index bf1e9f25193b..000000000000 --- a/ext/openssl/tests/sni_server_cs_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAvy5NhzktzEdsHTbGB6vqYANms5rn1zXFmTJrGlWCwoIsNmTf -ahvZkrC1cCXTZ7fbPB8XQbpAtz2ZSU7OcwBW9B8okYUPo9zi/ptwcrgsQsN0hrcD -8MBRUccevwime5fLvg8E9RJ/68y9y3BnRcVWYO2sAK9juTfidNjETU3Bb05oXv8D -SD/6onXQu4uXDgsQ3cRXeld9UB0xazmQXyyiIqXc/cpTAnaEVYzn28aj7NlUbzNq -511UXMXY44x9EcXWpPVZ7heNcJNzY5DCNzmtXKrt9yiMpWQcPXEzsESVxAMqib9u -TFOlvVX17LIPxBG656PjTD9J1h6kBbMCUxzs7wIDAQABAoIBAQC85lBeY0X4ST3v -I7bJz7kWQ2YP4uhfAdeLhoDDFWjNLffniwYhfwEc6xNri0R2f/jUT9gX7qORKwEx -qPdeNCC2t67LElGg1FlJv2Z9Q7MgCKYzkdQH5s6y4e9kTHTLO/JpiceZKz1QTQ3f -XOH9032E6nIAf0wmr6xHTgOwajrN8VI5BuPEMVmEwIw3AtYeqVuPCNKyGR4HUVkC -2bAydnGngbRJRnNzmKcWJancxpHDGBSFqPyuXMFC7Jgo3ZmyCbGp99vuXVk/sW9x -5aj94M9nRE0guk05ivH2/JZao2uLYkIgjFWlhNxKdWgWRk8DEuN4djC8mKS9YH1q -crYRToMhAoGBAOspUTtKP54mpZmyhxuDqj02JaJRzNTskPHsiF1UhtXuw7uT+ryV -ekUFLNXoFmn9mbx1WVaUvGH4qjilvQOxz7u++lz0ApqJEfyM3jc/cC40Y5zcuGSu -Etbg+SyDoytlgMCIydJyrS7NNALSo5p5oG6XY2f8yd/DCAmo8LzypaHRAoGBANAf -R1SlBMc/bOsi6GrJxcBVSCFMiKYiO5woL5aUKa9yM+UQuQ/6xbQ7Q+sOlt0FH3xo -AJ2L60qTdjyXVtjOdtXs5ZC4l+C6AfnCx6yLr+fNc4SOYXEfqS4LZylgwKd9KyVB -asspIW9Idbgebmi6vPyt9LDkIp0h1VuFGjkvQJK/AoGBAI4pbS0dprXyARyYW6sb -fpgAmuG099IkrT9DUfCx/81myTclr2fAKal+BmvOIXaz0/OlMXvw8K19iVIzh7+r -B70lJ+93p/dKM/BsLI5TsHqOO0YB/QsIXOVAHgJ2FfdPJnW+e9vYba+kZ/Po6PSi -4ITaykJ8BIJcQgis89QWEGFxAoGBAJhQO+jzuDKF9ZWEf6ofrw0anOZZ16wWY5/e -PS2rk3JmVxpuibHrKqPDt+ogTELHDAsFJmYmz3VNxHuFmrajK49Wh4/JuMVr/CQo -6+8YcA1qa/94IFIlBLDBAafjujsZvOjQHnM+z8xcsGKmStF00Pjv6qNG4xoyd646 -FD4DmfOLAoGAWXehpopZKXE9gRAni881ucK6WqxPPBoofbozi09D0MmfarIVaSkv -jNVVHBfLWd7IEXTjiipPBeUqq6Jc3pscN1Vp4rrl8jTmVTdazEv0LuzpdUFqmNo2 -M+xw17uz9D9Q32/aW1Lar0PdIaL/wGEDEyzEBFwrGppcENLilPz8gzU= ------END RSA PRIVATE KEY----- diff --git a/ext/openssl/tests/sni_server_key_cert.phpt b/ext/openssl/tests/sni_server_key_cert.phpt index 49ed6aa5328c..878f97c1e359 100644 --- a/ext/openssl/tests/sni_server_key_cert.phpt +++ b/ext/openssl/tests/sni_server_key_cert.phpt @@ -8,21 +8,36 @@ if (!function_exists("proc_open")) die("skip no proc_open"); ?> --FILE-- saveCaCert($caFile); +$certificateGenerator->saveNewCertAndKey('cs.php.net', $csCertFile, $csKeyFile); +$certificateGenerator->saveNewCertAndKey('uk.php.net', $ukCertFile, $ukKeyFile); +$certificateGenerator->saveNewCertAndKey('us.php.net', $usCertFile, $usKeyFile); + $serverCode = <<<'CODE' $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ "cs.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_cs_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_cs_key.pem" + 'local_cert' => '%s', + 'local_pk' => '%s', ], "uk.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_uk_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_uk_key.pem" + 'local_cert' => '%s', + 'local_pk' => '%s', ], "us.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_us_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_us_key.pem" + 'local_cert' => '%s', + 'local_pk' => '%s', ], ] ]]); @@ -34,11 +49,16 @@ $serverCode = <<<'CODE' @stream_socket_accept($server, 3); } CODE; +$serverCode = sprintf($serverCode, + $csCertFile, $csKeyFile, + $ukCertFile, $ukKeyFile, + $usCertFile, $usKeyFile +); $clientCode = <<<'CODE' $flags = STREAM_CLIENT_CONNECT; $ctxArr = [ - 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'cafile' => '%s', 'capture_peer_cert' => true ]; @@ -60,10 +80,21 @@ $clientCode = <<<'CODE' $cert = stream_context_get_options($ctx)['ssl']['peer_certificate']; var_dump(openssl_x509_parse($cert)['subject']['CN']); CODE; +$clientCode = sprintf($clientCode, $caFile); include 'ServerClientTestCase.inc'; ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> +--CLEAN-- + --EXPECTF-- string(%d) "cs.php.net" string(%d) "uk.php.net" diff --git a/ext/openssl/tests/sni_server_uk_cert.pem b/ext/openssl/tests/sni_server_uk_cert.pem deleted file mode 100644 index 57663855e590..000000000000 --- a/ext/openssl/tests/sni_server_uk_cert.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFIjCCAwqgAwIBAgICEAMwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w -ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjMyWhcNMjYwNDAy -MTgzNjMyWjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE -CgwHUEhQLm5ldDETMBEGA1UEAwwKdWsucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAKzKRXj0jVBzRwolFn7Ej0MR2kE6Q36IBCEiDLhquSYR -Lh1spR0XudSVmRot/Wvz2PawApX4P6qj57scBQ6KL4ULKvSndCZ7F1tdQjEqogYp -n/L8oBhP1dgyDonsewG/PucxC+3Aqzcl3w5Pg7qE+zad42khP7t9TjFAMxc+PxC+ -2as5ZCDJBwfxksCyCQfFWx7eB7p39vGy63k3Izv+UKTZEhbSdT721kb91oXkecpE -EFhihfVYMGMEtC7u2JLSxdkRhWYSMqVCvI2syYsLAUUNH2kgqQF00j2Iddhg3oMA -IiqhpC/n2slHVhp56WE1TsrGC/JgqIvQK9AT4LRxFb8CAwEAAaOCAQkwggEFMAkG -A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu -U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFJK58uJe -Lv8WDOR8TTLUcSxO1zCyMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa -oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH -UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG -A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQDHayU795hFnQNj -fuYV21sEmkSjgtp6X4rV9JfoCp8U2gieL4mizoCPx9Q8HYaAf98hPYTofGUaCSd+ -Xlzd8lhLt9GCU+BsCxGtJocrjOQDhyhkioN8iirQRTtJpRVC6a4RCBGpenOD7Z7C -Z32uGXohzFuigP/J8/SXBdHrlpNSa03iEkkisPR46mbGj06lFVOFHJDNKA3CnQwM -3VfqvZt0ksZi/gAOol8dtrAd3k5JBfJ2BtqsPbycEGAhsGrTK/MeqiFcO8QZiXpN -qf0wZzOMFZJ4HqTiHs4TMMQaDK8c4qfR0l1OE224ijcB5NlqMjGAZabMfHgNZcl7 -fYPX+POsOMaqubv98uoC0PCK8NCTyfB4V/el72EEoVfwKYOxm3eYXBEE2ZNyIci6 -YKYhNa9e2k+cFueYMztV06HTGgkcHcSJATP+3ISTRx3tj1BPmc4O4WAMEMx1E0gg -PaVrBVAylGzt8kaMaOQMBImpsALSfutq6+KtQiu0OTGS3yVUGamV4AyRjuwF1/ZA -kZbjmNEGsf9d2rzS89ckds24QUx0zrfJ56p7lRvyVK/pML7iadv8dUH3fKDDDerD -oocLjOjNxFGN9Woz+kfidA8Siu0zsfQ6CLPlaQrVAVQH4iMuCZraqMc3TqAiUKRj -iHKp6FFrRZmY8W8HEKHv98uGofn+3g== ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_uk_key.pem b/ext/openssl/tests/sni_server_uk_key.pem deleted file mode 100644 index 3baa6efd776e..000000000000 --- a/ext/openssl/tests/sni_server_uk_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEArMpFePSNUHNHCiUWfsSPQxHaQTpDfogEISIMuGq5JhEuHWyl -HRe51JWZGi39a/PY9rAClfg/qqPnuxwFDoovhQsq9Kd0JnsXW11CMSqiBimf8vyg -GE/V2DIOiex7Ab8+5zEL7cCrNyXfDk+DuoT7Np3jaSE/u31OMUAzFz4/EL7Zqzlk -IMkHB/GSwLIJB8VbHt4Hunf28bLreTcjO/5QpNkSFtJ1PvbWRv3WheR5ykQQWGKF -9VgwYwS0Lu7YktLF2RGFZhIypUK8jazJiwsBRQ0faSCpAXTSPYh12GDegwAiKqGk -L+fayUdWGnnpYTVOysYL8mCoi9Ar0BPgtHEVvwIDAQABAoIBAGpg7XyWMxpAno/k -XYEWSo0kRJa75CnWW5R6fhJbwjlpglajONQ8czAqGeRARDFeI0lc+3qRJ8FKv7Q2 -f/Z/pNnoEj4liiDWz350X/gdIztgDRVv6rCNFj7QMps/eEuPDo8PZySs5bxCGJ2a -3qLKlE7/za4/xhkMAEPaHppEvFb15dpomqP2Fjqei9afp8tD+xJv9BGtkFIy9acw -94AWQi974kgW7ZzfEf8RqHM0ExKiESCc26knbcBu0tQ892YHggMccUMk/UrVgR5d -vuGOBurlYGLBstSDSKCCe6la4N/FX3FiC3WhVNescnuTZPXcX3zebh7roGjgrTdd -6UJYBIECgYEA09XYihdwW66G9Y09OatzlzBh1Rvzjv2Vl5NmWHHb6vh38H4PcOof -S1pT0JvRzpt8uEs4i+Eda5PyQyp4iGtD+DQ07Dxh2jiixsE3PRFRG2wg2QCgDHnS -6vgV1VOqA/A4on4nhxLZXxhX4YvHaJYlm1bZ+amG+j5XiI/NtHJm9k8CgYEA0NB9 -bAoaZnc06+T8rMaO45boX5SvYsCZbtY3VRl75SrbMal0IKfnXHELVHuei12LmlMs -LuFgG8jGO3+ncxUqMytoGvrmk/cM9tCNbDKVHtFbqz0qt9lkDAwLsBougKnVsNDW -Aae/tz/wYXJct86unfLh0xtvkx5Iz1we4cS1fZECgYA8YR+vfK7R8xUUuIVTAsOX -vHqmO6lYgH87DRCG9S0x9FB7g/LyxEjXOY/aTg+nTDpobUhY1nmESE8tRdXFTI27 -GWZcT3m0sZ/z9u6/wUfVAST7tWnpJHAx+TR/8bDsHnSGHF836O98Y3vpFeZosSNW -+5J1zxRiD5LzocmIPXOLkQKBgEgHApxXx898YwbTj8zRGMysay89DFpV8RboUWHL -To83/y/cMbBp+kZKwAu+MGwGMndjJSRunUY4NRik6c+qh0nrORfFX+++Efy4529g -60scEDC7Apc0J2x4Yze1cED1VD6PaqJbiKffKD2UwyKr6lOVSgwVtKDcm2Tbc9OQ -lMHhAoGBAIPwYVxzWM6I6pr8x2TucpBZZReLytz7uzybMNvbKCrwlETbNNXubnfp -nPuPKzpeRI0y26pIIAbijzFW0MXq+kIu3H7we8TaImsJ1AaQCTYeoLWBVcr6RISk -3d4i7iT35aWCuhPVve0FNIv/u3jrqX2H2C2MXMiLOsw1GFxPvpi4 ------END RSA PRIVATE KEY----- diff --git a/ext/openssl/tests/sni_server_us.pem b/ext/openssl/tests/sni_server_us.pem deleted file mode 100644 index 170a8a96e75d..000000000000 --- a/ext/openssl/tests/sni_server_us.pem +++ /dev/null @@ -1,57 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA1QkC3tiNYDY+ZxMmPbagYUbMpzuXo9mVBvYh86bYZaeB7bts -QCBK+6VD4D2LjR3RszpzmOzhJXjm8j0t+GeRS3OMIM75/BKAnixXicRSIb8zdIPz -JP992vvMq8p46/XftAfBhAMOaCqcD85zpyX4PhfC9733nOyN4yqx58O4UhVTKih6 -W9/ldp3uwSYAW+HyoINnHls/bFO8vv60K5VIhkxK30LHnC5PvByGfuHOgrscEThs -jW0ESqO0+9l88KhGdmLgzvbBlGxNziCMfn0LcFH6p2ITc3foD4LSzGEFtJ92OZi3 -buCOfbFsN7vWHTsEi89fRcCnWGtMwLUx0TCluQIDAQABAoIBAQCnsUQ1Lrl6trhA -Yu6DPbLZX+XQ7jPbonaQ2Ea5iOhmfIjmHdaEU+cyV1EqvseO+Z4MO0KraiuAV79T -h50cIEpa3kW7vbFCHz5nQ/hUVdlg/yT93rASu5rSOctOnz64Xv8Ms948kDtS+9eF -Cbo4JMdX+VRbt4mmWP8HhqAsFACPexEoWxJcIxwFcI24GTGzySjemNjQzbmcVhzM -a4k6n8DolCL1cRS54C5Aaf5g4+IFDgyydcgZXp1lnX3MnqivSNkejnPnY55NcmrH -X3ZWPlAi9GHOJE33uy8bGWnip7Tn4iTt6tJvjz/yP82TGACDg1B8XsKrqsuQLsoU -cNBVGcQBAoGBAPteCgNmuNOpo4SRA1UVRw1WgnE8YtnNA6vYyVcTLSpqabq33UaD -03L9CQsbHtj88U+E8OH24Iqj3U9x7QJfH8DVmWuBrlwez80JsKGnLdViHydjKcAz -H2Cbv+SiWeaWXkFCkN4Jf7k3q0Ew4SG2LOq5PVUy/NB4bilbJD2ExKpZAoGBANj2 -Hpwo35IQ4XfSSsGaCdn+8ajMcNUMMGZ6YkZqmVO4kogqobyrPL/2KE9ol/hlacw6 -U/6Digox5/wqruYfqyM8lqGOq2/0Xf7c4XfiOTS9Na4JN3OGzlyqPvcn2zdqhYFY -iHPu2RqpA+LhCHW9Zs8C1Bp/KAEPdRP6OabqVaphAoGACLrHVj7nBFLL3vq6RuYq -RYhPl2cld7LrAbjRpTiBRQvVCCsCgERrv36SJdSXSanfJ4fSZcaRHb97HBs0w/RR -wfypC1bBm2lmhhRkEfkgWlzCADgtZwNff5dpHqOUw7FNLK8HIO7rhJ8uT2FHMEiH -Xs94FdFjfknwaXdE1u4ZdmECgYEAgxfbkQHFbO2UPqErGGXp0/WOsS6ucpyF1jXW -kbOxZ3vb1jjkNyrEbzzeSHTrdmRYk9UekWeLjfNvt9dWjKfP8V+XqJCbF+9wqCFw -fs6LQEmfWMQq5DwtDqKznwVPGOHdPzVuZZaJSemb9oeAZBwINccAv+3bDyD23hZQ -pYFsN6ECgYEA33QYDNG/spki4D8rlxyxZ+1MdB/efnrGBhO8FsJpG5+AtmYhWgD9 -sl29+3aiRkmDznoy36z+hoeZePILEAKMcbHyXOymixOHPuaZJ95hbvq6sqd6WMAe -w5tHnxlfEuu11zatolk6WiAmTmG3sZpN5Tqloq0Ye4dvlhVKNV3Bn3E= ------END RSA PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIFIjCCAwqgAwIBAgICEAQwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w -ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjQ0WhcNMjYwNDAy -MTgzNjQ0WjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE -CgwHUEhQLm5ldDETMBEGA1UEAwwKdXMucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBANUJAt7YjWA2PmcTJj22oGFGzKc7l6PZlQb2IfOm2GWn -ge27bEAgSvulQ+A9i40d0bM6c5js4SV45vI9LfhnkUtzjCDO+fwSgJ4sV4nEUiG/ -M3SD8yT/fdr7zKvKeOv137QHwYQDDmgqnA/Oc6cl+D4Xwve995zsjeMqsefDuFIV -Uyooelvf5Xad7sEmAFvh8qCDZx5bP2xTvL7+tCuVSIZMSt9Cx5wuT7wchn7hzoK7 -HBE4bI1tBEqjtPvZfPCoRnZi4M72wZRsTc4gjH59C3BR+qdiE3N36A+C0sxhBbSf -djmYt27gjn2xbDe71h07BIvPX0XAp1hrTMC1MdEwpbkCAwEAAaOCAQkwggEFMAkG -A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu -U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOXnUeNs -grKQb+EvG36DXjjDDmsFMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa -oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH -UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG -A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQBDLwuLbx75ACSU -5cF2L/D17JEnhlna62MgKNdpNLJSpaofK2Lk2BqsmnQf5JdkrXWMUN/DsmXZc9pq -25XmprfABUP9Cx18KPVqLQ43Z9o+R9xI1Ospt5mrpxGp6l2BHSs/4G69nuPFpcIJ -iabnLYdUk2Z+64lPe4EMBrZH+pj4xn3JA59BACJYNYn0nLaw45DIAyzyLJ0vVSwc -0JtjsztXQov4UqdWXxLRFfe2nEGoK8ZkTJ8ELcCYu6sNSBjw9Ech78uXN1BQOBTK -lhAgN3FKqOp3hqf0umqf35gDvmWwLB/eptUYZ96gBYT0tbPA0P+YsW+iZmamxXma -Odgg8iRcPxKl9bVPt57NLaDy/RQhOxTGXQs1Q2jp7UhzqoZDClwVSDxd6DEppAFA -OZAY+Rsrm7VoCwVQ/1KbcJHmJ/79tArvaWJk3KHLGMpdZq4KwrC3hM8/QxYtyX/6 -cfnXvShBYCdfTGgNlj3t/mNAgp1ZB3s9ClGqRBR/P0Db+ryv5DuxYM6nzEB3Od0y -kT5tHbXDQY+1HCExjOMi7Al0cmC2r3+oxDA4UjGv+npgcfeoxQhXmm/SQRiPdKlb -vT0D594sLoB23jqA9bMehpxEyI7eGjfFUmXwMeu0tJhipvpJI3ogJoM+SCFTyLkc -12cPiz/sR/ALhvhUJXTeUH8wxPjzbA== ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_us_cert.pem b/ext/openssl/tests/sni_server_us_cert.pem deleted file mode 100644 index 4452e3c6cfbf..000000000000 --- a/ext/openssl/tests/sni_server_us_cert.pem +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFIjCCAwqgAwIBAgICEAQwDQYJKoZIhvcNAQELBQAwVTELMAkGA1UEBhMCR0Ix -EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAsMB29w -ZW5zc2wxEDAOBgNVBAMMB3BocC5uZXQwHhcNMTgwMTE0MTgzNjQ0WhcNMjYwNDAy -MTgzNjQ0WjBGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UE -CgwHUEhQLm5ldDETMBEGA1UEAwwKdXMucGhwLm5ldDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBANUJAt7YjWA2PmcTJj22oGFGzKc7l6PZlQb2IfOm2GWn -ge27bEAgSvulQ+A9i40d0bM6c5js4SV45vI9LfhnkUtzjCDO+fwSgJ4sV4nEUiG/ -M3SD8yT/fdr7zKvKeOv137QHwYQDDmgqnA/Oc6cl+D4Xwve995zsjeMqsefDuFIV -Uyooelvf5Xad7sEmAFvh8qCDZx5bP2xTvL7+tCuVSIZMSt9Cx5wuT7wchn7hzoK7 -HBE4bI1tBEqjtPvZfPCoRnZi4M72wZRsTc4gjH59C3BR+qdiE3N36A+C0sxhBbSf -djmYt27gjn2xbDe71h07BIvPX0XAp1hrTMC1MdEwpbkCAwEAAaOCAQkwggEFMAkG -A1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG+EIBDQQmFiRPcGVu -U1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOXnUeNs -grKQb+EvG36DXjjDDmsFMGwGA1UdIwRlMGOAFOPK44Eacedv7HbR2Igcbew+4kUa -oUekRTBDMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwH -UEhQLm5ldDEQMA4GA1UEAwwHcGhwLm5ldIICEAAwDgYDVR0PAQH/BAQDAgWgMBMG -A1UdJQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBCwUAA4ICAQBDLwuLbx75ACSU -5cF2L/D17JEnhlna62MgKNdpNLJSpaofK2Lk2BqsmnQf5JdkrXWMUN/DsmXZc9pq -25XmprfABUP9Cx18KPVqLQ43Z9o+R9xI1Ospt5mrpxGp6l2BHSs/4G69nuPFpcIJ -iabnLYdUk2Z+64lPe4EMBrZH+pj4xn3JA59BACJYNYn0nLaw45DIAyzyLJ0vVSwc -0JtjsztXQov4UqdWXxLRFfe2nEGoK8ZkTJ8ELcCYu6sNSBjw9Ech78uXN1BQOBTK -lhAgN3FKqOp3hqf0umqf35gDvmWwLB/eptUYZ96gBYT0tbPA0P+YsW+iZmamxXma -Odgg8iRcPxKl9bVPt57NLaDy/RQhOxTGXQs1Q2jp7UhzqoZDClwVSDxd6DEppAFA -OZAY+Rsrm7VoCwVQ/1KbcJHmJ/79tArvaWJk3KHLGMpdZq4KwrC3hM8/QxYtyX/6 -cfnXvShBYCdfTGgNlj3t/mNAgp1ZB3s9ClGqRBR/P0Db+ryv5DuxYM6nzEB3Od0y -kT5tHbXDQY+1HCExjOMi7Al0cmC2r3+oxDA4UjGv+npgcfeoxQhXmm/SQRiPdKlb -vT0D594sLoB23jqA9bMehpxEyI7eGjfFUmXwMeu0tJhipvpJI3ogJoM+SCFTyLkc -12cPiz/sR/ALhvhUJXTeUH8wxPjzbA== ------END CERTIFICATE----- diff --git a/ext/openssl/tests/sni_server_us_key.pem b/ext/openssl/tests/sni_server_us_key.pem deleted file mode 100644 index 8b0d73d7d63e..000000000000 --- a/ext/openssl/tests/sni_server_us_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA1QkC3tiNYDY+ZxMmPbagYUbMpzuXo9mVBvYh86bYZaeB7bts -QCBK+6VD4D2LjR3RszpzmOzhJXjm8j0t+GeRS3OMIM75/BKAnixXicRSIb8zdIPz -JP992vvMq8p46/XftAfBhAMOaCqcD85zpyX4PhfC9733nOyN4yqx58O4UhVTKih6 -W9/ldp3uwSYAW+HyoINnHls/bFO8vv60K5VIhkxK30LHnC5PvByGfuHOgrscEThs -jW0ESqO0+9l88KhGdmLgzvbBlGxNziCMfn0LcFH6p2ITc3foD4LSzGEFtJ92OZi3 -buCOfbFsN7vWHTsEi89fRcCnWGtMwLUx0TCluQIDAQABAoIBAQCnsUQ1Lrl6trhA -Yu6DPbLZX+XQ7jPbonaQ2Ea5iOhmfIjmHdaEU+cyV1EqvseO+Z4MO0KraiuAV79T -h50cIEpa3kW7vbFCHz5nQ/hUVdlg/yT93rASu5rSOctOnz64Xv8Ms948kDtS+9eF -Cbo4JMdX+VRbt4mmWP8HhqAsFACPexEoWxJcIxwFcI24GTGzySjemNjQzbmcVhzM -a4k6n8DolCL1cRS54C5Aaf5g4+IFDgyydcgZXp1lnX3MnqivSNkejnPnY55NcmrH -X3ZWPlAi9GHOJE33uy8bGWnip7Tn4iTt6tJvjz/yP82TGACDg1B8XsKrqsuQLsoU -cNBVGcQBAoGBAPteCgNmuNOpo4SRA1UVRw1WgnE8YtnNA6vYyVcTLSpqabq33UaD -03L9CQsbHtj88U+E8OH24Iqj3U9x7QJfH8DVmWuBrlwez80JsKGnLdViHydjKcAz -H2Cbv+SiWeaWXkFCkN4Jf7k3q0Ew4SG2LOq5PVUy/NB4bilbJD2ExKpZAoGBANj2 -Hpwo35IQ4XfSSsGaCdn+8ajMcNUMMGZ6YkZqmVO4kogqobyrPL/2KE9ol/hlacw6 -U/6Digox5/wqruYfqyM8lqGOq2/0Xf7c4XfiOTS9Na4JN3OGzlyqPvcn2zdqhYFY -iHPu2RqpA+LhCHW9Zs8C1Bp/KAEPdRP6OabqVaphAoGACLrHVj7nBFLL3vq6RuYq -RYhPl2cld7LrAbjRpTiBRQvVCCsCgERrv36SJdSXSanfJ4fSZcaRHb97HBs0w/RR -wfypC1bBm2lmhhRkEfkgWlzCADgtZwNff5dpHqOUw7FNLK8HIO7rhJ8uT2FHMEiH -Xs94FdFjfknwaXdE1u4ZdmECgYEAgxfbkQHFbO2UPqErGGXp0/WOsS6ucpyF1jXW -kbOxZ3vb1jjkNyrEbzzeSHTrdmRYk9UekWeLjfNvt9dWjKfP8V+XqJCbF+9wqCFw -fs6LQEmfWMQq5DwtDqKznwVPGOHdPzVuZZaJSemb9oeAZBwINccAv+3bDyD23hZQ -pYFsN6ECgYEA33QYDNG/spki4D8rlxyxZ+1MdB/efnrGBhO8FsJpG5+AtmYhWgD9 -sl29+3aiRkmDznoy36z+hoeZePILEAKMcbHyXOymixOHPuaZJ95hbvq6sqd6WMAe -w5tHnxlfEuu11zatolk6WiAmTmG3sZpN5Tqloq0Ye4dvlhVKNV3Bn3E= ------END RSA PRIVATE KEY----- From 178a30b9e700d32a8aac4f49864838829bedd389 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sat, 4 Apr 2026 00:28:29 +0200 Subject: [PATCH 040/300] Fix SNI tests for bugs #80770 and #74796 --- ext/openssl/tests/bug74796.phpt | 29 ++++++++++++++++++++------ ext/openssl/tests/bug80770.phpt | 31 ++++++++++++++++------------ php-8.3.30.manifest | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 php-8.3.30.manifest diff --git a/ext/openssl/tests/bug74796.phpt b/ext/openssl/tests/bug74796.phpt index b3f594d5e60f..8ec5590c064f 100644 --- a/ext/openssl/tests/bug74796.phpt +++ b/ext/openssl/tests/bug74796.phpt @@ -12,13 +12,24 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- saveCaCert($caFile); +$certificateGenerator->saveNewCertAsFileWithKey('cs.php.net', $csFile); +$certificateGenerator->saveNewCertAsFileWithKey('uk.php.net', $ukFile); +$certificateGenerator->saveNewCertAsFileWithKey('us.php.net', $usFile); + $serverCode = <<<'CODE' $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ - "cs.php.net" => __DIR__ . "/sni_server_cs.pem", - "uk.php.net" => __DIR__ . "/sni_server_uk.pem", - "us.php.net" => __DIR__ . "/sni_server_us.pem" + "cs.php.net" => '%s', + "uk.php.net" => '%s', + "us.php.net" => '%s', ] ]]); @@ -33,6 +44,7 @@ $serverCode = <<<'CODE' phpt_wait(); CODE; +$serverCode = sprintf($serverCode, $csFile, $ukFile, $usFile); $proxyCode = <<<'CODE' function parse_sni_from_client_hello($data) { @@ -134,7 +146,7 @@ CODE; $clientCode = <<<'CODE' $clientCtx = stream_context_create([ 'ssl' => [ - 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'cafile' => '%s', 'verify_peer' => true, 'verify_peer_name' => true, ], @@ -155,16 +167,21 @@ $clientCode = <<<'CODE' phpt_notify('server'); CODE; +$clientCode = sprintf($clientCode, $caFile); include 'ServerClientTestCase.inc'; ServerClientTestCase::getInstance()->run($clientCode, [ - 'server' => $serverCode, - 'proxy' => $proxyCode, + 'server' => $serverCode, + 'proxy' => $proxyCode, ]); ?> --CLEAN-- --EXPECT-- string(19) "Hello from server 0" diff --git a/ext/openssl/tests/bug80770.phpt b/ext/openssl/tests/bug80770.phpt index 9100aaa5aa18..21860dc78eb7 100644 --- a/ext/openssl/tests/bug80770.phpt +++ b/ext/openssl/tests/bug80770.phpt @@ -11,14 +11,25 @@ if (OPENSSL_VERSION_NUMBER < 0x10101000) die("skip OpenSSL v1.1.1 required"); saveCaCert($caCertFile); +$certificateGenerator->saveNewCertAsFileWithKey('cs.php.net', $csFile); +$certificateGenerator->saveNewCertAsFileWithKey('uk.php.net', $ukFile); +$certificateGenerator->saveNewCertAsFileWithKey('us.php.net', $usFile); +$certificateGenerator->saveNewCertAsFileWithKey('Bug80770 Test Client', $clientCertFile); $serverCode = <<<'CODE' $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; $ctx = stream_context_create(['ssl' => [ 'SNI_server_certs' => [ - "cs.php.net" => __DIR__ . "/sni_server_cs.pem", - "uk.php.net" => __DIR__ . "/sni_server_uk.pem", - "us.php.net" => __DIR__ . "/sni_server_us.pem" + "cs.php.net" => '%s', + "uk.php.net" => '%s', + "us.php.net" => '%s', ], 'verify_peer' => true, 'cafile' => '%s', @@ -28,7 +39,6 @@ $serverCode = <<<'CODE' ]]); $server = stream_socket_server('tcp://127.0.0.1:0', $errno, $errstr, $flags, $ctx); phpt_notify_server_start($server); - $client = stream_socket_accept($server, 30); if ($client) { $success = stream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_TLS_SERVER); @@ -43,7 +53,7 @@ $serverCode = <<<'CODE' phpt_notify(message: "ACCEPT_FAILED"); } CODE; -$serverCode = sprintf($serverCode, $caCertFile); +$serverCode = sprintf($serverCode, $csFile, $ukFile, $usFile, $caCertFile); $clientCode = <<<'CODE' $flags = STREAM_CLIENT_CONNECT; @@ -58,19 +68,11 @@ $clientCode = <<<'CODE' if ($client) { stream_socket_enable_crypto($client, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); } - $result = phpt_wait(); echo trim($result); CODE; $clientCode = sprintf($clientCode, $clientCertFile); -include 'CertificateGenerator.inc'; - -// Generate CA and client certificate signed by that CA -$certificateGenerator = new CertificateGenerator(); -$certificateGenerator->saveCaCert($caCertFile); -$certificateGenerator->saveNewCertAsFileWithKey('Bug80770 Test Client', $clientCertFile); - include 'ServerClientTestCase.inc'; ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> @@ -78,6 +80,9 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); --EXPECTF-- CLIENT_CERT_CAPTURED diff --git a/php-8.3.30.manifest b/php-8.3.30.manifest new file mode 100644 index 000000000000..ef6ffe8aa803 --- /dev/null +++ b/php-8.3.30.manifest @@ -0,0 +1,36 @@ +php-8.3.30.tar.bz2 +SHA256 hash: 800b7b6ed50b73c8ee7844ee5f2f7cc612faa7875a0aa7c4529e8ed5866a5030 +PGP signature: +-----BEGIN PGP SIGNATURE----- + +iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsAAKCRAcB3ncXAqd +5FioAPwK1gjqwBbGr5g3y1TikqxgKVWMHCtir1n46yGN2hYvtwD/flOR9EqRejNU +wW4RMkmRwXGsXY28V1DH+NKnDKTEWQ8= +=jkCu +-----END PGP SIGNATURE----- + + +php-8.3.30.tar.gz +SHA256 hash: e587dc95fb7f62730299fa7b36b6e4f91e6708aaefa2fff68a0098d320c16386 +PGP signature: +-----BEGIN PGP SIGNATURE----- + +iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsAAKCRAcB3ncXAqd +5F4eAP44IkpP3p3FRq3S9pDm9Y6bJnrpzxafqfXlZ949ECmUIgEAxFb+m5Tz7gcb +DSU+taIv2W6EQeijjaXPvAE2t1dGswo= +=kn1U +-----END PGP SIGNATURE----- + + +php-8.3.30.tar.xz +SHA256 hash: 67f084d36852daab6809561a7c8023d130ca07fc6af8fb040684dd1414934d48 +PGP signature: +-----BEGIN PGP SIGNATURE----- + +iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsQAKCRAcB3ncXAqd +5NYpAP9Is0pCLlEuLiSRdAbgWPDee0jPA5JGoriGOFNkdMk67AD/WTzYCx7+dEVG +8Gb54wK005bk9nRGYQqwvZb+r1gqaQU= +=vSr4 +-----END PGP SIGNATURE----- + + From 1d8643deb7c2d6a5534cbc1a18c5d69fc003f9d2 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sat, 4 Apr 2026 00:29:54 +0200 Subject: [PATCH 041/300] Add back sni_server_ca for expired cert test --- ext/openssl/tests/sni_server_ca.pem | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ext/openssl/tests/sni_server_ca.pem diff --git a/ext/openssl/tests/sni_server_ca.pem b/ext/openssl/tests/sni_server_ca.pem new file mode 100644 index 000000000000..b2522884565d --- /dev/null +++ b/ext/openssl/tests/sni_server_ca.pem @@ -0,0 +1,63 @@ +-----BEGIN CERTIFICATE----- +MIIFejCCA2KgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwQzELMAkGA1UEBhMCR0Ix +EDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQxEDAOBgNVBAMMB3Bo +cC5uZXQwHhcNMTcxMTIyMTQyODIzWhcNMjcxMTIwMTQyODIzWjBVMQswCQYDVQQG +EwJHQjEQMA4GA1UECAwHRW5nbGFuZDEQMA4GA1UECgwHUEhQLm5ldDEQMA4GA1UE +CwwHb3BlbnNzbDEQMA4GA1UEAwwHcGhwLm5ldDCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMeENPus84HfIaypUVybbn5ZZyu1gXSYZAnDYYHhOlHu5kFh +26ohnHnoheapXVRbUtDZgUW5BztA+vDhKkM5G3U4p+YsqcSA/IkF2JQBkJH1jrxs +XMDtXIA4/MzYAVtyySqoMsrbkSCDzvI8imsbZI9O1x02VgaqoaQ9JZvglt1nhTIY +YpTbTKGCzMmrnFGHITeBsVose1ACFIAtqKqvUaA6TxcCtVcrENY3T3N/vEmoHHBg +O7j9+UvYN/WRPNcv0aIOlro83O9xQuJdRCygPmcv/jkqWRKm2Pu0lEkvbMCvOJr/ +Fz/kQg/6EVmIMsR/dgOMIjWjmpeTx24UJaNHUdNCeUbxIyTIyl9ISLWLM0Ipoq3L +95ygH6FSESAOpc8rVE2A5YZCtKlwvogMx3C/tMH1gWwMlfxn0CopP4Jx6lngw3yn +IpP0hnuCauQikBkyhsGu4J0Lbx5BsyDWQLwjiq4s8EcEy0vTdAvhDMRUGvpnjWaa +zBDVVrzHaRFvp6ueh35xf+dYieGL5UTICyrrQX9wwSafHV90a87y6XU+RwA25Dmc +V/kTn8/xkFv/4CbZp+0yArKpwXjqBMsQFbkFjT+Ky9MN+nedoFUMl7slgjpBs6RI +T08Hoa7/kMZGtLCiGcRXlwiIhB00gDz2avUvFTxwik9ssjDqBJGzNbBvZGb/AgMB +AAGjZjBkMB0GA1UdDgQWBBTjyuOBGnHnb+x20diIHG3sPuJFGjAfBgNVHSMEGDAW +gBQ0s99BNsV4Dszph6PArogA8HP4TDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1Ud +DwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAFrQMmCoSe8uJbJLqPGMPW4ZE +0U81WWboc9FrSfezBYkTKuCjMTjQFv8oLp4pnuWZw22mHrOiz9izjNnXcR/rdVbG +Cip/JSHlTzHd3gnxSSd2diXvVrSb4zuLyN6WIficlsj3QdIP4Cdfv1pdHBTsRPbW +vuHpwYqqjxPBjqvoVZyZRyRM1pqpxLCvxOt4S3z4uZXyIH2UI7yWxI6MvdHBZg5m +TwiVi1gEQuRnYRy4sK9qJlBo5jERvzDr46W1e9Yz5sNMPfwWb64Hkkys3GqJt5am +OKxvgF3lvIK90vBjenGDfYEENP+0qdmdpHQkxGM2cl9iPqW8iyRGBVjdbzTIeRgB +u+CEbffSKWCpbm1Zcszv3FHMlsU4Px2pUTdLwEMgBQUPW/ngBMdRgVZE01GI7D1k +AM3hO347eehQTWoyuHgsnB2uaANEeR/XFBGDFmbs5ggAzxxRsH1FxoHXrv3iDIPW +9lKnSow+OZGcPKgaY5Nsregt4jO+pQqhzxlMa2QMfrMoGkEvrKNcDqeEI6KQa1SI +Zbq7sjf2w+VL0oQcse+gtg4q771dKy9V/XcfnPbiBAXfQqGj/v0LmZRn3ZRrkgzl +CaZocqVRJZbqu7/iu/p9pDRMR03vhBWPn7iM8VqzkhKjAlD0rolnQqvOAXyPpd/O +qYuYP+6Ymt/rUWXGVh0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIJAJcrLHeFQrGEMA0GCSqGSIb3DQEBCwUAMEMxCzAJBgNV +BAYTAkdCMRAwDgYDVQQIDAdFbmdsYW5kMRAwDgYDVQQKDAdQSFAubmV0MRAwDgYD +VQQDDAdwaHAubmV0MB4XDTE3MTExNTE5MTEwMVoXDTM4MDUyOTE5MTEwMVowQzEL +MAkGA1UEBhMCR0IxEDAOBgNVBAgMB0VuZ2xhbmQxEDAOBgNVBAoMB1BIUC5uZXQx +EDAOBgNVBAMMB3BocC5uZXQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC4bIXbh+e+OCbLum2FYB8i6ZnOShp1teWNEE/8A4ot20wkPxLeXFSU1Egn+3BG +fxHKrWxV/FOiL7bims/SfwptFkgNZkwE52HVk49zgQevG38smsnIGuBMXMKebLPT +wlsIWRqCmZqEmh1wNcC9+qwoHoYjvJvMYfFvofiSc7qkTFsjoBVe+ho90vjYMznr +Bs9DlD88iXO0kKN0Bsu2igz68JWkUsoNeD6UKSir16SmQZxdFPCM0O0gxmOyz4NZ +w8pJ5XGDJyS82fVp13tYCOBFhK0QBvvzaz/gN6De5arefm6cer9TX0HE+VvGhx4T +2lqydFLfAVKTTNoZHOQk2mFVUm7dlMzLvsgNKdEZH6wAa12eBImCea+CyJNkbGLC +nrN6a93iGqTft75sbDyvzRk/BdnxadkAPlOxgK1qGrOgeS0+7chPMh24MRoKj5bU +lYGdcp7Y9qIW1hZXFfgPJO0yMOug/7J14jybp+YhymBIBTZYi1zbGqGNXdLPyp77 +9KTfyJE9KkbGegBvwqJmZTW8QoUDllopDjr1zaIqHWJqfAK7vGivu0iLVJHBRbRs +w9c48RCjfIh7AkvFKsdIDt9SMdZOdm9D8SXosYPM1zMFQsFFRPh/nKyl9QnhWbwd +Vs1tIFDrb10Z2sn0pF/V0F0gubR5rvYs+3h/dLciLVFobQIDAQABo2MwYTAdBgNV +HQ4EFgQUNLPfQTbFeA7M6YejwK6IAPBz+EwwHwYDVR0jBBgwFoAUNLPfQTbFeA7M +6YejwK6IAPBz+EwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJ +KoZIhvcNAQELBQADggIBAIkctDRCNcNVs2qP/O3zZsVZ1cqlqYNjcHIVHqNZRvVb +bPtInZ/i/6BbwA5QM/giKpl2aMwetUnezjHVD+7/m24Mfs1FWyPD3joCMIANj7hR +MNbmX1LQBMt/bD3E5trq9S9rZ++/ny4gn/z2jH3x+lzDMBDiam/wXbvSmyIUPUX6 +V8FFpkTBNERpurUvX1NEFLuiilWKrI7/u1qS11PGBcX3pNQNfhKNMtuFz74hAE7C +RE8756CGu2bZzydYCarUXSNTXqNm5ly2J0UN6Al4myFwj/6XnLnDhXDAI8CaqDMD +MwmxUzJvzuphNS085ZIntrSgPJESGozevEsf9bGD8GyoBQN/cSqOJCFfnJqxtKHb +wNa2F78SXYsiWkRb5EzoyCeon+0tygG6gLBouVY8ouCerExkH9qzRLLzFInxmCm2 +ill7c8Xmml4H2BxJE33dz/Qh7PM3eF2A2VriioLDj4+HOiWq/1BjdW6/Xiwx5iP2 +nC6Cex+lBt6HkP9WIiJbGxVeamF5jxNWWvLoUkrjFhpukjb5BPR9zFt7mAty9J/T +iQt26yylP4ucmL9KB6lv4ISW4Ri8mhMcYh6nF3tIYWZMCSQKqkyvymhKdLMZa20A +IME2oxnfZcmsfMpM6BYsN4XDfGBeYctqqt2AFRNLkI4wFkFFdPTMcTi1q0iRH2Xk +-----END CERTIFICATE----- From cea48b4781fc4d890e62a6ab7212c9e88d48ffcf Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:38:53 +0100 Subject: [PATCH 042/300] openssl: Propagate PHP_OPENSSL_ASN1_INTEGER_set() failure If this is not propagated, then the function will succeed even though the serial number is not set. --- ext/openssl/openssl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 460474488224..7bd2748c0aed 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3373,7 +3373,11 @@ PHP_FUNCTION(openssl_csr_sign) goto cleanup; } } else { - PHP_OPENSSL_ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial); + if (!PHP_OPENSSL_ASN1_INTEGER_set(X509_get_serialNumber(new_cert), serial)) { + php_openssl_store_errors(); + php_error_docref(NULL, E_WARNING, "Error setting serial number"); + goto cleanup; + } } if (!X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr))) { From 35e8cb87cb06e0a77b1751e36ba39bec15dc6471 Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:58:47 +0100 Subject: [PATCH 043/300] Fix memory leaks when php_openssl_dh_pub_from_priv() fails Leak report: ``` Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f97cf4cb340 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77 #1 0x7f97cef66106 in BN_new bn/bn_lib.c:75 #2 0x7f97cef6006c in bn_bin2bn_cbs bn/bn_convert.c:151 #3 0x7f97cef60853 in BN_bin2bn bn/bn_convert.c:206 #4 0x56229112465b in php_openssl_pkey_init_dh_data /work/php-src/ext/openssl/openssl_backend_v1.c:208 #5 0x5622911248be in php_openssl_pkey_init_dh /work/php-src/ext/openssl/openssl_backend_v1.c:246 #6 0x5622910fe1d7 in zif_openssl_pkey_new /work/php-src/ext/openssl/openssl.c:2051 #7 0x562291eb44e5 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #8 0x5622921dc85a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #9 0x56229233cfa5 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #10 0x562292351ec0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #11 0x5622924b60cc in zend_execute_script /work/php-src/Zend/zend.c:1980 #12 0x562291ee8ecb in php_execute_script_ex /work/php-src/main/main.c:2645 #13 0x562291ee92db in php_execute_script /work/php-src/main/main.c:2685 #14 0x5622924bbc37 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #15 0x5622924be204 in main /work/php-src/sapi/cli/php_cli.c:1362 #16 0x7f97ceb301c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x7f97ceb3028a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #18 0x562291009db4 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609db4) (BuildId: 5cc444a6a9fc1a486ea698e72366c16bd5472605) ... etc ... ``` --- ext/openssl/openssl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7bd2748c0aed..b10bd561ff59 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4275,7 +4275,12 @@ static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private OPENSSL_PKEY_SET_BN(data, p); OPENSSL_PKEY_SET_BN(data, q); OPENSSL_PKEY_SET_BN(data, g); - if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { + if (!p || !q) { + BN_free(p); + return 0; + } + + if (!DH_set0_pqg(dh, p, q, g)) { return 0; } @@ -4288,6 +4293,10 @@ static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private if (priv_key) { pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); if (pub_key == NULL) { + BN_free(p); + BN_free(q); + BN_free(g); + BN_free(priv_key); return 0; } return DH_set0_key(dh, pub_key, priv_key); From f9519ccbb9975b2afae95a418fae65ad93823dc6 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 4 Apr 2026 12:40:44 +0200 Subject: [PATCH 044/300] [ci skip] Silence test warning --- ext/openssl/tests/gh21031.phpt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/openssl/tests/gh21031.phpt b/ext/openssl/tests/gh21031.phpt index a35fab927270..55694bf7676e 100644 --- a/ext/openssl/tests/gh21031.phpt +++ b/ext/openssl/tests/gh21031.phpt @@ -65,7 +65,7 @@ $clientCode = <<<'CODE' ], ]); - var_dump(file_get_contents("https://cs.php.net/", false, $clientCtx)); + var_dump(@file_get_contents("https://cs.php.net/", false, $clientCtx)); phpt_notify('proxy'); phpt_notify('server'); @@ -77,6 +77,5 @@ ServerClientTestCase::getInstance()->run($clientCode, [ 'proxy' => $proxyCode, ]); ?> ---EXPECTF-- -Warning: file_get_contents(https://cs.php.net/): Failed to open stream: Cannot connect to HTTPS server through proxy in %s +--EXPECT-- bool(false) From 4cffcbaf4a2cc7fec6838061cd3cd916f20d26c4 Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:27:43 +0100 Subject: [PATCH 045/300] Add missing error check on BN_CTX_new() If this fails, then the big numbers will be allocated outside of the context, leading to leaks. Closes GH-21061. --- ext/openssl/openssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b10bd561ff59..1fa4597393d5 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4423,6 +4423,9 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_ EC_POINT *point_q = NULL; EC_GROUP *group = NULL; BN_CTX *bctx = BN_CTX_new(); + if (!bctx) { + goto clean_exit; + } *is_private = false; From 7eb38cd3f543c2fcc30f3bf4abbac341c0ec67ba Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:37:47 +0100 Subject: [PATCH 046/300] Fix memory leaks when BN_bin2bn() fails This is observable in LibreSSL. The code is creating 3 big numbers, but if one of them failed to create, then DSA_set0_pqg() will have never executed and there are no references left to the created big numbers, leaking them in the process. E.g.: ``` Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f4edd402340 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77 #1 0x7f4edce9d106 in BN_new bn/bn_lib.c:75 #2 0x7f4edce9706c in bn_bin2bn_cbs bn/bn_convert.c:151 #3 0x7f4edce97853 in BN_bin2bn bn/bn_convert.c:206 #4 0x5556bd923e1d in php_openssl_pkey_init_dsa_data /work/php-src/ext/openssl/openssl_backend_v1.c:142 #5 0x5556bd92428f in php_openssl_pkey_init_dsa /work/php-src/ext/openssl/openssl_backend_v1.c:186 #6 0x5556bd8fe079 in zif_openssl_pkey_new /work/php-src/ext/openssl/openssl.c:2042 #7 0x5556be6b44e5 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #8 0x5556be9dc85a in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #9 0x5556beb3cfa5 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #10 0x5556beb51ec0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #11 0x5556becb60cc in zend_execute_script /work/php-src/Zend/zend.c:1980 #12 0x5556be6e8ecb in php_execute_script_ex /work/php-src/main/main.c:2645 #13 0x5556be6e92db in php_execute_script /work/php-src/main/main.c:2685 #14 0x5556becbbc37 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #15 0x5556becbe204 in main /work/php-src/sapi/cli/php_cli.c:1362 #16 0x7f4edca671c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #17 0x7f4edca6728a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #18 0x5556bd809db4 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609db4) (BuildId: 5cc444a6a9fc1a486ea698e72366c16bd5472605) ``` Closes GH-21062. --- ext/openssl/openssl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 1fa4597393d5..bd8e7a94210d 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4102,7 +4102,14 @@ static bool php_openssl_pkey_init_legacy_dsa(DSA *dsa, zval *data, bool *is_priv OPENSSL_PKEY_SET_BN(data, p); OPENSSL_PKEY_SET_BN(data, q); OPENSSL_PKEY_SET_BN(data, g); - if (!p || !q || !g || !DSA_set0_pqg(dsa, p, q, g)) { + if (!p || !q || !g) { + BN_free(p); + BN_free(q); + BN_free(g); + return 0; + } + + if (!DSA_set0_pqg(dsa, p, q, g)) { return 0; } From 2467dfb18f4640d5d4f22ed1decf4fc515b93eac Mon Sep 17 00:00:00 2001 From: ndossche Date: Tue, 27 Jan 2026 11:07:42 +0100 Subject: [PATCH 047/300] Fix UB and error propagation when X509_gmtime_adj() fails This causes UB later on when the certificate is passed to another function: ``` /work/php-src/Zend/zend_string.h:191:2: runtime error: null pointer passed as argument 2, which is declared to never be null #0 0x55cfb9407d94 in zend_string_init /work/php-src/Zend/zend_string.h:191 #1 0x55cfb941ceb6 in add_assoc_stringl_ex /work/php-src/Zend/zend_API.c:1986 #2 0x55cfb7f4c16d in add_assoc_stringl /work/php-src/Zend/zend_API.h:579 #3 0x55cfb7f4cccd in php_openssl_add_assoc_asn1_string /work/php-src/ext/openssl/openssl_backend_common.c:113 #4 0x55cfb7f2eb98 in zif_openssl_x509_parse /work/php-src/ext/openssl/openssl.c:1074 #5 0x55cfb9160993 in zend_test_execute_internal /work/php-src/ext/zend_test/observer.c:306 #6 0x55cfb958ee2d in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER /work/php-src/Zend/zend_vm_execute.h:2154 #7 0x55cfb97854bd in execute_ex /work/php-src/Zend/zend_vm_execute.h:116519 #8 0x55cfb9795c96 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #9 0x55cfb99666c6 in zend_execute_script /work/php-src/Zend/zend.c:1980 #10 0x55cfb919583e in php_execute_script_ex /work/php-src/main/main.c:2645 #11 0x55cfb9195b48 in php_execute_script /work/php-src/main/main.c:2685 #12 0x55cfb996bf48 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #13 0x55cfb996e6a1 in main /work/php-src/sapi/cli/php_cli.c:1362 #14 0x7fb0b68301c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #15 0x7fb0b683028a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #16 0x55cfb7e097d4 in _start (/work/php-src/build-dbg-ubsan/sapi/cli/php+0x14097d4) (BuildId: b2b405964cc047ab6da19abaf92a8899a99e4a47) ``` Furthermore, it also simply does not propagate the error to userland. Closes GH-21046. --- ext/openssl/openssl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index bd8e7a94210d..5ea8574f0235 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3392,8 +3392,11 @@ PHP_FUNCTION(openssl_csr_sign) php_openssl_store_errors(); goto cleanup; } - X509_gmtime_adj(X509_getm_notBefore(new_cert), 0); - X509_gmtime_adj(X509_getm_notAfter(new_cert), 60*60*24*num_days); + if (!X509_gmtime_adj(X509_getm_notBefore(new_cert), 0) + || !X509_gmtime_adj(X509_getm_notAfter(new_cert), 60*60*24*num_days)) { + php_openssl_store_errors(); + goto cleanup; + } i = X509_set_pubkey(new_cert, key); if (!i) { php_openssl_store_errors(); From f81a9a2f7deb7e5047e89f523704c67d632ed141 Mon Sep 17 00:00:00 2001 From: ndossche Date: Tue, 27 Jan 2026 14:00:05 +0100 Subject: [PATCH 048/300] Add missing error check on SSL_set_ex_data() This can actually fail because internally this function does stack management in internal data structures. Can cause a crash later, e.g.: ``` ==239255==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x5652d8f2fe68 bp 0x7ffc99ee8fc0 sp 0x7ffc99ee8ec0 T0) ==239255==The signal is caused by a READ memory access. ==239255==Hint: address points to the zero page. #0 0x5652d8f2fe68 in php_openssl_limit_handshake_reneg /work/php-src/ext/openssl/xp_ssl.c:1080 #1 0x5652d8f306e2 in php_openssl_info_callback /work/php-src/ext/openssl/xp_ssl.c:1137 #2 0x7f45057b84e5 (/lib/x86_64-linux-gnu/libssl.so.3+0x694e5) (BuildId: 5f3b12d47114f9fbdc7765266cd0bb8f1b5ee8fc) #3 0x5652d8f351d9 in php_openssl_enable_crypto /work/php-src/ext/openssl/xp_ssl.c:1850 #4 0x5652d8f39c86 in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2516 #5 0x5652d9d4c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #6 0x5652d9d557c1 in php_stream_xport_crypto_enable /work/php-src/main/streams/transports.c:387 #7 0x5652d8f387be in php_openssl_tcp_sockop_accept /work/php-src/ext/openssl/xp_ssl.c:2279 #8 0x5652d8f39fcd in php_openssl_sockop_set_option /work/php-src/ext/openssl/xp_ssl.c:2551 #9 0x5652d9d4c610 in _php_stream_set_option /work/php-src/main/streams/streams.c:1466 #10 0x5652d9d54d3a in php_stream_xport_accept /work/php-src/main/streams/transports.c:307 #11 0x5652d9b50161 in zif_stream_socket_accept /work/php-src/ext/standard/streamsfuncs.c:298 #12 0x5652d9fdacfb in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER /work/php-src/Zend/zend_vm_execute.h:1355 #13 0x5652da140689 in execute_ex /work/php-src/Zend/zend_vm_execute.h:116469 #14 0x5652da1558b0 in zend_execute /work/php-src/Zend/zend_vm_execute.h:121962 #15 0x5652da2ba0ab in zend_execute_script /work/php-src/Zend/zend.c:1980 #16 0x5652d9cec8bb in php_execute_script_ex /work/php-src/main/main.c:2645 #17 0x5652d9cecccb in php_execute_script /work/php-src/main/main.c:2685 #18 0x5652da2bfc16 in do_cli /work/php-src/sapi/cli/php_cli.c:951 #19 0x5652da2c21e3 in main /work/php-src/sapi/cli/php_cli.c:1362 #20 0x7f4504ebc1c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #21 0x7f4504ebc28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 274eec488d230825a136fa9c4d85370fed7a0a5e) #22 0x5652d8e09b34 in _start (/work/php-src/build-dbg-asan/sapi/cli/php+0x609b34) (BuildId: aa149f943514fff0c491e1f199e30fed0e977f7c) ``` Closes GH-21049. --- ext/openssl/xp_ssl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 88c75253abaf..64812c28042a 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1810,7 +1810,8 @@ static zend_result php_openssl_setup_crypto(php_stream *stream, sslsock->ssl_handle = SSL_new(sslsock->ctx); - if (sslsock->ssl_handle == NULL) { + if (sslsock->ssl_handle == NULL + || !SSL_set_ex_data(sslsock->ssl_handle, php_openssl_get_ssl_stream_data_index(), stream)) { php_error_docref(NULL, E_WARNING, "SSL handle creation failure"); SSL_CTX_free(sslsock->ctx); sslsock->ctx = NULL; @@ -1821,8 +1822,6 @@ static zend_result php_openssl_setup_crypto(php_stream *stream, } #endif return FAILURE; - } else { - SSL_set_ex_data(sslsock->ssl_handle, php_openssl_get_ssl_stream_data_index(), stream); } if (!SSL_set_fd(sslsock->ssl_handle, sslsock->s.socket)) { From 4e105e0176b949aaff193959c312ad9ff7cd419a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sat, 4 Apr 2026 12:44:01 +0200 Subject: [PATCH 049/300] Fix openssl compile warnings on Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BIO_reset() needs a (void) cast, analogous to the other locations in this file. /usr/openssl/3/include/openssl/bio.h:555:34: error: value computed is not used [-Werror=unused-value] 555 | # define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/php-src/php-src/ext/openssl/openssl.c:1565:33: note: in expansion of macro ‘BIO_reset’ 1565 | BIO_reset(bio_out); | ^~~~~~~~~ --- ext/openssl/openssl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 42341a1f5b76..65da0752b557 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1562,7 +1562,7 @@ PHP_FUNCTION(openssl_pkcs12_read) add_index_zval(&zextracerts, i, &zextracert); } - BIO_reset(bio_out); + (void)BIO_reset(bio_out); X509_free(aCA); } BIO_free(bio_out); @@ -2844,7 +2844,7 @@ PHP_FUNCTION(openssl_pkcs7_read) ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_reset(bio_out); + (void)BIO_reset(bio_out); } BIO_free(bio_out); } @@ -2863,7 +2863,7 @@ PHP_FUNCTION(openssl_pkcs7_read) ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_reset(bio_out); + (void)BIO_reset(bio_out); } BIO_free(bio_out); } @@ -3520,7 +3520,7 @@ PHP_FUNCTION(openssl_cms_read) ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_reset(bio_out); + (void)BIO_reset(bio_out); } BIO_free(bio_out); } @@ -3540,7 +3540,7 @@ PHP_FUNCTION(openssl_cms_read) ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length); add_index_zval(zout, i, &zcert); } - BIO_reset(bio_out); + (void)BIO_reset(bio_out); } BIO_free(bio_out); } From 883014debb631c6e389df0057e5dc35a8791cc78 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 4 Apr 2026 12:54:31 +0200 Subject: [PATCH 050/300] Fix const-generic warning in xp_ssl.c ``` ext/openssl/xp_ssl.c:423:24: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 423 | if (!(wildcard = strchr(certname, '*')) || memchr(certname, '.', wildcard - certname)) { | ^ ``` Since these typically turn into errors with -Werror, fix the build already. --- ext/openssl/xp_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 64812c28042a..11a6b56bf449 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -413,7 +413,7 @@ static bool php_openssl_x509_fingerprint_match(X509 *peer, zval *val) static bool php_openssl_matches_wildcard_name(const char *subjectname, const char *certname) /* {{{ */ { - char *wildcard = NULL; + const char *wildcard = NULL; ptrdiff_t prefix_len; size_t suffix_len, subject_len; From 79b1ca2064c0492c4fbeeff1cd65b2c2345c32da Mon Sep 17 00:00:00 2001 From: Nora Dossche <7771979+ndossche@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:36:13 +0100 Subject: [PATCH 051/300] Fix memory leaks and missing error propagation when php_openssl_csr_make() fails to set a version The leaks appears to be at least somewhat dependent on the OpenSSL version, but it is reproducible on an Ubuntu 24.04 container. Easiest way to manually trigger the bug is to make the second call fail when executing bug69215.phpt. Closes GH-21032. --- NEWS | 3 +++ ext/openssl/openssl.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 1e72166bf934..6a926e6118bb 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,9 @@ PHP NEWS zend_jit_use_reg). (Arnaud) . Fixed bug GH-21593 (Borked function JIT JMPNZ smart branch). (ilutov) +- OpenSSL: + . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) + - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 5ea8574f0235..b3e1201854a5 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2968,7 +2968,9 @@ static zend_result php_openssl_csr_make(struct php_x509_request * req, X509_REQ } } /* setup the version number: version 1 */ - if (X509_REQ_set_version(csr, 0L)) { + static int counter = 0; + counter++; + if (counter!=2&&X509_REQ_set_version(csr, 0L)) { int i, nid; char *type; CONF_VALUE *v; @@ -3090,13 +3092,15 @@ static zend_result php_openssl_csr_make(struct php_x509_request * req, X509_REQ } } } + + if (!X509_REQ_set_pubkey(csr, req->priv_key)) { + php_openssl_store_errors(); + } } else { php_openssl_store_errors(); + return FAILURE; } - if (!X509_REQ_set_pubkey(csr, req->priv_key)) { - php_openssl_store_errors(); - } return SUCCESS; } From c5fb035c6701400cc284e7b6ebf66fa678133848 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 4 Apr 2026 13:24:24 +0200 Subject: [PATCH 052/300] openssl: Fix merge Diffs in commit messages are applied by git, what a stupid design. So this can introduce accidental changes like here where the original reproducer got applied. --- ext/openssl/openssl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b3e1201854a5..8fc830b756d7 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2968,9 +2968,7 @@ static zend_result php_openssl_csr_make(struct php_x509_request * req, X509_REQ } } /* setup the version number: version 1 */ - static int counter = 0; - counter++; - if (counter!=2&&X509_REQ_set_version(csr, 0L)) { + if (X509_REQ_set_version(csr, 0L)) { int i, nid; char *type; CONF_VALUE *v; From 7cc45e0e41c96d7966d8431a86a2220b77dba438 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 4 Apr 2026 14:15:50 +0200 Subject: [PATCH 053/300] Windows: Allow OpenSSL Argon2 password hashing on ZTS (#21194) This is a follow-up of ce6e7a278694bb065f8adcd11beb42c353787f18 (GH-19236). --- ext/openssl/config.w32 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/openssl/config.w32 b/ext/openssl/config.w32 index 6fd0e928422c..4b7f4b8b8565 100644 --- a/ext/openssl/config.w32 +++ b/ext/openssl/config.w32 @@ -16,9 +16,7 @@ if (PHP_OPENSSL != "no") { AC_DEFINE("LOAD_OPENSSL_LEGACY_PROVIDER", 1, "Define to 1 to load the OpenSSL legacy algorithm provider in addition to the default provider."); } if (PHP_OPENSSL_ARGON2 != "no") { - if (PHP_ZTS != "no") { - WARNING("OpenSSL argon2 hashing not supported in ZTS mode for now"); - } else if (!GREP_HEADER("openssl/thread.h", "OSSL_set_max_threads", PHP_PHP_BUILD + "\\include")) { + if (!GREP_HEADER("openssl/thread.h", "OSSL_set_max_threads", PHP_PHP_BUILD + "\\include")) { WARNING("OpenSSL argon2 hashing requires OpenSSL >= 3.2"); } else { AC_DEFINE("HAVE_OPENSSL_ARGON2", 1, "Define to 1 to enable OpenSSL argon2 password hashing."); From f90757102cda25c1167a0df7eab8402b65b24e73 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 4 Apr 2026 14:23:09 +0200 Subject: [PATCH 054/300] ext/intl: Add spoofchecker files unconditionally on Windows (#21621) This check was once relevant for ICU versions < 4.2 which lack the unicode/uspoof.h header file. See: 6f6d60821e25c1b978c8b3f8e3e3d8128e277f06 --- ext/intl/config.w32 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index da8285b50d0c..9e2f695532d3 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -92,13 +92,11 @@ if (PHP_INTL != "no") { resourcebundle_iterator.cpp", "intl"); - if (CHECK_HEADER("unicode/uspoof.h", "CFLAGS_INTL")) { - ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\ - spoofchecker_class.cpp \ - spoofchecker_create.cpp \ - spoofchecker_main.cpp", - "intl"); - } + ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\ + spoofchecker_class.cpp \ + spoofchecker_create.cpp \ + spoofchecker_main.cpp", + "intl"); ADD_SOURCES(configure_module_dirname + "/transliterator", "\ transliterator_class.cpp \ From 2b7489437b1b085bab57c62a64153de0a1431d6d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 3 Apr 2026 21:54:57 +0200 Subject: [PATCH 055/300] More gcov improvements - Suppress debug assertions - Exclude ext/opcache/jit/ir Closes GH-21629 --- Zend/zend_API.h | 8 +++++++- build/Makefile.gcov | 11 ++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index e56ded4e8f1b..1ec5813678a4 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1055,7 +1055,13 @@ static zend_always_inline bool zend_char_has_nul_byte(const char *s, size_t know #define RETURN_ZVAL(zv, copy, dtor) do { RETVAL_ZVAL(zv, copy, dtor); return; } while (0) #define RETURN_FALSE do { RETVAL_FALSE; return; } while (0) #define RETURN_TRUE do { RETVAL_TRUE; return; } while (0) -#define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) + +#ifndef HAVE_GCOV +# define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) +#else +/* Drop ZEND_ASSERT() to avoid untested branch warning in gcov. */ +# define RETURN_THROWS() do { (void) return_value; return; } while (0) +#endif #define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL))) diff --git a/build/Makefile.gcov b/build/Makefile.gcov index d389cecdd192..d0dde7c120c8 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -24,10 +24,15 @@ GCOVR_EXCLUDES = \ 'ext/hash/sha3/.*' \ 'ext/lexbor/lexbor/.*' \ 'ext/mbstring/libmbfl/.*' \ + 'ext/opcache/jit/ir/.*' \ 'ext/pcre/pcre2lib/.*' \ 'ext/uri/uriparser/.*' -GCOVR_EXCLUDE_LINES_BY_PATTERN = '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' +GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ + '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ + '\s*EMPTY_SWITCH_DEFAULT_CASE\(\)(;)?\s*' \ + '\s*ZEND_ASSERT\(.*\);\s*' \ + '\s*ZEND_UNREACHABLE\(\);\s*' lcov: lcov-html @@ -53,14 +58,14 @@ gcovr-html: @rm -rf gcovr_html/ @mkdir gcovr_html gcovr -sr . -o gcovr_html/index.html --html --html-details \ - --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ + $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml gcovr -sr . -o gcovr.xml --xml \ - --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ + $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) .PHONY: gcovr-html lcov-html php_lcov.info From 96e93e9f9d36ab6b424d7f8f49a02b698b6c3542 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 2 Apr 2026 19:08:31 +0100 Subject: [PATCH 056/300] Fix GH-21600: Remove xsltCleanupGlobals call in ext/xsl MSHUTDOWN. The call to xsltCleanupGlobals() during module shutdown can cause a segfault in xmlHashFree() when freeing libxslt internal hash tables. This is the same class of shutdown cleanup issue that led to xmlCleanupParser() being removed from ext/libxml. The process is about to exit and the OS will reclaim all memory, making the explicit cleanup both unnecessary and harmful. close GH-21610 --- NEWS | 3 +++ ext/xsl/php_xsl.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6a926e6118bb..7e1e34b8ae0e 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,9 @@ PHP NEWS . Fixed bug GH-21468 (Segfault in file_get_contents w/ a https URL and a proxy set). (ndossche) +- XSL: + . Fixed bug GH-21600 (Segfault on module shutdown). (David Carlier) + 09 Apr 2026, PHP 8.4.20 - Bz2: diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index dec7eb501eb2..1484d3891aa3 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -323,7 +323,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl) xsltUnregisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl"); xsltSetGenericErrorFunc(NULL, NULL); - xsltCleanupGlobals(); return SUCCESS; } From 21664fb9357a6a89f3b228a6fc7a0d07b396908b Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sat, 4 Apr 2026 15:53:26 +0200 Subject: [PATCH 057/300] Convert remaining K&R function declarations in libbcmath These are already converted in 8.3. Backport minimal changes to 8.2, as the latest version of Clang on macOS has stopped supporting the K&R syntax. Closes GH-21636 --- ext/bcmath/libbcmath/src/add.c | 5 +---- ext/bcmath/libbcmath/src/compare.c | 10 ++-------- ext/bcmath/libbcmath/src/doaddsub.c | 10 ++-------- ext/bcmath/libbcmath/src/init.c | 9 ++------- ext/bcmath/libbcmath/src/int2num.c | 5 +---- ext/bcmath/libbcmath/src/nearzero.c | 5 +---- ext/bcmath/libbcmath/src/neg.c | 4 +--- ext/bcmath/libbcmath/src/num2long.c | 4 +--- ext/bcmath/libbcmath/src/num2str.c | 5 +---- ext/bcmath/libbcmath/src/rmzero.c | 4 +--- ext/bcmath/libbcmath/src/sub.c | 5 +---- 11 files changed, 14 insertions(+), 52 deletions(-) diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c index e92fb0502f01..3d76e028909e 100644 --- a/ext/bcmath/libbcmath/src/add.c +++ b/ext/bcmath/libbcmath/src/add.c @@ -42,10 +42,7 @@ N1 is added to N2 and the result placed into RESULT. SCALE_MIN is the minimum scale for the result. */ -void -bc_add (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; +void bc_add(bc_num n1, bc_num n2, bc_num *result, int scale_min) { bc_num sum = NULL; int cmp_res; diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c index f7c4a403993e..dda2d544fb4c 100644 --- a/ext/bcmath/libbcmath/src/compare.c +++ b/ext/bcmath/libbcmath/src/compare.c @@ -42,11 +42,7 @@ than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just compare the magnitudes. */ - int -_bc_do_compare (n1, n2, use_sign, ignore_last) - bc_num n1, n2; - int use_sign; - int ignore_last; +int _bc_do_compare(bc_num n1, bc_num n2, int use_sign, int ignore_last) { char *n1ptr, *n2ptr; int count; @@ -151,9 +147,7 @@ _bc_do_compare (n1, n2, use_sign, ignore_last) /* This is the "user callable" routine to compare numbers N1 and N2. */ -int -bc_compare (n1, n2) - bc_num n1, n2; +int bc_compare(bc_num n1, bc_num n2) { return _bc_do_compare (n1, n2, TRUE, FALSE); } diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c index fcd768f2929f..d3db98167d4d 100644 --- a/ext/bcmath/libbcmath/src/doaddsub.c +++ b/ext/bcmath/libbcmath/src/doaddsub.c @@ -42,10 +42,7 @@ returned. The signs of N1 and N2 are ignored. SCALE_MIN is to set the minimum scale of the result. */ - bc_num -_bc_do_add (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; +bc_num _bc_do_add(bc_num n1, bc_num n2, int scale_min) { bc_num sum; int sum_scale, sum_digits; @@ -134,10 +131,7 @@ _bc_do_add (n1, n2, scale_min) assumed to be larger than N2. SCALE_MIN is the minimum scale of the result. */ - bc_num -_bc_do_sub (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; +bc_num _bc_do_sub(bc_num n1, bc_num n2, int scale_min) { bc_num diff; int diff_scale, diff_len; diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c index 96e934b34da7..79a58ef6bba4 100644 --- a/ext/bcmath/libbcmath/src/init.c +++ b/ext/bcmath/libbcmath/src/init.c @@ -39,9 +39,7 @@ /* new_num allocates a number and sets fields to known values. */ -bc_num -_bc_new_num_ex (length, scale, persistent) - int length, scale, persistent; +bc_num _bc_new_num_ex(int length, int scale, int persistent) { bc_num temp; /* PHP Change: malloc() -> pemalloc(), removed free_list code */ @@ -61,10 +59,7 @@ _bc_new_num_ex (length, scale, persistent) /* "Frees" a bc_num NUM. Actually decreases reference count and only frees the storage if reference count is zero. */ -void -_bc_free_num_ex (num, persistent) - bc_num *num; - int persistent; +void _bc_free_num_ex(bc_num *num, int persistent) { if (*num == NULL) return; (*num)->n_refs--; diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c index 3e675b627a8c..274768529a3d 100644 --- a/ext/bcmath/libbcmath/src/int2num.c +++ b/ext/bcmath/libbcmath/src/int2num.c @@ -40,10 +40,7 @@ /* Convert an integer VAL to a bc number NUM. */ -void -bc_int2num (num, val) - bc_num *num; - int val; +void bc_int2num(bc_num *num, int val) { char buffer[30]; char *bptr, *vptr; diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c index 0986b02b7a9c..fab72bedf374 100644 --- a/ext/bcmath/libbcmath/src/nearzero.c +++ b/ext/bcmath/libbcmath/src/nearzero.c @@ -41,10 +41,7 @@ Specifically, all but the last digit is 0 and the last digit is 1. Last digit is defined by scale. */ -char -bc_is_near_zero (num, scale) - bc_num num; - int scale; +char bc_is_near_zero(bc_num num, int scale) { int count; char *nptr; diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c index fe6f95aa34c8..748606c185b3 100644 --- a/ext/bcmath/libbcmath/src/neg.c +++ b/ext/bcmath/libbcmath/src/neg.c @@ -39,9 +39,7 @@ /* In some places we need to check if the number is negative. */ -char -bc_is_neg (num) - bc_num num; +char bc_is_neg(bc_num num) { return num->n_sign == MINUS; } diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c index e40a126c72cb..802c623e81af 100644 --- a/ext/bcmath/libbcmath/src/num2long.c +++ b/ext/bcmath/libbcmath/src/num2long.c @@ -42,9 +42,7 @@ a long, this function returns a zero. This can be detected by checking the NUM for zero after having a zero returned. */ -long -bc_num2long (num) - bc_num num; +long bc_num2long(bc_num num) { long val; char *nptr; diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c index 39f7adb1f0c3..44b05593c944 100644 --- a/ext/bcmath/libbcmath/src/num2str.c +++ b/ext/bcmath/libbcmath/src/num2str.c @@ -39,10 +39,7 @@ /* Convert a numbers to a string. Base 10 only.*/ -zend_string -*bc_num2str_ex (num, scale) - bc_num num; - int scale; +zend_string *bc_num2str_ex(bc_num num, int scale) { zend_string *str; char *sptr; diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c index 5e295c90af4d..c1d85c0a91ac 100644 --- a/ext/bcmath/libbcmath/src/rmzero.c +++ b/ext/bcmath/libbcmath/src/rmzero.c @@ -41,9 +41,7 @@ _bc_rm_leading_zeros just moves the data "value" pointer to the correct place and adjusts the length. */ - void -_bc_rm_leading_zeros (num) - bc_num num; +void _bc_rm_leading_zeros(bc_num num) { /* We can move n_value to point to the first non zero digit! */ while (*num->n_value == 0 && num->n_len > 1) { diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c index 2949c71fbb66..9da5e892db96 100644 --- a/ext/bcmath/libbcmath/src/sub.c +++ b/ext/bcmath/libbcmath/src/sub.c @@ -42,10 +42,7 @@ N2 is subtracted from N1 and the result placed in RESULT. SCALE_MIN is the minimum scale for the result. */ -void -bc_sub (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; +void bc_sub(bc_num n1, bc_num n2, bc_num *result, int scale_min) { bc_num diff = NULL; int cmp_res; From 3d8cb61f879dd74d7c44eccdf1c572eb6d1c3860 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sun, 5 Apr 2026 05:32:47 +0800 Subject: [PATCH 058/300] [skip ci] ext/intl: Fix various typo (GH-21615) --- ext/intl/ERROR_CONVENTIONS.md | 4 ++-- ext/intl/collator/collator_convert.cpp | 2 +- ext/intl/collator/collator_sort.cpp | 2 +- ext/intl/formatter/formatter_data.cpp | 2 +- ext/intl/intl_error.h | 2 +- ext/intl/locale/locale_methods.cpp | 4 ++-- ext/intl/transliterator/transliterator_class.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/intl/ERROR_CONVENTIONS.md b/ext/intl/ERROR_CONVENTIONS.md index 432862afd685..4b29101a0a86 100644 --- a/ext/intl/ERROR_CONVENTIONS.md +++ b/ext/intl/ERROR_CONVENTIONS.md @@ -40,7 +40,7 @@ no way to pass ownership of the string without it being copied. unless the error is due to bad arguments, in which case only the global error should be set. -Objects store an intl_error structed in their private data. For instance: +Objects store an intl_error in their private data. For instance: ```c typedef struct { @@ -59,7 +59,7 @@ void intl_errors_set_code(intl_error* err, UErrorCode err_code); void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg); ``` -by passing a pointer to the object's `intl_error` structed as the first parameter. +by passing a pointer to the object's `intl_error` as the first parameter. Node the extra `s` in the functions' names (`errors`, not `error`). Static methods should only set the global error. diff --git a/ext/intl/collator/collator_convert.cpp b/ext/intl/collator/collator_convert.cpp index d4de15aa0b82..aa49661f8d77 100644 --- a/ext/intl/collator/collator_convert.cpp +++ b/ext/intl/collator/collator_convert.cpp @@ -289,7 +289,7 @@ U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv ) /* {{{ collator_convert_string_to_number_if_possible * - * Convert string to numer. + * Convert string to number. * * @param zval* str String to convert. * diff --git a/ext/intl/collator/collator_sort.cpp b/ext/intl/collator/collator_sort.cpp index 003d7f45a837..2f8685e61e30 100644 --- a/ext/intl/collator/collator_sort.cpp +++ b/ext/intl/collator/collator_sort.cpp @@ -380,7 +380,7 @@ U_CFUNC PHP_FUNCTION( collator_sort_with_sort_keys ) if( !hash || zend_hash_num_elements( hash ) == 0 ) RETURN_TRUE; - /* Create bufers */ + /* Create buffers */ sortKeyBuf = reinterpret_cast(ecalloc( sortKeyBufSize, sizeof( char ) )); sortKeyIndxBuf = reinterpret_cast(ecalloc( sortKeyIndxBufSize, sizeof( uint8_t ) )); utf16_buf = eumalloc( utf16_buf_size ); diff --git a/ext/intl/formatter/formatter_data.cpp b/ext/intl/formatter/formatter_data.cpp index 095be92ed29e..a9e48d0b14d8 100644 --- a/ext/intl/formatter/formatter_data.cpp +++ b/ext/intl/formatter/formatter_data.cpp @@ -32,7 +32,7 @@ void formatter_data_init( formatter_data* nf_data ) /* }}} */ /* {{{ void formatter_data_free( formatter_data* nf_data ) - * Clean up mem allocted by internals of formatter_data + * Clean up mem allocated by internals of formatter_data */ void formatter_data_free( formatter_data* nf_data ) { diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index 8a9bff0b271c..d8d9fac97bf2 100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h @@ -37,7 +37,7 @@ void intl_error_set( intl_error* err, UErrorCode code, const char* msg); UErrorCode intl_error_get_code( intl_error* err ); zend_string* intl_error_get_message( intl_error* err ); -// Wrappers to synchonize object's and global error structures. +// Wrappers to synchronize object's and global error structures. void intl_errors_reset( intl_error* err ); void intl_errors_set_custom_msg( intl_error* err, const char* msg); void intl_errors_set_code( intl_error* err, UErrorCode err_code ); diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp index 8f09e5c116e1..cff62b503395 100644 --- a/ext/intl/locale/locale_methods.cpp +++ b/ext/intl/locale/locale_methods.cpp @@ -254,7 +254,7 @@ static zend_off_t getStrrtokenPos(char* str, zend_off_t savedPos) } } if(result < 1){ - /* Just in case inavlid locale e.g. '-x-xyz' or '-sl_Latn' */ + /* Just in case invalid locale e.g. '-x-xyz' or '-sl_Latn' */ result =-1; } return result; @@ -362,7 +362,7 @@ static zend_string* get_icu_value_internal( const char* loc_name , const char* t if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ return zend_string_init(loc_name, strlen(loc_name), 0); } else { - /* Since Grandfathered , no value , do nothing , retutn NULL */ + /* Since Grandfathered , no value , do nothing , return NULL */ return NULL; } } diff --git a/ext/intl/transliterator/transliterator_class.cpp b/ext/intl/transliterator/transliterator_class.cpp index fd0cd4f3c3e6..3525872d77f6 100644 --- a/ext/intl/transliterator/transliterator_class.cpp +++ b/ext/intl/transliterator/transliterator_class.cpp @@ -80,7 +80,7 @@ static void transliterator_object_init( Transliterator_object* to ) /* }}} */ /* {{{ void transliterator_object_destroy( Transliterator_object* to ) - * Clean up mem allocted by internals of Transliterator_object + * Clean up mem allocated by internals of Transliterator_object */ static void transliterator_object_destroy( Transliterator_object* to ) { From 4cc691ae46a74feb8f777a7ffb4c439e3486f444 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sat, 4 Apr 2026 23:39:27 +0200 Subject: [PATCH 059/300] Fix file cache for zend_arg_info.doc_comment --- ext/opcache/zend_file_cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 3114e5b92712..dac6f3b482f5 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -659,6 +659,7 @@ static void zend_file_cache_serialize_op_array(zend_op_array *op_arra SERIALIZE_STR(p->name); } zend_file_cache_serialize_type(&p->type, script, info, buf); + SERIALIZE_STR(p->doc_comment); p++; } } @@ -1562,6 +1563,7 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr UNSERIALIZE_STR(p->name); } zend_file_cache_unserialize_type(&p->type, (op_array->fn_flags & ZEND_ACC_CLOSURE) ? NULL : op_array->scope, script, buf); + UNSERIALIZE_STR(p->doc_comment); p++; } } From e826bf80363f307f7e461f06edc335000cfec3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 5 Apr 2026 07:31:58 +0200 Subject: [PATCH 060/300] Add support for generating enum pages for the manual (#21469) --- build/gen_stub.php | 351 +++++++++++++++++++++++++++++++-------------- 1 file changed, 243 insertions(+), 108 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 396541272c32..67be5c2f7b94 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -945,6 +945,22 @@ public function getDeclarationName(): string } } +class EnumCaseName { + public /* readonly */ Name $enum; + public /* readonly */ string $case; + + public function __construct(Name $enum, string $case) + { + $this->enum = $enum; + $this->case = $case; + } + + public function __toString(): string + { + return "$this->enum::$this->case"; + } +} + interface FunctionOrMethodName { public function getDeclaration(): string; public function getArgInfoName(): string; @@ -3286,17 +3302,19 @@ protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fie } class EnumCaseInfo { - private /* readonly */ string $name; + private /* readonly */ EnumCaseName $name; private /* readonly */ ?Expr $value; + private /* readonly */ ?string $valueString; - public function __construct(string $name, ?Expr $value) { + public function __construct(EnumCaseName $name, ?Expr $value, ?string $valueString) { $this->name = $name; $this->value = $value; + $this->valueString = $valueString; } /** @param array $allConstInfos */ public function getDeclaration(array $allConstInfos): string { - $escapedName = addslashes($this->name); + $escapedName = addslashes($this->name->case); if ($this->value === null) { $code = "\n\tzend_enum_add_case_cstr(class_entry, \"$escapedName\", NULL);\n"; } else { @@ -3309,6 +3327,55 @@ public function getDeclaration(array $allConstInfos): string { return $code; } + + /** @param array $allConstInfos */ + public function getEnumSynopsisItemElement(DOMDocument $doc, array $allConstInfos, int $indentationLevel): DOMElement + { + $indentation = str_repeat(" ", $indentationLevel); + + $itemElement = $doc->createElement("enumitem"); + + $identifierElement = $doc->createElement("enumidentifier", $this->name->case); + + $itemElement->appendChild(new DOMText("\n$indentation ")); + $itemElement->appendChild($identifierElement); + + $valueString = $this->getEnumSynopsisValueString($allConstInfos); + if ($valueString) { + $itemElement->appendChild(new DOMText("\n$indentation ")); + $valueElement = $doc->createElement("enumvalue", $valueString); + $itemElement->appendChild($valueElement); + } + + $descriptionElement = $doc->createElement("enumitemdescription", "Description."); + $itemElement->appendChild(new DOMText("\n$indentation ")); + $itemElement->appendChild($descriptionElement); + + $itemElement->appendChild(new DOMText("\n$indentation")); + + return $itemElement; + } + + /** @param array $allConstInfos */ + public function getEnumSynopsisValueString(array $allConstInfos): ?string + { + if ($this->value === null) { + return null; + } + + $value = EvaluatedValue::createFromExpression($this->value, null, null, $allConstInfos); + if ($value->isUnknownConstValue) { + return null; + } + + if ($value->originatingConsts) { + return implode("\n", array_map(function (ConstInfo $const) use ($allConstInfos) { + return $const->getFieldSynopsisValueString($allConstInfos); + }, $value->originatingConsts)); + } + + return $this->valueString; + } } // Instances of AttributeInfo are immutable and do not need to be cloned @@ -3748,8 +3815,12 @@ public function getClassSynopsisDocument(array $classMap, array $allConstInfos): * @param array $allConstInfos */ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array $allConstInfos): ?DOMElement { - $classSynopsis = $doc->createElement("classsynopsis"); - $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class"); + if ($this->type === "enum") { + $classSynopsis = $doc->createElement("enumsynopsis"); + } else { + $classSynopsis = $doc->createElement("classsynopsis"); + $classSynopsis->setAttribute("class", $this->type === "interface" ? "interface" : "class"); + } $namespace = $this->getNamespace(); if ($namespace) { @@ -3769,108 +3840,120 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array $classSynopsisIndentation = str_repeat(" ", $classSynopsisIndentationLevel); } - $exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null; - $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, $classSynopsisIndentationLevel + 1); - if (!$ooElement) { - return null; - } $classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation ")); - $classSynopsis->appendChild($ooElement); - foreach ($this->extends as $k => $parent) { - $parentInfo = $classMap[$parent->toString()] ?? null; - if ($parentInfo === null) { - throw new Exception("Missing parent class " . $parent->toString()); - } + if ($this->type === "enum") { + $enumName = $doc->createElement("enumname", $this->getClassName()); + $classSynopsis->appendChild($enumName); - $ooElement = self::createOoElement( - $doc, - $parentInfo, - null, - false, - $k === 0 ? "extends" : null, - $classSynopsisIndentationLevel + 1 - ); + foreach ($this->enumCaseInfos as $enumCaseInfo) { + $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); + $enumItemElement = $enumCaseInfo->getEnumSynopsisItemElement($doc, $allConstInfos, $classSynopsisIndentationLevel + 1); + $classSynopsis->appendChild($enumItemElement); + } + } else { + $exceptionOverride = $this->type === "class" && $this->isException($classMap) ? "exception" : null; + $ooElement = self::createOoElement($doc, $this, $exceptionOverride, true, null, $classSynopsisIndentationLevel + 1); if (!$ooElement) { return null; } - - $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); $classSynopsis->appendChild($ooElement); - } - foreach ($this->implements as $k => $interface) { - $interfaceInfo = $classMap[$interface->toString()] ?? null; - if (!$interfaceInfo) { - throw new Exception("Missing implemented interface " . $interface->toString()); + foreach ($this->extends as $k => $parent) { + $parentInfo = $classMap[$parent->toString()] ?? null; + if ($parentInfo === null) { + throw new Exception("Missing parent class " . $parent->toString()); + } + + $ooElement = self::createOoElement( + $doc, + $parentInfo, + null, + false, + $k === 0 ? "extends" : null, + $classSynopsisIndentationLevel + 1 + ); + if (!$ooElement) { + return null; + } + + $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); + $classSynopsis->appendChild($ooElement); } - $ooElement = self::createOoElement($doc, $interfaceInfo, null, false, $k === 0 ? "implements" : null, $classSynopsisIndentationLevel + 1); - if (!$ooElement) { - return null; + foreach ($this->implements as $k => $interface) { + $interfaceInfo = $classMap[$interface->toString()] ?? null; + if (!$interfaceInfo) { + throw new Exception("Missing implemented interface " . $interface->toString()); + } + + $ooElement = self::createOoElement($doc, $interfaceInfo, null, false, $k === 0 ? "implements" : null, $classSynopsisIndentationLevel + 1); + if (!$ooElement) { + return null; + } + $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); + $classSynopsis->appendChild($ooElement); } - $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); - $classSynopsis->appendChild($ooElement); - } - /** @var array $parentsWithInheritedConstants */ - $parentsWithInheritedConstants = []; - /** @var array $parentsWithInheritedProperties */ - $parentsWithInheritedProperties = []; - /** @var array $parentsWithInheritedMethods */ - $parentsWithInheritedMethods = []; + /** @var array $parentsWithInheritedConstants */ + $parentsWithInheritedConstants = []; + /** @var array $parentsWithInheritedProperties */ + $parentsWithInheritedProperties = []; + /** @var array $parentsWithInheritedMethods */ + $parentsWithInheritedMethods = []; - $this->collectInheritedMembers( - $parentsWithInheritedConstants, - $parentsWithInheritedProperties, - $parentsWithInheritedMethods, - $this->hasConstructor(), - $classMap - ); + $this->collectInheritedMembers( + $parentsWithInheritedConstants, + $parentsWithInheritedProperties, + $parentsWithInheritedMethods, + $this->hasConstructor(), + $classMap + ); - $this->appendInheritedMemberSectionToClassSynopsis( - $doc, - $classSynopsis, - $parentsWithInheritedConstants, - "&Constants;", - "&InheritedConstants;", - $classSynopsisIndentationLevel + 1 - ); + $this->appendInheritedMemberSectionToClassSynopsis( + $doc, + $classSynopsis, + $parentsWithInheritedConstants, + "&Constants;", + "&InheritedConstants;", + $classSynopsisIndentationLevel + 1 + ); - if (!empty($this->constInfos)) { - $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); - $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Constants;"); - $classSynopsisInfo->setAttribute("role", "comment"); - $classSynopsis->appendChild($classSynopsisInfo); + if (!empty($this->constInfos)) { + $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Constants;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); - foreach ($this->constInfos as $constInfo) { - $classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation ")); - $fieldSynopsisElement = $constInfo->getFieldSynopsisElement($doc, $allConstInfos, $classSynopsisIndentationLevel + 1); - $classSynopsis->appendChild($fieldSynopsisElement); + foreach ($this->constInfos as $constInfo) { + $classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation ")); + $fieldSynopsisElement = $constInfo->getFieldSynopsisElement($doc, $allConstInfos, $classSynopsisIndentationLevel + 1); + $classSynopsis->appendChild($fieldSynopsisElement); + } } - } - if (!empty($this->propertyInfos)) { - $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); - $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Properties;"); - $classSynopsisInfo->setAttribute("role", "comment"); - $classSynopsis->appendChild($classSynopsisInfo); + if (!empty($this->propertyInfos)) { + $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); + $classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Properties;"); + $classSynopsisInfo->setAttribute("role", "comment"); + $classSynopsis->appendChild($classSynopsisInfo); - foreach ($this->propertyInfos as $propertyInfo) { - $classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation ")); - $fieldSynopsisElement = $propertyInfo->getFieldSynopsisElement($doc, $allConstInfos, $classSynopsisIndentationLevel + 1); - $classSynopsis->appendChild($fieldSynopsisElement); + foreach ($this->propertyInfos as $propertyInfo) { + $classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation ")); + $fieldSynopsisElement = $propertyInfo->getFieldSynopsisElement($doc, $allConstInfos, $classSynopsisIndentationLevel + 1); + $classSynopsis->appendChild($fieldSynopsisElement); + } } - } - $this->appendInheritedMemberSectionToClassSynopsis( - $doc, - $classSynopsis, - $parentsWithInheritedProperties, - "&Properties;", - "&InheritedProperties;", - $classSynopsisIndentationLevel + 1 - ); + $this->appendInheritedMemberSectionToClassSynopsis( + $doc, + $classSynopsis, + $parentsWithInheritedProperties, + "&Properties;", + "&InheritedProperties;", + $classSynopsisIndentationLevel + 1 + ); + } if (!empty($this->funcInfos)) { $classSynopsis->appendChild(new DOMText("\n\n$classSynopsisIndentation ")); @@ -3954,7 +4037,7 @@ private static function createOoElement( $indentation = str_repeat(" ", $indentationLevel); if ($classInfo->type !== "class" && $classInfo->type !== "interface") { - echo "Class synopsis generation is not implemented for " . $classInfo->type . "\n"; + echo "Warning: Class synopsis generation is not implemented for " . $classInfo->type . " of type " . $classInfo->name . "\n"; return null; } @@ -4491,7 +4574,10 @@ private function handleStatements(array $stmts, PrettyPrinterAbstract $prettyPri ); } else if ($classStmt instanceof Stmt\EnumCase) { $enumCaseInfos[] = new EnumCaseInfo( - $classStmt->name->toString(), $classStmt->expr); + new EnumCaseName($className, $classStmt->name->toString()), + $classStmt->expr, + $classStmt->expr ? $prettyPrinter->prettyPrintExpr($classStmt->expr) : null, + ); } else { throw new Exception("Not implemented {$classStmt->getType()}"); } @@ -5741,7 +5827,7 @@ function replaceClassSynopses( continue; } - if (stripos($xml, "getElementsByTagName("classsynopsis") as $element) { - $classSynopsisElements[] = $element; + $synopsisElements[] = $element; } - foreach ($classSynopsisElements as $classSynopsis) { - if (!$classSynopsis instanceof DOMElement) { - continue; - } + foreach ($doc->getElementsByTagName("enumsynopsis") as $element) { + $synopsisElements[] = $element; + } - $child = $classSynopsis->firstElementChild; - if ($child === null) { + foreach ($synopsisElements as $synopsis) { + if (!$synopsis instanceof DOMElement) { continue; } - $child = $child->lastElementChild; - if ($child === null) { - continue; + + if ($synopsis->nodeName === "classsynopsis") { + $child = $synopsis->firstElementChild; + if ($child === null) { + continue; + } + $child = $child->lastElementChild; + if ($child === null) { + continue; + } + } elseif ($synopsis->nodeName === "enumsynopsis") { + $child = $synopsis->firstElementChild; + if ($child === null) { + continue; + } } + $className = $child->textContent; - if ($classSynopsis->parentElement->nodeName === "packagesynopsis" && - $classSynopsis->parentElement->firstElementChild->nodeName === "package" + if ($synopsis->parentElement->nodeName === "packagesynopsis" && + $synopsis->parentElement->firstElementChild->nodeName === "package" ) { - $package = $classSynopsis->parentElement->firstElementChild; + $package = $synopsis->parentElement->firstElementChild; $namespace = $package->textContent; $className = $namespace . "\\" . $className; - $elementToReplace = $classSynopsis->parentElement; + $elementToReplace = $synopsis->parentElement; } else { - $elementToReplace = $classSynopsis; + $elementToReplace = $synopsis; } if (!isset($classMap[$className])) { @@ -5797,17 +5895,32 @@ function replaceClassSynopses( $classInfo = $classMap[$className]; - $newClassSynopsis = $classInfo->getClassSynopsisElement($doc, $classMap, $allConstInfos); - if ($newClassSynopsis === null) { + $newSynopsis = $classInfo->getClassSynopsisElement($doc, $classMap, $allConstInfos); + if ($newSynopsis === null) { continue; } // Check if there is any change - short circuit if there is not any. - if (replaceAndCompareXmls($doc, $elementToReplace, $newClassSynopsis)) { + if (replaceAndCompareXmls($doc, $elementToReplace, $newSynopsis)) { continue; } + if ($synopsis->nodeName === "enumsynopsis") { + $oldEnumCaseDescriptionElements = collectEnumSynopsisItemDescriptions($className, $elementToReplace); + $newEnumCaseDescriptionElements = collectEnumSynopsisItemDescriptions($className, $newSynopsis); + + foreach ($newEnumCaseDescriptionElements as $key => $newEnumCaseDescriptionElement) { + if (isset($oldEnumCaseDescriptionElements[$key]) === false) { + continue; + } + + $oldEnumCaseDescriptionElement = $oldEnumCaseDescriptionElements[$key]; + + $newEnumCaseDescriptionElement->parentElement->replaceChild($oldEnumCaseDescriptionElement, $newEnumCaseDescriptionElement); + } + } + // Return the updated XML $replacedXml = $doc->saveXML(); @@ -5843,6 +5956,28 @@ function replaceClassSynopses( return $classSynopses; } +/** + * @return array + */ +function collectEnumSynopsisItemDescriptions(string $className, DOMElement $synopsis): array +{ + $enumCaseDescriptionElements = []; + + $enumCaseDescriptions = $synopsis->getElementsByTagName("enumitemdescription"); + foreach ($enumCaseDescriptions as $enumItemDescription) { + $enumCaseNames = $enumItemDescription->parentElement->getElementsByTagName("enumidentifier"); + if (empty($enumCaseNames)) { + continue; + } + + $enumCaseName = $enumCaseNames[0]->textContent; + + $enumCaseDescriptionElements["$className::$enumCaseName"] = $enumItemDescription; + } + + return $enumCaseDescriptionElements; +} + function getReplacedSynopsisXml(string $xml): string { return preg_replace( From 27ebf47ff1ba5a5145a57176a5655e0ce11bfdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 5 Apr 2026 07:40:29 +0200 Subject: [PATCH 061/300] Use readonly properties + CPP for EnumCaseName in gen_stub.php --- build/gen_stub.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 70265c40cb97..9c1f797485c1 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -902,13 +902,10 @@ public function getDeclarationName(): string } class EnumCaseName { - public /* readonly */ Name $enum; - public /* readonly */ string $case; - - public function __construct(Name $enum, string $case) - { - $this->enum = $enum; - $this->case = $case; + public function __construct( + public readonly Name $enum, + public readonly string $case + ) { } public function __toString(): string From 1a9a2c7052e3e22b21c43b31dda9355b6d975f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 5 Apr 2026 10:10:15 +0200 Subject: [PATCH 062/300] Fix enum case registration An EnumCaseName::__toString() was added to the PHP 8.5 branch returning the FQCN of the enum case, which worked fine, but in the meanwhile, support for enum registration was added to master which implicitly relied on the EnumCaseName::__toString() method to return only the name of the case. That's why the "Verify the generated files are up to date" step was failing until this fix. --- build/gen_stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 9c1f797485c1..ce1a23866610 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -3529,7 +3529,7 @@ public function getCDeclarations(): string $i = 1; foreach ($this->enumCaseInfos as $case) { - $cName = 'ZEND_ENUM_' . str_replace('\\', '_', $this->name->toString()) . '_' . $case->name; + $cName = 'ZEND_ENUM_' . str_replace('\\', '_', $this->name->toString()) . '_' . $case->name->case; $code .= "\t{$cName} = {$i},\n"; $i++; } From fbf8bf84dbe3bed33a179a668e2c3d5d109d469a Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sun, 5 Apr 2026 18:43:57 +0100 Subject: [PATCH 063/300] Implement mysqli::quote_string method (#20729) --- NEWS | 3 + UPGRADING | 4 + ext/mysqli/mysqli.stub.php | 7 ++ ext/mysqli/mysqli_api.c | 25 +++++- ext/mysqli/mysqli_arginfo.h | 11 ++- .../tests/mysqli_class_mysqli_interface.phpt | 1 + ext/mysqli/tests/mysqli_quote_string.phpt | 86 +++++++++++++++++++ 7 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 ext/mysqli/tests/mysqli_quote_string.phpt diff --git a/NEWS b/NEWS index 1759f6e2ee76..11a0dbb34a07 100644 --- a/NEWS +++ b/NEWS @@ -64,6 +64,9 @@ PHP NEWS . Fixed bug GH-21223; mb_guess_encoding no longer crashes when passed huge list of candidate encodings (with 200,000+ entries). (Jordi Kroon) +- Opcache: + . Added mysqli_quote_string() and mysqli::quote_string(). (Kamil Tekiela) + - Opcache: . Fixed bug GH-20051 (apache2 shutdowns when restart is requested during preloading). (Arnaud, welcomycozyhom) diff --git a/UPGRADING b/UPGRADING index 467387a9ea3c..18f34eca1984 100644 --- a/UPGRADING +++ b/UPGRADING @@ -151,6 +151,10 @@ PHP 8.6 UPGRADE NOTES . `grapheme_strrev()` returns strrev for grapheme cluster unit. RFC: https://wiki.php.net/rfc/grapheme_strrev +- mysqli: + . Added `mysqli::quote_string()` and `mysqli_quote_string()`. + RFC: https://wiki.php.net/rfc/mysqli_quote_string + - Standard: . `clamp()` returns the given value if in range, else return the nearest bound. diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index 7ca2a20ca1b7..cc6b8c57404a 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -906,6 +906,11 @@ public function real_connect( */ public function real_escape_string(string $string): string {} + /** + * @alias mysqli_quote_string + */ + public function quote_string(string $string): string {} + /** * @tentative-return-type * @alias mysqli_reap_async_query @@ -1547,6 +1552,8 @@ function mysqli_real_escape_string(mysqli $mysql, string $string): string {} /** @alias mysqli_real_escape_string */ function mysqli_escape_string(mysqli $mysql, string $string): string {} +function mysqli_quote_string(mysqli $mysql, string $string): string {} + function mysqli_real_query(mysqli $mysql, string $query): bool {} /** @refcount 1 */ diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 9473f4a06c13..259fc128237e 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1198,7 +1198,7 @@ PHP_FUNCTION(mysqli_options) zend_argument_value_error(ERROR_ARG_POS(2), "must be MYSQLI_INIT_COMMAND, MYSQLI_SET_CHARSET_NAME, MYSQLI_SERVER_PUBLIC_KEY, or one of the MYSQLI_OPT_* constants"); RETURN_THROWS(); } - + if (expected_type != Z_TYPE_P(mysql_value)) { switch (expected_type) { case IS_STRING: @@ -1363,6 +1363,29 @@ PHP_FUNCTION(mysqli_real_escape_string) { RETURN_NEW_STR(newstr); } +PHP_FUNCTION(mysqli_quote_string) { + MY_MYSQL *mysql; + zval *mysql_link = NULL; + char *escapestr; + size_t escapestr_len; + zend_string *newstr; + + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) { + RETURN_THROWS(); + } + MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); + + newstr = zend_string_safe_alloc(2, escapestr_len, 2, 0); + char *out = ZSTR_VAL(newstr); + *out++ = '\''; + out += mysql_real_escape_string(mysql->mysql, out, escapestr, escapestr_len); + *out++ = '\''; + *out = '\0'; + newstr = zend_string_truncate(newstr, out - ZSTR_VAL(newstr), 0); + + RETURN_NEW_STR(newstr); +} + /* {{{ Undo actions from current transaction */ PHP_FUNCTION(mysqli_rollback) { diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 4439908e55dc..0121f36f3cfd 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit mysqli.stub.php instead. - * Stub hash: c0af8c627a063fbd2c8b76c63b5e70c8ddd1e4f9 */ + * Stub hash: dc804bc50cd0a0e14dafc0e03564d5699d641db0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) @@ -252,6 +252,8 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_escape_string arginfo_mysqli_real_escape_string +#define arginfo_mysqli_quote_string arginfo_mysqli_real_escape_string + #define arginfo_mysqli_real_query arginfo_mysqli_multi_query ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_reap_async_query, 0, 1, mysqli_result, MAY_BE_BOOL) @@ -527,6 +529,10 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_real_esca ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_quote_string, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_reap_async_query, 0, 0, mysqli_result, MAY_BE_BOOL) ZEND_END_ARG_INFO() @@ -767,6 +773,7 @@ ZEND_FUNCTION(mysqli_report); ZEND_FUNCTION(mysqli_query); ZEND_FUNCTION(mysqli_real_connect); ZEND_FUNCTION(mysqli_real_escape_string); +ZEND_FUNCTION(mysqli_quote_string); ZEND_FUNCTION(mysqli_real_query); ZEND_FUNCTION(mysqli_reap_async_query); ZEND_FUNCTION(mysqli_release_savepoint); @@ -883,6 +890,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(mysqli_real_connect, arginfo_mysqli_real_connect) ZEND_FE(mysqli_real_escape_string, arginfo_mysqli_real_escape_string) ZEND_RAW_FENTRY("mysqli_escape_string", zif_mysqli_real_escape_string, arginfo_mysqli_escape_string, 0, NULL, NULL) + ZEND_FE(mysqli_quote_string, arginfo_mysqli_quote_string) ZEND_FE(mysqli_real_query, arginfo_mysqli_real_query) ZEND_FE(mysqli_reap_async_query, arginfo_mysqli_reap_async_query) ZEND_FE(mysqli_release_savepoint, arginfo_mysqli_release_savepoint) @@ -957,6 +965,7 @@ static const zend_function_entry class_mysqli_methods[] = { ZEND_RAW_FENTRY("query", zif_mysqli_query, arginfo_class_mysqli_query, ZEND_ACC_PUBLIC, NULL, NULL) ZEND_RAW_FENTRY("real_connect", zif_mysqli_real_connect, arginfo_class_mysqli_real_connect, ZEND_ACC_PUBLIC, NULL, NULL) ZEND_RAW_FENTRY("real_escape_string", zif_mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string, ZEND_ACC_PUBLIC, NULL, NULL) + ZEND_RAW_FENTRY("quote_string", zif_mysqli_quote_string, arginfo_class_mysqli_quote_string, ZEND_ACC_PUBLIC, NULL, NULL) ZEND_RAW_FENTRY("reap_async_query", zif_mysqli_reap_async_query, arginfo_class_mysqli_reap_async_query, ZEND_ACC_PUBLIC, NULL, NULL) ZEND_RAW_FENTRY("escape_string", zif_mysqli_real_escape_string, arginfo_class_mysqli_escape_string, ZEND_ACC_PUBLIC, NULL, NULL) ZEND_RAW_FENTRY("real_query", zif_mysqli_real_query, arginfo_class_mysqli_real_query, ZEND_ACC_PUBLIC, NULL, NULL) diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index bada1d85a5ce..ccac6710edd1 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -43,6 +43,7 @@ require_once 'skipifconnectfailure.inc'; 'ping' => true, 'prepare' => true, 'query' => true, + 'quote_string' => true, 'real_connect' => true, 'real_escape_string' => true, 'real_query' => true, diff --git a/ext/mysqli/tests/mysqli_quote_string.phpt b/ext/mysqli/tests/mysqli_quote_string.phpt new file mode 100644 index 000000000000..b4a25aa3996f --- /dev/null +++ b/ext/mysqli/tests/mysqli_quote_string.phpt @@ -0,0 +1,86 @@ +--TEST-- +mysqli_quote_string() +--EXTENSIONS-- +mysqli +--SKIPIF-- + +--FILE-- +query("SELECT $escaped AS test"); +$value = $result->fetch_column(); +echo $value . "\n"; + +$escaped = mysqli_quote_string($link, '" OR 1=1 -- foo'); +echo $escaped . "\n"; +$result = $link->query("SELECT $escaped AS test"); +$value = $result->fetch_column(); +echo $value . "\n"; + +$escaped = mysqli_quote_string($link, "\n"); +if ($escaped !== "'\\n'") { + printf("[001] Expected '\\n', got %s\n", $escaped); +} + +$escaped = mysqli_quote_string($link, "\r"); +if ($escaped !== "'\\r'") { + printf("[002] Expected '\\r', got %s\n", $escaped); +} + +$escaped = mysqli_quote_string($link, "foo" . chr(0) . "bar"); +if ($escaped !== "'foo\\0bar'") { + printf("[003] Expected 'foo\\0bar', got %s\n", $escaped); +} + +echo "=====================\n"; + +// Test that the SQL injection is impossible with NO_BACKSLASH_ESCAPES mode +$link->query('SET @@sql_mode="NO_BACKSLASH_ESCAPES"'); + +echo $link->quote_string('\\') . "\n"; +echo $link->quote_string('"') . "\n"; +echo $link->quote_string("'") . "\n"; + +$escaped = $link->quote_string("\' \ \""); +echo $escaped . "\n"; +$result = $link->query("SELECT $escaped AS test"); +$value = $result->fetch_column(); +echo $value . "\n"; + +$escaped = $link->quote_string('" OR 1=1 -- foo'); +echo $escaped . "\n"; +$result = $link->query("SELECT $escaped AS test"); +$value = $result->fetch_column(); +echo $value . "\n"; + +echo "done!"; +?> +--EXPECT-- +'\\' +'\"' +'\'' +'\\\' \\ \"' +\' \ " +'\" OR 1=1 -- foo' +" OR 1=1 -- foo +===================== +'\' +'"' +'''' +'\'' \ "' +\' \ " +'" OR 1=1 -- foo' +" OR 1=1 -- foo +done! From ef8b1b8bb5127efdd31176e4d53f70d91976f07f Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sun, 5 Apr 2026 18:46:09 +0100 Subject: [PATCH 064/300] Fix wrong heading --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 11a0dbb34a07..f22f5b47017e 100644 --- a/NEWS +++ b/NEWS @@ -64,7 +64,7 @@ PHP NEWS . Fixed bug GH-21223; mb_guess_encoding no longer crashes when passed huge list of candidate encodings (with 200,000+ entries). (Jordi Kroon) -- Opcache: +- Mysqli: . Added mysqli_quote_string() and mysqli::quote_string(). (Kamil Tekiela) - Opcache: From b685fb2a94cfa82f1dc26039ae2329a6914ee296 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 5 Apr 2026 21:00:14 +0200 Subject: [PATCH 065/300] More general assert() gcov solution Fully disable assert() when compiling with gcov instead of overriding individual macros. --- Zend/zend_API.h | 8 +------- Zend/zend_portability.h | 5 ++++- build/Makefile.gcov | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 1ec5813678a4..e56ded4e8f1b 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1055,13 +1055,7 @@ static zend_always_inline bool zend_char_has_nul_byte(const char *s, size_t know #define RETURN_ZVAL(zv, copy, dtor) do { RETVAL_ZVAL(zv, copy, dtor); return; } while (0) #define RETURN_FALSE do { RETVAL_FALSE; return; } while (0) #define RETURN_TRUE do { RETVAL_TRUE; return; } while (0) - -#ifndef HAVE_GCOV -# define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) -#else -/* Drop ZEND_ASSERT() to avoid untested branch warning in gcov. */ -# define RETURN_THROWS() do { (void) return_value; return; } while (0) -#endif +#define RETURN_THROWS() do { ZEND_ASSERT(EG(exception)); (void) return_value; return; } while (0) #define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL))) diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index c8a6dfa871b5..b218886c2da5 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -106,7 +106,10 @@ # define ZEND_ASSUME(c) #endif -#if ZEND_DEBUG +#ifdef HAVE_GCOV +/* Disable assert() when compiling with gcov to avoid untested branch warning. */ +# define ZEND_ASSERT(c) ((void)sizeof(c)) +#elif ZEND_DEBUG # define ZEND_ASSERT(c) assert(c) #else # define ZEND_ASSERT(c) ZEND_ASSUME(c) diff --git a/build/Makefile.gcov b/build/Makefile.gcov index d0dde7c120c8..a1ae17a373ea 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -31,7 +31,6 @@ GCOVR_EXCLUDES = \ GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ '\s*EMPTY_SWITCH_DEFAULT_CASE\(\)(;)?\s*' \ - '\s*ZEND_ASSERT\(.*\);\s*' \ '\s*ZEND_UNREACHABLE\(\);\s*' lcov: lcov-html From 144ba8bed3f6074239bd069af9bd752fdd462557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 5 Apr 2026 22:59:05 +0200 Subject: [PATCH 066/300] zend_ast: Remove unused `ZEND_AST_PARENT_PROPERTY_HOOK_CALL` (#21644) --- UPGRADING.INTERNALS | 1 + Zend/zend_ast.c | 6 ------ Zend/zend_ast.h | 1 - Zend/zend_compile.c | 4 ---- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 1072d822ee49..2b8484011e32 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -83,6 +83,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The INI_ORIG_{INT|STR|FLT|BOOL}() macros have been removed as they are unused. If this behaviour is required fall back to the zend_ini_* functions. + . The unused ZEND_AST_PARENT_PROPERTY_HOOK_CALL has been removed. ======================== 2. Build system changes diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index e6270262e452..58aae4b22b58 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2555,12 +2555,6 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio smart_str_appendc(str, ')'); break; } - case ZEND_AST_PARENT_PROPERTY_HOOK_CALL: - smart_str_append(str, Z_STR_P(zend_ast_get_zval(ast->child[0]))); - smart_str_appendc(str, '('); - zend_ast_export_ex(str, ast->child[1], 0, indent); - smart_str_appendc(str, ')'); - break; case ZEND_AST_CALLABLE_CONVERT: { zend_ast_fcc *fcc_ast = (zend_ast_fcc*)ast; ast = fcc_ast->args; diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index a88efefd85b2..47d22564f980 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -153,7 +153,6 @@ enum _zend_ast_kind { ZEND_AST_MATCH, ZEND_AST_MATCH_ARM, ZEND_AST_NAMED_ARG, - ZEND_AST_PARENT_PROPERTY_HOOK_CALL, ZEND_AST_PIPE, /* 3 child nodes */ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 6734db09a2e9..b88d5b9d9876 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -12135,7 +12135,6 @@ static void zend_compile_expr_inner(znode *result, zend_ast *ast) /* {{{ */ case ZEND_AST_METHOD_CALL: case ZEND_AST_NULLSAFE_METHOD_CALL: case ZEND_AST_STATIC_CALL: - case ZEND_AST_PARENT_PROPERTY_HOOK_CALL: case ZEND_AST_PIPE: zend_compile_var(result, ast, BP_VAR_R, false); return; @@ -12292,9 +12291,6 @@ static zend_op *zend_compile_var_inner(znode *result, zend_ast *ast, uint32_t ty case ZEND_AST_CALL: zend_compile_call(result, ast, type); return NULL; - case ZEND_AST_PARENT_PROPERTY_HOOK_CALL: - zend_compile_parent_property_hook_call(result, ast, type); - return NULL; case ZEND_AST_METHOD_CALL: case ZEND_AST_NULLSAFE_METHOD_CALL: zend_compile_method_call(result, ast, type); From 05a400123a4bdcae69dca226eaa123601f77a0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 5 Apr 2026 23:46:58 +0200 Subject: [PATCH 067/300] zend_ast: Rename `ZEND_AST_METHOD_REFERENCE` to `ZEND_AST_TRAIT_METHOD_REFERENCE` (#21645) This AST node is specific to traits and thus should include `TRAIT` in its name. --- UPGRADING.INTERNALS | 2 ++ Zend/zend_ast.c | 2 +- Zend/zend_ast.h | 2 +- Zend/zend_language_parser.y | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 2b8484011e32..8eb380b387a4 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -84,6 +84,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES unused. If this behaviour is required fall back to the zend_ini_* functions. . The unused ZEND_AST_PARENT_PROPERTY_HOOK_CALL has been removed. + . ZEND_AST_METHOD_REFERENCE has been renamed to + ZEND_AST_TRAIT_METHOD_REFERENCE. ======================== 2. Build system changes diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 58aae4b22b58..97c9eee9ae58 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2803,7 +2803,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio smart_str_appends(str, " insteadof "); zend_ast_export_ex(str, ast->child[1], 0, indent); break; - case ZEND_AST_METHOD_REFERENCE: + case ZEND_AST_TRAIT_METHOD_REFERENCE: if (ast->child[0]) { zend_ast_export_name(str, ast->child[0], 0, indent); smart_str_appends(str, "::"); diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index 47d22564f980..e2807b03d1f5 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -144,7 +144,7 @@ enum _zend_ast_kind { ZEND_AST_DECLARE, ZEND_AST_USE_TRAIT, ZEND_AST_TRAIT_PRECEDENCE, - ZEND_AST_METHOD_REFERENCE, + ZEND_AST_TRAIT_METHOD_REFERENCE, ZEND_AST_NAMESPACE, ZEND_AST_USE_ELEM, ZEND_AST_TRAIT_ALIAS, diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 57ebf02fe024..25035a693426 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -1059,13 +1059,13 @@ trait_alias: trait_method_reference: identifier - { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, NULL, $1); } + { $$ = zend_ast_create(ZEND_AST_TRAIT_METHOD_REFERENCE, NULL, $1); } | absolute_trait_method_reference { $$ = $1; } ; absolute_trait_method_reference: class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { $$ = zend_ast_create(ZEND_AST_METHOD_REFERENCE, $1, $3); } + { $$ = zend_ast_create(ZEND_AST_TRAIT_METHOD_REFERENCE, $1, $3); } ; method_body: From f6ddc37e21799506efee19ae27daf46cf79236e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 00:10:15 +0200 Subject: [PATCH 068/300] Update GitHub Actions to `codecov/codecov-action@v6` This fixes: > Warning: Node.js 20 actions are deprecated. The following actions are running > on Node.js 20 and may not work as expected: > actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea. --- .github/workflows/test-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9eeff1455f8f..cf0ad1df647a 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -413,7 +413,7 @@ jobs: with: enableOpcache: true jitType: tracing - - uses: codecov/codecov-action@v5 + - uses: codecov/codecov-action@v6 if: ${{ !cancelled() }} with: fail_ci_if_error: true From 04f06e8cf28e1a9dff54b84fb10bc403bb2f91be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 14:46:15 +0200 Subject: [PATCH 069/300] zend_portability: Remove `EMPTY_SWITCH_DEFAULT_CASE()` (#20063) There are several issues with this macro: - It is incorrectly named: It's not an empty default case. It's an unreachable default case. - It is hiding control flow in its definition, which can be confusing for humans and tools (such as Coccinelle) alike, because it looks like it would be a statement that belongs to the "current" case rather than opening a new one. Since this macro is exactly as long as explicitly spelling out its definition (excluding the useless `break;`), it is not even making the code any more succinct. --- UPGRADING.INTERNALS | 2 ++ Zend/Optimizer/sccp.c | 2 +- Zend/Optimizer/zend_inference.c | 10 +++--- Zend/zend_API.c | 4 +-- Zend/zend_ast.c | 26 +++++++------- Zend/zend_compile.c | 36 +++++++++---------- Zend/zend_compile.h | 2 +- Zend/zend_execute.c | 10 +++--- Zend/zend_execute_API.c | 2 +- Zend/zend_inheritance.c | 2 +- Zend/zend_ini_parser.y | 2 +- Zend/zend_operators.c | 22 ++++++------ Zend/zend_portability.h | 4 --- Zend/zend_smart_str.c | 2 +- Zend/zend_string.h | 2 +- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 12 +++---- ext/bcmath/bcmath.c | 10 +++--- ext/bcmath/libbcmath/src/round.c | 2 +- ext/bz2/bz2.c | 2 +- ext/date/php_date.c | 8 ++--- ext/dom/element.c | 8 ++--- ext/dom/html5_parser.c | 2 +- ext/dom/inner_outer_html_mixin.c | 2 +- ext/dom/lexbor/selectors-adapted/selectors.c | 4 +-- ext/dom/node.c | 2 +- ext/gd/gd.c | 6 ++-- ext/gmp/gmp.c | 4 +-- ext/intl/formatter/formatter_format.cpp | 2 +- ext/intl/resourcebundle/resourcebundle.cpp | 2 +- ext/ldap/ldap.c | 2 +- ext/mbstring/libmbfl/filters/mbfilter_cjk.c | 10 +++--- ext/mbstring/libmbfl/filters/mbfilter_utf7.c | 4 +-- .../libmbfl/filters/mbfilter_utf7imap.c | 4 +-- ext/mbstring/mbstring.c | 2 +- ext/mbstring/php_unicode.c | 2 +- ext/mysqli/mysqli.c | 2 +- ext/opcache/jit/zend_jit.c | 2 +- ext/opcache/jit/zend_jit_helpers.c | 2 +- ext/opcache/jit/zend_jit_ir.c | 2 +- ext/openssl/openssl_backend_common.c | 2 +- ext/pcre/php_pcre.c | 2 +- ext/pdo/pdo_stmt.c | 6 ++-- ext/pdo_firebird/firebird_statement.c | 2 +- ext/pgsql/pgsql.c | 10 +++--- ext/reflection/php_reflection.c | 4 +-- ext/standard/array.c | 2 +- ext/standard/http.c | 2 +- ext/standard/math.c | 12 +++---- ext/standard/proc_open.c | 2 +- ext/tidy/tidy.c | 2 +- ext/uri/php_uri_common.c | 2 +- ext/uri/php_uri_common.h | 2 +- ext/uri/uri_parser_php_parse_url.c | 2 +- ext/uri/uri_parser_rfc3986.c | 2 +- ext/uri/uri_parser_whatwg.c | 6 ++-- ext/xmlreader/php_xmlreader.c | 2 +- ext/zend_test/test.c | 4 +-- ext/zlib/zlib.c | 4 +-- sapi/cli/php_cli_server.c | 2 +- sapi/phpdbg/phpdbg_out.c | 2 +- sapi/phpdbg/phpdbg_win.c | 2 +- 62 files changed, 151 insertions(+), 153 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 8eb380b387a4..5da8d205be74 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -86,6 +86,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The unused ZEND_AST_PARENT_PROPERTY_HOOK_CALL has been removed. . ZEND_AST_METHOD_REFERENCE has been renamed to ZEND_AST_TRAIT_METHOD_REFERENCE. + . The EMPTY_SWITCH_DEFAULT_CASE() macro has been removed. Use + default: ZEND_UNREACHABLE(); instead. ======================== 2. Build system changes diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 1457e7467cf7..0758c4d0faf2 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -1596,7 +1596,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o case ZEND_SHORT_CIRCUITING_CHAIN_EMPTY: ZVAL_TRUE(&zv); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } SET_RESULT(result, &zv); break; diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index c19d864f1bd0..601b37a868af 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1063,7 +1063,7 @@ static bool zend_inference_calc_binary_op_range( case ZEND_BW_XOR: // TODO break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 0; } @@ -2350,7 +2350,7 @@ static uint32_t binary_op_result_type( /* TODO: +MAY_BE_OBJECT ??? */ tmp = MAY_BE_STRING | MAY_BE_RC1 | MAY_BE_RCN; break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return tmp; } @@ -3708,7 +3708,7 @@ static zend_always_inline zend_result _zend_update_type_info( case ZEND_FREE: /* This may happen if the using opcode is DCEd. */ break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } j = zend_ssa_next_use(ssa->ops, ssa_op->result_def, j); if (j >= 0) { @@ -5294,10 +5294,10 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op return (t1 & MAY_BE_OBJECT); case IS_OBJECT: return 0; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } /* GCC is getting confused here for the Wimplicit-fallthrough warning with - * EMPTY_SWITCH_DEFAULT_CASE() macro */ + * default: ZEND_UNREACHABLE(); macro */ return 0; case ZEND_ARRAY_KEY_EXISTS: if ((t2 & MAY_BE_ANY) != MAY_BE_ARRAY) { diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 7363a4a12039..4d4ba2652866 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -126,7 +126,7 @@ ZEND_API const char *zend_get_type_by_const(int type) /* {{{ */ return "mixed"; case _IS_NUMBER: return "int|float"; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -262,7 +262,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code, case ZPP_ERROR_FAILURE: ZEND_ASSERT(EG(exception) && "Should have produced an error already"); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 97c9eee9ae58..cc4a2a8226fe 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -814,7 +814,7 @@ static zend_result ZEND_FASTCALL zend_ast_evaluate_inner( case IS_OBJECT: zend_cast_zval_to_object(result, &op1, IS_VAR); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } zval_ptr_dtor_nogc(&op1); if (UNEXPECTED(EG(exception))) { @@ -1240,7 +1240,7 @@ static zend_result ZEND_FASTCALL zend_ast_evaluate_inner( break; } - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } zend_create_fake_closure(result, fptr, fptr->common.scope, called_scope, NULL); @@ -1961,7 +1961,7 @@ static ZEND_COLD void zend_ast_export_zval(smart_str *str, const zval *zv, int p case IS_CONSTANT_AST: zend_ast_export_ex(str, Z_ASTVAL_P(zv), priority, indent); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } @@ -2396,7 +2396,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case T_PROPERTY_C: APPEND_STR("__PROPERTY__"); case T_NS_C: APPEND_STR("__NAMESPACE__"); case T_CLASS_C: APPEND_STR("__CLASS__"); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_TYPE: @@ -2405,7 +2405,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case IS_CALLABLE: APPEND_STR("callable"); case IS_STATIC: APPEND_STR("static"); case IS_MIXED: APPEND_STR("mixed"); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_PLACEHOLDER_ARG: @@ -2439,7 +2439,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case IS_STRING: PREFIX_OP("(string)", 240, 241); case IS_ARRAY: PREFIX_OP("(array)", 240, 241); case IS_OBJECT: PREFIX_OP("(object)", 240, 241); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_CAST_VOID: @@ -2473,14 +2473,14 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_REQUIRE_ONCE: FUNC_OP("require_once"); case ZEND_REQUIRE: FUNC_OP("require"); case ZEND_EVAL: FUNC_OP("eval"); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_UNARY_OP: switch (ast->attr) { case ZEND_BW_NOT: PREFIX_OP("~", 240, 241); case ZEND_BOOL_NOT: PREFIX_OP("!", 240, 241); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_PRE_INC: @@ -2575,7 +2575,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_FETCH_CLASS_PARENT: smart_str_append(str, ZSTR_KNOWN(ZEND_STR_PARENT)); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } else { zend_ast_export_ns_name(str, ast->child[0], 0, indent); @@ -2598,7 +2598,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_BW_AND: BINARY_OP(" &= ", 90, 91, 90); case ZEND_BW_XOR: BINARY_OP(" ^= ", 90, 91, 90); case ZEND_POW: BINARY_OP(" **= ", 90, 91, 90); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_ASSIGN_COALESCE: BINARY_OP(" \?\?= ", 90, 91, 90); @@ -2624,7 +2624,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_POW: BINARY_OP(" ** ", 250, 251, 250); case ZEND_BOOL_XOR: BINARY_OP(" xor ", 40, 40, 41); case ZEND_SPACESHIP: BINARY_OP(" <=> ", 180, 181, 181); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; case ZEND_AST_GREATER: BINARY_OP(" > ", 180, 181, 181); @@ -2976,7 +2976,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio zend_ast_export_indent(str, indent); smart_str_appendc(str, '}'); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return; @@ -3073,7 +3073,7 @@ zend_ast * ZEND_FASTCALL zend_ast_with_attributes(zend_ast *ast, zend_ast *attr) * zend_compile_const_decl() checks the kind of the list elements. */ ast = zend_ast_list_add(ast, attr); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return ast; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b88d5b9d9876..cebcec3c5b39 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -891,7 +891,7 @@ static const char *zend_modifier_token_to_string(uint32_t token) return "protected(set)"; case T_PRIVATE_SET: return "private(set)"; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -1834,7 +1834,7 @@ static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *c case ZEND_FETCH_CLASS_DEFAULT: ZVAL_STR(zv, zend_resolve_class_name_ast(class_ast)); return 1; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -2281,7 +2281,7 @@ static void zend_adjust_for_fetch_type(zend_op *opline, znode *result, uint32_t case BP_VAR_UNSET: opline->opcode += 5 * factor; return; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -2444,7 +2444,7 @@ static inline void zend_update_jump_target(uint32_t opnum_jump, uint32_t opnum_t case ZEND_JMP_FRAMELESS: opline->op2.opline_num = opnum_target; break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -3594,7 +3594,7 @@ static void zend_compile_assign(znode *result, zend_ast *ast, bool stmt, uint32_ result->op_type = IS_UNUSED; } return; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -3750,7 +3750,7 @@ static void zend_compile_compound_assign(znode *result, zend_ast *ast) /* {{{ */ opline = zend_emit_op_data(&expr_node); opline->extended_value = cache_slot; return; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -5012,7 +5012,7 @@ static zend_result zend_compile_func_sprintf(znode *result, zend_ast_list *args) case 'd': zend_emit_op_tmp(&elements[placeholder_count], ZEND_CAST, &elements[placeholder_count], NULL)->extended_value = IS_LONG; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if (rope_elements == 0) { @@ -5329,7 +5329,7 @@ static const char *zend_get_cstring_from_property_hook_kind(zend_property_hook_k return "get"; case ZEND_PROPERTY_HOOK_SET: return "set"; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -5879,7 +5879,7 @@ static void zend_compile_unset(const zend_ast *ast) /* {{{ */ opline = zend_compile_static_prop(NULL, var_ast, BP_VAR_UNSET, false, false); opline->opcode = ZEND_UNSET_STATIC_PROP; return; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -9465,7 +9465,7 @@ static void zend_compile_use_trait(const zend_ast *ast) /* {{{ */ case ZEND_AST_TRAIT_ALIAS: zend_compile_trait_alias(adaptation_ast); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } } @@ -9837,7 +9837,7 @@ static HashTable *zend_get_import_ht(uint32_t type) /* {{{ */ zend_hash_init(FC(imports_const), 8, NULL, str_dtor, 0); } return FC(imports_const); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return NULL; @@ -9853,7 +9853,7 @@ static char *zend_get_use_type_str(uint32_t type) /* {{{ */ return " function"; case ZEND_SYMBOL_CONST: return " const"; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return " unknown"; @@ -10219,7 +10219,7 @@ static bool zend_try_ct_eval_magic_const(zval *zv, const zend_ast *ast) /* {{{ * ZVAL_EMPTY_STRING(zv); } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 1; @@ -10961,7 +10961,7 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */ zend_emit_op_data(&default_node); assign_node = var_node_w; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } opline = zend_emit_op_tmp(NULL, ZEND_QM_ASSIGN, &assign_node, NULL); @@ -11181,7 +11181,7 @@ static void zend_compile_isset_or_empty(znode *result, const zend_ast *ast) /* { opline = zend_compile_static_prop(result, var_ast, BP_VAR_IS, false, false); opline->opcode = ZEND_ISSET_ISEMPTY_STATIC_PROP; break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } result->op_type = opline->result_type = IS_TMP_VAR; @@ -11697,7 +11697,7 @@ static void zend_compile_const_expr_class_name(zend_ast **ast_ptr) /* {{{ */ case ZEND_FETCH_CLASS_STATIC: zend_error_noreturn(E_COMPILE_ERROR, "static::class cannot be used for compile-time class name resolution"); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -11805,7 +11805,7 @@ static void zend_compile_const_expr_fcc(zend_ast **ast_ptr) case ZEND_AST_STATIC_CALL: args_ast = &(*ast_ptr)->child[2]; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if ((*args_ast)->kind != ZEND_AST_CALLABLE_CONVERT) { zend_error_noreturn(E_COMPILE_ERROR, "Constant expression contains invalid operations"); @@ -11843,7 +11843,7 @@ static void zend_compile_const_expr_fcc(zend_ast **ast_ptr) } break; } - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index abe2a53fe744..77beacabbb92 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -430,7 +430,7 @@ static zend_always_inline uint32_t zend_visibility_to_set_visibility(uint32_t vi return ZEND_ACC_PROTECTED_SET; case ZEND_ACC_PRIVATE: return ZEND_ACC_PRIVATE_SET; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 37278c5cb9a2..adfc2727d1dd 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1789,10 +1789,10 @@ ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void) case ZEND_FETCH_DIM_INCDEC: msg = "Cannot increment/decrement string offsets"; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } ZEND_ASSERT(msg != NULL); zend_throw_error(NULL, "%s", msg); @@ -3500,7 +3500,7 @@ static zend_never_inline bool zend_handle_fetch_obj_flags( ZEND_REF_ADD_TYPE_SOURCE(Z_REF_P(ptr), prop_info); } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 1; } @@ -4220,7 +4220,7 @@ static zend_never_inline void zend_fetch_this_var(int type OPLINE_DC EXECUTE_DAT ZVAL_UNDEF(result); zend_throw_error(NULL, "Cannot unset $this"); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -5357,7 +5357,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval efree(eval_desc); } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } zend_tmp_string_release(tmp_inc_filename); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 30ed4f5914cf..35d9994d1cb3 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1764,7 +1764,7 @@ zend_class_entry *zend_fetch_class_with_scope( case 0: break; /* Other fetch types are not supported by this function. */ - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ce = zend_lookup_class_ex(class_name, NULL, fetch_type); diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index bfa709ba60b6..149826c1e7a0 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -537,7 +537,7 @@ static inheritance_status zend_is_class_subtype_of_type( return INHERITANCE_SUCCESS; } continue; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 748ccd2235a6..c936e7ba96f4 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -57,7 +57,7 @@ static int get_int_val(zval *op) { zend_string_free(Z_STR_P(op)); return val; } - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 58624ea5e1ce..c0ca71d3ff05 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -359,7 +359,7 @@ static zend_never_inline zend_result ZEND_FASTCALL _zendi_try_convert_scalar_to_ case IS_RESOURCE: case IS_ARRAY: return FAILURE; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -461,7 +461,7 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval * goto try_again; } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -606,7 +606,7 @@ ZEND_API void ZEND_FASTCALL convert_to_long(zval *op) /* {{{ */ case IS_REFERENCE: zend_unwrap_reference(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -665,7 +665,7 @@ ZEND_API void ZEND_FASTCALL convert_to_double(zval *op) /* {{{ */ case IS_REFERENCE: zend_unwrap_reference(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -747,7 +747,7 @@ ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op) /* {{{ */ case IS_REFERENCE: zend_unwrap_reference(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -805,7 +805,7 @@ ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op) /* {{{ */ case IS_REFERENCE: zend_unwrap_reference(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -1014,7 +1014,7 @@ ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_stri case IS_REFERENCE: op = Z_REFVAL_P(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 0; } @@ -1053,7 +1053,7 @@ ZEND_API double ZEND_FASTCALL zval_get_double_func(const zval *op) /* {{{ */ case IS_REFERENCE: op = Z_REFVAL_P(op); goto try_again; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 0.0; } @@ -1094,7 +1094,7 @@ static zend_always_inline zend_string* __zval_get_string_func(const zval *op, bo goto try_again; case IS_STRING: return zend_string_copy(Z_STR_P(op)); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return NULL; } @@ -2784,7 +2784,7 @@ ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ case IS_ARRAY: zend_type_error("Cannot increment %s", zend_zval_value_name(op1)); return FAILURE; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return SUCCESS; } @@ -2891,7 +2891,7 @@ ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ case IS_ARRAY: zend_type_error("Cannot decrement %s", zend_zval_value_name(op1)); return FAILURE; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return SUCCESS; diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index b218886c2da5..33a3e79a212e 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -137,10 +137,6 @@ # define ZEND_FALLTHROUGH ((void)0) #endif -/* Only use this macro if you know for sure that all of the switches values - are covered by its case statements */ -#define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_UNREACHABLE(); break; - #if defined(__GNUC__) && __GNUC__ >= 4 # define ZEND_IGNORE_VALUE(x) (({ __typeof__ (x) __x = (x); (void) __x; })) #else diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c index c779ee5c97ca..0124ed7885d6 100644 --- a/Zend/zend_smart_str.c +++ b/Zend/zend_smart_str.c @@ -229,7 +229,7 @@ ZEND_API void ZEND_FASTCALL smart_str_append_scalar(smart_str *dest, const zval smart_str_appendc(dest, '\''); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 97386ea6bad6..69c2edd13b3d 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -537,7 +537,7 @@ static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size case 2: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */ case 1: hash = ((hash << 5) + hash) + *str++; break; case 0: break; -EMPTY_SWITCH_DEFAULT_CASE() +default: ZEND_UNREACHABLE(); } #endif diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 86708f8c97a2..9cffc64a0ff5 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9012,7 +9012,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, CV|TMP|UNUSED|CLASS_FETCH, ANY) } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7dfedca98d3b..10fe98595d27 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -18232,7 +18232,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FETCH_CLASS_N } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } @@ -32825,7 +32825,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FETCH_CLASS_N } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } @@ -40825,7 +40825,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FETCH_CLASS_N } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } @@ -70738,7 +70738,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FETCH_CLASS_NAME_S } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } @@ -85231,7 +85231,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FETCH_CLASS_NAME_S } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } @@ -93231,7 +93231,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FETCH_CLASS_NAME_S } ZVAL_STR_COPY(EX_VAR(opline->result.var), called_scope->name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } ZEND_VM_NEXT_OPCODE(); } diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 63d9cd2a994e..d3a077251e80 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -195,7 +195,7 @@ static void bc_pow_err(bc_raise_status status, uint32_t arg_num) zend_argument_value_error(arg_num, "exponent is too large, the number of digits overflowed"); } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } @@ -573,7 +573,7 @@ PHP_FUNCTION(bcpowmod) case OK: RETVAL_NEW_STR(bc_num2str_ex(result, scale)); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } cleanup: { @@ -1306,7 +1306,7 @@ static zend_result bcmath_number_do_operation(uint8_t opcode, zval *ret_val, zva goto fail; } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if (Z_TYPE_P(op1) != IS_OBJECT) { @@ -1492,7 +1492,7 @@ static void bcmath_number_calc_method(INTERNAL_FUNCTION_PARAMETERS, uint8_t opco goto fail; } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if (num_obj == NULL) { @@ -1652,7 +1652,7 @@ PHP_METHOD(BcMath_Number, powmod) goto cleanup; case OK: break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } bc_rm_trailing_zeros(ret); diff --git a/ext/bcmath/libbcmath/src/round.c b/ext/bcmath/libbcmath/src/round.c index ec0042a9f482..707489990f9b 100644 --- a/ext/bcmath/libbcmath/src/round.c +++ b/ext/bcmath/libbcmath/src/round.c @@ -194,7 +194,7 @@ size_t bc_round(bc_num num, zend_long precision, zend_enum_RoundingMode mode, bc } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } up: diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 2299e8272086..c5a97bac3300 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -402,7 +402,7 @@ PHP_FUNCTION(bzopen) RETURN_FALSE; } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { diff --git a/ext/date/php_date.c b/ext/date/php_date.c index e5b094acdb3c..7e85c71b94c5 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2049,7 +2049,7 @@ static int date_object_compare_timezone(zval *tz1, zval *tz2) /* {{{ */ return strcmp(o1->tzi.z.abbr, o2->tzi.z.abbr) ? 1 : 0; case TIMELIB_ZONETYPE_ID: return strcmp(o1->tzi.tz->name, o2->tzi.tz->name) ? 1 : 0; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -2744,7 +2744,7 @@ PHP_METHOD(DateTime, createFromTimestamp) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } RETURN_OBJ(Z_OBJ(new_object)); @@ -2825,7 +2825,7 @@ PHP_METHOD(DateTimeImmutable, createFromTimestamp) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } RETURN_OBJ(Z_OBJ(new_object)); @@ -5969,7 +5969,7 @@ static int date_period_has_property(zend_object *object, zend_string *name, int return 0; case ZEND_PROPERTY_EXISTS: return 1; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/dom/element.c b/ext/dom/element.c index 4d0099b2c641..87f70c6f9a41 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -466,7 +466,7 @@ PHP_METHOD(DOMElement, setAttribute) break; case XML_NAMESPACE_DECL: RETURN_FALSE; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } @@ -593,7 +593,7 @@ static bool dom_remove_attribute(xmlNodePtr thisp, xmlNodePtr attrp) break; } - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return true; } @@ -1819,7 +1819,7 @@ PHP_METHOD(Dom_Element, insertAdjacentHTML) /* Set context to this. */ context = thisp; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } /* 4. If context is not an Element or all of the following are true: (...) */ @@ -1858,7 +1858,7 @@ PHP_METHOD(Dom_Element, insertAdjacentHTML) case ZEND_ENUM_Dom_AdjacentPosition_BeforeEnd: php_dom_node_append(this_intern->document, fragment, thisp); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } err: diff --git a/ext/dom/html5_parser.c b/ext/dom/html5_parser.c index c00fa81b9c9e..1ea7a27246b2 100644 --- a/ext/dom/html5_parser.c +++ b/ext/dom/html5_parser.c @@ -462,7 +462,7 @@ static php_libxml_quirks_mode dom_translate_quirks_mode(lxb_dom_document_cmode_t case LXB_DOM_DOCUMENT_CMODE_NO_QUIRKS: return PHP_LIBXML_NO_QUIRKS; case LXB_DOM_DOCUMENT_CMODE_LIMITED_QUIRKS: return PHP_LIBXML_LIMITED_QUIRKS; case LXB_DOM_DOCUMENT_CMODE_QUIRKS: return PHP_LIBXML_QUIRKS; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/dom/inner_outer_html_mixin.c b/ext/dom/inner_outer_html_mixin.c index 85124d41689a..9c616441fe17 100644 --- a/ext/dom/inner_outer_html_mixin.c +++ b/ext/dom/inner_outer_html_mixin.c @@ -181,7 +181,7 @@ static lxb_dom_document_cmode_t dom_translate_quirks_mode(php_libxml_quirks_mode case PHP_LIBXML_NO_QUIRKS: return LXB_DOM_DOCUMENT_CMODE_NO_QUIRKS; case PHP_LIBXML_LIMITED_QUIRKS: return LXB_DOM_DOCUMENT_CMODE_LIMITED_QUIRKS; case PHP_LIBXML_QUIRKS: return LXB_DOM_DOCUMENT_CMODE_QUIRKS; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/dom/lexbor/selectors-adapted/selectors.c b/ext/dom/lexbor/selectors-adapted/selectors.c index 0bb285b39e99..c02d61aa51a2 100644 --- a/ext/dom/lexbor/selectors-adapted/selectors.c +++ b/ext/dom/lexbor/selectors-adapted/selectors.c @@ -1453,7 +1453,7 @@ lxb_selectors_match(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, case LXB_CSS_SELECTOR_TYPE_PSEUDO_ELEMENT_FUNCTION: return false; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return false; @@ -1635,7 +1635,7 @@ lxb_selectors_match_attribute_value(const lxb_css_selector_attribute_t *attr, bo return lexbor_str_data_ncmp_contain(trg->data, trg->length, src->data, src->length); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return false; diff --git a/ext/dom/node.c b/ext/dom/node.c index 7ff5c6615a6c..1a01f4448ff9 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -138,7 +138,7 @@ zend_result dom_node_node_name_read(dom_object *obj, zval *retval) case XML_TEXT_NODE: ZVAL_STRING(retval, "#text"); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return SUCCESS; diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 1bd1a26f0519..2624d13b51da 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1746,7 +1746,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type) RETURN_THROWS(); } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } /* quality must fit in an int */ @@ -1776,7 +1776,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type) } gdImageGd2(im, fp, quality, type); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } fflush(fp); fclose(fp); @@ -1802,7 +1802,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type) } gdImageGd2(im, tmp, quality, type); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } fseek(tmp, 0, SEEK_SET); diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index b5451b8035e3..318380808e01 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -393,7 +393,7 @@ typeof_op_failure: ; case ZEND_SR: op_sigil = ">>"; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } zend_type_error("Unsupported operand types: %s %s %s", zend_zval_type_name(op1), op_sigil, zend_zval_type_name(op2)); return FAILURE; @@ -929,7 +929,7 @@ ZEND_FUNCTION(gmp_div_qr) case GMP_ROUND_MINUSINF: mpz_fdiv_qr(gmpnum_result1, gmpnum_result2, gmpnum_a, gmpnum_b); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/intl/formatter/formatter_format.cpp b/ext/intl/formatter/formatter_format.cpp index f28ea30b9ff8..25d21cb20f1f 100644 --- a/ext/intl/formatter/formatter_format.cpp +++ b/ext/intl/formatter/formatter_format.cpp @@ -55,7 +55,7 @@ U_CFUNC PHP_FUNCTION( numfmt_format ) case IS_DOUBLE: type = FORMAT_TYPE_DOUBLE; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/intl/resourcebundle/resourcebundle.cpp b/ext/intl/resourcebundle/resourcebundle.cpp index b8c5c00efaba..7d4f63521184 100644 --- a/ext/intl/resourcebundle/resourcebundle.cpp +++ b/ext/intl/resourcebundle/resourcebundle.cpp @@ -74,7 +74,7 @@ U_CFUNC void resourcebundle_extract_value( zval *return_value, ResourceBundle_ob source->child = NULL; intl_errors_reset(INTL_DATA_ERROR_P(source)); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index a13b25e1efde..fe8d7a5c5c67 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2783,7 +2783,7 @@ PHP_FUNCTION(ldap_modify_batch) case LDAP_MODIFY_BATCH_REPLACE: ldap_operation = LDAP_MOD_REPLACE; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } /* fill in the basic info */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cjk.c b/ext/mbstring/libmbfl/filters/mbfilter_cjk.c index 6a9c3803c470..83bc34ae1b77 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_cjk.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_cjk.c @@ -279,7 +279,7 @@ static int mbfl_filt_conv_jis_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -1836,7 +1836,7 @@ static int mbfl_filt_conv_jis2004_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -2528,7 +2528,7 @@ static int mbfl_filt_conv_cp5022x_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -4115,7 +4115,7 @@ static int mbfl_filt_conv_2022kr_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -9223,7 +9223,7 @@ static int mbfl_filt_conv_hz_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c index 87bdc590e6d5..0ee74c032140 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c @@ -260,7 +260,7 @@ int mbfl_filt_conv_utf7_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -368,7 +368,7 @@ int mbfl_filt_conv_wchar_utf7(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c index ac49e6a165b4..ba34255ebc13 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c @@ -282,7 +282,7 @@ int mbfl_filt_conv_utf7imap_wchar(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; @@ -409,7 +409,7 @@ int mbfl_filt_conv_wchar_utf7imap(int c, mbfl_convert_filter *filter) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } return 0; diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index c5987f3c9e7a..50355f784fb9 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -5260,7 +5260,7 @@ static bool mb_fast_check_utf8_default(zend_string *str) } break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c index f4944312bdf5..205c70b9cfb5 100644 --- a/ext/mbstring/php_unicode.c +++ b/ext/mbstring/php_unicode.c @@ -463,7 +463,7 @@ MBSTRING_API zend_string *php_unicode_convert_case(php_case_mode case_mode, cons } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } converted_end = p; diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a077972f5167..bcb8880e5785 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -325,7 +325,7 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in } break; } - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } else { has_property = zend_std_has_property(object, name, has_set_exists, cache_slot); diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index c80d2be3c3db..244e1ad59987 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -1411,7 +1411,7 @@ static bool zend_jit_supported_binary_op(uint8_t op, uint32_t op1_info, uint32_t return (op1_info & MAY_BE_LONG) && (op2_info & MAY_BE_LONG); case ZEND_CONCAT: return (op1_info & MAY_BE_STRING) && (op2_info & MAY_BE_STRING); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 59bb9401d9a9..70e691313b87 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -2285,7 +2285,7 @@ static zend_never_inline bool zend_handle_fetch_obj_flags( } } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return 1; } diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index a0e0ed46128c..20fb79cf2da7 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -16082,7 +16082,7 @@ static int zend_jit_fetch_static_prop(zend_jit_ctx *jit, const zend_op *opline, case ZEND_FETCH_STATIC_PROP_UNSET: fetch_type = BP_VAR_UNSET; break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } // JIT: result = CACHED_PTR(cache_slot + sizeof(void *)); diff --git a/ext/openssl/openssl_backend_common.c b/ext/openssl/openssl_backend_common.c index 5762d0613777..4ed92ca021bd 100644 --- a/ext/openssl/openssl_backend_common.c +++ b/ext/openssl/openssl_backend_common.c @@ -1520,7 +1520,7 @@ EVP_PKEY *php_openssl_generate_private_key(struct php_x509_request * req) case EVP_PKEY_ED448: break; #endif - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (EVP_PKEY_paramgen(ctx, ¶ms) <= 0) { diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 32ab6b0e5090..a251b7b09a9b 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2495,7 +2495,7 @@ PHP_FUNCTION(preg_replace_callback_array) case IS_NULL: RETVAL_NULL(); goto error; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (EG(exception)) { diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 1e2c2d14f37d..50f16f23ead1 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -148,7 +148,7 @@ bool pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */ stmt->columns[col].name = zend_string_toupper(orig_name); zend_string_release(orig_name); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -823,7 +823,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h * However, if we fetch a group key we will have over allocated. */ fetch_function_params = safe_emalloc(sizeof(zval), stmt->column_count, 0); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } if (group_key) { @@ -918,7 +918,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h case PDO_FETCH_FUNC: ZVAL_COPY_VALUE(&fetch_function_params[fetch_function_param_num++], &val); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index d506aa69eed3..8e917e2926a0 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -492,7 +492,7 @@ static int pdo_firebird_stmt_get_col( break; case SQL_DOUBLE: break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if ((var->sqltype & ~1) == SQL_DOUBLE) { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 2ddbf0af2309..c839eda553bc 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1013,7 +1013,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type break; } #endif - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (result) { RETURN_STRING(result); @@ -1578,7 +1578,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty case PHP_PG_CMD_TUPLES: RETVAL_LONG(atoi(PQcmdTuples(pgsql_result))); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } @@ -1817,7 +1817,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ oid = PQftype(pgsql_result, (int)field); PGSQL_RETURN_OID(oid); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -2348,7 +2348,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type, bo case PHP_PG_DATA_ISNULL: RETVAL_LONG(PQgetisnull(pgsql_result, pgsql_row, field_offset)); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -3921,7 +3921,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type) PQfreeCancel(c); break; } - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (PQsetnonblocking(pgsql, 0)) { php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode"); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9665d1453284..4a10a950b910 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1516,7 +1516,7 @@ static void reflection_type_factory(zend_type type, zval *object, bool legacy_be case NAMED_TYPE: object_init_ex(object, reflection_named_type_ptr); break; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } intern = Z_REFLECTION_P(object); @@ -6669,7 +6669,7 @@ static zend_always_inline uint32_t set_visibility_to_visibility(uint32_t set_vis return ZEND_ACC_PROTECTED; case ZEND_ACC_PRIVATE_SET: return ZEND_ACC_PRIVATE; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/standard/array.c b/ext/standard/array.c index 7aafe6ea0a17..037f13a7a464 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2818,7 +2818,7 @@ static uint8_t php_range_process_input(const zval *input, uint32_t arg_num, zend *dval = 0.0; return IS_STRING; } - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/standard/http.c b/ext/standard/http.c index 9ce8d5e559a7..9954a34b69ea 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -79,7 +79,7 @@ static void php_url_encode_scalar(zval *scalar, smart_str *form_str, scalar = zend_enum_fetch_case_value(Z_OBJ_P(scalar)); goto try_again; /* All possible types are either handled here or previously */ - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/standard/math.c b/ext/standard/math.c index a1d151209a70..61534975c2f8 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -152,7 +152,7 @@ static inline double php_round_helper(double integral, double value, double expo return integral; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } // FIXME: GCC bug, branch is considered reachable. ZEND_UNREACHABLE(); @@ -261,7 +261,7 @@ PHP_FUNCTION(abs) } case IS_DOUBLE: RETURN_DOUBLE(fabs(Z_DVAL_P(value))); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -280,7 +280,7 @@ PHP_FUNCTION(ceil) RETURN_DOUBLE(zval_get_double(value)); case IS_DOUBLE: RETURN_DOUBLE(ceil(Z_DVAL_P(value))); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -299,7 +299,7 @@ PHP_FUNCTION(floor) RETURN_DOUBLE(zval_get_double(value)); case IS_DOUBLE: RETURN_DOUBLE(floor(Z_DVAL_P(value))); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -382,7 +382,7 @@ PHP_FUNCTION(round) case IS_DOUBLE: RETURN_DOUBLE(_php_math_round(zval_get_double(value), (int)places, (int)mode)); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } /* }}} */ @@ -1437,7 +1437,7 @@ PHP_FUNCTION(number_format) } RETURN_STR(_php_math_number_format_ex(Z_DVAL_P(num), dec_int, dec_point, dec_point_len, thousand_sep, thousand_sep_len)); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } /* }}} */ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index a393a2a1f884..ddce144161ca 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -1024,7 +1024,7 @@ static zend_result redirect_proc_descriptor(descriptorspec_item *desc, int targe case 0: redirect_to = GetStdHandle(STD_INPUT_HANDLE); break; case 1: redirect_to = GetStdHandle(STD_OUTPUT_HANDLE); break; case 2: redirect_to = GetStdHandle(STD_ERROR_HANDLE); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } #endif } diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 6b5d1061d512..496fb260976e 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -705,7 +705,7 @@ static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetyp node = tidyGetBody(obj->ptdoc->doc); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (!node) { diff --git a/ext/uri/php_uri_common.c b/ext/uri/php_uri_common.c index da73bc59bf9c..5c48be475fb9 100644 --- a/ext/uri/php_uri_common.c +++ b/ext/uri/php_uri_common.c @@ -38,7 +38,7 @@ static zend_string *get_known_string_by_property_name(php_uri_property_name prop return ZSTR_KNOWN(ZEND_STR_QUERY); case PHP_URI_PROPERTY_NAME_FRAGMENT: return ZSTR_KNOWN(ZEND_STR_FRAGMENT); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/uri/php_uri_common.h b/ext/uri/php_uri_common.h index 2ae76cb2ee4d..6fced64e372f 100644 --- a/ext/uri/php_uri_common.h +++ b/ext/uri/php_uri_common.h @@ -182,7 +182,7 @@ static inline const php_uri_property_handler *php_uri_parser_property_handler_by return &parser->property_handler.query; case PHP_URI_PROPERTY_NAME_FRAGMENT: return &parser->property_handler.fragment; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/uri/uri_parser_php_parse_url.c b/ext/uri/uri_parser_php_parse_url.c index 8cee29e8f0c6..b5f7ed2f81ac 100644 --- a/ext/uri/uri_parser_php_parse_url.c +++ b/ext/uri/uri_parser_php_parse_url.c @@ -34,7 +34,7 @@ static zend_string *decode_component(zend_string *in, php_uri_component_read_mod return out; } - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/uri/uri_parser_rfc3986.c b/ext/uri/uri_parser_rfc3986.c index 5f1edbefe2bb..419f3db5652b 100644 --- a/ext/uri/uri_parser_rfc3986.c +++ b/ext/uri/uri_parser_rfc3986.c @@ -103,7 +103,7 @@ ZEND_ATTRIBUTE_NONNULL static UriUriA *get_uri_for_reading(php_uri_parser_rfc398 ZEND_FALLTHROUGH; case PHP_URI_COMPONENT_READ_MODE_NORMALIZED_UNICODE: return get_normalized_uri(uriparser_uris); - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } diff --git a/ext/uri/uri_parser_whatwg.c b/ext/uri/uri_parser_whatwg.c index 9d5e87fd4cf4..2b47d31d79e1 100644 --- a/ext/uri/uri_parser_whatwg.c +++ b/ext/uri/uri_parser_whatwg.c @@ -196,7 +196,7 @@ static const char *fill_errors(zval *errors) error_str = "FileInvalidWindowsDriveLetterHost"; ZVAL_FALSE(&failure); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } zval error_type; @@ -374,7 +374,7 @@ static zend_result php_uri_parser_whatwg_host_read(void *uri, php_uri_component_ case PHP_URI_COMPONENT_READ_MODE_RAW: ZVAL_STRINGL(retval, (const char *) lexbor_uri->host.u.domain.data, lexbor_uri->host.u.domain.length); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } else { ZVAL_NULL(retval); @@ -615,7 +615,7 @@ static zend_string *php_uri_parser_whatwg_to_string(void *uri, php_uri_recomposi case PHP_URI_RECOMPOSITION_MODE_NORMALIZED_ASCII: lxb_url_serialize(lexbor_uri, serialize_to_smart_str_callback, &uri_str, exclude_fragment); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return smart_str_extract(&uri_str); diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 8e35ad9d6b0d..27de3a290285 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -102,7 +102,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl case IS_LONG: ZVAL_LONG(rv, retint); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return SUCCESS; diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 0faf65f36437..7ab2272dd168 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -347,7 +347,7 @@ static ZEND_FUNCTION(zend_number_or_string) RETURN_DOUBLE(Z_DVAL_P(input)); case IS_STRING: RETURN_STR_COPY(Z_STR_P(input)); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } @@ -371,7 +371,7 @@ static ZEND_FUNCTION(zend_number_or_string_or_null) RETURN_DOUBLE(Z_DVAL_P(input)); case IS_STRING: RETURN_STR_COPY(Z_STR_P(input)); - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } } diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index ef792b374b11..c6a56e172be4 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -925,7 +925,7 @@ PHP_FUNCTION(inflate_init) efree(ctx->inflateDict); ctx->inflateDict = NULL; break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } } } @@ -1022,7 +1022,7 @@ PHP_FUNCTION(inflate_add) zend_string_release_ex(out, 0); php_error_docref(NULL, E_WARNING, "Dictionary does not match expected dictionary (incorrect adler32 hash)"); RETURN_FALSE; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } break; } else { diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 65d6d5a898de..3e943f0f5eaa 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2648,7 +2648,7 @@ static zend_result php_cli_server_recv_event_read_request(php_cli_server *server case 0: php_cli_server_poller_add(&server->poller, POLLIN, client->sock); return SUCCESS; - EMPTY_SWITCH_DEFAULT_CASE(); + default: ZEND_UNREACHABLE(); } /* Under ASAN the compiler somehow doesn't realise that the switch block always returns */ return FAILURE; diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index 63b61fb8eab0..34f640ab6e53 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -109,7 +109,7 @@ int phpdbg_process_print(int fd, int type, const char *msg, int msglen) { } } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } if (msgoutlen != FAILURE) { diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c index dc1c1dba216a..033991f0d901 100644 --- a/sapi/phpdbg/phpdbg_win.c +++ b/sapi/phpdbg/phpdbg_win.c @@ -35,7 +35,7 @@ int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) { return EXCEPTION_CONTINUE_EXECUTION; } break; - EMPTY_SWITCH_DEFAULT_CASE() + default: ZEND_UNREACHABLE(); } return EXCEPTION_CONTINUE_SEARCH; From 308050769c7c77a1bbeb16db688d213c65c89568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 14:49:48 +0200 Subject: [PATCH 070/300] Drop `EMPTY_SWITCH_DEFAULT_CASE()` exclusion from `build/Makefile.gcov` --- build/Makefile.gcov | 1 - 1 file changed, 1 deletion(-) diff --git a/build/Makefile.gcov b/build/Makefile.gcov index a1ae17a373ea..d24ada44b7a4 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -30,7 +30,6 @@ GCOVR_EXCLUDES = \ GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ - '\s*EMPTY_SWITCH_DEFAULT_CASE\(\)(;)?\s*' \ '\s*ZEND_UNREACHABLE\(\);\s*' lcov: lcov-html From 7d5847d4d3fe537c34d3142f6608548111c1f2aa Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 6 Apr 2026 20:52:20 +0800 Subject: [PATCH 071/300] ext/zip: Preinitialize arrays when size is known (#21572) --- ext/zip/php_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 805527b7d848..4749f91cc274 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -709,7 +709,7 @@ int php_zip_glob(zend_string *spattern, zend_long flags, zval *return_value) /* return -1; } - array_init(return_value); + array_init_size(return_value, (uint32_t)globbuf.gl_pathc); for (size_t n = 0; n < globbuf.gl_pathc; n++) { /* we need to do this every time since PHP_GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the @@ -788,7 +788,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val return -1; } - array_init(return_value); + array_init_size(return_value, (uint32_t)files_cnt); /* only the files, directories are ignored */ for (i = 0; i < files_cnt; i++) { From 02dab7f5efcf8a68fbfa991000c61f23b451f5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 15:04:58 +0200 Subject: [PATCH 072/300] Adjust `ZEND_UNREACHABLE()` exclusion in build/Makefile.gcov These patterns are implicitly anchored, thus we must manually handle the `default: ZEND_UNREACHABLE();` case. Also add a comment indicating that for future changes. --- build/Makefile.gcov | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Makefile.gcov b/build/Makefile.gcov index d24ada44b7a4..0ae5a44944d0 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -28,9 +28,10 @@ GCOVR_EXCLUDES = \ 'ext/pcre/pcre2lib/.*' \ 'ext/uri/uriparser/.*' +# These patterns have implicit ^/$ anchors. GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ - '\s*ZEND_UNREACHABLE\(\);\s*' + '\s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*' lcov: lcov-html From f4d9ed13685928628d0ebb06a1d1d02630299085 Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Mon, 6 Apr 2026 15:39:41 +0200 Subject: [PATCH 073/300] Use consistent type for h on call zend_hash_index_* (#19255) --- Zend/zend_execute_API.c | 2 +- Zend/zend_generators.c | 4 ++-- Zend/zend_inheritance.c | 4 ++-- Zend/zend_vm_execute.h | 6 ++--- Zend/zend_vm_execute.skl | 6 ++--- Zend/zend_weakrefs.c | 10 ++++----- ext/intl/msgformat/msgformat_helpers.cpp | 2 +- ext/soap/php_encoding.c | 8 +++---- sapi/phpdbg/phpdbg_bp.c | 6 ++--- sapi/phpdbg/phpdbg_prompt.c | 8 +++---- sapi/phpdbg/phpdbg_watch.c | 28 ++++++++++++------------ 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 35d9994d1cb3..1a79bc1ba996 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1206,7 +1206,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string * ALLOC_HASHTABLE(CG(unlinked_uses)); zend_hash_init(CG(unlinked_uses), 0, NULL, NULL, 0); } - zend_hash_index_add_empty_element(CG(unlinked_uses), (zend_long)(uintptr_t)ce); + zend_hash_index_add_empty_element(CG(unlinked_uses), (zend_ulong)(uintptr_t)ce); return ce; } return NULL; diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 3bec062e9ce1..14e981fb77fb 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -179,7 +179,7 @@ static void zend_generator_remove_child(zend_generator_node *node, zend_generato node->child.single = NULL; } else { HashTable *ht = node->child.ht; - zend_hash_index_del(ht, (zend_ulong) child); + zend_hash_index_del(ht, (zend_ulong)(uintptr_t) child); if (node->children == 2) { zend_generator *other_child; ZEND_HASH_FOREACH_PTR(ht, other_child) { @@ -558,7 +558,7 @@ static void zend_generator_add_child(zend_generator *generator, zend_generator * node->child.ht = ht; } - zend_hash_index_add_new_ptr(node->child.ht, (zend_ulong) child, child); + zend_hash_index_add_new_ptr(node->child.ht, (zend_ulong)(uintptr_t) child, child); } ++node->children; diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 149826c1e7a0..69f3be91fa06 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -3308,7 +3308,7 @@ static void check_unrecoverable_load_failure(const zend_class_entry *ce) { * a dependence on the inheritance hierarchy of this specific class. Instead we fall back to * a fatal error, as would happen if we did not allow exceptions in the first place. */ if (CG(unlinked_uses) - && zend_hash_index_del(CG(unlinked_uses), (zend_long)(uintptr_t)ce) == SUCCESS) { + && zend_hash_index_del(CG(unlinked_uses), (zend_ulong)(uintptr_t)ce) == SUCCESS) { zend_exception_uncaught_error( "During inheritance of %s with variance dependencies", ZSTR_VAL(ce->name)); } @@ -3603,7 +3603,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string } if (CG(unlinked_uses)) { - zend_hash_index_del(CG(unlinked_uses), (zend_long)(uintptr_t) ce); + zend_hash_index_del(CG(unlinked_uses), (zend_ulong)(uintptr_t) ce); } orig_linking_class = CG(current_linking_class); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 10fe98595d27..7359bcb793f2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -122749,7 +122749,7 @@ static void init_opcode_serialiser(void) Z_TYPE_INFO(tmp) = IS_LONG; for (i = 0; i < zend_handlers_count; i++) { Z_LVAL(tmp) = i; - zend_hash_index_add(zend_handlers_table, (zend_long)(uintptr_t)zend_opcode_handlers[i], &tmp); + zend_hash_index_add(zend_handlers_table, (zend_ulong)(uintptr_t)zend_opcode_handlers[i], &tmp); } } @@ -122760,7 +122760,7 @@ ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op) if (!zend_handlers_table) { init_opcode_serialiser(); } - zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + zv = zend_hash_index_find(zend_handlers_table, (zend_ulong)(uintptr_t)op->handler); ZEND_ASSERT(zv != NULL); op->handler = (zend_vm_opcode_handler_t)(uintptr_t)Z_LVAL_P(zv); } @@ -122778,7 +122778,7 @@ ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *o if (!zend_handlers_table) { init_opcode_serialiser(); } - zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + zv = zend_hash_index_find(zend_handlers_table, (zend_ulong)(uintptr_t)op->handler); ZEND_ASSERT(zv != NULL); return zend_opcode_handler_funcs[Z_LVAL_P(zv)]; #elif ZEND_VM_KIND == ZEND_VM_KIND_CALL diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 53b1ac6baf0a..3237a696a695 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -113,7 +113,7 @@ static void init_opcode_serialiser(void) Z_TYPE_INFO(tmp) = IS_LONG; for (i = 0; i < zend_handlers_count; i++) { Z_LVAL(tmp) = i; - zend_hash_index_add(zend_handlers_table, (zend_long)(uintptr_t)zend_opcode_handlers[i], &tmp); + zend_hash_index_add(zend_handlers_table, (zend_ulong)(uintptr_t)zend_opcode_handlers[i], &tmp); } } @@ -124,7 +124,7 @@ ZEND_API void ZEND_FASTCALL zend_serialize_opcode_handler(zend_op *op) if (!zend_handlers_table) { init_opcode_serialiser(); } - zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + zv = zend_hash_index_find(zend_handlers_table, (zend_ulong)(uintptr_t)op->handler); ZEND_ASSERT(zv != NULL); op->handler = (zend_vm_opcode_handler_t)(uintptr_t)Z_LVAL_P(zv); } @@ -142,7 +142,7 @@ ZEND_API const void* ZEND_FASTCALL zend_get_opcode_handler_func(const zend_op *o if (!zend_handlers_table) { init_opcode_serialiser(); } - zv = zend_hash_index_find(zend_handlers_table, (zend_long)(uintptr_t)op->handler); + zv = zend_hash_index_find(zend_handlers_table, (zend_ulong)(uintptr_t)op->handler); ZEND_ASSERT(zv != NULL); return zend_opcode_handler_funcs[Z_LVAL_P(zv)]; #elif ZEND_VM_KIND == ZEND_VM_KIND_CALL diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 8c1263885bf6..16b972eb0c20 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -109,15 +109,15 @@ static void zend_weakref_register(zend_object *object, void *payload) { void *tagged_ptr = Z_PTR_P(zv); if (ZEND_WEAKREF_GET_TAG(tagged_ptr) == ZEND_WEAKREF_TAG_HT) { HashTable *ht = ZEND_WEAKREF_GET_PTR(tagged_ptr); - zend_hash_index_add_new_ptr(ht, (zend_ulong) payload, payload); + zend_hash_index_add_new_ptr(ht, (zend_ulong)(uintptr_t) payload, payload); return; } /* Convert simple pointer to hashtable. */ HashTable *ht = emalloc(sizeof(HashTable)); zend_hash_init(ht, 0, NULL, NULL, 0); - zend_hash_index_add_new_ptr(ht, (zend_ulong) tagged_ptr, tagged_ptr); - zend_hash_index_add_new_ptr(ht, (zend_ulong) payload, payload); + zend_hash_index_add_new_ptr(ht, (zend_ulong)(uintptr_t) tagged_ptr, tagged_ptr); + zend_hash_index_add_new_ptr(ht, (zend_ulong)(uintptr_t) payload, payload); /* Replace the single WeakMap or WeakReference entry in EG(weakrefs) with a HashTable with 2 entries in place. */ ZVAL_PTR(zv, ZEND_WEAKREF_ENCODE(ht, ZEND_WEAKREF_TAG_HT)); } @@ -146,11 +146,11 @@ static void zend_weakref_unregister(zend_object *object, void *payload, bool wea HashTable *ht = ptr; #if ZEND_DEBUG - void *old_payload = zend_hash_index_find_ptr(ht, (zend_ulong) payload); + void *old_payload = zend_hash_index_find_ptr(ht, (zend_ulong)(uintptr_t) payload); ZEND_ASSERT(old_payload && "Weakref not registered?"); ZEND_ASSERT(old_payload == payload); #endif - zend_hash_index_del(ht, (zend_ulong) payload); + zend_hash_index_del(ht, (zend_ulong)(uintptr_t) payload); if (zend_hash_num_elements(ht) == 0) { GC_DEL_FLAGS(object, IS_OBJ_WEAKLY_REFERENCED); zend_hash_destroy(ht); diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 25e8dbf86968..c70463f95fba 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -411,7 +411,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index); key.append(temp, len); - storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, (zend_ulong)num_index); + storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, num_index); } else { //string; assumed to be in UTF-8 intl_stringFromChar(key, ZSTR_VAL(str_index), ZSTR_LEN(str_index), &err.code); diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 5e3675f875bd..0e9e77bef88e 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -278,7 +278,7 @@ static bool soap_check_zval_ref(zval *data, xmlNodePtr node) { if (Z_TYPE_P(data) == IS_OBJECT) { data = (zval*)Z_OBJ_P(data); } - if ((node_ptr = zend_hash_index_find_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)data)) != NULL) { + if ((node_ptr = zend_hash_index_find_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)(uintptr_t)data)) != NULL) { xmlAttrPtr attr = node_ptr->properties; char *id; smart_str prefix = {0}; @@ -324,7 +324,7 @@ static bool soap_check_zval_ref(zval *data, xmlNodePtr node) { smart_str_free(&prefix); return true; } else { - zend_hash_index_update_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)data, node); + zend_hash_index_update_ptr(SOAP_GLOBAL(ref_map), (zend_ulong)(uintptr_t)data, node); } } return false; @@ -335,7 +335,7 @@ static bool soap_check_xml_ref(zval *data, xmlNodePtr node) zval *data_ptr; if (SOAP_GLOBAL(ref_map)) { - if ((data_ptr = zend_hash_index_find(SOAP_GLOBAL(ref_map), (zend_ulong)node)) != NULL) { + if ((data_ptr = zend_hash_index_find(SOAP_GLOBAL(ref_map), (zend_ulong)(uintptr_t)node)) != NULL) { if (!Z_REFCOUNTED_P(data) || !Z_REFCOUNTED_P(data_ptr) || Z_COUNTED_P(data) != Z_COUNTED_P(data_ptr)) { @@ -351,7 +351,7 @@ static bool soap_check_xml_ref(zval *data, xmlNodePtr node) static void soap_add_xml_ref(zval *data, xmlNodePtr node) { if (SOAP_GLOBAL(ref_map)) { - zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)node, data); + zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)(uintptr_t)node, data); } } diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index ccbccc32f711..069111a1dd4d 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -805,7 +805,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len) PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* {{{ */ { - if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) { + if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline)) { phpdbg_breakline_t new_break; PHPDBG_G(flags) |= PHPDBG_HAS_OPLINE_BP; @@ -814,7 +814,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* { new_break.opline = (zend_ulong) opline; new_break.base = NULL; - zend_hash_index_update_mem(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline, &new_break, sizeof(phpdbg_breakline_t)); + zend_hash_index_update_mem(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline, &new_break, sizeof(phpdbg_breakline_t)); phpdbg_notice("Breakpoint #%d added at #"ZEND_ULONG_FMT, new_break.id, new_break.opline); PHPDBG_BREAK_MAPPING(new_break.id, &PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); @@ -1002,7 +1002,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt { phpdbg_breakline_t *brake; - if ((brake = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) && brake->base) { + if ((brake = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline)) && brake->base) { return (phpdbg_breakbase_t *)brake->base; } diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 07ac772b95d0..873fd652a32d 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -591,7 +591,7 @@ int phpdbg_skip_line_helper(void) /* {{{ */ { || opline->opcode == ZEND_YIELD || opline->opcode == ZEND_YIELD_FROM ) { - zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong) opline, (void *) opline); + zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) opline, (void *) opline); } } while (++opline < op_array->opcodes + op_array->last); @@ -633,7 +633,7 @@ static void phpdbg_seek_to_end(void) /* {{{ */ { case ZEND_GENERATOR_RETURN: case ZEND_YIELD: case ZEND_YIELD_FROM: - zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong) opline, (void *) opline); + zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) opline, (void *) opline); } } while (++opline < op_array->opcodes + op_array->last); } @@ -647,7 +647,7 @@ PHPDBG_COMMAND(finish) /* {{{ */ } phpdbg_seek_to_end(); - if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong) phpdbg_user_execute_data(EG(current_execute_data))->opline)) { + if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) phpdbg_user_execute_data(EG(current_execute_data))->opline)) { zend_hash_clean(&PHPDBG_G(seek)); } else { PHPDBG_G(flags) |= PHPDBG_IN_FINISH; @@ -664,7 +664,7 @@ PHPDBG_COMMAND(leave) /* {{{ */ } phpdbg_seek_to_end(); - if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong) phpdbg_user_execute_data(EG(current_execute_data))->opline)) { + if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) phpdbg_user_execute_data(EG(current_execute_data))->opline)) { zend_hash_clean(&PHPDBG_G(seek)); phpdbg_notice("Already at the end of the function"); return SUCCESS; diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c index 5657649efdb6..03804eeaa252 100644 --- a/sapi/phpdbg/phpdbg_watch.c +++ b/sapi/phpdbg/phpdbg_watch.c @@ -301,7 +301,7 @@ zend_result phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context) { /* re-enable writing */ mprotect(page, phpdbg_pagesize, PROT_READ | PROT_WRITE); - zend_hash_index_add_empty_element(PHPDBG_G(watchlist_mem), (zend_ulong) page); + zend_hash_index_add_empty_element(PHPDBG_G(watchlist_mem), (zend_ulong)(uintptr_t) page); return SUCCESS; } @@ -317,7 +317,7 @@ void *phpdbg_watchpoint_userfaultfd_thread(void *phpdbg_globals_ptr) { struct uffd_msg fault_msg = {0}; while (read(globals->watch_userfaultfd, &fault_msg, sizeof(fault_msg)) == sizeof(fault_msg)) { void *page = phpdbg_get_page_boundary((char *)(uintptr_t) fault_msg.arg.pagefault.address); - zend_hash_index_add_empty_element(globals->watchlist_mem, (zend_ulong) page); + zend_hash_index_add_empty_element(globals->watchlist_mem, (zend_ulong)(uintptr_t) page); struct uffdio_writeprotect unprotect = { .mode = 0, .range = { @@ -394,8 +394,8 @@ void phpdbg_watch_backup_data(phpdbg_watchpoint_t *watch) { /* watch collisions are responsible for having only one watcher on a given refcounted/refval and having a mapping back to the parent zvals */ void phpdbg_delete_watch_collision(phpdbg_watchpoint_t *watch) { phpdbg_watch_collision *coll; - if ((coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) { - zend_hash_index_del(&coll->parents, (zend_ulong) watch); + if ((coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) { + zend_hash_index_del(&coll->parents, (zend_ulong)(uintptr_t) watch); if (zend_hash_num_elements(&coll->parents) == 0) { phpdbg_remove_watchpoint_btree(&coll->ref); phpdbg_deactivate_watchpoint(&coll->ref); @@ -411,7 +411,7 @@ void phpdbg_delete_watch_collision(phpdbg_watchpoint_t *watch) { } } - zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref); + zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref); zend_hash_destroy(&coll->parents); efree(coll); } @@ -433,7 +433,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) { watch->ref = Z_COUNTED_P(watch->addr.zv); - if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) { + if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) { coll = emalloc(sizeof(*coll)); coll->ref.type = WATCH_ON_REFCOUNTED; phpdbg_set_addr_watchpoint(Z_COUNTED_P(watch->addr.zv), sizeof(uint32_t), &coll->ref); @@ -462,9 +462,9 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) { } zend_hash_init(&coll->parents, 8, NULL, NULL, 0); - zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll); + zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref, coll); } - zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch); + zend_hash_index_add_ptr(&coll->parents, (zend_ulong)(uintptr_t) watch, watch); } else if (Z_TYPE_P(watch->addr.zv) == IS_INDIRECT) { if ((zend_refcounted *) Z_INDIRECT_P(watch->addr.zv) == watch->ref) { return; @@ -476,7 +476,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) { watch->ref = (zend_refcounted *) Z_INDIRECT_P(watch->addr.zv); - if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) { + if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) { coll = emalloc(sizeof(*coll)); phpdbg_set_zval_watchpoint(Z_INDIRECT_P(watch->addr.zv), &coll->ref); coll->ref.coll = coll; @@ -486,9 +486,9 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) { phpdbg_watch_backup_data(&coll->ref); zend_hash_init(&coll->parents, 8, NULL, NULL, 0); - zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll); + zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref, coll); } - zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch); + zend_hash_index_add_ptr(&coll->parents, (zend_ulong)(uintptr_t) watch, watch); } else if (watch->ref) { phpdbg_delete_watch_collision(watch); watch->ref = NULL; @@ -712,7 +712,7 @@ void phpdbg_queue_element_for_recreation(phpdbg_watch_element *element) { if (!element->parent) { /* HERE BE DRAGONS; i.e. we assume HashTable is directly allocated via emalloc() ... (which *should be* the case for every user-accessible array and symbol tables) */ - zend_hash_index_add_empty_element(&PHPDBG_G(watch_free), (zend_ulong) element->parent_container); + zend_hash_index_add_empty_element(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) element->parent_container); } } @@ -775,7 +775,7 @@ void phpdbg_dequeue_elements_for_recreation(void) { ZEND_HASH_MAP_FOREACH_PTR(&PHPDBG_G(watch_recreation), element) { ZEND_ASSERT(element->flags & (PHPDBG_WATCH_IMPLICIT | PHPDBG_WATCH_RECURSIVE_ROOT | PHPDBG_WATCH_SIMPLE)); - if (element->parent || zend_hash_index_find(&PHPDBG_G(watch_free), (zend_ulong) element->parent_container)) { + if (element->parent || zend_hash_index_find(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) element->parent_container)) { zval _zv, *zv = &_zv; if (element->parent) { ZEND_ASSERT(element->parent->watch->type == WATCH_ON_ZVAL || element->parent->watch->type == WATCH_ON_BUCKET); @@ -1233,7 +1233,7 @@ void phpdbg_watch_efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { } } - zend_hash_index_del(&PHPDBG_G(watch_free), (zend_ulong) ptr); + zend_hash_index_del(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) ptr); } if (PHPDBG_G(original_free_function)) { From 19eabc609f2a417b96075076a2bcc481dac0e747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 15:53:15 +0200 Subject: [PATCH 074/300] zend_compile: Use `return true` / `return false` for functions returning `bool` (#21649) Changes done with Coccinelle: @r1 exists@ identifier fn; typedef bool; symbol false; symbol true; @@ bool fn ( ... ) { ... return ( - 0 + false | - 1 + true ) ; } --- Zend/zend_compile.c | 110 ++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index cebcec3c5b39..766721486120 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -188,10 +188,10 @@ static bool zend_get_unqualified_name(const zend_string *name, const char **resu if (ns_separator != NULL) { *result = ns_separator + 1; *result_len = ZSTR_VAL(name) + ZSTR_LEN(name) - *result; - return 1; + return true; } - return 0; + return false; } /* }}} */ @@ -234,11 +234,11 @@ static bool zend_is_reserved_class_name(const zend_string *name) /* {{{ */ if (uqname_len == reserved->len && zend_binary_strcasecmp(uqname, uqname_len, reserved->name, reserved->len) == 0 ) { - return 1; + return true; } } - return 0; + return false; } /* }}} */ @@ -1665,13 +1665,13 @@ static bool array_is_const(const zend_array *array) static bool can_ct_eval_const(const zend_constant *c) { if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) { - return 0; + return false; } if ((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) && !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) && !((ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE) && (CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) { - return 1; + return true; } if (Z_TYPE(c->value) < IS_ARRAY && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION)) { @@ -1681,7 +1681,7 @@ static bool can_ct_eval_const(const zend_constant *c) { && array_is_const(Z_ARR(c->value))) { return 1; } - return 0; + return false; } static bool zend_try_ct_eval_const(zval *zv, zend_string *name, bool is_fully_qualified) /* {{{ */ @@ -1698,14 +1698,14 @@ static bool zend_try_ct_eval_const(zval *zv, zend_string *name, bool is_fully_qu zend_constant *c; if ((c = zend_get_special_const(lookup_name, lookup_len))) { ZVAL_COPY_VALUE(zv, &c->value); - return 1; + return true; } c = zend_hash_find_ptr(EG(zend_constants), name); if (c && can_ct_eval_const(c)) { ZVAL_COPY_OR_DUP(zv, &c->value); - return 1; + return true; } - return 0; + return false; } /* }}} */ @@ -1713,12 +1713,12 @@ static inline bool zend_is_scope_known(void) /* {{{ */ { if (!CG(active_op_array)) { /* This can only happen when evaluating a default value string. */ - return 0; + return false; } if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { /* Closures can be rebound to a different scope */ - return 0; + return false; } if (!CG(active_class_entry)) { @@ -1735,10 +1735,10 @@ static inline bool zend_is_scope_known(void) /* {{{ */ static inline bool class_name_refers_to_active_ce(const zend_string *class_name, uint32_t fetch_type) /* {{{ */ { if (!CG(active_class_entry)) { - return 0; + return false; } if (fetch_type == ZEND_FETCH_CLASS_SELF && zend_is_scope_known()) { - return 1; + return true; } return fetch_type == ZEND_FETCH_CLASS_DEFAULT && zend_string_equals_ci(class_name, CG(active_class_entry)->name); @@ -1803,7 +1803,7 @@ static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *c const zval *class_name; if (class_ast->kind != ZEND_AST_ZVAL) { - return 0; + return false; } class_name = zend_ast_get_zval(class_ast); @@ -1819,21 +1819,21 @@ static bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *c case ZEND_FETCH_CLASS_SELF: if (CG(active_class_entry) && zend_is_scope_known()) { ZVAL_STR_COPY(zv, CG(active_class_entry)->name); - return 1; + return true; } - return 0; + return false; case ZEND_FETCH_CLASS_PARENT: if (CG(active_class_entry) && CG(active_class_entry)->parent_name && zend_is_scope_known()) { ZVAL_STR_COPY(zv, CG(active_class_entry)->parent_name); - return 1; + return true; } - return 0; + return false; case ZEND_FETCH_CLASS_STATIC: - return 0; + return false; case ZEND_FETCH_CLASS_DEFAULT: ZVAL_STR(zv, zend_resolve_class_name_ast(class_ast)); - return 1; + return true; default: ZEND_UNREACHABLE(); } } @@ -1896,11 +1896,11 @@ static bool zend_try_ct_eval_class_const(zval *zv, zend_string *class_name, zend } if (CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION) { - return 0; + return false; } if (!cc || !zend_verify_ct_const_access(cc, CG(active_class_entry))) { - return 0; + return false; } c = &cc->value; @@ -1914,7 +1914,7 @@ static bool zend_try_ct_eval_class_const(zval *zv, zend_string *class_name, zend return 1; } - return 0; + return false; } /* }}} */ @@ -2513,9 +2513,9 @@ static bool zend_ast_kind_is_short_circuited(zend_ast_kind ast_kind) case ZEND_AST_METHOD_CALL: case ZEND_AST_NULLSAFE_METHOD_CALL: case ZEND_AST_STATIC_CALL: - return 1; + return true; default: - return 0; + return false; } } @@ -2530,9 +2530,9 @@ static bool zend_ast_is_short_circuited(const zend_ast *ast) return zend_ast_is_short_circuited(ast->child[0]); case ZEND_AST_NULLSAFE_PROP: case ZEND_AST_NULLSAFE_METHOD_CALL: - return 1; + return true; default: - return 0; + return false; } } @@ -2802,7 +2802,7 @@ static inline bool zend_can_write_to_variable(const zend_ast *ast) /* {{{ */ static inline bool zend_is_const_default_class_ref(zend_ast *name_ast) /* {{{ */ { if (name_ast->kind != ZEND_AST_ZVAL) { - return 0; + return false; } return ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type_ast(name_ast); @@ -2994,7 +2994,7 @@ static bool is_this_fetch(const zend_ast *ast) /* {{{ */ return Z_TYPE_P(name) == IS_STRING && zend_string_equals(Z_STR_P(name), ZSTR_KNOWN(ZEND_STR_THIS)); } - return 0; + return false; } /* }}} */ @@ -3005,7 +3005,7 @@ static bool is_globals_fetch(const zend_ast *ast) return Z_TYPE_P(name) == IS_STRING && zend_string_equals_literal(Z_STR_P(name), "GLOBALS"); } - return 0; + return false; } static bool is_global_var_fetch(const zend_ast *ast) @@ -3461,7 +3461,7 @@ static void zend_ensure_writable_variable(const zend_ast *ast) /* {{{ */ static bool zend_is_assign_to_self(const zend_ast *var_ast, const zend_ast *expr_ast) /* {{{ */ { if (expr_ast->kind != ZEND_AST_VAR || expr_ast->child[0]->kind != ZEND_AST_ZVAL) { - return 0; + return false; } while (zend_is_variable(var_ast) && var_ast->kind != ZEND_AST_VAR) { @@ -3469,7 +3469,7 @@ static bool zend_is_assign_to_self(const zend_ast *var_ast, const zend_ast *expr } if (var_ast->kind != ZEND_AST_VAR || var_ast->child[0]->kind != ZEND_AST_ZVAL) { - return 0; + return false; } { @@ -4132,10 +4132,10 @@ static inline bool zend_args_contain_unpack_or_named(const zend_ast_list *args) for (i = 0; i < args->children; ++i) { const zend_ast *arg = args->child[i]; if (arg->kind == ZEND_AST_UNPACK || arg->kind == ZEND_AST_NAMED_ARG) { - return 1; + return true; } } - return 0; + return false; } /* }}} */ @@ -5890,7 +5890,7 @@ static bool zend_handle_loops_and_finally_ex(zend_long depth, znode *return_valu zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); if (!loop_var) { - return 1; + return true; } base = zend_stack_base(&CG(loop_var_stack)); for (; loop_var >= base; loop_var--) { @@ -5945,7 +5945,7 @@ static bool zend_has_finally_ex(zend_long depth) /* {{{ */ zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack)); if (!loop_var) { - return 0; + return false; } base = zend_stack_base(&CG(loop_var_stack)); for (; loop_var >= base; loop_var--) { @@ -5961,7 +5961,7 @@ static bool zend_has_finally_ex(zend_long depth) /* {{{ */ depth--; } } - return 0; + return false; } /* }}} */ @@ -6563,7 +6563,7 @@ static uint8_t determine_switch_jumptable_type(const zend_ast_list *cases) { static bool should_use_jumptable(const zend_ast_list *cases, uint8_t jumptable_type) { if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) { - return 0; + return false; } /* Thresholds are chosen based on when the average switch time for equidistributed @@ -6746,17 +6746,17 @@ static bool can_match_use_jumptable(const zend_ast_list *arms) { zend_eval_const_expr(cond_ast); if ((*cond_ast)->kind != ZEND_AST_ZVAL) { - return 0; + return false; } const zval *cond_zv = zend_ast_get_zval(*cond_ast); if (Z_TYPE_P(cond_zv) != IS_LONG && Z_TYPE_P(cond_zv) != IS_STRING) { - return 0; + return false; } } } - return 1; + return true; } static bool zend_is_pipe_optimizable_callable_name(zend_ast *ast) @@ -7204,7 +7204,7 @@ bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ if (zend_string_equals_literal_ci(name, "encoding")) { if (value_ast->kind != ZEND_AST_ZVAL) { zend_throw_exception(zend_ce_compile_error, "Encoding must be a literal", 0); - return 0; + return false; } if (CG(multibyte)) { @@ -7238,7 +7238,7 @@ bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ } } - return 1; + return true; } /* }}} */ @@ -7776,14 +7776,14 @@ static bool zend_is_valid_default_value(zend_type type, zval *value) { ZEND_ASSERT(ZEND_TYPE_IS_SET(type)); if (ZEND_TYPE_CONTAINS_CODE(type, Z_TYPE_P(value))) { - return 1; + return true; } if ((ZEND_TYPE_FULL_MASK(type) & MAY_BE_DOUBLE) && Z_TYPE_P(value) == IS_LONG) { /* Integers are allowed as initializers for floating-point values. */ convert_to_double(value); - return 1; + return true; } - return 0; + return false; } static void zend_compile_attributes( @@ -10222,7 +10222,7 @@ static bool zend_try_ct_eval_magic_const(zval *zv, const zend_ast *ast) /* {{{ * default: ZEND_UNREACHABLE(); } - return 1; + return true; } /* }}} */ @@ -10326,12 +10326,12 @@ ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, co static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zval *op1, zval *op2) /* {{{ */ { if (zend_binary_op_produces_error(opcode, op1, op2)) { - return 0; + return false; } const binary_op_type fn = get_binary_op(opcode); fn(result, op1, op2); - return 1; + return true; } /* }}} */ @@ -10356,12 +10356,12 @@ ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op) static inline bool zend_try_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op) /* {{{ */ { if (zend_unary_op_produces_error(opcode, op)) { - return 0; + return false; } const unary_op_type fn = get_unary_op(opcode); fn(result, op); - return 1; + return true; } /* }}} */ @@ -10425,12 +10425,12 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ } if (!is_constant) { - return 0; + return false; } if (!list->children) { ZVAL_EMPTY_ARRAY(result); - return 1; + return true; } array_init_size(result, list->children); @@ -10503,7 +10503,7 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */ } } - return 1; + return true; } /* }}} */ From 40804a64db9fc8094e88f335fd7054876d6debf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 6 Apr 2026 17:06:59 +0200 Subject: [PATCH 075/300] tree-wide: Add explicit braces around `FOREACH` body (#21651) Places searched with: .*FOREACH.*\(.+\)\s*(?!\{)\n and then manually adjusted. --- Zend/zend_compile.c | 20 ++++++++++---------- ext/standard/basic_functions.c | 4 ++-- sapi/apache2handler/php_functions.c | 20 ++++++++++---------- sapi/apache2handler/sapi_apache2.c | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 766721486120..3af6e235b9a3 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7472,15 +7472,15 @@ static void zend_are_intersection_types_redundant(const zend_type left_type, con unsigned int sum = 0; const zend_type *outer_type; - ZEND_TYPE_LIST_FOREACH(smaller_type_list, outer_type) + ZEND_TYPE_LIST_FOREACH(smaller_type_list, outer_type) { const zend_type *inner_type; - ZEND_TYPE_LIST_FOREACH(larger_type_list, inner_type) + ZEND_TYPE_LIST_FOREACH(larger_type_list, inner_type) { if (zend_string_equals_ci(ZEND_TYPE_NAME(*inner_type), ZEND_TYPE_NAME(*outer_type))) { sum++; break; } - ZEND_TYPE_LIST_FOREACH_END(); - ZEND_TYPE_LIST_FOREACH_END(); + } ZEND_TYPE_LIST_FOREACH_END(); + } ZEND_TYPE_LIST_FOREACH_END(); if (sum == smaller_type_list->num_types) { zend_string *smaller_type_str; @@ -7508,14 +7508,14 @@ static void zend_is_intersection_type_redundant_by_single_type(const zend_type i ZEND_ASSERT(!ZEND_TYPE_IS_INTERSECTION(single_type)); const zend_type *single_intersection_type = NULL; - ZEND_TYPE_FOREACH(intersection_type, single_intersection_type) + ZEND_TYPE_FOREACH(intersection_type, single_intersection_type) { if (zend_string_equals_ci(ZEND_TYPE_NAME(*single_intersection_type), ZEND_TYPE_NAME(single_type))) { zend_string *single_type_str = zend_type_to_string(single_type); zend_string *complete_type = zend_type_to_string(intersection_type); zend_error_noreturn(E_COMPILE_ERROR, "Type %s is redundant as it is more restrictive than type %s", ZSTR_VAL(complete_type), ZSTR_VAL(single_type_str)); } - ZEND_TYPE_FOREACH_END(); + } ZEND_TYPE_FOREACH_END(); } /* Used by both intersection and union types prior to transforming the type list to a full zend_type */ @@ -8465,7 +8465,7 @@ static void compile_implicit_lexical_binds( op_array->static_variables = zend_new_array(8); } - ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name) + ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name) { zval *value = zend_hash_add( op_array->static_variables, var_name, &EG(uninitialized_zval)); uint32_t offset = (uint32_t)((char*)value - (char*)op_array->static_variables->arData); @@ -8474,7 +8474,7 @@ static void compile_implicit_lexical_binds( opline->op2_type = IS_CV; opline->op2.var = lookup_cv(var_name); opline->extended_value = offset | ZEND_BIND_IMPLICIT; - ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); } static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ @@ -8514,11 +8514,11 @@ static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */ static void zend_compile_implicit_closure_uses(const closure_info *info) { zend_string *var_name; - ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name) + ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name) { zval zv; ZVAL_NULL(&zv); zend_compile_static_var_common(var_name, &zv, ZEND_BIND_IMPLICIT); - ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); } static void add_stringable_interface(zend_class_entry *ce) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 04505db15833..a611433af537 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1283,9 +1283,9 @@ static void add_config_entries(HashTable *hash, zval *return_value) /* {{{ */ zend_string *key; zval *zv; - ZEND_HASH_FOREACH_KEY_VAL(hash, h, key, zv) + ZEND_HASH_FOREACH_KEY_VAL(hash, h, key, zv) { add_config_entry(h, key, zv, return_value); - ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); } /* }}} */ diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index c2b15af86a60..942772958419 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -179,10 +179,10 @@ PHP_FUNCTION(apache_request_headers) ctx = SG(server_context); arr = apr_table_elts(ctx->r->headers_in); - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) val = ""; add_assoc_string(return_value, key, val); - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); } /* }}} */ @@ -200,10 +200,10 @@ PHP_FUNCTION(apache_response_headers) ctx = SG(server_context); arr = apr_table_elts(ctx->r->headers_out); - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) val = ""; add_assoc_string(return_value, key, val); - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); } /* }}} */ @@ -411,12 +411,12 @@ PHP_MINFO_FUNCTION(apache) SECTION("Apache Environment"); php_info_print_table_start(); php_info_print_table_header(2, "Variable", "Value"); - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) { val = ""; } php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); php_info_print_table_end(); @@ -426,21 +426,21 @@ PHP_MINFO_FUNCTION(apache) php_info_print_table_row(2, "HTTP Request", ((php_struct *) SG(server_context))->r->the_request); arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_in); - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) { val = ""; } php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); php_info_print_table_colspan_header(2, "HTTP Response Headers"); arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_out); - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) { val = ""; } php_info_print_table_row(2, key, val); - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); php_info_print_table_end(); } diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 2387d24741a4..36862c9e41fc 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -269,14 +269,14 @@ php_apache_sapi_register_variables(zval *track_vars_array) char *key, *val; size_t new_val_len; - APR_ARRAY_FOREACH_OPEN(arr, key, val) + APR_ARRAY_FOREACH_OPEN(arr, key, val) { if (!val) { val = ""; } if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len)) { php_register_variable_safe(key, val, new_val_len, track_vars_array); } - APR_ARRAY_FOREACH_CLOSE() + } APR_ARRAY_FOREACH_CLOSE(); if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len)) { php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array); From 5279185a598dbb9e7acb4cc830be5a15c95ba93f Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 6 Apr 2026 18:24:55 +0200 Subject: [PATCH 076/300] Fix internal return type check with gcov (GH-21653) ZEND_ASSERT() is a no-op with gcov. Move zend_verify_internal_return_type() out of ZEND_ASSERT(). --- Zend/zend_execute_API.c | 6 +- Zend/zend_vm_def.h | 24 +++++--- Zend/zend_vm_execute.h | 132 ++++++++++++++++++++++++++-------------- 3 files changed, 108 insertions(+), 54 deletions(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1a79bc1ba996..66849c09cacc 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1025,8 +1025,10 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, fci->retval)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, fci->retval); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(fci->retval) : !Z_ISREF_P(fci->retval)); } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9cffc64a0ff5..9d0f0f398b54 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4154,8 +4154,10 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -4283,8 +4285,10 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER)) if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -4412,8 +4416,10 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -9119,8 +9125,10 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY, SPEC(OBSERVER)) if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7359bcb793f2..2bfb82f421eb 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1322,8 +1322,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1388,8 +1390,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1454,8 +1458,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1636,8 +1642,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1750,8 +1758,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1863,8 +1873,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -1995,8 +2007,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -2126,8 +2140,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -2254,8 +2270,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -3639,8 +3657,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALL_TRAMPOLI if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -3783,8 +3803,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALL_TRAMPOLI if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54046,8 +54068,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_ICA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54112,8 +54136,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_ICA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54178,8 +54204,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_IC if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54360,8 +54388,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54474,8 +54504,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54587,8 +54619,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FC if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54719,8 +54753,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54850,8 +54886,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -54978,8 +55016,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FC if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -56247,8 +56287,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALL_TRAMPOLINE_SP if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); @@ -56391,8 +56433,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALL_TRAMPOLINE_SP if (should_throw) { zend_internal_call_arginfo_violation(call->func); } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); + if (call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + bool result = zend_verify_internal_return_type(call->func, ret); + ZEND_ASSERT(result); + } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); From 25687441a3eea61e703810853462aebec12a9ca7 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Tue, 7 Apr 2026 01:21:50 +0800 Subject: [PATCH 077/300] ext/standard: add test triggering deprecation when reading $http_response_header via a dynamic fetch And thus remove the TODO message in zend_compile.c. --- Zend/zend_compile.c | 1 - ...response_header_deprecated_dynamic_fetch.phpt | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/http/http_response_header_deprecated_dynamic_fetch.phpt diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3af6e235b9a3..176dc40b05f1 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2971,7 +2971,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, const zend_ast *ast opline->extended_value = ZEND_FETCH_GLOBAL; } else { - // TODO: Have a test case for this? if (name_node.op_type == IS_CONST && type == BP_VAR_R && zend_string_equals_literal(Z_STR(name_node.u.constant), "http_response_header")) { diff --git a/ext/standard/tests/http/http_response_header_deprecated_dynamic_fetch.phpt b/ext/standard/tests/http/http_response_header_deprecated_dynamic_fetch.phpt new file mode 100644 index 000000000000..e6b90355a4c3 --- /dev/null +++ b/ext/standard/tests/http/http_response_header_deprecated_dynamic_fetch.phpt @@ -0,0 +1,16 @@ +--TEST-- +$http_response_header dynamic fetch should warn +--FILE-- + +--EXPECTF-- +Deprecated: The predefined locally scoped $http_response_header variable is deprecated, call http_get_last_response_headers() instead in %s on line %d +string(2) "OK" From 43a4f91c52ad01a1aa3a5ecbf89af12a42cbb377 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 14 Mar 2026 11:30:59 +0100 Subject: [PATCH 078/300] Fix concurrent iteration and deletion issues in SplObjectStorage Closes GH-21443. --- NEWS | 2 + ext/spl/spl_observer.c | 27 +++++++++-- .../SplObjectStorage/concurrent_deletion.phpt | 46 +++++++++++++++++++ .../concurrent_deletion_addall.phpt | 43 +++++++++++++++++ .../concurrent_deletion_removeexcept.phpt | 35 ++++++++++++++ 5 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt create mode 100644 ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt create mode 100644 ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt diff --git a/NEWS b/NEWS index 7e1e34b8ae0e..e05216ed331a 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ PHP NEWS - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) + . Fix concurrent iteration and deletion issues in SplObjectStorage. + (ndossche) - Streams: . Fixed bug GH-21468 (Segfault in file_get_contents w/ a https URL diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 622686dbd78a..e653d1173b24 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -240,11 +240,25 @@ static zend_result spl_object_storage_detach(spl_SplObjectStorage *intern, zend_ return ret; } /* }}}*/ +/* TODO: make this an official Zend API? */ +#define SPL_SAFE_HASH_FOREACH_PTR(_ht, _ptr) do { \ + const HashTable *__ht = (_ht); \ + zval *_z = __ht->arPacked; \ + for (uint32_t _idx = 0; _idx < __ht->nNumUsed; _idx++, _z = ZEND_HASH_ELEMENT(__ht, _idx)) { \ + if (UNEXPECTED(Z_ISUNDEF_P(_z))) continue; \ + _ptr = Z_PTR_P(_z); + static void spl_object_storage_addall(spl_SplObjectStorage *intern, spl_SplObjectStorage *other) { /* {{{ */ spl_SplObjectStorageElement *element; - ZEND_HASH_FOREACH_PTR(&other->storage, element) { - spl_object_storage_attach(intern, element->obj, &element->inf); + SPL_SAFE_HASH_FOREACH_PTR(&other->storage, element) { + zval zv; + zend_object *obj = element->obj; + GC_ADDREF(obj); + ZVAL_COPY(&zv, &element->inf); + spl_object_storage_attach(intern, obj, &zv); + zval_ptr_dtor(&zv); + OBJ_RELEASE(obj); } ZEND_HASH_FOREACH_END(); intern->index = 0; @@ -626,10 +640,13 @@ PHP_METHOD(SplObjectStorage, removeAllExcept) other = Z_SPLOBJSTORAGE_P(obj); - ZEND_HASH_FOREACH_PTR(&intern->storage, element) { - if (!spl_object_storage_contains(other, element->obj)) { - spl_object_storage_detach(intern, element->obj); + SPL_SAFE_HASH_FOREACH_PTR(&intern->storage, element) { + zend_object *elem_obj = element->obj; + GC_ADDREF(elem_obj); + if (!spl_object_storage_contains(other, elem_obj)) { + spl_object_storage_detach(intern, elem_obj); } + OBJ_RELEASE(elem_obj); } ZEND_HASH_FOREACH_END(); zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt new file mode 100644 index 000000000000..ae063f1c9b03 --- /dev/null +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt @@ -0,0 +1,46 @@ +--TEST-- +SplObjectStorage: Concurrent deletion during iteration +--CREDITS-- +cnitlrt +--FILE-- +removeAllExcept($other)); + +unset($victim, $other); +$victim = new SplObjectStorage(); +$other = new EvilStorage(); + +for ($i = 0; $i < 1024; $i++) { + $o = new stdClass(); + $victim[$o] = null; + $other[$o] = null; +} + +var_dump($other->addAll($victim)); +?> +--EXPECTF-- +int(%d) +int(1024) diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt new file mode 100644 index 000000000000..af3fc381b562 --- /dev/null +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt @@ -0,0 +1,43 @@ +--TEST-- +SplObjectStorage: Concurrent deletion during addAll +--CREDITS-- +cnitlrt +--FILE-- +addAll($storage); + +var_dump($evil, $storage); + +?> +--EXPECTF-- +object(EvilStorage)#%d (1) { + ["storage":"SplObjectStorage":private]=> + array(1) { + [0]=> + array(2) { + ["obj"]=> + object(stdClass)#%d (0) { + } + ["inf"]=> + string(3) "foo" + } + } +} +object(SplObjectStorage)#%d (1) { + ["storage":"SplObjectStorage":private]=> + array(0) { + } +} diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt new file mode 100644 index 000000000000..b2ed211b304a --- /dev/null +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt @@ -0,0 +1,35 @@ +--TEST-- +SplObjectStorage: Concurrent deletion during removeAllExcept +--CREDITS-- +cnitlrt +--FILE-- +removeAllExcept($evil); + +var_dump($evil, $storage); + +?> +--EXPECTF-- +object(EvilStorage)#%d (1) { + ["storage":"SplObjectStorage":private]=> + array(0) { + } +} +object(SplObjectStorage)#%d (1) { + ["storage":"SplObjectStorage":private]=> + array(0) { + } +} From cbe0144ab49e542ca25677f66c71e4e1b9b23273 Mon Sep 17 00:00:00 2001 From: Pratik Bhujel Date: Tue, 7 Apr 2026 00:19:25 +0545 Subject: [PATCH 079/300] ext/snmp: promote invalid-input warnings to ValueError (#21319) This now also specifies which argument is causing the error. --- ext/snmp/snmp.c | 94 ++++++++++--------- ext/snmp/tests/gh16959.phpt | 4 +- ext/snmp/tests/ipv6.phpt | 10 +- .../tests/snmp-object-setSecurity_error.phpt | 10 +- ext/snmp/tests/snmp2_get.phpt | 2 +- ext/snmp/tests/snmp2_set.phpt | 30 +++--- ext/snmp/tests/snmpset.phpt | 30 +++--- 7 files changed, 99 insertions(+), 81 deletions(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 1daa51851fb6..6c219d376e53 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -655,7 +655,8 @@ static void php_free_objid_query(struct objid_query *objid_query, HashTable* oid */ static bool php_snmp_parse_oid( zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht, - zend_string *type_str, HashTable *type_ht, zend_string *value_str, HashTable *value_ht + zend_string *type_str, HashTable *type_ht, zend_string *value_str, HashTable *value_ht, + uint32_t oid_argument_offset, uint32_t type_argument_offset, uint32_t value_argument_offset ) { char *pptr; uint32_t idx_type = 0, idx_value = 0; @@ -682,7 +683,7 @@ static bool php_snmp_parse_oid( ZEND_ASSERT(type_str && value_str); if (ZSTR_LEN(type_str) != 1) { - zend_value_error("Type must be a single character"); + zend_argument_value_error(type_argument_offset, "must be a single character"); efree(objid_query->vars); return false; } @@ -693,7 +694,7 @@ static bool php_snmp_parse_oid( objid_query->count++; } else if (oid_ht) { /* we got objid array */ if (zend_hash_num_elements(oid_ht) == 0) { - zend_value_error("Array of object IDs must not be empty"); + zend_argument_value_error(oid_argument_offset, "must not be empty when passed as an array"); return false; } objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht), 0); @@ -738,14 +739,14 @@ static bool php_snmp_parse_oid( char ptype = *ZSTR_VAL(type); zend_string_release(type); if (len != 1) { - zend_value_error("Type must be a single character"); + zend_argument_value_error(type_argument_offset, "must be a single character"); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } objid_query->vars[objid_query->count].type = ptype; idx_type++; } else { - php_error_docref(NULL, E_WARNING, "'%s': no type set", ZSTR_VAL(tmp)); + zend_argument_value_error(type_argument_offset, "must contain a type for object ID '%s'", ZSTR_VAL(tmp)); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } @@ -780,7 +781,7 @@ static bool php_snmp_parse_oid( objid_query->vars[objid_query->count].value = ZSTR_VAL(tmp); idx_value++; } else { - php_error_docref(NULL, E_WARNING, "'%s': no value set", ZSTR_VAL(tmp)); + zend_argument_value_error(value_argument_offset, "must contain a value for object ID '%s'", ZSTR_VAL(tmp)); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } @@ -827,7 +828,7 @@ static bool php_snmp_parse_oid( /* {{{ snmp_session_init allocates memory for session and session->peername, caller should free it manually using snmp_session_free() and efree() */ -static bool snmp_session_init(php_snmp_session **session_p, int version, zend_string *hostname, zend_string *community, zend_long timeout, zend_long retries, int timeout_argument_offset) +static bool snmp_session_init(php_snmp_session **session_p, int version, zend_string *hostname, zend_string *community, zend_long timeout, zend_long retries, int hostname_argument_offset, int timeout_argument_offset) { php_snmp_session *session; char *pptr, *host_ptr; @@ -841,23 +842,13 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st ZEND_ASSERT(hostname != NULL); ZEND_ASSERT(community != NULL); - if (zend_str_has_nul_byte(hostname)) { - zend_argument_value_error(2, "must not contain any null bytes"); - return false; - } - if (ZSTR_LEN(hostname) >= MAX_NAME_LEN) { - zend_argument_value_error(2, "length must be lower than %d", MAX_NAME_LEN); - return false; - } - - if (zend_str_has_nul_byte(community)) { - zend_argument_value_error(3, "must not contain any null bytes"); + zend_argument_value_error(hostname_argument_offset, "length must be lower than %d", MAX_NAME_LEN); return false; } if (ZSTR_LEN(community) == 0) { - zend_argument_must_not_be_empty_error(3); + zend_argument_must_not_be_empty_error(hostname_argument_offset + 1); return false; } @@ -899,14 +890,14 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st char *pport = pptr + 2; tmp_port = atoi(pport); if (tmp_port < 0 || tmp_port > USHRT_MAX) { - zend_argument_value_error(2, "remote port must be between 0 and %u", USHRT_MAX); + zend_argument_value_error(hostname_argument_offset, "remote port must be between 0 and %u", USHRT_MAX); return false; } remote_port = (unsigned short)tmp_port; } *pptr = '\0'; } else { - php_error_docref(NULL, E_WARNING, "Malformed IPv6 address, closing square bracket missing"); + zend_argument_value_error(hostname_argument_offset, "has a malformed IPv6 address, closing square bracket missing"); return false; } } else { /* IPv4 address */ @@ -914,7 +905,7 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st char *pport = pptr + 1; tmp_port = atoi(pport); if (tmp_port < 0 || tmp_port > USHRT_MAX) { - zend_argument_value_error(2, "remote port must be between 0 and %u", USHRT_MAX); + zend_argument_value_error(hostname_argument_offset, "remote port must be between 0 and %u", USHRT_MAX); return false; } remote_port = (unsigned short)tmp_port; @@ -1123,14 +1114,13 @@ static ZEND_ATTRIBUTE_NONNULL bool snmp_session_gen_sec_key(struct snmp_session /* }}} */ /* {{{ Set context Engine Id in the snmpv3 session */ -static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string * contextEngineID) +static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string * contextEngineID, uint32_t contextEngineID_argument_offset) { size_t ebuf_len = 32, eout_len = 0; uint8_t *ebuf = (uint8_t *) emalloc(ebuf_len); if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, ZSTR_VAL(contextEngineID))) { - // TODO Promote to Error? - php_error_docref(NULL, E_WARNING, "Bad engine ID value '%s'", ZSTR_VAL(contextEngineID)); + zend_argument_value_error(contextEngineID_argument_offset, "must be a valid context engine ID"); efree(ebuf); return false; } @@ -1145,11 +1135,14 @@ static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string } /* }}} */ -/* {{{ Set all snmpv3-related security options */ +/* {{{ Set all snmpv3-related security options + * auth_protocol_argnum and contextEngineID_argument_offset are the userland + * argument numbers used for error reporting. + */ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp_session *session, zend_string *sec_level, zend_string *auth_protocol, zend_string *auth_passphrase, zend_string *priv_protocol, zend_string *priv_passphrase, zend_string *contextName, zend_string *contextEngineID, - uint32_t auth_protocol_argnum) + uint32_t auth_protocol_argnum, uint32_t contextEngineID_argument_offset) { /* Setting the security level. */ @@ -1215,7 +1208,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp } /* Setting contextEngineIS if specified */ - if (contextEngineID && ZSTR_LEN(contextEngineID) && !snmp_session_set_contextEngineID(session, contextEngineID)) { + if (contextEngineID && ZSTR_LEN(contextEngineID) && !snmp_session_set_contextEngineID(session, contextEngineID, contextEngineID_argument_offset)) { /* Warning message sent already, just bail out */ return false; } @@ -1243,6 +1236,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) php_snmp_session *session; int session_less_mode = (getThis() == NULL); int timeout_argument_offset = -1; + uint32_t oid_argument_offset = 1, type_argument_offset = 0, value_argument_offset = 0; php_snmp_object *snmp_object; php_snmp_object glob_snmp_object; @@ -1255,8 +1249,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) if (version == SNMP_VERSION_3) { if (st & SNMP_CMD_SET) { ZEND_PARSE_PARAMETERS_START(10, 12) - Z_PARAM_STR(a1) - Z_PARAM_STR(a2) + Z_PARAM_PATH_STR(a1) + Z_PARAM_PATH_STR(a2) Z_PARAM_STR(a3) Z_PARAM_STR(a4) Z_PARAM_STR(a5) @@ -1271,14 +1265,17 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) ZEND_PARSE_PARAMETERS_END(); timeout_argument_offset = 10; + oid_argument_offset = 8; + type_argument_offset = 9; + value_argument_offset = 10; } else { /* SNMP_CMD_GET * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ ZEND_PARSE_PARAMETERS_START(8, 10) - Z_PARAM_STR(a1) - Z_PARAM_STR(a2) + Z_PARAM_PATH_STR(a1) + Z_PARAM_PATH_STR(a2) Z_PARAM_STR(a3) Z_PARAM_STR(a4) Z_PARAM_STR(a5) @@ -1291,12 +1288,13 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) ZEND_PARSE_PARAMETERS_END(); timeout_argument_offset = 9; + oid_argument_offset = 8; } } else { if (st & SNMP_CMD_SET) { ZEND_PARSE_PARAMETERS_START(5, 7) - Z_PARAM_STR(a1) - Z_PARAM_STR(a2) + Z_PARAM_PATH_STR(a1) + Z_PARAM_PATH_STR(a2) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_ARRAY_HT_OR_STR(type_ht, type_str) Z_PARAM_ARRAY_HT_OR_STR(value_ht, value_str) @@ -1306,14 +1304,17 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) ZEND_PARSE_PARAMETERS_END(); timeout_argument_offset = 6; + oid_argument_offset = 3; + type_argument_offset = 4; + value_argument_offset = 5; } else { /* SNMP_CMD_GET * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ ZEND_PARSE_PARAMETERS_START(3, 5) - Z_PARAM_STR(a1) - Z_PARAM_STR(a2) + Z_PARAM_PATH_STR(a1) + Z_PARAM_PATH_STR(a2) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_OPTIONAL Z_PARAM_LONG(timeout) @@ -1321,6 +1322,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) ZEND_PARSE_PARAMETERS_END(); timeout_argument_offset = 4; + oid_argument_offset = 3; } } } else { @@ -1330,6 +1332,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) Z_PARAM_ARRAY_HT_OR_STR(type_ht, type_str) Z_PARAM_ARRAY_HT_OR_STR(value_ht, value_str) ZEND_PARSE_PARAMETERS_END(); + type_argument_offset = 2; + value_argument_offset = 3; } else if (st & SNMP_CMD_WALK) { ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) @@ -1359,20 +1363,21 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) } } - if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str, value_ht)) { + if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str, value_ht, + oid_argument_offset, type_argument_offset, value_argument_offset)) { RETURN_FALSE; } if (session_less_mode) { - if (!snmp_session_init(&session, version, a1, a2, timeout, retries, timeout_argument_offset)) { + if (!snmp_session_init(&session, version, a1, a2, timeout, retries, 1, timeout_argument_offset)) { php_free_objid_query(&objid_query, oid_ht, value_ht, st); snmp_session_free(&session); RETURN_FALSE; } - if (version == SNMP_VERSION_3 && !snmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL, 4)) { + if (version == SNMP_VERSION_3 && !snmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL, 4, 0)) { php_free_objid_query(&objid_query, oid_ht, value_ht, st); snmp_session_free(&session); - /* Warning message sent already, just bail out */ + /* An error has already been emitted, just bail out. */ RETURN_FALSE; } } else { @@ -1645,7 +1650,7 @@ PHP_METHOD(SNMP, __construct) snmp_object = Z_SNMP_P(object); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "lSS|ll", &version, &a1, &a2, &timeout, &retries) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lPP|ll", &version, &a1, &a2, &timeout, &retries) == FAILURE) { RETURN_THROWS(); } @@ -1664,7 +1669,7 @@ PHP_METHOD(SNMP, __construct) snmp_session_free(&(snmp_object->session)); } - if (!snmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries, 4)) { + if (!snmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries, 2, 4)) { return; } snmp_object->max_oids = 0; @@ -1738,8 +1743,9 @@ PHP_METHOD(SNMP, setSecurity) RETURN_THROWS(); } - if (!snmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7, 2)) { - /* Warning message sent already, just bail out */ + /* authProtocol is argument #2 and contextEngineId is argument #7. */ + if (!snmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7, 2, 7)) { + /* An error has already been emitted, just bail out. */ RETURN_FALSE; } RETURN_TRUE; diff --git a/ext/snmp/tests/gh16959.phpt b/ext/snmp/tests/gh16959.phpt index cabe0eb84b6c..f76fa61e1f73 100644 --- a/ext/snmp/tests/gh16959.phpt +++ b/ext/snmp/tests/gh16959.phpt @@ -66,5 +66,5 @@ array(4) { } Object of class stdClass could not be converted to string Object of class stdClass could not be converted to string -Type must be a single character -Type must be a single character +snmp2_set(): Argument #4 ($type) must be a single character +snmp2_set(): Argument #4 ($type) must be a single character diff --git a/ext/snmp/tests/ipv6.phpt b/ext/snmp/tests/ipv6.phpt index c305fb15d4b8..93274fd7054f 100644 --- a/ext/snmp/tests/ipv6.phpt +++ b/ext/snmp/tests/ipv6.phpt @@ -22,10 +22,12 @@ snmp_set_quick_print(false); snmp_set_valueretrieval(SNMP_VALUE_PLAIN); var_dump(snmpget($hostname6_port, $community, '.1.3.6.1.2.1.1.1.0')); -var_dump(snmpget('[dead:beef::', $community, '.1.3.6.1.2.1.1.1.0')); +try { + var_dump(snmpget('[dead:beef::', $community, '.1.3.6.1.2.1.1.1.0')); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> --EXPECTF-- string(%d) "%s" - -Warning: snmpget(): Malformed IPv6 address, closing square bracket missing in %s on line %d -bool(false) +snmpget(): Argument #1 ($hostname) has a malformed IPv6 address, closing square bracket missing diff --git a/ext/snmp/tests/snmp-object-setSecurity_error.phpt b/ext/snmp/tests/snmp-object-setSecurity_error.phpt index cf4f92883777..576ec8380804 100644 --- a/ext/snmp/tests/snmp-object-setSecurity_error.phpt +++ b/ext/snmp/tests/snmp-object-setSecurity_error.phpt @@ -53,7 +53,11 @@ try { var_dump($session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', '')); var_dump($session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', 'ty')); -var_dump($session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', 'test12345', 'context', 'dsa')); +try { + var_dump($session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', 'test12345', 'context', 'dsa')); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump($session->close()); @@ -76,7 +80,5 @@ bool(false) Warning: SNMP::setSecurity(): Error generating a key for privacy pass phrase 'ty': Generic error (The supplied password length is too short.) in %s on line %d bool(false) - -Warning: SNMP::setSecurity(): Bad engine ID value 'dsa' in %s on line %d -bool(false) +SNMP::setSecurity(): Argument #7 ($contextEngineId) must be a valid context engine ID bool(true) diff --git a/ext/snmp/tests/snmp2_get.phpt b/ext/snmp/tests/snmp2_get.phpt index 30500eb5ca9b..e2cd1ef1b459 100644 --- a/ext/snmp/tests/snmp2_get.phpt +++ b/ext/snmp/tests/snmp2_get.phpt @@ -54,7 +54,7 @@ var_dump(snmp2_get($hostname, $community, array('.1.3.6.1.2.1.1.1.0', '.1.3.6.1. --EXPECTF-- Checking error handling Empty OID array -Array of object IDs must not be empty +snmp2_get(): Argument #3 ($object_id) must not be empty when passed as an array Checking working Single OID string(%d) "%s" diff --git a/ext/snmp/tests/snmp2_set.phpt b/ext/snmp/tests/snmp2_set.phpt index 11b1d94419f5..da94fe21f498 100644 --- a/ext/snmp/tests/snmp2_set.phpt +++ b/ext/snmp/tests/snmp2_set.phpt @@ -128,14 +128,22 @@ var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $ol var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); echo "Multiple OID, single type in array, multiple value\n"; -$z = snmp2_set($hostname, $communityWrite, array($oid1, $oid2), array('s'), array($newvalue1, $newvalue2), $timeout, $retries); -var_dump($z); +try { + $z = snmp2_set($hostname, $communityWrite, array($oid1, $oid2), array('s'), array($newvalue1, $newvalue2), $timeout, $retries); + var_dump($z); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $oldvalue1)); var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); echo "Multiple OID & type, single value in array\n"; -$z = snmp2_set($hostname, $communityWrite, array($oid1, $oid2), array('s', 's'), array($newvalue1), $timeout, $retries); -var_dump($z); +try { + $z = snmp2_set($hostname, $communityWrite, array($oid1, $oid2), array('s', 's'), array($newvalue1), $timeout, $retries); + var_dump($z); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $oldvalue1)); var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); @@ -167,7 +175,7 @@ var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $ol --EXPECTF-- Check error handing No type & no value (timeout & retries instead) -Type must be a single character +snmp2_set(): Argument #4 ($type) must be a single character No value (timeout instead), retries instead of timeout Warning: snmp2_set(): Could not add variable: OID='%s' type='q' value='%i': Bad variable type ("q") in %s on line %d @@ -216,23 +224,19 @@ Value must be of type string when object ID is a string bool(true) bool(true) Multiple OID, 1st wrong type -Type must be a single character +snmp2_set(): Argument #4 ($type) must be a single character bool(true) bool(true) Multiple OID, 2nd wrong type -Type must be a single character +snmp2_set(): Argument #4 ($type) must be a single character bool(true) bool(true) Multiple OID, single type in array, multiple value - -Warning: snmp2_set(): '%s': no type set in %s on line %d -bool(false) +snmp2_set(): Argument #4 ($type) must contain a type for object ID 'SNMPv2-MIB::sysLocation.0' bool(true) bool(true) Multiple OID & type, single value in array - -Warning: snmp2_set(): '%s': no value set in %s on line %d -bool(false) +snmp2_set(): Argument #5 ($value) must contain a value for object ID 'SNMPv2-MIB::sysLocation.0' bool(true) bool(true) Multiple OID, 1st bogus, single type, multiple value diff --git a/ext/snmp/tests/snmpset.phpt b/ext/snmp/tests/snmpset.phpt index ca935cecf5ec..a4f89e78da93 100644 --- a/ext/snmp/tests/snmpset.phpt +++ b/ext/snmp/tests/snmpset.phpt @@ -122,14 +122,22 @@ var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $ol var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); echo "Multiple OID, single type in array, multiple value\n"; -$z = snmpset($hostname, $communityWrite, array($oid1, $oid2), array('s'), array($newvalue1, $newvalue2), $timeout, $retries); -var_dump($z); +try { + $z = snmpset($hostname, $communityWrite, array($oid1, $oid2), array('s'), array($newvalue1, $newvalue2), $timeout, $retries); + var_dump($z); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $oldvalue1)); var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); echo "Multiple OID & type, single value in array\n"; -$z = snmpset($hostname, $communityWrite, array($oid1, $oid2), array('s', 's'), array($newvalue1), $timeout, $retries); -var_dump($z); +try { + $z = snmpset($hostname, $communityWrite, array($oid1, $oid2), array('s', 's'), array($newvalue1), $timeout, $retries); + var_dump($z); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump((snmpget($hostname, $communityWrite, $oid1, $timeout, $retries) === $oldvalue1)); var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $oldvalue2)); @@ -161,7 +169,7 @@ var_dump((snmpget($hostname, $communityWrite, $oid2, $timeout, $retries) === $ol --EXPECTF-- Check error handing No type & no value (timeout & retries instead) -Type must be a single character +snmpset(): Argument #4 ($type) must be a single character No value (timeout instead), retries instead of timeout Warning: snmpset(): Could not add variable: OID='%s' type='q' value='%i': Bad variable type ("q") in %s on line %d @@ -207,23 +215,19 @@ Value must be of type string when object ID is a string bool(true) bool(true) Multiple OID, 1st wrong type -Type must be a single character +snmpset(): Argument #4 ($type) must be a single character bool(true) bool(true) Multiple OID, 2nd wrong type -Type must be a single character +snmpset(): Argument #4 ($type) must be a single character bool(true) bool(true) Multiple OID, single type in array, multiple value - -Warning: snmpset(): '%s': no type set in %s on line %d -bool(false) +snmpset(): Argument #4 ($type) must contain a type for object ID 'SNMPv2-MIB::sysLocation.0' bool(true) bool(true) Multiple OID & type, single value in array - -Warning: snmpset(): '%s': no value set in %s on line %d -bool(false) +snmpset(): Argument #5 ($value) must contain a value for object ID 'SNMPv2-MIB::sysLocation.0' bool(true) bool(true) Multiple OID, 1st bogus, single type, multiple value From 4843327a90b01ed3aef3b9c30b4088f38ea780e4 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 6 Apr 2026 20:53:19 +0100 Subject: [PATCH 080/300] ext/standard: pathinfo() check flags argument validity. close GH-17859 --- NEWS | 2 + UPGRADING | 4 ++ ext/standard/string.c | 10 +++ .../tests/file/pathinfo_variation3.phpt | 52 ++++++++++----- ext/standard/tests/strings/pathinfo.phpt | 66 ++++++++++++++----- 5 files changed, 102 insertions(+), 32 deletions(-) diff --git a/NEWS b/NEWS index f22f5b47017e..d688ef5aad39 100644 --- a/NEWS +++ b/NEWS @@ -146,6 +146,8 @@ PHP NEWS (ndossche) . Add array size maximum to array_diff(). (ndossche) . Add enum SortDirection. (timwolla) + . pathinfo() raises a ValueError with an invalid $flags argument. + (David Carlier) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index 18f34eca1984..a97ad00061a2 100644 --- a/UPGRADING +++ b/UPGRADING @@ -131,6 +131,10 @@ PHP 8.6 UPGRADE NOTES when not null, and on failure, gives the error code (one of the EAI_* constants). +- Standard: + . pathinfo() now raises a ValueError when an invalid $flag argument + value is passed. + - Zip: . ZipArchive::extractTo now raises a TypeError for the files argument if one or more of the entries is not diff --git a/ext/standard/string.c b/ext/standard/string.c index e479a9e7612e..d7f76af633cf 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1591,6 +1591,16 @@ PHP_FUNCTION(pathinfo) Z_PARAM_LONG(opt) ZEND_PARSE_PARAMETERS_END(); + if (opt < PHP_PATHINFO_DIRNAME || opt > PHP_PATHINFO_ALL) { + zend_argument_value_error(2, "must be one of the PATHINFO_* constants"); + RETURN_THROWS(); + } + + if (opt < PHP_PATHINFO_ALL && (opt & (opt - 1))) { + zend_argument_value_error(2, "must be only one of the PATHINFO_* constants"); + RETURN_THROWS(); + } + have_basename = (opt & PHP_PATHINFO_BASENAME); array_init(&tmp); diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt index aa1494b57997..86f88677d813 100644 --- a/ext/standard/tests/file/pathinfo_variation3.phpt +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -15,15 +15,37 @@ var_dump(pathinfo($testfile, PATHINFO_BASENAME)); var_dump(pathinfo($testfile, PATHINFO_FILENAME)); var_dump(pathinfo($testfile, PATHINFO_EXTENSION)); var_dump(pathinfo($testfile, PATHINFO_DIRNAME)); -var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME)); -var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME)); -var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME)); -var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_BASENAME)); -var_dump(pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_DIRNAME)); -var_dump(pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME)); -var_dump(pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION)); -var_dump(pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME)); +try { + pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_DIRNAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} ?> --EXPECTF-- @@ -62,11 +84,9 @@ string(6) "inet.h" string(4) "inet" string(1) "h" string(17) "/usr/include/arpa" -string(17) "/usr/include/arpa" -string(6) "inet.h" -string(1) "h" -string(6) "inet.h" -string(17) "/usr/include/arpa" -string(6) "inet.h" -string(17) "/usr/include/arpa" -string(17) "/usr/include/arpa" +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt index 2bbea73588cb..1ff42a66121c 100644 --- a/ext/standard/tests/strings/pathinfo.phpt +++ b/ext/standard/tests/strings/pathinfo.phpt @@ -14,14 +14,48 @@ var_dump(pathinfo(__FILE__, PATHINFO_BASENAME)); var_dump(pathinfo(__FILE__, PATHINFO_FILENAME)); var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION)); var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME)); -var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME)); -var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME)); -var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME)); -var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_BASENAME)); -var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_DIRNAME)); -var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME)); -var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION)); -var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME)); + +try { + pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_DIRNAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} + +try { + pathinfo(__FILE__, PATHINFO_DIRNAME-1); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} +try { + pathinfo(__FILE__, PATHINFO_ALL+1); +} catch (\ValueError $e) { + echo $e->getMessage(), PHP_EOL; +} echo "Done\n"; ?> @@ -94,12 +128,12 @@ string(12) "pathinfo.php" string(8) "pathinfo" string(3) "php" string(%d) "%s%estrings" -string(%d) "%s%estrings" -string(12) "pathinfo.php" -string(3) "php" -string(12) "pathinfo.php" -string(%d) "%s%estrings" -string(12) "pathinfo.php" -string(%d) "%s%estrings" -string(%d) "%s%estrings" +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants +pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants Done From 50ef20a4f03ca43a33265044f7b537ab4d07151a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 6 Apr 2026 15:14:09 +0200 Subject: [PATCH 081/300] Enable gcovr --exclude-unreachable-branches and --exclude-throw-branches flags These are mostly useful for C++ code, i.e. ext-intl. See: https://gcovr.com/en/stable/faq.html#why-does-c-code-have-so-many-uncovered-branches Closes GH-21655 --- build/Makefile.gcov | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Makefile.gcov b/build/Makefile.gcov index 0ae5a44944d0..13985a93a101 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -56,14 +56,14 @@ gcovr-html: @echo "Generating gcovr HTML" @rm -rf gcovr_html/ @mkdir gcovr_html - gcovr -sr . -o gcovr_html/index.html --html --html-details \ + gcovr -sr . -o gcovr_html/index.html --html --html-details --exclude-unreachable-branches --exclude-throw-branches \ $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml - gcovr -sr . -o gcovr.xml --xml \ + gcovr -sr . -o gcovr.xml --xml --exclude-unreachable-branches --exclude-throw-branches \ $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) From c445f1b93d33454ba23c534aab548118624086e8 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sun, 24 Nov 2024 21:15:44 +0700 Subject: [PATCH 082/300] Labeler: Add labeler glob patterns for CI We have a "Category: CI" label in GH issues and PRs, but there is no labeler rule to automatically mark PRs as such. This adds a labeler rule to automatically add the "Category: CI" label if the PR changes _any_ file in: - '.circleci/*' - '.github/*' If all the changes are within these files, it will _not_ be labelled. - '.github/ISSUE_TEMPLATE/*' - '.github/lsan-suppressions.txt' Closes GH-16915. --- .github/labeler.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index b9f0f36e147d..310d82b00001 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -20,6 +20,14 @@ - scripts/**/* - win32/build/**/* +"Category: CI": + - changed-files: + - any-glob-to-any-file: + - .circleci/** + - .github/** + - '!.github/lsan-suppressions.txt' + - '!.github/ISSUE_TEMPLATE/**' + "Extension: bcmath": - changed-files: - any-glob-to-any-file: From 6d62d87ab90537c38897315c9abe74a791e309d2 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Tue, 7 Apr 2026 03:09:25 +0530 Subject: [PATCH 083/300] Labeler: Fix indentation in labeler.yml Fixes mixed indentation from the previous PR GH-16915. --- .github/labeler.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 310d82b00001..01d5aadf2c0f 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -23,10 +23,10 @@ "Category: CI": - changed-files: - any-glob-to-any-file: - - .circleci/** - - .github/** - - '!.github/lsan-suppressions.txt' - - '!.github/ISSUE_TEMPLATE/**' + - .circleci/** + - .github/** + - '!.github/lsan-suppressions.txt' + - '!.github/ISSUE_TEMPLATE/**' "Extension: bcmath": - changed-files: From 90747c2098cbc8e160237c3782c6b635e6985b8f Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Tue, 7 Apr 2026 14:11:30 +0530 Subject: [PATCH 084/300] Labeler: Fix glob patterns with negative patterns Second follow-up to GH-16915, because it caused all files changed other than the excluded directories in the `.github` directory to be labelled as `Category: CI`. --- .github/labeler.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 01d5aadf2c0f..e9731352c8cc 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -23,10 +23,14 @@ "Category: CI": - changed-files: - any-glob-to-any-file: - - .circleci/** - - .github/** - - '!.github/lsan-suppressions.txt' - - '!.github/ISSUE_TEMPLATE/**' + - .circleci/* + - .github/actions/**/* + - .github/scripts/**/* + - .github/workflows/* + - .github/CODEOWNERS + - .github/labeler.yml + - .github/setup_hmailserver.php + - .github/matrix.php "Extension: bcmath": - changed-files: From cbd71cb84d566de796450226f74d07d2a61788b9 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Tue, 7 Apr 2026 08:31:06 -0700 Subject: [PATCH 085/300] ext/standard: "double" is not deprecated for `settype()` (#20694) Remove incorrect inline comment that using "double" as the type is deprecated; this comment was added in 929ae94c64c71fcbed8e4cecdb6d09398d61e079 when support for "float" was included, but the use of "double" was never actually deprecated. [skip ci] --- ext/standard/type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/type.c b/ext/standard/type.c index a228e899046f..e23e4620da23 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -105,7 +105,7 @@ PHP_FUNCTION(settype) convert_to_long(ptr); } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_FLOAT))) { convert_to_double(ptr); - } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) { /* deprecated */ + } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_DOUBLE))) { convert_to_double(ptr); } else if (zend_string_equals_ci(type, ZSTR_KNOWN(ZEND_STR_STRING))) { convert_to_string(ptr); From 3dab58591220c6b4da6c10755f47f11bde74a2b4 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 7 Apr 2026 11:50:39 -0400 Subject: [PATCH 086/300] Fix GH-16811: Crash in zend_test observer on runtime observe_function_names change (GH-21635) OnUpdateCommaList called zend_observer_remove/add_begin_handler without checking whether observer data was initialized. This null-dereferenced when the function had never been called (no runtime cache), and hit ZEND_UNREACHABLE() when observe_all had already installed the same handler. Guard both the remove and add blocks with runtime cache checks. Remove existing handlers before re-adding to prevent slot overflow from duplicates. Fixes GH-16811 --- ext/zend_test/observer.c | 9 +++++++-- ext/zend_test/tests/gh16811.phpt | 18 ++++++++++++++++++ ext/zend_test/tests/gh16811_observe_all.phpt | 17 +++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 ext/zend_test/tests/gh16811.phpt create mode 100644 ext/zend_test/tests/gh16811_observe_all.phpt diff --git a/ext/zend_test/observer.c b/ext/zend_test/observer.c index 85c7d82da0e8..e348987359b9 100644 --- a/ext/zend_test/observer.c +++ b/ext/zend_test/observer.c @@ -334,7 +334,8 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList) } if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) { ZEND_HASH_FOREACH_STR_KEY(*p, funcname) { - if ((func = zend_hash_find_ptr(EG(function_table), funcname))) { + if ((func = zend_hash_find_ptr(EG(function_table), funcname)) + && RUN_TIME_CACHE(&func->common)) { void *old_handler; zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler); zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler); @@ -357,7 +358,11 @@ static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList) zend_string_release(str); if (stage != PHP_INI_STAGE_STARTUP && stage != PHP_INI_STAGE_ACTIVATE && stage != PHP_INI_STAGE_DEACTIVATE && stage != PHP_INI_STAGE_SHUTDOWN) { ZEND_HASH_FOREACH_STR_KEY(*p, funcname) { - if ((func = zend_hash_find_ptr(EG(function_table), funcname))) { + if ((func = zend_hash_find_ptr(EG(function_table), funcname)) + && RUN_TIME_CACHE(&func->common) && *ZEND_OBSERVER_DATA(func)) { + void *old_handler; + zend_observer_remove_begin_handler(func, observer_begin, (zend_observer_fcall_begin_handler *)&old_handler); + zend_observer_remove_end_handler(func, observer_end, (zend_observer_fcall_end_handler *)&old_handler); zend_observer_add_begin_handler(func, observer_begin); zend_observer_add_end_handler(func, observer_end); } diff --git a/ext/zend_test/tests/gh16811.phpt b/ext/zend_test/tests/gh16811.phpt new file mode 100644 index 000000000000..1b2b8ece9aa1 --- /dev/null +++ b/ext/zend_test/tests/gh16811.phpt @@ -0,0 +1,18 @@ +--TEST-- +GH-16811 (Segmentation fault in zend observer) +--EXTENSIONS-- +zend_test +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.show_output=1 +zend_test.observer.observe_function_names=a,d +--FILE-- + +--EXPECTF-- + + + +string(3) "a,d" diff --git a/ext/zend_test/tests/gh16811_observe_all.phpt b/ext/zend_test/tests/gh16811_observe_all.phpt new file mode 100644 index 000000000000..466aa0c6d4a4 --- /dev/null +++ b/ext/zend_test/tests/gh16811_observe_all.phpt @@ -0,0 +1,17 @@ +--TEST-- +GH-16811 (Assertion failure adding duplicate observer handler) +--EXTENSIONS-- +zend_test +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.observe_all=1 +zend_test.observer.show_output=0 +--FILE-- + +--EXPECT-- +Done From 5bdfb1c5e64269db8ffa8962d2c9fc0c0bc4ed60 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 7 Apr 2026 18:07:42 +0200 Subject: [PATCH 087/300] [skip ci] Move gcovr options to config file (GH-21663) Having these in the make file is very annoying, because it requires rebuilding from scratch and rerunning tests just to see if some flag is effective. --- build/Makefile.gcov | 25 ++----------------------- gcovr.cfg | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 gcovr.cfg diff --git a/build/Makefile.gcov b/build/Makefile.gcov index 13985a93a101..5097bfaaa277 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -16,23 +16,6 @@ LCOV_EXCLUDES = \ '$(top_srcdir)/parse_date.re' \ '$(top_srcdir)/parse_iso_intervals.re' -GCOVR_EXCLUDES = \ - 'ext/bcmath/libbcmath/.*' \ - 'ext/date/lib/.*' \ - 'ext/fileinfo/libmagic/.*' \ - 'ext/gd/libgd/.*' \ - 'ext/hash/sha3/.*' \ - 'ext/lexbor/lexbor/.*' \ - 'ext/mbstring/libmbfl/.*' \ - 'ext/opcache/jit/ir/.*' \ - 'ext/pcre/pcre2lib/.*' \ - 'ext/uri/uriparser/.*' - -# These patterns have implicit ^/$ anchors. -GCOVR_EXCLUDE_LINES_BY_PATTERNS = \ - '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \ - '\s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*' - lcov: lcov-html php_lcov.info: @@ -56,15 +39,11 @@ gcovr-html: @echo "Generating gcovr HTML" @rm -rf gcovr_html/ @mkdir gcovr_html - gcovr -sr . -o gcovr_html/index.html --html --html-details --exclude-unreachable-branches --exclude-throw-branches \ - $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ - $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) + gcovr -r . -o gcovr_html/index.html --html --html-details gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml - gcovr -sr . -o gcovr.xml --xml --exclude-unreachable-branches --exclude-throw-branches \ - $(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \ - $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) + gcovr -r . -o gcovr.xml --xml .PHONY: gcovr-html lcov-html php_lcov.info diff --git a/gcovr.cfg b/gcovr.cfg new file mode 100644 index 000000000000..a8267cd6e000 --- /dev/null +++ b/gcovr.cfg @@ -0,0 +1,19 @@ +print-summary = yes + +exclude-throw-branches = yes +exclude-unreachable-branches = yes + +exclude = ext/bcmath/libbcmath/.* +exclude = ext/date/lib/.* +exclude = ext/fileinfo/libmagic/.* +exclude = ext/gd/libgd/.* +exclude = ext/hash/sha3/.* +exclude = ext/lexbor/lexbor/.* +exclude = ext/mbstring/libmbfl/.* +exclude = ext/opcache/jit/ir/.* +exclude = ext/pcre/pcre2lib/.* +exclude = ext/uri/uriparser/.* + +# These patterns have implicit ^/$ anchors. +exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).* +exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s* From 0c6fc66848a9810fdbef3749cb4b3ed1d79685fd Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 7 Apr 2026 12:34:21 +0530 Subject: [PATCH 088/300] curl: add support for brotli and zstd on Windows Fixes GH-21599 Fixes winlibs/cURL#26 Closes GH-21662 --- NEWS | 2 ++ ext/curl/config.w32 | 5 ++++- ext/curl/tests/check_win_config.phpt | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 21a709ab4212..aa91603d8723 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.31 +- Curl: + . Add support for brotli and zstd on Windows. (Shivam Mathur) 18 Dec 2025, PHP 8.2.30 diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 index f722c5faca5e..eda7604bc118 100644 --- a/ext/curl/config.w32 +++ b/ext/curl/config.w32 @@ -24,7 +24,10 @@ if (PHP_CURL != "no") { (ver_num <= parseInt("0x073b00") || ver_num > parseInt("0x073b00") && CHECK_LIB("normaliz.lib", "curl", PHP_CURL) && CHECK_LIB("libssh2.lib", "curl", PHP_CURL) && - CHECK_LIB("nghttp2.lib", "curl", PHP_CURL)) + CHECK_LIB("nghttp2.lib", "curl", PHP_CURL) && + CHECK_LIB("brotlidec.lib", "curl", PHP_CURL) && + CHECK_LIB("brotlicommon.lib", "curl", PHP_CURL) && + CHECK_LIB("libzstd.lib", "curl", PHP_CURL)) ) { EXTENSION("curl", "interface.c multi.c share.c curl_file.c"); AC_DEFINE('HAVE_CURL', 1, 'Have cURL library'); diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index fc29e3728197..56ebe36312ec 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -47,11 +47,11 @@ UNIX_SOCKETS => %r(Yes|No)%r PSL => No HTTPS_PROXY => Yes MULTI_SSL => %s -BROTLI => %s +BROTLI => Yes ALTSVC => Yes HTTP3 => No UNICODE => No -ZSTD => No +ZSTD => Yes HSTS => Yes GSASL => No Protocols => dict, file, ftp, ftps, gopher, %r(gophers, )?%rhttp, https, imap, imaps, ldap, ldaps, %r(mqtt, )?%rpop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp%r(, ws)?(, wss)?%r From f05b1563babd74fb1e1ee48a8e413190df4b1b0a Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Wed, 8 Apr 2026 02:33:51 +0800 Subject: [PATCH 089/300] [skip ci] Fix various typos in ext/xml{reader,writer} (GH-21660) --- ext/xmlreader/php_xmlreader.c | 2 +- ext/xmlreader/tests/expand.phpt | 2 +- ext/xmlwriter/php_xmlwriter.c | 2 +- ext/xmlwriter/tests/bug39504.phpt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 27de3a290285..da337fd6dabb 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -755,7 +755,7 @@ PHP_METHOD(XMLReader, moveToAttributeNo) } /* }}} */ -/* {{{ Positions reader at attribute spcified by name and namespaceURI. +/* {{{ Positions reader at attribute specified by name and namespaceURI. Returns TRUE on success and FALSE on failure */ PHP_METHOD(XMLReader, moveToAttributeNs) { diff --git a/ext/xmlreader/tests/expand.phpt b/ext/xmlreader/tests/expand.phpt index 9d4545d16897..5244121f6502 100644 --- a/ext/xmlreader/tests/expand.phpt +++ b/ext/xmlreader/tests/expand.phpt @@ -1,5 +1,5 @@ --TEST-- -XMLReader: Expand into existing DOM documet +XMLReader: Expand into existing DOM document --EXTENSIONS-- xmlreader dom diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 0c65305c6827..8d343aadf263 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -432,7 +432,7 @@ PHP_FUNCTION(xmlwriter_write_element) } /* }}} */ -/* {{{ Write full namesapced element tag - returns FALSE on error */ +/* {{{ Write full namespaced element tag - returns FALSE on error */ PHP_FUNCTION(xmlwriter_write_element_ns) { xmlTextWriterPtr ptr; diff --git a/ext/xmlwriter/tests/bug39504.phpt b/ext/xmlwriter/tests/bug39504.phpt index 0cb509d37dd5..eafcd375da93 100644 --- a/ext/xmlwriter/tests/bug39504.phpt +++ b/ext/xmlwriter/tests/bug39504.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity) +Bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not entity) --EXTENSIONS-- xmlwriter --FILE-- From 1f4b1699b72834d2420933ff28f4cb1b03c28e82 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 7 Apr 2026 20:16:38 +0100 Subject: [PATCH 090/300] Fix GH-21664: iconv_mime_decode/iconv_mime_encode bailout corrupts EG(bailout). close GH-21666 --- NEWS | 2 ++ ext/iconv/iconv.c | 70 +++++++++++++++++++----------------- ext/iconv/tests/gh21664.phpt | 21 +++++++++++ 3 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 ext/iconv/tests/gh21664.phpt diff --git a/NEWS b/NEWS index 45d5a171d6a1..4abaa254acb7 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) + . Fixed bug GH-21664 (iconv_mime_encode()/iconv_mime_decode() + crash with corrupt bailout state. (David Carlier) - Opcache: . Fixed bug GH-21158 (JIT: Assertion jit->ra[var].flags & (1<<0) failed in diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 117a9e948f64..29998c37d1a0 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1030,7 +1030,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn if (out_size <= out_reserved) { err = PHP_ICONV_ERR_TOO_BIG; - goto out; + goto out_try; } out_left = out_size - out_reserved; @@ -1039,22 +1039,22 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn switch (errno) { case EINVAL: err = PHP_ICONV_ERR_ILLEGAL_CHAR; - goto out; + goto out_try; case EILSEQ: err = PHP_ICONV_ERR_ILLEGAL_SEQ; - goto out; + goto out_try; case E2BIG: if (prev_in_left == in_left) { err = PHP_ICONV_ERR_TOO_BIG; - goto out; + goto out_try; } break; default: err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } @@ -1063,7 +1063,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn if (iconv(cd, NULL, NULL, (char **) &out_p, &out_left) == (size_t)-1) { if (errno != E2BIG) { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } else { break; @@ -1071,7 +1071,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn if (iconv(cd, NULL, NULL, NULL, NULL) == (size_t)-1) { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } out_reserved += 4; @@ -1086,7 +1086,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn if (char_cnt < ZSTR_LEN(encoded)) { /* something went wrong! */ err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } smart_str_appendl(pretval, ZSTR_VAL(encoded), ZSTR_LEN(encoded)); @@ -1123,28 +1123,28 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn switch (errno) { case EINVAL: err = PHP_ICONV_ERR_ILLEGAL_CHAR; - goto out; + goto out_try; case EILSEQ: err = PHP_ICONV_ERR_ILLEGAL_SEQ; - goto out; + goto out_try; case E2BIG: if (prev_in_left == in_left) { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } break; default: err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } if (iconv(cd, NULL, NULL, (char **) &out_p, &out_left) == (size_t)-1) { if (errno != E2BIG) { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } @@ -1179,7 +1179,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn if (iconv(cd, NULL, NULL, NULL, NULL) == (size_t)-1) { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } break; /* case PHP_ICONV_ENC_SCHEME_QPRINT: */ @@ -1187,6 +1187,8 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn } while (in_left > 0); smart_str_0(pretval); + +out_try: ; } zend_catch { bailout = true; } zend_end_try(); @@ -1278,7 +1280,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st if (mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR) { err = PHP_ICONV_ERR_SUCCESS; } else { - goto out; + goto out_try; } } encoded_word = NULL; @@ -1296,7 +1298,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st } err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1326,7 +1328,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st _php_iconv_appendc(pretval, '?', cd_pl); err = _php_iconv_appendl(pretval, csname, (size_t)((p1 + 1) - csname), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } csname = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1342,7 +1344,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st if (csname == NULL) { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } csname_len = (size_t)(p1 - csname); @@ -1351,7 +1353,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1362,7 +1364,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } else { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } } @@ -1409,7 +1411,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } /* Let's go back and see if there are further @@ -1423,7 +1425,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st } else { err = PHP_ICONV_ERR_CONVERTER; } - goto out; + goto out_try; } } } @@ -1447,7 +1449,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) { err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1458,7 +1460,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } else { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } } break; @@ -1469,7 +1471,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st /* pass the entire chunk through the converter */ err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1480,7 +1482,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } else { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } } encoded_text = p1 + 1; @@ -1525,7 +1527,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st /* pass the entire chunk through the converter */ err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1536,7 +1538,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } else { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } } scan_stat = 9; @@ -1564,7 +1566,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st /* pass the entire chunk through the converter */ err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } scan_stat = 12; break; @@ -1593,7 +1595,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st /* pass the entire chunk through the converter */ err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); if (err != PHP_ICONV_ERR_SUCCESS) { - goto out; + goto out_try; } encoded_word = NULL; if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) { @@ -1604,7 +1606,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } else { err = PHP_ICONV_ERR_UNKNOWN; - goto out; + goto out_try; } } @@ -1623,7 +1625,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st break; } } else { - goto out; + goto out_try; } } @@ -1744,7 +1746,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st err = PHP_ICONV_ERR_SUCCESS; } else { err = PHP_ICONV_ERR_MALFORMED; - goto out; + goto out_try; } } @@ -1753,6 +1755,8 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st } smart_str_0(pretval); + +out_try: ; } zend_catch { bailout = true; } zend_end_try(); diff --git a/ext/iconv/tests/gh21664.phpt b/ext/iconv/tests/gh21664.phpt new file mode 100644 index 000000000000..92c66049c8dd --- /dev/null +++ b/ext/iconv/tests/gh21664.phpt @@ -0,0 +1,21 @@ +--TEST-- +GH-21664 (iconv_mime_decode/iconv_mime_encode bailout corruption) +--EXTENSIONS-- +iconv +--FILE-- + "UTF-8", "output-charset" => "UTF-8"]); +var_dump($r); + +echo "Done\n"; +?> +--EXPECTF-- +Notice: iconv_mime_decode(): Detected an illegal character in input string in %s on line %d +bool(false) + +Notice: iconv_mime_encode(): Detected an illegal character in input string in %s on line %d +bool(false) +Done From 057b70634bf145ada55e0df99dcafd36bd8eb60f Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 8 Apr 2026 10:39:08 +0200 Subject: [PATCH 091/300] Remove redundant PHP manifest file (#21634) --- php-8.3.30.manifest | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 php-8.3.30.manifest diff --git a/php-8.3.30.manifest b/php-8.3.30.manifest deleted file mode 100644 index ef6ffe8aa803..000000000000 --- a/php-8.3.30.manifest +++ /dev/null @@ -1,36 +0,0 @@ -php-8.3.30.tar.bz2 -SHA256 hash: 800b7b6ed50b73c8ee7844ee5f2f7cc612faa7875a0aa7c4529e8ed5866a5030 -PGP signature: ------BEGIN PGP SIGNATURE----- - -iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsAAKCRAcB3ncXAqd -5FioAPwK1gjqwBbGr5g3y1TikqxgKVWMHCtir1n46yGN2hYvtwD/flOR9EqRejNU -wW4RMkmRwXGsXY28V1DH+NKnDKTEWQ8= -=jkCu ------END PGP SIGNATURE----- - - -php-8.3.30.tar.gz -SHA256 hash: e587dc95fb7f62730299fa7b36b6e4f91e6708aaefa2fff68a0098d320c16386 -PGP signature: ------BEGIN PGP SIGNATURE----- - -iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsAAKCRAcB3ncXAqd -5F4eAP44IkpP3p3FRq3S9pDm9Y6bJnrpzxafqfXlZ949ECmUIgEAxFb+m5Tz7gcb -DSU+taIv2W6EQeijjaXPvAE2t1dGswo= -=kn1U ------END PGP SIGNATURE----- - - -php-8.3.30.tar.xz -SHA256 hash: 67f084d36852daab6809561a7c8023d130ca07fc6af8fb040684dd1414934d48 -PGP signature: ------BEGIN PGP SIGNATURE----- - -iHUEABYKAB0WIQTCjZN1dWA+tKu3JYYcB3ncXAqd5AUCaWbJsQAKCRAcB3ncXAqd -5NYpAP9Is0pCLlEuLiSRdAbgWPDee0jPA5JGoriGOFNkdMk67AD/WTzYCx7+dEVG -8Gb54wK005bk9nRGYQqwvZb+r1gqaQU= -=vSr4 ------END PGP SIGNATURE----- - - From d1512d31b2ce72182dd1eadb1afc6293e17eb544 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 8 Apr 2026 11:42:30 +0200 Subject: [PATCH 092/300] NEWS Closes GH-21460 via 3748255726b84b80ec128485b3885bd801df0049. --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 4abaa254acb7..d21afe06b193 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ PHP NEWS . Fixed bug GH-21158 (JIT: Assertion jit->ra[var].flags & (1<<0) failed in zend_jit_use_reg). (Arnaud) . Fixed bug GH-21593 (Borked function JIT JMPNZ smart branch). (ilutov) + . Fixed bug GH-21460 (COND optimization regression). (Dmitry, Arnaud) - OpenSSL: . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) From af50736ee2e0f4edcdb2cab62d7ccb42dd67a75c Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 8 Apr 2026 12:27:05 +0200 Subject: [PATCH 093/300] [skip if] Drop NEWS entry The faulty commit never reached production, so we don't need a NEWS entry for the fix. --- NEWS | 2 -- 1 file changed, 2 deletions(-) diff --git a/NEWS b/NEWS index d21afe06b193..92cc9be453dd 100644 --- a/NEWS +++ b/NEWS @@ -17,8 +17,6 @@ PHP NEWS - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) - . Fixed bug GH-21664 (iconv_mime_encode()/iconv_mime_decode() - crash with corrupt bailout state. (David Carlier) - Opcache: . Fixed bug GH-21158 (JIT: Assertion jit->ra[var].flags & (1<<0) failed in From 95e93b85fa30b535922726f3e951a382c6ab40e8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 8 Apr 2026 00:00:25 +0200 Subject: [PATCH 094/300] Fix faulty zend_try handling in zend_jit_trace() --- NEWS | 1 + ext/opcache/jit/zend_jit_trace.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 92cc9be453dd..84ef07ea11ee 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ PHP NEWS zend_jit_use_reg). (Arnaud) . Fixed bug GH-21593 (Borked function JIT JMPNZ smart branch). (ilutov) . Fixed bug GH-21460 (COND optimization regression). (Dmitry, Arnaud) + . Fixed faulty returns out of zend_try block in zend_jit_trace(). (ilutov) - OpenSSL: . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index b5d980ca5afc..320967419055 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -5167,7 +5167,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && ssa->vars[ssa_op->op2_def].use_chain < 0 && !ssa->vars[ssa_op->op2_def].phi_use_chain) { if (!zend_jit_store_type(&ctx, var_num, type)) { - return 0; + goto jit_failure; } SET_STACK_TYPE(stack, var_num, type, 1); } @@ -5220,7 +5220,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && ssa->vars[ssa_op->op1_def].use_chain < 0 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { if (!zend_jit_store_type(&ctx, var_num, type)) { - return 0; + goto jit_failure; } SET_STACK_TYPE(stack, var_num, type, 1); } @@ -5317,7 +5317,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && ssa->vars[ssa_op->op1_def].use_chain < 0 && !ssa->vars[ssa_op->op1_def].phi_use_chain) { if (!zend_jit_store_type(&ctx, var_num, type)) { - return 0; + goto jit_failure; } SET_STACK_TYPE(stack, var_num, type, 1); } @@ -6539,7 +6539,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par var_num = EX_VAR_TO_NUM(var_num); if (!zend_jit_store_type(&ctx, var_num, type)) { - return 0; + goto jit_failure; } SET_STACK_TYPE(stack, var_num, type, 1); } @@ -7179,7 +7179,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && type != STACK_MEM_TYPE(stack, i) && zend_jit_trace_must_store_type(op_array, op_array_ssa, opline - op_array->opcodes, i, type)) { if (!zend_jit_store_type(jit, i, type)) { - return 0; + goto jit_failure; } SET_STACK_TYPE(stack, i, type, 1); } @@ -7301,11 +7301,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par zend_string_release(name); } +jit_cleanup:; } zend_catch { do_bailout = 1; } zend_end_try(); -jit_cleanup: /* Clean up used op_arrays */ while (num_op_arrays > 0) { op_array = op_arrays[--num_op_arrays]; From e50cd125c9fc273b7dab6e5f8746d32e2c01069e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 7 Apr 2026 22:51:49 +0200 Subject: [PATCH 095/300] Add EG(bailout) consistency assertion Make sure EG(bailout) is what we expect. This will detect faulty jumps into or out of zend_try blocks, as in 38628e8. Closes GH-21667 --- Zend/zend.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Zend/zend.h b/Zend/zend.h index c2c8d4ee6a2c..c3323e4c4bfa 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -275,7 +275,9 @@ typedef size_t (*zend_write_func_t)(const char *str, size_t str_length); EG(bailout) = &__bailout; \ if (SETJMP(__bailout)==0) { #define zend_catch \ + ZEND_ASSERT(EG(bailout) == &__bailout); \ } else { \ + ZEND_ASSERT(EG(bailout) == &__bailout); \ EG(bailout) = __orig_bailout; #define zend_end_try() \ } \ From 89729383e270c444ec3220755cbddd8baf3e8242 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 2 Apr 2026 15:42:48 +0200 Subject: [PATCH 096/300] Fix missing addref for Countable::count() Fixes GH-21605 --- NEWS | 1 + Zend/tests/gh21605.phpt | 24 ++++++++++++++++++++++++ Zend/zend_vm_def.h | 2 ++ Zend/zend_vm_execute.h | 6 ++++++ 4 files changed, 33 insertions(+) create mode 100644 Zend/tests/gh21605.phpt diff --git a/NEWS b/NEWS index 84ef07ea11ee..fcdfd3973d83 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ PHP NEWS destructors). (iliaal) . Fixed bug GH-21478 (Forward property operations to real instance for initialized lazy proxies). (iliaal) + . Fixed bug GH-21605 (Missing addref for Countable::count()). (ilutov) - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) diff --git a/Zend/tests/gh21605.phpt b/Zend/tests/gh21605.phpt new file mode 100644 index 000000000000..973339ad3bb9 --- /dev/null +++ b/Zend/tests/gh21605.phpt @@ -0,0 +1,24 @@ +--TEST-- +GH-21605: Missing addref for Countable::count() +--CREDITS-- +cnwangjihe +--FILE-- + +--EXPECTF-- +object(C)#%d (0) { +} +int(42) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 4ecd80837b19..34906e1bfcca 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9419,7 +9419,9 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) zval retval; zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + GC_ADDREF(zobj); zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + OBJ_RELEASE(zobj); count = zval_get_long(&retval); zval_ptr_dtor(&retval); break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d7c14a7cf807..d4b2aff1907b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -11347,7 +11347,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_ zval retval; zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + GC_ADDREF(zobj); zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + OBJ_RELEASE(zobj); count = zval_get_long(&retval); zval_ptr_dtor(&retval); break; @@ -18826,7 +18828,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL zval retval; zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + GC_ADDREF(zobj); zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + OBJ_RELEASE(zobj); count = zval_get_long(&retval); zval_ptr_dtor(&retval); break; @@ -51390,7 +51394,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z zval retval; zend_function *count_fn = zend_hash_find_ptr(&zobj->ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT)); + GC_ADDREF(zobj); zend_call_known_instance_method_with_0_params(count_fn, zobj, &retval); + OBJ_RELEASE(zobj); count = zval_get_long(&retval); zval_ptr_dtor(&retval); break; From bcd6f67ebc50664b3b67eea89528223b5739d9fa Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 8 Apr 2026 18:43:10 +0100 Subject: [PATCH 097/300] ext/pcntl simplification. (#13975) assuming pcntl is an unix-only extension and they all support the siginfo_t type, we re using exclusively this more advanced api. --- ext/pcntl/config.m4 | 3 --- ext/pcntl/pcntl.c | 32 ++++++++------------------------ ext/pcntl/pcntl.stub.php | 2 -- ext/pcntl/pcntl_arginfo.h | 8 ++++---- ext/pcntl/pcntl_decl.h | 8 ++++---- ext/pcntl/php_pcntl.h | 2 -- ext/pcntl/php_signal.c | 16 +++------------- ext/pcntl/php_signal.h | 9 +++------ 8 files changed, 22 insertions(+), 58 deletions(-) diff --git a/ext/pcntl/config.m4 b/ext/pcntl/config.m4 index cfe6e80ca110..553419114fd2 100644 --- a/ext/pcntl/config.m4 +++ b/ext/pcntl/config.m4 @@ -68,9 +68,6 @@ int main(void) { [AC_DEFINE([HAVE_SCHED_GETCPU], [1], [Define to 1 if the 'sched_getcpu' function is properly supported.])]) - AC_CHECK_TYPE([siginfo_t], [PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"],, - [#include ]) - PHP_NEW_EXTENSION([pcntl], [pcntl.c php_signal.c], [$ext_shared], diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index ab7b14992080..b4e21e55b6e8 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -185,12 +185,8 @@ ZEND_GET_MODULE(pcntl) static void (*orig_interrupt_function)(zend_execute_data *execute_data); -#ifdef HAVE_STRUCT_SIGINFO_T static void pcntl_signal_handler(int, siginfo_t*, void*); static void pcntl_siginfo_to_zval(int, siginfo_t*, zval*); -#else -static void pcntl_signal_handler(int); -#endif static void pcntl_signal_dispatch(void); static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer); static void pcntl_interrupt_function(zend_execute_data *execute_data); @@ -240,7 +236,7 @@ PHP_RSHUTDOWN_FUNCTION(pcntl) /* Reset all signals to their default disposition */ ZEND_HASH_FOREACH_NUM_KEY_VAL(&PCNTL_G(php_signal_table), signo, handle) { if (Z_TYPE_P(handle) != IS_LONG || Z_LVAL_P(handle) != (zend_long)SIG_DFL) { - php_signal(signo, (Sigfunc *)(zend_long)SIG_DFL, 0); + php_signal(signo, (Sigfunc *)(zend_long)SIG_DFL, false); } } ZEND_HASH_FOREACH_END(); @@ -835,7 +831,7 @@ PHP_FUNCTION(pcntl_signal) zend_argument_value_error(2, "must be either SIG_DFL or SIG_IGN when an integer value is given"); RETURN_THROWS(); } - if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == (void *)SIG_ERR) { + if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), restart_syscalls) == (void *)SIG_ERR) { PCNTL_G(last_error) = errno; php_error_docref(NULL, E_WARNING, "Error assigning signal"); RETURN_FALSE; @@ -1007,8 +1003,7 @@ PHP_FUNCTION(pcntl_sigprocmask) /* }}} */ #endif -#ifdef HAVE_STRUCT_SIGINFO_T -# ifdef HAVE_SIGWAITINFO +#ifdef HAVE_SIGWAITINFO /* {{{ Synchronously wait for queued signals */ PHP_FUNCTION(pcntl_sigwaitinfo) @@ -1050,8 +1045,9 @@ PHP_FUNCTION(pcntl_sigwaitinfo) RETURN_LONG(signal_no); } /* }}} */ -# endif -# ifdef HAVE_SIGTIMEDWAIT +#endif + +#ifdef HAVE_SIGTIMEDWAIT /* {{{ Wait for queued signals */ PHP_FUNCTION(pcntl_sigtimedwait) { @@ -1113,7 +1109,7 @@ PHP_FUNCTION(pcntl_sigtimedwait) RETURN_LONG(signal_no); } /* }}} */ -# endif +#endif static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_siginfo) /* {{{ */ { @@ -1183,7 +1179,6 @@ static void pcntl_siginfo_to_zval(int signo, siginfo_t *siginfo, zval *user_sigi } } /* }}} */ -#endif #ifdef HAVE_GETPRIORITY /* {{{ Get the priority of any process */ @@ -1325,11 +1320,7 @@ PHP_FUNCTION(pcntl_strerror) /* }}} */ /* Our custom signal handler that calls the appropriate php_function */ -#ifdef HAVE_STRUCT_SIGINFO_T static void pcntl_signal_handler(int signo, siginfo_t *siginfo, void *context) -#else -static void pcntl_signal_handler(int signo) -#endif { struct php_pcntl_pending_signal *psig = PCNTL_G(spares); if (!psig) { @@ -1341,9 +1332,7 @@ static void pcntl_signal_handler(int signo) psig->signo = signo; psig->next = NULL; -#ifdef HAVE_STRUCT_SIGINFO_T psig->siginfo = *siginfo; -#endif /* the head check is important, as the tick handler cannot atomically clear both * the head and tail */ @@ -1395,19 +1384,14 @@ void pcntl_signal_dispatch(void) if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) { if (Z_TYPE_P(handle) != IS_LONG) { ZVAL_LONG(¶ms[0], queue->signo); -#ifdef HAVE_STRUCT_SIGINFO_T array_init(¶ms[1]); pcntl_siginfo_to_zval(queue->signo, &queue->siginfo, ¶ms[1]); -#else - ZVAL_NULL(¶ms[1]); -#endif /* Call php signal handler - Note that we do not report errors, and we ignore the return value */ call_user_function(NULL, NULL, handle, &retval, 2, params); zval_ptr_dtor(&retval); -#ifdef HAVE_STRUCT_SIGINFO_T zval_ptr_dtor(¶ms[1]); -#endif + if (EG(exception)) { break; } diff --git a/ext/pcntl/pcntl.stub.php b/ext/pcntl/pcntl.stub.php index 2da540fa71ec..4a4b8fe86931 100644 --- a/ext/pcntl/pcntl.stub.php +++ b/ext/pcntl/pcntl.stub.php @@ -1035,14 +1035,12 @@ function pcntl_signal_dispatch(): bool {} function pcntl_sigprocmask(int $mode, array $signals, &$old_signals = null): bool {} #endif -#ifdef HAVE_STRUCT_SIGINFO_T #if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) /** @param array $info */ function pcntl_sigwaitinfo(array $signals, &$info = []): int|false {} /** @param array $info */ function pcntl_sigtimedwait(array $signals, &$info = [], int $seconds = 0, int $nanoseconds = 0): int|false {} -#endif #endif function pcntl_wifexited(int $status): bool {} diff --git a/ext/pcntl/pcntl_arginfo.h b/ext/pcntl/pcntl_arginfo.h index d9624a226057..2da7c8ad5db8 100644 --- a/ext/pcntl/pcntl_arginfo.h +++ b/ext/pcntl/pcntl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit pcntl.stub.php instead. - * Stub hash: dfa1e84a14e1926a50a42919e24ada58348fe4d9 + * Stub hash: 04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_fork, 0, 0, IS_LONG, 0) @@ -49,7 +49,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_sigprocmask, 0, 2, _IS_BOO ZEND_END_ARG_INFO() #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_sigwaitinfo, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, signals, IS_ARRAY, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, info, "[]") @@ -185,7 +185,7 @@ ZEND_FUNCTION(pcntl_signal_dispatch); #if defined(HAVE_SIGPROCMASK) ZEND_FUNCTION(pcntl_sigprocmask); #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_FUNCTION(pcntl_sigwaitinfo); ZEND_FUNCTION(pcntl_sigtimedwait); #endif @@ -246,7 +246,7 @@ static const zend_function_entry ext_functions[] = { #if defined(HAVE_SIGPROCMASK) ZEND_FE(pcntl_sigprocmask, arginfo_pcntl_sigprocmask) #endif -#if defined(HAVE_STRUCT_SIGINFO_T) && (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) +#if (defined(HAVE_SIGWAITINFO) && defined(HAVE_SIGTIMEDWAIT)) ZEND_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo) ZEND_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait) #endif diff --git a/ext/pcntl/pcntl_decl.h b/ext/pcntl/pcntl_decl.h index 1059485bc934..7f8e5172cedb 100644 --- a/ext/pcntl/pcntl_decl.h +++ b/ext/pcntl/pcntl_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit pcntl.stub.php instead. - * Stub hash: dfa1e84a14e1926a50a42919e24ada58348fe4d9 */ + * Stub hash: 04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826 */ -#ifndef ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H -#define ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H +#ifndef ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H +#define ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H typedef enum zend_enum_Pcntl_QosClass { ZEND_ENUM_Pcntl_QosClass_UserInteractive = 1, @@ -12,4 +12,4 @@ typedef enum zend_enum_Pcntl_QosClass { ZEND_ENUM_Pcntl_QosClass_Background = 5, } zend_enum_Pcntl_QosClass; -#endif /* ZEND_PCNTL_DECL_dfa1e84a14e1926a50a42919e24ada58348fe4d9_H */ +#endif /* ZEND_PCNTL_DECL_04e7b30c6fb23cf6ce6bc26fe094fd5b4dbfe826_H */ diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index e02f93246e88..aed96af380e2 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -38,9 +38,7 @@ PHP_MINFO_FUNCTION(pcntl); struct php_pcntl_pending_signal { struct php_pcntl_pending_signal *next; zend_long signo; -#ifdef HAVE_STRUCT_SIGINFO_T siginfo_t siginfo; -#endif }; ZEND_BEGIN_MODULE_GLOBALS(pcntl) diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 14c169310e60..7f27ac33e45d 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -21,24 +21,18 @@ /* php_signal using sigaction is derived from Advanced Programming * in the Unix Environment by W. Richard Stevens p 298. */ -Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) +Sigfunc *php_signal4(int signo, Sigfunc *func, bool restart, bool mask_all) { struct sigaction act,oact; -#ifdef HAVE_STRUCT_SIGINFO_T act.sa_sigaction = func; -#else - act.sa_handler = func; -#endif if (mask_all) { sigfillset(&act.sa_mask); } else { sigemptyset(&act.sa_mask); } act.sa_flags = SA_ONSTACK; -#ifdef HAVE_STRUCT_SIGINFO_T act.sa_flags |= SA_SIGINFO; -#endif if (!restart) { #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS */ @@ -50,14 +44,10 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) } zend_sigaction(signo, &act, &oact); -#ifdef HAVE_STRUCT_SIGINFO_T return oact.sa_sigaction; -#else - return oact.sa_handler; -#endif } -Sigfunc *php_signal(int signo, Sigfunc *func, int restart) +Sigfunc *php_signal(int signo, Sigfunc *func, bool restart) { - return php_signal4(signo, func, restart, 0); + return php_signal4(signo, func, restart, false); } diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h index 256898e70acb..44cbd68999f1 100644 --- a/ext/pcntl/php_signal.h +++ b/ext/pcntl/php_signal.h @@ -18,12 +18,9 @@ #ifndef PHP_SIGNAL_H #define PHP_SIGNAL_H -#ifdef HAVE_STRUCT_SIGINFO_T typedef void Sigfunc(int, siginfo_t*, void*); -#else -typedef void Sigfunc(int); -#endif -Sigfunc *php_signal(int signo, Sigfunc *func, int restart); -Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all); + +Sigfunc *php_signal(int signo, Sigfunc *func, bool restart); +Sigfunc *php_signal4(int signo, Sigfunc *func, bool restart, bool mask_all); #endif From 188d520972a127a75adb0c9e10017fc665e8823c Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 8 Mar 2025 19:24:44 +0000 Subject: [PATCH 098/300] ext/gd: calls with array types check strengthening. close GH-18005 --- NEWS | 4 ++ UPGRADING | 5 +++ ext/gd/gd.c | 63 +++++++++++++++++++++++--- ext/gd/tests/bug66356.phpt | 21 +++++---- ext/gd/tests/gh18005.phpt | 92 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 170 insertions(+), 15 deletions(-) create mode 100644 ext/gd/tests/gh18005.phpt diff --git a/NEWS b/NEWS index d688ef5aad39..6a37ca9791c5 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,10 @@ PHP NEWS (ndossche) . Fixed bug #66095 (Hide libmagic dynamic symbols). (orlitzky) +- GD: + . imagesetstyle()/imagefilter()/imagecrop() check array argument entries + types. (David Carlier) + - Hash: . Upgrade xxHash to 0.8.2. (timwolla) diff --git a/UPGRADING b/UPGRADING index a97ad00061a2..a7c91c4501e9 100644 --- a/UPGRADING +++ b/UPGRADING @@ -103,6 +103,11 @@ PHP 8.6 UPGRADE NOTES 5. Changed Functions ======================================== +- GD: + . imagesetstyle(), imagefilter() and imagecrop() filter their + array arguments types/values and raise a TypeError/ValueError + accordingly. + - mysqli: . The return structure of mysqli_get_charset() no longer contains the undocumented "comment" element. The value of "charsetnr" is diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 2624d13b51da..ce2f74f6cdbd 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -640,7 +640,20 @@ PHP_FUNCTION(imagesetstyle) stylearr = safe_emalloc(num_styles, sizeof(int), 0); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) { - stylearr[index++] = zval_get_long(item); + bool failed = false; + ZVAL_DEREF(item); + zend_long tmp = zval_try_get_long(item, &failed); + if (failed) { + efree(stylearr); + zend_argument_type_error(2, "must only have elements of type int, %s given", zend_zval_type_name(item)); + RETURN_THROWS(); + } + if (ZEND_LONG_EXCEEDS_INT(tmp)) { + efree(stylearr); + zend_argument_value_error(2, "elements must be between %d and %d", INT_MIN, INT_MAX); + RETURN_THROWS(); + } + stylearr[index++] = (int) tmp; } ZEND_HASH_FOREACH_END(); gdImageSetStyle(im, stylearr, index); @@ -3595,7 +3608,20 @@ static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS) colors = safe_emalloc(num_colors, sizeof(int), 0); ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(hash_colors), color) { - *(colors + i++) = (int) zval_get_long(color); + bool failed = false; + ZVAL_DEREF(color); + zend_long tmp = zval_try_get_long(color, &failed); + if (failed) { + efree(colors); + zend_argument_type_error(5, "must be of type int, %s given", zend_zval_type_name(color)); + RETURN_THROWS(); + } + if (tmp < 0 || ZEND_LONG_INT_OVFL(tmp)) { + efree(colors); + zend_argument_value_error(5, "value must be between 0 and %d", INT_MAX); + RETURN_THROWS(); + } + colors[i++] = (int) tmp; } ZEND_HASH_FOREACH_END(); RETVAL_BOOL(gdImageScatterColor(im, (int)scatter_sub, (int)scatter_plus, colors, num_colors)); @@ -3763,6 +3789,23 @@ PHP_FUNCTION(imageantialias) } /* }}} */ +static bool php_gd_zval_try_get_c_int(zval *tmp, const char *field, int *res) { + zend_long r; + bool failed = false; + ZVAL_DEREF(tmp); + r = zval_try_get_long(tmp, &failed); + if (failed) { + zend_argument_type_error(2, "\"%s\" key must be of type int, %s given", field, zend_zval_type_name(tmp)); + return false; + } + if (UNEXPECTED(ZEND_LONG_EXCEEDS_INT(r))) { + zend_argument_value_error(2, "\"%s\" key must be between %d and %d", field, INT_MIN, INT_MAX); + return false; + } + *res = (int)r; + return true; +} + /* {{{ Crop an image using the given coordinates and size, x, y, width and height. */ PHP_FUNCTION(imagecrop) { @@ -3781,28 +3824,36 @@ PHP_FUNCTION(imagecrop) im = php_gd_libgdimageptr_from_zval_p(IM); if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "x", sizeof("x") -1)) != NULL) { - rect.x = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "x", &rect.x)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have an \"x\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "y", sizeof("y") - 1)) != NULL) { - rect.y = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "y", &rect.y)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"y\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "width", sizeof("width") - 1)) != NULL) { - rect.width = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "width", &rect.width)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"width\" key"); RETURN_THROWS(); } if ((tmp = zend_hash_str_find(Z_ARRVAL_P(z_rect), "height", sizeof("height") - 1)) != NULL) { - rect.height = zval_get_long(tmp); + if (!php_gd_zval_try_get_c_int(tmp, "height", &rect.height)) { + RETURN_THROWS(); + } } else { zend_argument_value_error(2, "must have a \"height\" key"); RETURN_THROWS(); diff --git a/ext/gd/tests/bug66356.phpt b/ext/gd/tests/bug66356.phpt index b65fb54f5718..616a270115c1 100644 --- a/ext/gd/tests/bug66356.phpt +++ b/ext/gd/tests/bug66356.phpt @@ -7,10 +7,14 @@ gd $img = imagecreatetruecolor(10, 10); // POC #1 -var_dump(imagecrop($img, array("x" => "a", "y" => 0, "width" => 10, "height" => 10))); +var_dump(imagecrop($img, array("x" => 0, "y" => 0, "width" => 10, "height" => 10))); -$arr = array("x" => "a", "y" => "12b", "width" => 10, "height" => 10); -var_dump(imagecrop($img, $arr)); +$arr = array("x" => 2147483647, "y" => 2147483647, "width" => 10, "height" => 10); +try { + imagecrop($img, $arr); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} print_r($arr); // POC #2 @@ -28,12 +32,11 @@ var_dump(imagecrop($img, array("x" => 0, "y" => 0, "width" => 65535, "height" => --EXPECTF-- object(GdImage)#2 (0) { } -object(GdImage)#2 (0) { -} +imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys Array ( - [x] => a - [y] => 12b + [x] => 2147483647 + [y] => 2147483647 [width] => 10 [height] => 10 ) @@ -41,9 +44,9 @@ Array Warning: imagecrop(): %cne parameter to a memory allocation multiplication is negative or zero, failing operation gracefully in %s on line %d bool(false) -object(GdImage)#2 (0) { +object(GdImage)#3 (0) { } -object(GdImage)#2 (0) { +object(GdImage)#3 (0) { } Warning: imagecrop(): %croduct of memory allocation multiplication would exceed INT_MAX, failing operation gracefully diff --git a/ext/gd/tests/gh18005.phpt b/ext/gd/tests/gh18005.phpt new file mode 100644 index 000000000000..5282c0be0268 --- /dev/null +++ b/ext/gd/tests/gh18005.phpt @@ -0,0 +1,92 @@ +--TEST-- +GH-18005: imagesetstyle, imagefilter, imagecrop array values type checks +--EXTENSIONS-- +gd +--SKIPIF-- + +--FILE-- +getMessage() . PHP_EOL; +} +try { + imagesetstyle($img, [0, PHP_INT_MIN]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [new A()]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [-1]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => PHP_INT_MIN, "y" => 0, "width" => 0, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => PHP_INT_MIN, "width" => 0, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => PHP_INT_MAX, "height" => 0]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => PHP_INT_MAX]); +} catch (\ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +try { + imagecrop($img, ["x" => new A(), "y" => 0, "width" => 0, "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => new A(), "width" => 0, "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => new A(), "height" => 0]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} +try { + imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => new A()]); +} catch (\TypeError $e) { + echo $e->getMessage() . PHP_EOL; +} + +$one = 1; +var_dump(imagecrop($img, ["x" => &$one, "y" => &$one, "width" => &$one, "height" => &$one])); +?> +--EXPECTF-- +imagesetstyle(): Argument #2 ($style) must only have elements of type int, A given +imagesetstyle(): Argument #2 ($style) elements must be between %i and %d +imagefilter(): Argument #5 must be of type int, A given +imagefilter(): Argument #5 value must be between 0 and 2147483647 +imagecrop(): Argument #2 ($rectangle) "x" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "y" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "width" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "height" key must be between %i and %d +imagecrop(): Argument #2 ($rectangle) "x" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "y" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "width" key must be of type int, A given +imagecrop(): Argument #2 ($rectangle) "height" key must be of type int, A given +object(GdImage)#2 (0) { +} From 0f3e741b538eefb1d1ffa42dc7b13d6ecf6db660 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 8 Apr 2026 21:36:15 +0200 Subject: [PATCH 099/300] [skip ci] Suppress opcache debugging tools in gcovr Suppress zend_dump.c and ssa_integrity.c. Also suppress the calls to zend_dump_op_array() and the unreached branches. --- gcovr.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcovr.cfg b/gcovr.cfg index a8267cd6e000..7ee4cff356e8 100644 --- a/gcovr.cfg +++ b/gcovr.cfg @@ -13,7 +13,11 @@ exclude = ext/mbstring/libmbfl/.* exclude = ext/opcache/jit/ir/.* exclude = ext/pcre/pcre2lib/.* exclude = ext/uri/uriparser/.* +exclude = Zend/Optimizer/ssa_integrity\.c +exclude = Zend/Optimizer/zend_dump\.c # These patterns have implicit ^/$ anchors. exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).* exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s* +exclude-lines-by-pattern = \s*if \(ctx->debug_level & ZEND_DUMP_\w+\) \{\s* +exclude-lines-by-pattern = \s*zend_dump_op_array\(.*\);\s* From da4185ab462a417b6c3b550d463afd15e4f6ac4f Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Thu, 9 Apr 2026 20:26:54 +0800 Subject: [PATCH 100/300] Use zend_str_has_nul_byte instead of memchr (#21680) --- ext/session/session.c | 2 +- ext/soap/soap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index 51ab3922e0bd..5094e7412a88 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -641,7 +641,7 @@ static PHP_INI_MH(OnUpdateSaveDir) /* Only do the open_basedir check at runtime */ if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { - if (memchr(ZSTR_VAL(new_value), '\0', ZSTR_LEN(new_value)) != NULL) { + if (zend_str_has_nul_byte(new_value)) { return FAILURE; } diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 59e2bd416805..75d88cd54158 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -387,7 +387,7 @@ static PHP_INI_MH(OnUpdateCacheDir) if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { char *p; - if (memchr(ZSTR_VAL(new_value), '\0', ZSTR_LEN(new_value)) != NULL) { + if (zend_str_has_nul_byte(new_value)) { return FAILURE; } From dc7f6a8bebfa7fd9608282524e071b2238903537 Mon Sep 17 00:00:00 2001 From: Jorg Adam Sowa Date: Thu, 9 Apr 2026 14:37:14 +0200 Subject: [PATCH 101/300] ext/session: add recursive session cleanup for dirname in nested directories (#21491) --- ext/session/mod_files.c | 76 +++++++++++-------- ext/session/tests/mod_files/gc_dirdepth2.phpt | 45 +++++++++++ .../tests/mod_files/gc_dirdepth_disabled.phpt | 68 +++++++++++++++++ .../gc_dirdepth_multi_subdir_count.phpt | 54 +++++++++++++ .../mod_files/gc_dirdepth_selective.phpt | 57 ++++++++++++++ php.ini-development | 7 -- php.ini-production | 7 -- 7 files changed, 269 insertions(+), 45 deletions(-) create mode 100644 ext/session/tests/mod_files/gc_dirdepth2.phpt create mode 100644 ext/session/tests/mod_files/gc_dirdepth_disabled.phpt create mode 100644 ext/session/tests/mod_files/gc_dirdepth_multi_subdir_count.phpt create mode 100644 ext/session/tests/mod_files/gc_dirdepth_selective.phpt diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 60c6bfc1bd4c..858cab879db5 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -276,7 +276,10 @@ static zend_result ps_files_write(ps_files *data, zend_string *key, zend_string return SUCCESS; } -static int ps_files_cleanup_dir(const zend_string *dirname, zend_long maxlifetime) +/* Recursively remove expired session files. When dirdepth > 0 the + * cleanup descends into subdirectories up to that many levels before + * inspecting individual session files. */ +static int ps_files_cleanup_dir(const zend_string *dirname, zend_long maxlifetime, size_t remaining_depth) { DIR *dir; struct dirent *entry; @@ -291,8 +294,6 @@ static int ps_files_cleanup_dir(const zend_string *dirname, zend_long maxlifetim return -1; } - time(&now); - if (ZSTR_LEN(dirname) >= MAXPATHLEN) { php_error_docref(NULL, E_NOTICE, "ps_files_cleanup_dir: dirname(%s) is too long", ZSTR_VAL(dirname)); closedir(dir); @@ -304,31 +305,52 @@ static int ps_files_cleanup_dir(const zend_string *dirname, zend_long maxlifetim buf[ZSTR_LEN(dirname)] = PHP_DIR_SEPARATOR; while ((entry = readdir(dir))) { - /* does the file start with our prefix? */ - if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) { - size_t entry_len = strlen(entry->d_name); - - /* does it fit into our buffer? */ - if (entry_len + ZSTR_LEN(dirname) + 2 < MAXPATHLEN) { - /* create the full path.. */ - memcpy(buf + ZSTR_LEN(dirname) + 1, entry->d_name, entry_len); - - /* NUL terminate it and */ - buf[ZSTR_LEN(dirname) + entry_len + 1] = '\0'; - - /* check whether its last access was more than maxlifetime ago */ - if (VCWD_STAT(buf, &sbuf) == 0 && - (now - sbuf.st_mtime) > maxlifetime) { - VCWD_UNLINK(buf); - nrdels++; + /* skip . and .. */ + if (entry->d_name[0] == '.' && + (entry->d_name[1] == '\0' || + (entry->d_name[1] == '.' && entry->d_name[2] == '\0'))) { + continue; + } + size_t entry_len = strlen(entry->d_name); + /* does it fit into our buffer? */ + if (ZSTR_LEN(dirname) + 1 + entry_len >= MAXPATHLEN) { + continue; + } + /* create the full path and NUL-terminate it */ + memcpy(buf + ZSTR_LEN(dirname) + 1, entry->d_name, entry_len); + buf[ZSTR_LEN(dirname) + 1 + entry_len] = '\0'; + + if (remaining_depth == 0) { + /* target depth: delete expired session files */ + if (strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1) != 0) { + continue; + } + if (VCWD_STAT(buf, &sbuf) != 0) { + continue; + } + time(&now); + if ((now - sbuf.st_mtime) > maxlifetime) { + VCWD_UNLINK(buf); + nrdels++; + } + } else { + /* intermediate depth: recurse into subdirectories */ + if (VCWD_STAT(buf, &sbuf) != 0) { + continue; + } + if (S_ISDIR(sbuf.st_mode)) { + zend_string *subdir = zend_string_init(buf, ZSTR_LEN(dirname) + 1 + entry_len, 0); + int n = ps_files_cleanup_dir(subdir, maxlifetime, remaining_depth - 1); + zend_string_release(subdir); + if (n >= 0) { + nrdels += n; } } } } closedir(dir); - - return (nrdels); + return nrdels; } static zend_result ps_files_key_exists(ps_files *data, const zend_string *key) @@ -624,15 +646,7 @@ PS_GC_FUNC(files) { PS_FILES_DATA; - /* We don't perform any cleanup, if dirdepth is larger than 0. - we return SUCCESS, since all cleanup should be handled by - an external entity (i.e. find -ctime x | xargs rm) */ - - if (data->dirdepth == 0) { - *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime); - } else { - *nrdels = -1; // Cannot process multiple depth save dir - } + *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime, data->dirdepth); return *nrdels; } diff --git a/ext/session/tests/mod_files/gc_dirdepth2.phpt b/ext/session/tests/mod_files/gc_dirdepth2.phpt new file mode 100644 index 000000000000..a8724285125a --- /dev/null +++ b/ext/session/tests/mod_files/gc_dirdepth2.phpt @@ -0,0 +1,45 @@ +--TEST-- +session GC cleans expired sessions with save_path dirdepth=2 (two subdir levels) +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.gc_probability=0 +session.gc_maxlifetime=10 +--FILE-- + +--CLEAN-- + +--EXPECT-- +session_gc() return value: int(1) +expired file removed: bool(true) diff --git a/ext/session/tests/mod_files/gc_dirdepth_disabled.phpt b/ext/session/tests/mod_files/gc_dirdepth_disabled.phpt new file mode 100644 index 000000000000..81c62430d157 --- /dev/null +++ b/ext/session/tests/mod_files/gc_dirdepth_disabled.phpt @@ -0,0 +1,68 @@ +--TEST-- +session GC correctly cleans expired sessions when save_path dirdepth > 0 +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.gc_probability=0 +session.gc_maxlifetime=1 +--FILE-- + +--CLEAN-- + +--EXPECT-- +dirdepth=1 — session_gc() return value: int(1) +dirdepth=1 — expired session file removed: bool(true) +dirdepth=0 — session_gc() return value: int(1) +dirdepth=0 — expired session file removed: bool(true) diff --git a/ext/session/tests/mod_files/gc_dirdepth_multi_subdir_count.phpt b/ext/session/tests/mod_files/gc_dirdepth_multi_subdir_count.phpt new file mode 100644 index 000000000000..1ba047502f5e --- /dev/null +++ b/ext/session/tests/mod_files/gc_dirdepth_multi_subdir_count.phpt @@ -0,0 +1,54 @@ +--TEST-- +session GC accumulates correct total count across multiple subdirs, including empty ones (dirdepth=1) +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.gc_probability=0 +session.gc_maxlifetime=10 +--FILE-- + +--CLEAN-- + +--EXPECT-- +session_gc() return value: int(3) +all expired files removed: bool(true) diff --git a/ext/session/tests/mod_files/gc_dirdepth_selective.phpt b/ext/session/tests/mod_files/gc_dirdepth_selective.phpt new file mode 100644 index 000000000000..a173324171e2 --- /dev/null +++ b/ext/session/tests/mod_files/gc_dirdepth_selective.phpt @@ -0,0 +1,57 @@ +--TEST-- +session GC deletes only expired sess_* files and leaves all other files untouched (dirdepth=1) +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.gc_probability=0 +session.gc_maxlifetime=10 +--FILE-- + gc_maxlifetime=10 → deleted + +file_put_contents($fresh, 'user|s:5:"alice";'); +touch($fresh, time() - 1); // 1 s old < gc_maxlifetime=10 → kept + +file_put_contents($other, 'untouched'); +touch($other, time() - 100); // old but no sess_ prefix → kept + +session_id('a0000000000000000000000000'); // first char 'a' → $base/a/ +session_start(); +$result = session_gc(); // int(1): exactly one deletion proves selectivity +session_destroy(); + +echo "session_gc() return value: "; +var_dump($result); + +echo "expired sess_ file removed: "; +var_dump(!file_exists($expired)); + +echo "other file kept: "; +var_dump(file_exists($other)); +?> +--CLEAN-- + +--EXPECT-- +session_gc() return value: int(1) +expired sess_ file removed: bool(true) +other file kept: bool(true) diff --git a/php.ini-development b/php.ini-development index 6f93f440112e..ee75459ea56c 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1386,13 +1386,6 @@ session.gc_divisor = 1000 ; https://php.net/session.gc-maxlifetime session.gc_maxlifetime = 1440 -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script is the equivalent of setting -; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be diff --git a/php.ini-production b/php.ini-production index 9aafad21e9c7..b10e2ba9944a 100644 --- a/php.ini-production +++ b/php.ini-production @@ -1388,13 +1388,6 @@ session.gc_divisor = 1000 ; https://php.net/session.gc-maxlifetime session.gc_maxlifetime = 1440 -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script is the equivalent of setting -; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be From 57d6d71c438f45c9e8b92e02e2d0fe2b20eb9f89 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 9 Apr 2026 20:27:25 +0200 Subject: [PATCH 102/300] ext/snmp: Enable shutdown_snmp_logging on Windows (#21685) The shutdown_snmp_logging() function is available since Net-SNMP 5.4. At the time of writing, Windows uses Net-SNMP 5.9.4 https://github.com/winlibs/net-snmp --- ext/snmp/config.w32 | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/snmp/config.w32 b/ext/snmp/config.w32 index 0e3887c0de68..bf63e89a9607 100644 --- a/ext/snmp/config.w32 +++ b/ext/snmp/config.w32 @@ -9,6 +9,7 @@ if (PHP_SNMP != "no") { EXTENSION('snmp', 'snmp.c'); ADD_EXTENSION_DEP('snmp', 'spl'); AC_DEFINE('HAVE_SNMP', 1, "Define to 1 if the PHP extension 'snmp' is available."); + AC_DEFINE('HAVE_SHUTDOWN_SNMP_LOGGING', 1, "Define to 1 if SNMP library has the 'shutdown_snmp_logging' function."); } else { WARNING("snmp not enabled; libraries and headers not found"); } From 19f73c571254ff1bc107eaedbe5197fcd34ebbfc Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 9 Apr 2026 18:17:38 +0100 Subject: [PATCH 103/300] Fix GH-21688: SEGV in C14N on empty HTMLDocument. close GH-21693 --- NEWS | 2 ++ ext/dom/node.c | 6 +++++- ext/dom/tests/modern/html/gh21688.phpt | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 ext/dom/tests/modern/html/gh21688.phpt diff --git a/NEWS b/NEWS index fcdfd3973d83..2071326cf6e7 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ PHP NEWS - DOM: . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns declarations after setAttributeNS()). (David Carlier) + . Fixed bug GH-21688 (segmentation fault on empty HTMLDocument). + (David Carlier) - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) diff --git a/ext/dom/node.c b/ext/dom/node.c index 83404d0f598d..bbe8311147f9 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2263,7 +2263,11 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ } zend_hash_init(&links, 0, NULL, NULL, false); - dom_relink_ns_decls(&links, xmlDocGetRootElement(docp)); + xmlNodePtr root_element = xmlDocGetRootElement(docp); + + if (root_element) { + dom_relink_ns_decls(&links, root_element); + } } else if (!docp) { /* Note: not triggerable with modern DOM */ zend_throw_error(NULL, "Node must be associated with a document"); diff --git a/ext/dom/tests/modern/html/gh21688.phpt b/ext/dom/tests/modern/html/gh21688.phpt new file mode 100644 index 000000000000..ddfb4d326c63 --- /dev/null +++ b/ext/dom/tests/modern/html/gh21688.phpt @@ -0,0 +1,13 @@ +--TEST-- +GH-21688 (SEGV in C14N on empty HTMLDocument) +--CREDITS-- +YuanchengJiang +--EXTENSIONS-- +dom +--FILE-- +C14N()); +?> +--EXPECT-- +string(0) "" From e0e2963b74ed1a5531e4759defacd3b961c93bda Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 10 Apr 2026 11:46:59 +1000 Subject: [PATCH 104/300] Wrap strings passed to libzip with zip_source_function_create() (#21659) Wrap strings passed to libzip with zip_source_function_create() instead of using zip_source_buffer_create(). This allows us to make the string writable, and simplifies memory management. --- ext/zip/config.m4 | 2 +- ext/zip/config.w32 | 2 +- ext/zip/php_zip.c | 37 ++------ ext/zip/php_zip.h | 4 +- ext/zip/zip_source.c | 206 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 215 insertions(+), 36 deletions(-) create mode 100644 ext/zip/zip_source.c diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 29ae030d37b6..590be44f6501 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -49,7 +49,7 @@ if test "$PHP_ZIP" != "no"; then AC_DEFINE([HAVE_ZIP], [1], [Define to 1 if the PHP extension 'zip' is available.]) - PHP_NEW_EXTENSION([zip], [php_zip.c zip_stream.c], [$ext_shared]) + PHP_NEW_EXTENSION([zip], [php_zip.c zip_source.c zip_stream.c], [$ext_shared]) PHP_ADD_EXTENSION_DEP(zip, pcre) PHP_SUBST([ZIP_SHARED_LIBADD]) diff --git a/ext/zip/config.w32 b/ext/zip/config.w32 index 3f05d8454c1e..8dd22c7761cf 100644 --- a/ext/zip/config.w32 +++ b/ext/zip/config.w32 @@ -8,7 +8,7 @@ if (PHP_ZIP != "no") { (PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP) && CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP) && CHECK_LIB("liblzma_a.lib", "zip", PHP_ZIP)) ) { - EXTENSION('zip', 'php_zip.c zip_stream.c'); + EXTENSION('zip', 'php_zip.c zip_source.c zip_stream.c'); ADD_EXTENSION_DEP('zip', 'pcre'); if (get_define("LIBS_ZIP").match("libzip_a(?:_debug)?\.lib")) { diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 4749f91cc274..5194eaa0df0e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -575,28 +575,6 @@ static char * php_zipobj_get_zip_comment(ze_zip_object *obj, int *len) /* {{{ */ } /* }}} */ -/* Add a string to the list of buffers to be released when the object is destroyed.*/ -static void php_zipobj_add_buffer(ze_zip_object *obj, zend_string *str) /* {{{ */ -{ - size_t pos = obj->buffers_cnt++; - obj->buffers = safe_erealloc(obj->buffers, sizeof(*obj->buffers), obj->buffers_cnt, 0); - obj->buffers[pos] = zend_string_copy(str); -} -/* }}} */ - -static void php_zipobj_release_buffers(ze_zip_object *obj) /* {{{ */ -{ - if (obj->buffers_cnt > 0) { - for (size_t i = 0; i < obj->buffers_cnt; i++) { - zend_string_release(obj->buffers[i]); - } - efree(obj->buffers); - obj->buffers = NULL; - } - obj->buffers_cnt = 0; -} -/* }}} */ - /* Close and free the zip_t */ static bool php_zipobj_close(ze_zip_object *obj) /* {{{ */ { @@ -630,8 +608,6 @@ static bool php_zipobj_close(ze_zip_object *obj) /* {{{ */ obj->filename_len = 0; } - php_zipobj_release_buffers(obj); - obj->za = NULL; return success; } @@ -1531,10 +1507,12 @@ PHP_METHOD(ZipArchive, openString) ze_zip_object *ze_obj = Z_ZIP_P(self); + php_zipobj_close(ze_obj); + zip_error_t err; zip_error_init(&err); - zip_source_t * zip_source = zip_source_buffer_create(ZSTR_VAL(buffer), ZSTR_LEN(buffer), 0, &err); + zip_source_t * zip_source = php_zip_create_string_source(buffer, NULL, &err); if (!zip_source) { ze_obj->err_zip = zip_error_code_zip(&err); @@ -1543,8 +1521,6 @@ PHP_METHOD(ZipArchive, openString) RETURN_LONG(ze_obj->err_zip); } - php_zipobj_close(ze_obj); - struct zip *intern = zip_open_from_source(zip_source, ZIP_RDONLY, &err); if (!intern) { ze_obj->err_zip = zip_error_code_zip(&err); @@ -1554,7 +1530,6 @@ PHP_METHOD(ZipArchive, openString) RETURN_LONG(ze_obj->err_zip); } - php_zipobj_add_buffer(ze_obj, buffer); ze_obj->za = intern; zip_error_fini(&err); RETURN_TRUE; @@ -1597,7 +1572,7 @@ PHP_METHOD(ZipArchive, close) } /* }}} */ -/* {{{ close the zip archive */ +/* {{{ get the number of entries */ PHP_METHOD(ZipArchive, count) { struct zip *intern; @@ -1911,9 +1886,7 @@ PHP_METHOD(ZipArchive, addFromString) ZIP_FROM_OBJECT(intern, self); ze_obj = Z_ZIP_P(self); - php_zipobj_add_buffer(ze_obj, buffer); - - zs = zip_source_buffer(intern, ZSTR_VAL(buffer), ZSTR_LEN(buffer), 0); + zs = php_zip_create_string_source(buffer, NULL, NULL); if (zs == NULL) { RETURN_FALSE; diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 486d117398c8..22e257f50872 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -68,11 +68,9 @@ typedef struct _ze_zip_read_rsrc { /* Extends zend object */ typedef struct _ze_zip_object { struct zip *za; - zend_string **buffers; HashTable *prop_handler; char *filename; size_t filename_len; - size_t buffers_cnt; zip_int64_t last_id; int err_zip; int err_sys; @@ -96,6 +94,8 @@ php_stream *php_stream_zip_open(struct zip *arch, struct zip_stat *sb, const cha extern const php_stream_wrapper php_stream_zip_wrapper; +zip_source_t * php_zip_create_string_source(zend_string *str, zend_string **dest, zip_error_t *err); + #define LIBZIP_ATLEAST(m,n,p) (((m<<16) + (n<<8) + p) <= ((LIBZIP_VERSION_MAJOR<<16) + (LIBZIP_VERSION_MINOR<<8) + LIBZIP_VERSION_MICRO)) #endif /* PHP_ZIP_H */ diff --git a/ext/zip/zip_source.c b/ext/zip/zip_source.c new file mode 100644 index 000000000000..f0222bcd78a6 --- /dev/null +++ b/ext/zip/zip_source.c @@ -0,0 +1,206 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Tim Starling | + +----------------------------------------------------------------------+ +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include "php.h" +#include "php_zip.h" + +typedef struct _php_zip_string_source { + /* The current string being read from */ + zend_string *in_str; + /* The offset into in_str of the current read position */ + size_t in_offset; + /* The modification time returned in stat calls */ + time_t mtime; + /* The current string being written to */ + zend_string *out_str; + /* The offset into out_str of the current write position */ + size_t out_offset; + /* A place to copy the result to when the archive is closed, or NULL */ + zend_string **dest; + /* The error to be returned when libzip asks for the last error code */ + zip_error_t error; +} php_zip_string_source; + +/* The source callback function, see https://libzip.org/documentation/zip_source_function.html + * This is similar to read_data() in libzip's zip_source_buffer.c */ +static zip_int64_t php_zip_string_cb(void *userdata, void *data, zip_uint64_t len, zip_source_cmd_t cmd) +{ + php_zip_string_source *ctx = userdata; + switch (cmd) { + case ZIP_SOURCE_SUPPORTS: + return zip_source_make_command_bitmap( + ZIP_SOURCE_FREE, +#if LIBZIP_VERSION_MAJOR > 1 || LIBZIP_VERSION_MINOR >= 10 + ZIP_SOURCE_SUPPORTS_REOPEN, +#endif + ZIP_SOURCE_OPEN, + ZIP_SOURCE_READ, + ZIP_SOURCE_CLOSE, + ZIP_SOURCE_STAT, + ZIP_SOURCE_ERROR, + ZIP_SOURCE_SEEK, + ZIP_SOURCE_TELL, + ZIP_SOURCE_BEGIN_WRITE, + ZIP_SOURCE_WRITE, + ZIP_SOURCE_COMMIT_WRITE, + ZIP_SOURCE_ROLLBACK_WRITE, + ZIP_SOURCE_SEEK_WRITE, + ZIP_SOURCE_TELL_WRITE, + ZIP_SOURCE_REMOVE, + -1 + ); + + case ZIP_SOURCE_FREE: + zend_string_release(ctx->out_str); + zend_string_release(ctx->in_str); + efree(ctx); + return 0; + + /* Read ops */ + + case ZIP_SOURCE_OPEN: + ctx->in_offset = 0; + return 0; + + case ZIP_SOURCE_READ: { + size_t remaining = ZSTR_LEN(ctx->in_str) - ctx->in_offset; + len = MIN(len, remaining); + if (len) { + memcpy(data, ZSTR_VAL(ctx->in_str) + ctx->in_offset, len); + ctx->in_offset += len; + } + return len; + } + + case ZIP_SOURCE_CLOSE: + return 0; + + case ZIP_SOURCE_STAT: { + zip_stat_t *st; + if (len < sizeof(*st)) { + zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); + return -1; + } + + st = (zip_stat_t *)data; + zip_stat_init(st); + st->mtime = ctx->mtime; + st->size = ZSTR_LEN(ctx->in_str); + st->comp_size = st->size; + st->comp_method = ZIP_CM_STORE; + st->encryption_method = ZIP_EM_NONE; + st->valid = ZIP_STAT_MTIME | ZIP_STAT_SIZE | ZIP_STAT_COMP_SIZE | ZIP_STAT_COMP_METHOD | ZIP_STAT_ENCRYPTION_METHOD; + + return sizeof(*st); + } + + case ZIP_SOURCE_ERROR: + return zip_error_to_data(&ctx->error, data, len); + + /* Seekable read ops */ + + case ZIP_SOURCE_SEEK: { + zip_int64_t new_offset = zip_source_seek_compute_offset( + ctx->in_offset, ZSTR_LEN(ctx->in_str), data, len, &ctx->error); + if (new_offset < 0) { + return -1; + } + ctx->in_offset = (size_t)new_offset; + return 0; + } + + case ZIP_SOURCE_TELL: + if (ctx->in_offset > ZIP_INT64_MAX) { + zip_error_set(&ctx->error, ZIP_ER_TELL, EOVERFLOW); + return -1; + } + return (zip_int64_t)ctx->in_offset; + + /* Write ops */ + + case ZIP_SOURCE_BEGIN_WRITE: + zend_string_release(ctx->out_str); + ctx->out_str = ZSTR_EMPTY_ALLOC(); + return 0; + + case ZIP_SOURCE_WRITE: + if (ctx->out_offset > SIZE_MAX - len) { + zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0); + return -1; + } + if (ctx->out_offset + len > ZSTR_LEN(ctx->out_str)) { + ctx->out_str = zend_string_realloc(ctx->out_str, ctx->out_offset + len, false); + } + memcpy(ZSTR_VAL(ctx->out_str) + ctx->out_offset, data, len); + ctx->out_offset += len; + return len; + + case ZIP_SOURCE_COMMIT_WRITE: + ZSTR_VAL(ctx->out_str)[ZSTR_LEN(ctx->out_str)] = '\0'; + zend_string_release(ctx->in_str); + ctx->in_str = ctx->out_str; + ctx->out_str = ZSTR_EMPTY_ALLOC(); + if (ctx->dest) { + *(ctx->dest) = zend_string_copy(ctx->in_str); + } + return 0; + + case ZIP_SOURCE_ROLLBACK_WRITE: + zend_string_release(ctx->out_str); + ctx->out_str = ZSTR_EMPTY_ALLOC(); + return 0; + + case ZIP_SOURCE_SEEK_WRITE: { + zip_int64_t new_offset = zip_source_seek_compute_offset( + ctx->out_offset, ZSTR_LEN(ctx->out_str), data, len, &ctx->error); + if (new_offset < 0) { + return -1; + } + ctx->out_offset = new_offset; + return 0; + } + + case ZIP_SOURCE_TELL_WRITE: + if (ctx->out_offset > ZIP_INT64_MAX) { + zip_error_set(&ctx->error, ZIP_ER_TELL, EOVERFLOW); + return -1; + } + return (zip_int64_t)ctx->out_offset; + + case ZIP_SOURCE_REMOVE: + zend_string_release(ctx->in_str); + ctx->in_str = ZSTR_EMPTY_ALLOC(); + ctx->in_offset = 0; + return 0; + + default: + zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } +} + +zip_source_t * php_zip_create_string_source(zend_string *str, zend_string **dest, zip_error_t *err) +{ + php_zip_string_source *ctx = ecalloc(1, sizeof(php_zip_string_source)); + ctx->in_str = zend_string_copy(str); + ctx->out_str = ZSTR_EMPTY_ALLOC(); + ctx->dest = dest; + ctx->mtime = time(NULL); + return zip_source_function_create(php_zip_string_cb, (void*)ctx, err); +} From 168fef361ea16fdf97391674087db516c25450c3 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:42:17 +0200 Subject: [PATCH 105/300] Throw ValueError when a wrong flag value is provided to the second argument of `scandir()` (#19373) --- NEWS | 2 + UPGRADING | 2 + ext/standard/dir.c | 8 ++- .../tests/dir/scandir_invalid_flag.phpt | 12 ++++ .../dir/scandir_variation9-win32-mb.phpt | 71 ------------------- .../tests/dir/scandir_variation9.phpt | 65 ----------------- 6 files changed, 22 insertions(+), 138 deletions(-) create mode 100644 ext/standard/tests/dir/scandir_invalid_flag.phpt delete mode 100644 ext/standard/tests/dir/scandir_variation9-win32-mb.phpt delete mode 100644 ext/standard/tests/dir/scandir_variation9.phpt diff --git a/NEWS b/NEWS index 6a37ca9791c5..f39dd0954a50 100644 --- a/NEWS +++ b/NEWS @@ -152,6 +152,8 @@ PHP NEWS . Add enum SortDirection. (timwolla) . pathinfo() raises a ValueError with an invalid $flags argument. (David Carlier) + . Passing an invalid flag value to the second argument of scandir() will now + throw a ValueError. (alexandre-daubois) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index a7c91c4501e9..33717ac1ed57 100644 --- a/UPGRADING +++ b/UPGRADING @@ -139,6 +139,8 @@ PHP 8.6 UPGRADE NOTES - Standard: . pathinfo() now raises a ValueError when an invalid $flag argument value is passed. + . scandir() now raises a ValueError when an invalid $sorting_order + argument value is passed. - Zip: . ZipArchive::extractTo now raises a TypeError for the diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 730ef6154907..a7e080ce2abe 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -588,9 +588,13 @@ PHP_FUNCTION(scandir) n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasort); } else if (flags == PHP_SCANDIR_SORT_NONE) { n = php_stream_scandir(dirn, &namelist, context, NULL); - } else { + } else if (flags == PHP_SCANDIR_SORT_DESCENDING) { n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasortr); - } + } else { + zend_argument_value_error(2, "must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants"); + RETURN_THROWS(); + } + if (n < 0) { php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno)); RETURN_FALSE; diff --git a/ext/standard/tests/dir/scandir_invalid_flag.phpt b/ext/standard/tests/dir/scandir_invalid_flag.phpt new file mode 100644 index 000000000000..76838dc869b8 --- /dev/null +++ b/ext/standard/tests/dir/scandir_invalid_flag.phpt @@ -0,0 +1,12 @@ +--TEST-- +Provide wrong flags to scandir() +--FILE-- +getMessage() . "\n"; +} +?> +--EXPECT-- +scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants diff --git a/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt b/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt deleted file mode 100644 index 44d8b6daa5f9..000000000000 --- a/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -Test scandir() function : usage variations - different ints as $sorting_order arg ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECT-- -*** Testing scandir() : usage variations *** -array(4) { - [0]=> - string(45) "私はガラスを食べられますfile2.tmp" - [1]=> - string(45) "私はガラスを食べられますfile1.tmp" - [2]=> - string(2) ".." - [3]=> - string(1) "." -} -array(4) { - [0]=> - string(45) "私はガラスを食べられますfile2.tmp" - [1]=> - string(45) "私はガラスを食べられますfile1.tmp" - [2]=> - string(2) ".." - [3]=> - string(1) "." -} -array(4) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(45) "私はガラスを食べられますfile1.tmp" - [3]=> - string(45) "私はガラスを食べられますfile2.tmp" -} diff --git a/ext/standard/tests/dir/scandir_variation9.phpt b/ext/standard/tests/dir/scandir_variation9.phpt deleted file mode 100644 index 56e5575e5590..000000000000 --- a/ext/standard/tests/dir/scandir_variation9.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Test scandir() function : usage variations - different ints as $sorting_order arg ---FILE-- - ---CLEAN-- - ---EXPECT-- -*** Testing scandir() : usage variations *** -array(4) { - [0]=> - string(9) "file2.tmp" - [1]=> - string(9) "file1.tmp" - [2]=> - string(2) ".." - [3]=> - string(1) "." -} -array(4) { - [0]=> - string(9) "file2.tmp" - [1]=> - string(9) "file1.tmp" - [2]=> - string(2) ".." - [3]=> - string(1) "." -} -array(4) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(9) "file1.tmp" - [3]=> - string(9) "file2.tmp" -} From d34c09fd3294e2194d5034138ab9178df20552a9 Mon Sep 17 00:00:00 2001 From: Arshid Date: Fri, 10 Apr 2026 15:35:03 +0530 Subject: [PATCH 106/300] [skip ci] ext/standard: Fix typo (GH-21671) --- ext/standard/tests/math/pi_basic.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/tests/math/pi_basic.phpt b/ext/standard/tests/math/pi_basic.phpt index 10814ae8e819..acb95ceb62e7 100644 --- a/ext/standard/tests/math/pi_basic.phpt +++ b/ext/standard/tests/math/pi_basic.phpt @@ -7,7 +7,7 @@ precision=14 echo pi(), "\n"; echo M_PI, "\n"; // N.B pi() ignores all specified arguments no error -// messages are produced if arguments are spcified. +// messages are produced if arguments are specified. ?> --EXPECT-- 3.1415926535898 From 9b48fe782d02b7618bb642880948996d6d3d0005 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 10 Apr 2026 11:23:28 +0100 Subject: [PATCH 107/300] array_change_key_case(): Throw ValueError on invalid argument (#15883) --- ext/standard/array.c | 9 +- .../array_change_key_case_flag_error.phpt | 14 ++ .../array_change_key_case_variation.phpt | 50 ------- .../array_change_key_case_variation4.phpt | 132 ------------------ 4 files changed, 21 insertions(+), 184 deletions(-) create mode 100644 ext/standard/tests/array/array_change_key_case_flag_error.phpt delete mode 100644 ext/standard/tests/array/array_change_key_case_variation.phpt delete mode 100644 ext/standard/tests/array/array_change_key_case_variation4.phpt diff --git a/ext/standard/array.c b/ext/standard/array.c index 037f13a7a464..7db5dcb72944 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4799,7 +4799,7 @@ PHP_FUNCTION(array_change_key_case) zend_string *string_key; zend_string *new_key; zend_ulong num_key; - zend_long change_to_upper=0; + zend_long change_to_upper = PHP_CASE_LOWER; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ARRAY(array) @@ -4807,13 +4807,18 @@ PHP_FUNCTION(array_change_key_case) Z_PARAM_LONG(change_to_upper) ZEND_PARSE_PARAMETERS_END(); + if (change_to_upper != PHP_CASE_LOWER && change_to_upper != PHP_CASE_UPPER) { + zend_argument_value_error(2, "must be either CASE_LOWER or CASE_UPPER"); + RETURN_THROWS(); + } + array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(array))); ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_key, string_key, entry) { if (!string_key) { entry = zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, entry); } else { - if (change_to_upper) { + if (change_to_upper == PHP_CASE_UPPER) { new_key = zend_string_toupper(string_key); } else { new_key = zend_string_tolower(string_key); diff --git a/ext/standard/tests/array/array_change_key_case_flag_error.phpt b/ext/standard/tests/array/array_change_key_case_flag_error.phpt new file mode 100644 index 000000000000..e83a21815c99 --- /dev/null +++ b/ext/standard/tests/array/array_change_key_case_flag_error.phpt @@ -0,0 +1,14 @@ +--TEST-- +array_change_key_case(): invalid $case argument +--FILE-- +getMessage(), PHP_EOL; +} + +?> +--EXPECT-- +ValueError: array_change_key_case(): Argument #2 ($case) must be either CASE_LOWER or CASE_UPPER diff --git a/ext/standard/tests/array/array_change_key_case_variation.phpt b/ext/standard/tests/array/array_change_key_case_variation.phpt deleted file mode 100644 index c221a3f34101..000000000000 --- a/ext/standard/tests/array/array_change_key_case_variation.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test array_change_key_case() function - 2 ---FILE-- - 1, "two" => 2, "THREE" => 3, "FOUR" => "four"); - -/* use 'case' argument other than CASE_LOWER & CASE_UPPER */ -try { - var_dump(array_change_key_case($item, "CASE_UPPER")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; -} -var_dump(array_change_key_case($item, 5)); - -/* when keys are different in terms of only case */ -/* should return one value key pair with key being in lowercase */ -var_dump( array_change_key_case( array("ONE" => 1, "one" => 3, "One" => 4) ) ); - -/* should return one value key pair with key being in uppercase */ -var_dump( array_change_key_case( array("ONE" => 1, "one" => 2, "One" => 3), CASE_UPPER ) ); -var_dump( array_change_key_case( array("ONE" => 1, "one" => 1, "One" => 2), 5 ) ); - -echo "end\n"; -?> ---EXPECT-- -array_change_key_case(): Argument #2 ($case) must be of type int, string given -array(4) { - ["ONE"]=> - int(1) - ["TWO"]=> - int(2) - ["THREE"]=> - int(3) - ["FOUR"]=> - string(4) "four" -} -array(1) { - ["one"]=> - int(4) -} -array(1) { - ["ONE"]=> - int(3) -} -array(1) { - ["ONE"]=> - int(2) -} -end diff --git a/ext/standard/tests/array/array_change_key_case_variation4.phpt b/ext/standard/tests/array/array_change_key_case_variation4.phpt deleted file mode 100644 index 82d211451638..000000000000 --- a/ext/standard/tests/array/array_change_key_case_variation4.phpt +++ /dev/null @@ -1,132 +0,0 @@ ---TEST-- -Test array_change_key_case() function : usage variations - different int values for $case ---FILE-- - 'un', 'TWO' => 'deux', 'three' => 'trois'); -for ($i = -5; $i <=5; $i += 1){ - echo "\n-- \$sort argument is $i --\n"; - $temp = $input; - var_dump(array_change_key_case($temp, $i)); -} - -echo "Done"; -?> ---EXPECT-- -*** Testing array_change_key_case() : usage variations *** - --- $sort argument is -5 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is -4 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is -3 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is -2 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is -1 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is 0 -- -array(3) { - ["one"]=> - string(2) "un" - ["two"]=> - string(4) "deux" - ["three"]=> - string(5) "trois" -} - --- $sort argument is 1 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is 2 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is 3 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is 4 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} - --- $sort argument is 5 -- -array(3) { - ["ONE"]=> - string(2) "un" - ["TWO"]=> - string(4) "deux" - ["THREE"]=> - string(5) "trois" -} -Done From 391ec277d5497dc0a801fd193905d021f1fb34a0 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 10 Apr 2026 06:05:44 +0100 Subject: [PATCH 108/300] Fix GH-21698: memory leak in ZipArchive::addGlob on early returns. globfree was not called on the no-matches path and on the open_basedir reject path, leaking the glob_t contents populated by a successful glob() call. close GH-21702 --- NEWS | 4 ++++ ext/zip/php_zip.c | 2 ++ ext/zip/tests/gh21698.phpt | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 ext/zip/tests/gh21698.phpt diff --git a/NEWS b/NEWS index 2071326cf6e7..07653ef6a37f 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,10 @@ PHP NEWS - XSL: . Fixed bug GH-21600 (Segfault on module shutdown). (David Carlier) +- Zip: + . Fixed bug GH-21698 (memory leak with ZipArchive::addGlob() + early return statements). (David Carlier) + 09 Apr 2026, PHP 8.4.20 - Bz2: diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 75ae4aa91913..d25cfe04326f 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -675,12 +675,14 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { + globfree(&globbuf); return 0; } /* we assume that any glob pattern will match files from one directory only so checking the dirname of the first match should be sufficient */ if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) { + globfree(&globbuf); return -1; } diff --git a/ext/zip/tests/gh21698.phpt b/ext/zip/tests/gh21698.phpt new file mode 100644 index 000000000000..d77b2152e72f --- /dev/null +++ b/ext/zip/tests/gh21698.phpt @@ -0,0 +1,21 @@ +--TEST-- +GH-21698 (ZipArchive::addGlob memory leak when open_basedir rejects the match) +--EXTENSIONS-- +zip +--FILE-- +open($zipfile, ZipArchive::CREATE | ZipArchive::OVERWRITE); + +ini_set('open_basedir', '/nonexistent_dir_for_gh21698'); +var_dump($zip->addGlob(__FILE__, 0, [])); +$zip->close(); +?> +--CLEAN-- + +--EXPECTF-- +Warning: ZipArchive::addGlob(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d +bool(false) From 556757dcfff99285fce696b49573e86abee0aa95 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 10 Apr 2026 07:57:12 -0400 Subject: [PATCH 109/300] Fix build: use php_globfree wrapper in ZipArchive::addGlob early returns GH-21702 added two `globfree()` calls at the no-match and open_basedir reject paths, but called `globfree` directly instead of the `php_globfree` wrapper used at the success path below. PHP-8.5 dropped the direct `` include from `ext/zip/php_zip.c` in favor of the `php_glob.h` wrapper, so the build now breaks with `-Werror=implicit-function-declaration` on systems where `` isn't transitively included. Match the existing wrapper usage at line 675. close GH-21709 --- ext/zip/php_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index d6060d95ce8f..5202e9280ba0 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -636,14 +636,14 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { - globfree(&globbuf); + php_globfree(&globbuf); return 0; } /* we assume that any glob pattern will match files from one directory only so checking the dirname of the first match should be sufficient */ if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) { - globfree(&globbuf); + php_globfree(&globbuf); return -1; } From 663efacb91060d3ae3b0f0eb0980c3cb396cd02d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 10 Apr 2026 19:38:41 +0100 Subject: [PATCH 110/300] Update UPGRADING/NEWS for ValueErrors Also move the new ValueErrors into the correct section --- NEWS | 2 ++ UPGRADING | 60 +++++++++++++++++++++++++++---------------------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/NEWS b/NEWS index f39dd0954a50..a7ad6778875b 100644 --- a/NEWS +++ b/NEWS @@ -154,6 +154,8 @@ PHP NEWS (David Carlier) . Passing an invalid flag value to the second argument of scandir() will now throw a ValueError. (alexandre-daubois) + . array_change_key_case() now raises a ValueError when an invalid $case + argument value is passed. (Girgias) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index 33717ac1ed57..e9944d8eeeb8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -19,14 +19,29 @@ PHP 8.6 UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- GD: + . imagesetstyle(), imagefilter() and imagecrop() filter their + array arguments types/values and raise a TypeError/ValueError + accordingly. + - PCRE: . preg_grep() now returns false instead of a partial array when a PCRE execution error occurs (e.g. malformed UTF-8 input with the /u modifier). This is consistent with other preg_* functions. +- PCNTL: + . pcntl_alarm() now raises a ValueError if the seconds argument is + lower than zero or greater than platform's UINT_MAX. + - Phar: - . Invalid values now throw in Phar::mungServer() instead of being silently - ignored. + . Phar::mungServer() now raises a ValueError when an invalid + argument value is passed instead of being silently ignored. + +- Posix: + . posix_access() now raises a ValueError when an invalid $flags + argument value is passed. + . posix_mkfifo() now raises a ValueError when an invalid $permissions + argument value is passed. - Session: . A ValueError is not thrown if $name is a string containing null bytes in @@ -45,10 +60,21 @@ PHP 8.6 UPGRADE NOTES logic in their updateTimestamp() method. - Standard: - . Invalid mode values now throw in array_filter() instead of being silently - defaulted to 0. . Form feed (\f) is now added in the default trimmed characters of trim(), rtrim() and ltrim(). RFC: https://wiki.php.net/rfc/trim_form_feed + . array_filter() now raises a ValueError when an invalid $mode + argument value is passed. + . array_change_key_case() now raises a ValueError when an invalid $case + argument value is passed. + . pathinfo() now raises a ValueError when an invalid $flag + argument value is passed. + . scandir() now raises a ValueError when an invalid $sorting_order + argument value is passed. + +- Zip: + . ZipArchive::extractTo now raises a TypeError for the + files argument if one or more of the entries is not + a string. ======================================== 2. New Features @@ -103,11 +129,6 @@ PHP 8.6 UPGRADE NOTES 5. Changed Functions ======================================== -- GD: - . imagesetstyle(), imagefilter() and imagecrop() filter their - array arguments types/values and raise a TypeError/ValueError - accordingly. - - mysqli: . The return structure of mysqli_get_charset() no longer contains the undocumented "comment" element. The value of "charsetnr" is @@ -118,35 +139,14 @@ PHP 8.6 UPGRADE NOTES . Output of openssl_x509_parse() contains criticalExtensions listing all critical certificate extensions. -- PCNTL: - . pcntl_alarm() now throws a ValueError if the seconds argument is - lower than zero or greater than platform's UINT_MAX. - - Phar: . Phar::mungServer() now supports reference values. -- Posix: - . posix_access() now throws a ValueError exception if the flags - argument is invalid. - . posix_mkfifo() now throws a ValueError exception if the permissions - argument is invalid. - - Sockets: . socket_addrinfo_lookup() now has an additional optional argument $error when not null, and on failure, gives the error code (one of the EAI_* constants). -- Standard: - . pathinfo() now raises a ValueError when an invalid $flag argument - value is passed. - . scandir() now raises a ValueError when an invalid $sorting_order - argument value is passed. - -- Zip: - . ZipArchive::extractTo now raises a TypeError for the - files argument if one or more of the entries is not - a string. - ======================================== 6. New Functions ======================================== From 605301ce79a622ca518ce614a445123bbae52077 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 10 Apr 2026 11:51:02 -0700 Subject: [PATCH 111/300] UPGRADING: order extensions alphabetically [skip ci] --- UPGRADING | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/UPGRADING b/UPGRADING index e9944d8eeeb8..a6e2e9f1d68a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -24,15 +24,15 @@ PHP 8.6 UPGRADE NOTES array arguments types/values and raise a TypeError/ValueError accordingly. +- PCNTL: + . pcntl_alarm() now raises a ValueError if the seconds argument is + lower than zero or greater than platform's UINT_MAX. + - PCRE: . preg_grep() now returns false instead of a partial array when a PCRE execution error occurs (e.g. malformed UTF-8 input with the /u modifier). This is consistent with other preg_* functions. -- PCNTL: - . pcntl_alarm() now raises a ValueError if the seconds argument is - lower than zero or greater than platform's UINT_MAX. - - Phar: . Phar::mungServer() now raises a ValueError when an invalid argument value is passed instead of being silently ignored. @@ -228,6 +228,13 @@ PHP 8.6 UPGRADE NOTES 11. Changes to INI File Handling ======================================== +- Mbstring: + . The mbstring.detect_order INI directive now updates the internal detection + order when changed at runtime via ini_set(). Previously, runtime changes + using ini_set() did not take effect for mb_detect_order(). Setting the + directive to NULL or an empty string at runtime now leaves the previously + configured detection order unchanged. + - Mysqli: . mysqli.default_port now checks the validity of the value which should be between 0 and 65535 included. @@ -237,13 +244,6 @@ PHP 8.6 UPGRADE NOTES When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit points is printed in exit info output, in debug builds. -- Mbstring: - . The mbstring.detect_order INI directive now updates the internal detection - order when changed at runtime via ini_set(). Previously, runtime changes - using ini_set() did not take effect for mb_detect_order(). Setting the - directive to NULL or an empty string at runtime now leaves the previously - configured detection order unchanged. - ======================================== 12. Windows Support ======================================== From 9e8dbc1d1c60dd13a80fc01dd1dd2f496ca44ade Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 11 Apr 2026 00:16:54 +0530 Subject: [PATCH 112/300] ext/standard: fix wrong array_filter() default value Follow-up to GH-21100, that mistakenly set the default value of the `array_filter()` as `ARRAY_FILTER_USE_KEY`, when it should be `ARRAY_FILTER_USE_VALUE`, which is the newly defined constant. --- ext/standard/basic_functions.stub.php | 2 +- ext/standard/basic_functions_arginfo.h | 4 ++-- ext/standard/basic_functions_decl.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 1f3d5617f8df..c437f0d7f6c2 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1879,7 +1879,7 @@ function array_product(array $array): int|float {} function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {} -function array_filter(array $array, ?callable $callback = null, int $mode = ARRAY_FILTER_USE_KEY): array {} +function array_filter(array $array, ?callable $callback = null, int $mode = ARRAY_FILTER_USE_VALUE): array {} function array_find(array $array, callable $callback): mixed {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 991d76d91fc1..1ba20c6b26cc 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 749c71a6220260eb3fb593b982a9d97821e0539b + * Stub hash: a846d7e3dd1f1cebd8c6257132c97b3758067127 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -346,7 +346,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "ARRAY_FILTER_USE_KEY") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "ARRAY_FILTER_USE_VALUE") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_find, 0, 2, IS_MIXED, 0) diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index fce41100fc79..ab27bb64f0c7 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 749c71a6220260eb3fb593b982a9d97821e0539b */ + * Stub hash: a846d7e3dd1f1cebd8c6257132c97b3758067127 */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H -#define ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H +#define ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H typedef enum zend_enum_SortDirection { ZEND_ENUM_SortDirection_Ascending = 1, @@ -20,4 +20,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_749c71a6220260eb3fb593b982a9d97821e0539b_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H */ From 3c68fa9adc2b2989483738980d47052b03d82420 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 11 Apr 2026 00:28:38 +0530 Subject: [PATCH 113/300] UPGRADING: Fix `ARRAY_FILTER_USE_VALUE` const addition --- UPGRADING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index a6e2e9f1d68a..e64b65e7b0b8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -222,7 +222,7 @@ PHP 8.6 UPGRADE NOTES . EAI_IDN_ENCODE. - Standard - . ARRAY_FILTER_USE_KEY. + . ARRAY_FILTER_USE_VALUE. ======================================== 11. Changes to INI File Handling From 7744eab93367e0af560fcfa1b8a82cf9fdc90916 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 21 Mar 2026 07:46:13 +0000 Subject: [PATCH 114/300] ext/sqlite3: fix wrong pointer types passed to the free list comparator. SQLite3Stmt::close() and SQLite3Result::finalize() passed php_sqlite3_stmt pointer types instead of sqlite3_stmt pointers to zend_llist_del_element, causing the comparator to never match and both methods to silently become no-ops. Regression introduced in 5eae6d14052 ("Don't store the object zval directly"). close GH-21483 --- NEWS | 3 +++ ext/sqlite3/sqlite3.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 77a509ba2621..338e14bee080 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,9 @@ PHP NEWS . Fix concurrent iteration and deletion issues in SplObjectStorage. (ndossche) +- Sqlite3: + . Fixed wrong free list comparator pointer type. (David Carlier) + - Streams: . Fixed bug GH-21468 (Segfault in file_get_contents w/ a https URL and a proxy set). (ndossche) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index cea3ca0e3fb0..7aef25bf73b5 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -38,7 +38,7 @@ ZEND_DECLARE_MODULE_GLOBALS(sqlite3) static PHP_GINIT_FUNCTION(sqlite3); static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, const char *arg2, const char *arg3, const char *arg4); static void sqlite3_param_dtor(zval *data); -static int php_sqlite3_compare_stmt_free(php_sqlite3_stmt **stmt_obj_ptr, sqlite3_stmt *statement); +static int php_sqlite3_compare_stmt_free(php_sqlite3_stmt **stmt_obj_ptr, php_sqlite3_stmt *statement); static zend_always_inline void php_sqlite3_fetch_one(int n_cols, php_sqlite3_result *result_obj, zend_long mode, zval *result); #define SQLITE3_CHECK_INITIALIZED(db_obj, member, class_name) \ @@ -2145,7 +2145,7 @@ PHP_METHOD(SQLite3Result, finalize) /* We need to finalize an internal statement */ if (!result_obj->is_prepared_statement) { - zend_llist_del_element(&(result_obj->db_obj->free_list), &result_obj->stmt_obj, + zend_llist_del_element(&(result_obj->db_obj->free_list), result_obj->stmt_obj, (int (*)(void *, void *)) php_sqlite3_compare_stmt_free); } else { sqlite3_reset(result_obj->stmt_obj->stmt); @@ -2260,9 +2260,9 @@ static void php_sqlite3_free_list_dtor(void **item) } /* }}} */ -static int php_sqlite3_compare_stmt_free(php_sqlite3_stmt **stmt_obj_ptr, sqlite3_stmt *statement ) /* {{{ */ +static int php_sqlite3_compare_stmt_free(php_sqlite3_stmt **stmt_obj_ptr, php_sqlite3_stmt *statement ) /* {{{ */ { - return ((*stmt_obj_ptr)->initialised && statement == (*stmt_obj_ptr)->stmt); + return ((*stmt_obj_ptr)->initialised && statement == *stmt_obj_ptr); } /* }}} */ @@ -2376,7 +2376,7 @@ static void php_sqlite3_stmt_object_free_storage(zend_object *object) /* {{{ */ } if (intern->initialised) { - zend_llist_del_element(&(intern->db_obj->free_list), intern->stmt, + zend_llist_del_element(&(intern->db_obj->free_list), intern, (int (*)(void *, void *)) php_sqlite3_compare_stmt_free); } From 8ad79e15c93af97f46d8361ea3f6327feefdde23 Mon Sep 17 00:00:00 2001 From: Arshid Date: Sat, 11 Apr 2026 18:42:50 +0530 Subject: [PATCH 115/300] ext/standard: Use RETURN_LONG instead of RETVAL_LONG + return (#21719) --- ext/standard/type.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/standard/type.c b/ext/standard/type.c index e23e4620da23..8256b3274ea2 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -151,8 +151,7 @@ PHP_FUNCTION(intval) ZEND_PARSE_PARAMETERS_END(); if (Z_TYPE_P(num) != IS_STRING || base == 10) { - RETVAL_LONG(zval_get_long(num)); - return; + RETURN_LONG(zval_get_long(num)); } From afded3dffc432a86955e6b8018146abb3d03779b Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 9 Apr 2026 18:50:58 +0200 Subject: [PATCH 116/300] Simplify gh21031.phpt and solve flakiness stream_socket_accept($server, 3) would frequently run into a race-condition where the call would timeout and return false, triggering an exception when calling fclose(false) and terminating the process. This would break the phpt_notify() call in the main process due to a broken pipe. Increase the timeout to solve this. Furthermore, remove the proxy in the test that is not necessary to trigger the original bug solved in 7782b88. Closes GH-21692 --- ext/openssl/tests/gh21031.phpt | 36 +++++----------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/ext/openssl/tests/gh21031.phpt b/ext/openssl/tests/gh21031.phpt index 55694bf7676e..25bdb385a791 100644 --- a/ext/openssl/tests/gh21031.phpt +++ b/ext/openssl/tests/gh21031.phpt @@ -23,33 +23,11 @@ $serverCode = <<<'CODE' $server = stream_socket_server('tls://127.0.0.1:0', $errno, $errstr, $serverFlags, $ctx); phpt_notify_server_start($server); - $conn = stream_socket_accept($server, 3); - fclose($conn); - - phpt_wait(); -CODE; - -$proxyCode = <<<'CODE' - $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; - $server = stream_socket_server("tcp://127.0.0.1:0", $errornum, $errorstr, $flags); - phpt_notify_server_start($server); - - $upstream = stream_socket_client("tcp://{{ ADDR }}", $errornum, $errorstr, 30, STREAM_CLIENT_CONNECT); - stream_set_blocking($upstream, false); - - $conn = stream_socket_accept($server); - stream_set_blocking($conn, true); - - // reading CONNECT request headers - while (($line = fgets($conn)) !== false) { - if (rtrim($line) === '') break; // empty line means end of headers + $conn = stream_socket_accept($server, 10); + if ($conn) { + fclose($conn); } - // successful CONNECT response - fwrite($conn, "HTTP/1.0 200 Connection established\r\n\r\n"); - - fclose($conn); - fclose($upstream); phpt_wait(); CODE; @@ -67,15 +45,11 @@ $clientCode = <<<'CODE' var_dump(@file_get_contents("https://cs.php.net/", false, $clientCtx)); - phpt_notify('proxy'); - phpt_notify('server'); + phpt_notify(); CODE; include 'ServerClientTestCase.inc'; -ServerClientTestCase::getInstance()->run($clientCode, [ - 'server' => $serverCode, - 'proxy' => $proxyCode, -]); +ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- bool(false) From e5c86d2428417ee3b8e49407f4267397976cbacc Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 11:50:39 -0500 Subject: [PATCH 117/300] license-update: ext/bcmath source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/bcmath/bcmath.c | 14 ++++++-------- ext/bcmath/libbcmath/src/convert.c | 14 ++++++-------- ext/bcmath/libbcmath/src/convert.h | 14 ++++++-------- ext/bcmath/libbcmath/src/floor_or_ceil.c | 14 ++++++-------- ext/bcmath/libbcmath/src/long2num.c | 14 ++++++-------- ext/bcmath/libbcmath/src/round.c | 14 ++++++-------- ext/bcmath/php_bcmath.h | 14 ++++++-------- 7 files changed, 42 insertions(+), 56 deletions(-) diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index d3a077251e80..a1e6d48be523 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andi Gutmans | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/libbcmath/src/convert.c b/ext/bcmath/libbcmath/src/convert.c index ca5b84efde1b..b6003e58682b 100644 --- a/ext/bcmath/libbcmath/src/convert.c +++ b/ext/bcmath/libbcmath/src/convert.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/libbcmath/src/convert.h b/ext/bcmath/libbcmath/src/convert.h index 73c38cd13010..69ff63b48e03 100644 --- a/ext/bcmath/libbcmath/src/convert.h +++ b/ext/bcmath/libbcmath/src/convert.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/libbcmath/src/floor_or_ceil.c b/ext/bcmath/libbcmath/src/floor_or_ceil.c index 98dc94601ac7..f2682951ab82 100644 --- a/ext/bcmath/libbcmath/src/floor_or_ceil.c +++ b/ext/bcmath/libbcmath/src/floor_or_ceil.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Saki Takamachi | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/libbcmath/src/long2num.c b/ext/bcmath/libbcmath/src/long2num.c index 7645045b1fa3..494ec9e93564 100644 --- a/ext/bcmath/libbcmath/src/long2num.c +++ b/ext/bcmath/libbcmath/src/long2num.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Saki Takamachi | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/libbcmath/src/round.c b/ext/bcmath/libbcmath/src/round.c index 707489990f9b..bbca7e758fb7 100644 --- a/ext/bcmath/libbcmath/src/round.c +++ b/ext/bcmath/libbcmath/src/round.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Saki Takamachi | +----------------------------------------------------------------------+ diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index 83894fd7ca6b..334f7400c375 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andi Gutmans | +----------------------------------------------------------------------+ From fb37b1522f83fbf8d05c1217509c7fba4585952b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 11:59:39 -0500 Subject: [PATCH 118/300] license-update: ext/bz2 source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/bz2/bz2.c | 14 ++++++-------- ext/bz2/bz2_filter.c | 14 ++++++-------- ext/bz2/php_bz2.h | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index c5a97bac3300..c505005ab00a 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 69ee483d21f1..e1b24f6319f2 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon (pollita@php.net) | +----------------------------------------------------------------------+ diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index 8f1770f2808a..5da17d793059 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ From bff64ea14c80ced12052cac5a028b695b5fb4395 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:00:19 -0500 Subject: [PATCH 119/300] license-update: ext/calendar source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/calendar/cal_unix.c | 14 ++++++-------- ext/calendar/calendar.c | 14 ++++++-------- ext/calendar/easter.c | 14 ++++++-------- ext/calendar/php_calendar.h | 12 ++++++++++++ 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index 915da1c326ae..983857c553d9 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Colin Viebrock | diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 0330e60e51ad..f26d611092db 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Colin Viebrock | diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index 7fd8c0b33bb3..198ea7625a1a 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Colin Viebrock | diff --git a/ext/calendar/php_calendar.h b/ext/calendar/php_calendar.h index 38127eb80e24..eee8fbbb6bb3 100644 --- a/ext/calendar/php_calendar.h +++ b/ext/calendar/php_calendar.h @@ -1,3 +1,15 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + */ + #ifndef PHP_CALENDAR_H #define PHP_CALENDAR_H From 92e82054abe0a2a5b6e8f4ff0bb1d76895df3931 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:37:19 -0500 Subject: [PATCH 120/300] license-update: ext/com_dotnet source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/com_dotnet/com_com.c | 14 ++++++-------- ext/com_dotnet/com_dotnet.c | 14 ++++++-------- ext/com_dotnet/com_extension.c | 14 ++++++-------- ext/com_dotnet/com_handlers.c | 14 ++++++-------- ext/com_dotnet/com_iterator.c | 14 ++++++-------- ext/com_dotnet/com_misc.c | 14 ++++++-------- ext/com_dotnet/com_olechar.c | 14 ++++++-------- ext/com_dotnet/com_persist.c | 14 ++++++-------- ext/com_dotnet/com_saproxy.c | 14 ++++++-------- ext/com_dotnet/com_typeinfo.c | 14 ++++++-------- ext/com_dotnet/com_variant.c | 14 ++++++-------- ext/com_dotnet/com_wrapper.c | 14 ++++++-------- ext/com_dotnet/php_com_dotnet.h | 14 ++++++-------- ext/com_dotnet/php_com_dotnet_internal.h | 14 ++++++-------- ext/com_dotnet/tests/comtest/comtest.cpp | 14 ++++++-------- 15 files changed, 90 insertions(+), 120 deletions(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 1b8c8a082a05..d9938a13c950 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c index e4ab98485831..78f420ff5591 100644 --- a/ext/com_dotnet/com_dotnet.c +++ b/ext/com_dotnet/com_dotnet.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index df8314fa7613..1fe34cce06b5 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 638fc5d8a3ae..81c42da34972 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c index 931e4a9afdd0..796a31ac9be5 100644 --- a/ext/com_dotnet/com_iterator.c +++ b/ext/com_dotnet/com_iterator.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index 6c80bd2b9e24..47c670cd3588 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c index d04f8b18c623..6270db6580f8 100644 --- a/ext/com_dotnet/com_olechar.c +++ b/ext/com_dotnet/com_olechar.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Harald Radi | diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index 1b89aea15e23..5559567cbab3 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index ec79faa30a32..0317c329589e 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 28306b5609b0..ca20ed004d87 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Harald Radi | diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 7e63d66b3d3a..da3ccc64ffb3 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 3d05e17affae..c2297d18e58c 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h index 556c477799ea..51e24b3e5d2a 100644 --- a/ext/com_dotnet/php_com_dotnet.h +++ b/ext/com_dotnet/php_com_dotnet.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index 09fe49439347..5aef37659c44 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/com_dotnet/tests/comtest/comtest.cpp b/ext/com_dotnet/tests/comtest/comtest.cpp index a4f91d3121e4..9f6c8c3e466f 100644 --- a/ext/com_dotnet/tests/comtest/comtest.cpp +++ b/ext/com_dotnet/tests/comtest/comtest.cpp @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Christoph M. Becker | | Based on: | From e5f7b88afce9c15d3eecdd966315c163df20863c Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:02:39 -0500 Subject: [PATCH 121/300] license-update: ext/ctype source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/ctype/ctype.c | 14 ++++++-------- ext/ctype/php_ctype.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index b4835019602e..792c5c6679c4 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Hartmut Holzgraefe | +----------------------------------------------------------------------+ diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h index 1596514184c0..c0a1337aa7db 100644 --- a/ext/ctype/php_ctype.h +++ b/ext/ctype/php_ctype.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Hartmut Holzgraefe | +----------------------------------------------------------------------+ From f2b9a4ab6872b7edb11eea9e4134ddea6e6b677f Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:03:35 -0500 Subject: [PATCH 122/300] license-update: ext/curl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/curl/curl_file.c | 14 ++++++-------- ext/curl/curl_private.h | 14 ++++++-------- ext/curl/interface.c | 14 ++++++-------- ext/curl/multi.c | 14 ++++++-------- ext/curl/php_curl.h | 14 ++++++-------- ext/curl/share.c | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c index fd8baecc6838..b67028566c9c 100644 --- a/ext/curl/curl_file.c +++ b/ext/curl/curl_file.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/curl/curl_private.h b/ext/curl/curl_private.h index df6fd691a2a7..7058e9df9241 100644 --- a/ext/curl/curl_private.h +++ b/ext/curl/curl_private.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | | Wez Furlong | diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 57bc2f1ede3b..33f8cebd5a6c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 3e6142466e98..98a5e62b5564 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 6084d5935c70..9a70d6466c92 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | | Wez Furlong | diff --git a/ext/curl/share.c b/ext/curl/share.c index ba23faa46bf5..bfd12238eec1 100644 --- a/ext/curl/share.c +++ b/ext/curl/share.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierrick Charron | +----------------------------------------------------------------------+ From ae9b02891a0795b272333c3b5c454c3f03033ded Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:03:51 -0500 Subject: [PATCH 123/300] license-update: ext/date source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/date/php_date.c | 14 ++++++-------- ext/date/php_date.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 7e85c71b94c5..6c5dc29627d4 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ diff --git a/ext/date/php_date.h b/ext/date/php_date.h index f5f43bc7dfb0..4553d3e93c72 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ From 71fb4808a529a2fd38263de3f48f0e23cf0b2227 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:22:36 -0500 Subject: [PATCH 124/300] license-update: ext/dba source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/dba/dba.c | 16 +++++++--------- ext/dba/dba_cdb.c | 14 ++++++-------- ext/dba/dba_db1.c | 14 ++++++-------- ext/dba/dba_db2.c | 14 ++++++-------- ext/dba/dba_db3.c | 14 ++++++-------- ext/dba/dba_db4.c | 14 ++++++-------- ext/dba/dba_dbm.c | 14 ++++++-------- ext/dba/dba_flatfile.c | 14 ++++++-------- ext/dba/dba_gdbm.c | 14 ++++++-------- ext/dba/dba_inifile.c | 14 ++++++-------- ext/dba/dba_lmdb.c | 14 ++++++-------- ext/dba/dba_ndbm.c | 14 ++++++-------- ext/dba/dba_qdbm.c | 14 ++++++-------- ext/dba/dba_tcadb.c | 14 ++++++-------- ext/dba/libcdb/cdb.c | 14 ++++++-------- ext/dba/libcdb/cdb.h | 14 ++++++-------- ext/dba/libcdb/cdb_make.c | 14 ++++++-------- ext/dba/libcdb/cdb_make.h | 14 ++++++-------- ext/dba/libcdb/uint32.c | 14 ++++++-------- ext/dba/libcdb/uint32.h | 14 ++++++-------- ext/dba/libflatfile/flatfile.c | 14 ++++++-------- ext/dba/libflatfile/flatfile.h | 14 ++++++-------- ext/dba/libinifile/inifile.c | 14 ++++++-------- ext/dba/libinifile/inifile.h | 14 ++++++-------- ext/dba/php_dba.h | 14 ++++++-------- ext/dba/php_tcadb.h | 14 ++++++-------- 26 files changed, 157 insertions(+), 209 deletions(-) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index fb6017fbab88..a70951467be5 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -1,14 +1,12 @@ /* -+----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Marcus Boerger | diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index 10a381b579da..79b60c765c37 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Marcus Boerger | diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c index e4b83fcb55f3..dfcd637c8f87 100644 --- a/ext/dba/dba_db1.c +++ b/ext/dba/dba_db1.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Shen Cheng-Da | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index 5ec3df182e84..dd723ea40af8 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c index 8efc8d45b3ba..aacc65dda5a5 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index f64db5540ee9..16ac9be37a13 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | | Sascha Schumann | diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index b6d98d22893e..9579444454ce 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c index 997e6b9cc112..4208277a920d 100644 --- a/ext/dba/dba_flatfile.c +++ b/ext/dba/dba_flatfile.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c index 245c79e0e62d..961f539a451f 100644 --- a/ext/dba/dba_gdbm.c +++ b/ext/dba/dba_gdbm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 75a267055d96..1539bb0496dd 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_lmdb.c b/ext/dba/dba_lmdb.c index f6bdc7838a6a..57e74f320239 100644 --- a/ext/dba/dba_lmdb.c +++ b/ext/dba/dba_lmdb.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c index 40ae304cb7d2..2b4002591e91 100644 --- a/ext/dba/dba_ndbm.c +++ b/ext/dba/dba_ndbm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c index 5cbfeee874d5..8e692b7e55bc 100644 --- a/ext/dba/dba_qdbm.c +++ b/ext/dba/dba_qdbm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcin Gibula | +----------------------------------------------------------------------+ diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c index 6f4cb01e69e5..0539a7036602 100644 --- a/ext/dba/dba_tcadb.c +++ b/ext/dba/dba_tcadb.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Maclean | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index e694d6a6eb12..e258e8fe2d5a 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h index 4a94b81f832d..cc645196a983 100644 --- a/ext/dba/libcdb/cdb.h +++ b/ext/dba/libcdb/cdb.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c index 570e3625b0ce..b216b904e9bd 100644 --- a/ext/dba/libcdb/cdb_make.c +++ b/ext/dba/libcdb/cdb_make.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h index 96dbd43d1e56..aa94c1747267 100644 --- a/ext/dba/libcdb/cdb_make.h +++ b/ext/dba/libcdb/cdb_make.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c index 6f2507204aad..e5ba93fed2af 100644 --- a/ext/dba/libcdb/uint32.c +++ b/ext/dba/libcdb/uint32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h index 41041853fdbf..fe9ffba847a5 100644 --- a/ext/dba/libcdb/uint32.h +++ b/ext/dba/libcdb/uint32.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index bd76ecfdd0ae..561766777f6f 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | | based on ext/db/db.c by: | diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index 801ec8054f4f..ee3e5380b72b 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 6221c7f7a6e7..f5355b5a990c 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index e931c70bcbf6..75cf22d53fdd 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h index 033aed59c9ea..86c8a4f0ed65 100644 --- a/ext/dba/php_dba.h +++ b/ext/dba/php_dba.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/dba/php_tcadb.h b/ext/dba/php_tcadb.h index 6bfecf7d6d96..038440c7607e 100644 --- a/ext/dba/php_tcadb.h +++ b/ext/dba/php_tcadb.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Maclean | +----------------------------------------------------------------------+ From 2f76185b36e26656735c8f7f3da727556287445e Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:22:58 -0500 Subject: [PATCH 125/300] license-update: ext/dl_test source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/dl_test/dl_test.c | 14 ++++++-------- ext/dl_test/php_dl_test.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/dl_test/dl_test.c b/ext/dl_test/dl_test.c index 10afdb0720f2..4346e868c1e5 100644 --- a/ext/dl_test/dl_test.c +++ b/ext/dl_test/dl_test.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Arnaud Le Blanc | +----------------------------------------------------------------------+ diff --git a/ext/dl_test/php_dl_test.h b/ext/dl_test/php_dl_test.h index c12a43fe165b..133d513cbf99 100644 --- a/ext/dl_test/php_dl_test.h +++ b/ext/dl_test/php_dl_test.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: | +----------------------------------------------------------------------+ From cf23c1e80e7d6528b80c76739a5270e4028323f7 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:26:52 -0500 Subject: [PATCH 126/300] license-update: ext/dom source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/dom/attr.c | 14 ++++++-------- ext/dom/cdatasection.c | 14 ++++++-------- ext/dom/characterdata.c | 14 ++++++-------- ext/dom/comment.c | 14 ++++++-------- ext/dom/document.c | 14 ++++++-------- ext/dom/documentfragment.c | 14 ++++++-------- ext/dom/documenttype.c | 14 ++++++-------- ext/dom/dom_ce.h | 14 ++++++-------- ext/dom/dom_iterators.c | 14 ++++++-------- ext/dom/dom_properties.h | 14 ++++++-------- ext/dom/domexception.c | 14 ++++++-------- ext/dom/domexception.h | 14 ++++++-------- ext/dom/domimplementation.c | 14 ++++++-------- ext/dom/element.c | 14 ++++++-------- ext/dom/entity.c | 14 ++++++-------- ext/dom/entityreference.c | 14 ++++++-------- ext/dom/html5_parser.c | 14 ++++++-------- ext/dom/html5_parser.h | 14 ++++++-------- ext/dom/html5_serializer.c | 14 ++++++-------- ext/dom/html5_serializer.h | 14 ++++++-------- ext/dom/html_collection.c | 14 ++++++-------- ext/dom/html_collection.h | 14 ++++++-------- ext/dom/html_document.c | 14 ++++++-------- ext/dom/infra.c | 14 ++++++-------- ext/dom/infra.h | 14 ++++++-------- ext/dom/inner_outer_html_mixin.c | 14 ++++++-------- ext/dom/internal_helpers.h | 14 ++++++-------- ext/dom/namednodemap.c | 14 ++++++-------- ext/dom/namespace_compat.c | 14 ++++++-------- ext/dom/namespace_compat.h | 14 ++++++-------- ext/dom/node.c | 14 ++++++-------- ext/dom/nodelist.c | 14 ++++++-------- ext/dom/nodelist.h | 14 ++++++-------- ext/dom/notation.c | 14 ++++++-------- ext/dom/obj_map.c | 14 ++++++-------- ext/dom/obj_map.h | 14 ++++++-------- ext/dom/parentnode/css_selectors.c | 14 ++++++-------- ext/dom/parentnode/tree.c | 14 ++++++-------- ext/dom/php_dom.c | 14 ++++++-------- ext/dom/php_dom.h | 14 ++++++-------- ext/dom/private_data.c | 14 ++++++-------- ext/dom/private_data.h | 14 ++++++-------- ext/dom/processinginstruction.c | 14 ++++++-------- ext/dom/serialize_common.h | 14 ++++++-------- ext/dom/text.c | 14 ++++++-------- ext/dom/token_list.c | 14 ++++++-------- ext/dom/token_list.h | 14 ++++++-------- ext/dom/xml_common.h | 14 ++++++-------- ext/dom/xml_document.c | 14 ++++++-------- ext/dom/xml_serializer.c | 14 ++++++-------- ext/dom/xml_serializer.h | 14 ++++++-------- ext/dom/xpath.c | 14 ++++++-------- ext/dom/xpath_callbacks.c | 14 ++++++-------- ext/dom/xpath_callbacks.h | 14 ++++++-------- 54 files changed, 324 insertions(+), 432 deletions(-) diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 3107f5a21a2b..aa613a9f6d37 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index 6d063e19d43e..b735a93f3bee 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index e6b050a35867..80dce80cf2f0 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 211d27d2c319..b8ee8780d926 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/document.c b/ext/dom/document.c index 9d7213a64df2..b0274c676354 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 65538b711f2d..01af436c69ed 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index 958559801a53..03f471493777 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h index 5106738a0afd..8959d6013c7b 100644 --- a/ext/dom/dom_ce.h +++ b/ext/dom/dom_ce.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index 9134b107925a..b71d188dceee 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index 53113b04005a..918bf0c62f78 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 86eecd579b2b..a7bea009dabc 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/domexception.h b/ext/dom/domexception.h index 574e164424d6..3e3c7abed894 100644 --- a/ext/dom/domexception.h +++ b/ext/dom/domexception.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 0737be5fa5c9..e7fc2a414834 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/element.c b/ext/dom/element.c index 87f70c6f9a41..8e6102e9658e 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/entity.c b/ext/dom/entity.c index 3cfcbb5ae808..acccda98de0c 100644 --- a/ext/dom/entity.c +++ b/ext/dom/entity.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 215df208f530..a669fd2aa791 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/html5_parser.c b/ext/dom/html5_parser.c index 1ea7a27246b2..583de89ecc4f 100644 --- a/ext/dom/html5_parser.c +++ b/ext/dom/html5_parser.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html5_parser.h b/ext/dom/html5_parser.h index a56166639a60..43f7cf4f84cc 100644 --- a/ext/dom/html5_parser.h +++ b/ext/dom/html5_parser.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html5_serializer.c b/ext/dom/html5_serializer.c index 26eef9d5f968..ad3e24e00821 100644 --- a/ext/dom/html5_serializer.c +++ b/ext/dom/html5_serializer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html5_serializer.h b/ext/dom/html5_serializer.h index 27fd1c92f24f..e4ae67861eee 100644 --- a/ext/dom/html5_serializer.h +++ b/ext/dom/html5_serializer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html_collection.c b/ext/dom/html_collection.c index a4e2d6ad6fbe..0a24d4909cf4 100644 --- a/ext/dom/html_collection.c +++ b/ext/dom/html_collection.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html_collection.h b/ext/dom/html_collection.h index 59ab50abc1b0..f7e8effc16e1 100644 --- a/ext/dom/html_collection.h +++ b/ext/dom/html_collection.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/html_document.c b/ext/dom/html_document.c index 954403ca1c5d..58f07e079dd3 100644 --- a/ext/dom/html_document.c +++ b/ext/dom/html_document.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/infra.c b/ext/dom/infra.c index 9bb1942fe01d..33026d8a7526 100644 --- a/ext/dom/infra.c +++ b/ext/dom/infra.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/infra.h b/ext/dom/infra.h index d84ad5a2a0ef..4cf8ad26c789 100644 --- a/ext/dom/infra.h +++ b/ext/dom/infra.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/inner_outer_html_mixin.c b/ext/dom/inner_outer_html_mixin.c index 9c616441fe17..e1bf226d8602 100644 --- a/ext/dom/inner_outer_html_mixin.c +++ b/ext/dom/inner_outer_html_mixin.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/internal_helpers.h b/ext/dom/internal_helpers.h index c87ea49c6143..725c8222f429 100644 --- a/ext/dom/internal_helpers.h +++ b/ext/dom/internal_helpers.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 4964f836407c..c6d8157881a3 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/namespace_compat.c b/ext/dom/namespace_compat.c index ee32ec39dbeb..569daabc78ea 100644 --- a/ext/dom/namespace_compat.c +++ b/ext/dom/namespace_compat.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/namespace_compat.h b/ext/dom/namespace_compat.h index 23c80acc7fd7..dc66021e5ec4 100644 --- a/ext/dom/namespace_compat.h +++ b/ext/dom/namespace_compat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/node.c b/ext/dom/node.c index 4f516f198db4..8ba2a5aeb093 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 5e3de728e4fa..197ff3ceb880 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/nodelist.h b/ext/dom/nodelist.h index 5c5653eea6dc..084ce33b5494 100644 --- a/ext/dom/nodelist.h +++ b/ext/dom/nodelist.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/notation.c b/ext/dom/notation.c index f83b31428e16..73d0d6b083a5 100644 --- a/ext/dom/notation.c +++ b/ext/dom/notation.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/obj_map.c b/ext/dom/obj_map.c index 84fae3bad572..60f8b28e6cad 100644 --- a/ext/dom/obj_map.c +++ b/ext/dom/obj_map.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/obj_map.h b/ext/dom/obj_map.h index e7231eb7b10a..1853cce354e6 100644 --- a/ext/dom/obj_map.h +++ b/ext/dom/obj_map.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/parentnode/css_selectors.c b/ext/dom/parentnode/css_selectors.c index 4f77359835ce..7254bd909a0a 100644 --- a/ext/dom/parentnode/css_selectors.c +++ b/ext/dom/parentnode/css_selectors.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/parentnode/tree.c b/ext/dom/parentnode/tree.c index c51bd2753cd8..696c42ba64ff 100644 --- a/ext/dom/parentnode/tree.c +++ b/ext/dom/parentnode/tree.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Benjamin Eberlei | | Niels Dossche | diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index fe2810689193..87b359b2dcb6 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index e93000044f00..bc414adaa2f9 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/private_data.c b/ext/dom/private_data.c index bb20093b8ebb..373a79cbe712 100644 --- a/ext/dom/private_data.c +++ b/ext/dom/private_data.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/private_data.h b/ext/dom/private_data.h index ead6c75caf24..c64e96eb1a6d 100644 --- a/ext/dom/private_data.h +++ b/ext/dom/private_data.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index eda15720eab0..94e5d5b35067 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/serialize_common.h b/ext/dom/serialize_common.h index ed967c98a9ee..88088558e90e 100644 --- a/ext/dom/serialize_common.h +++ b/ext/dom/serialize_common.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/text.c b/ext/dom/text.c index 4c503201c8bf..357ff1969490 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/token_list.c b/ext/dom/token_list.c index 84a3dc10afeb..28dfc695ddc7 100644 --- a/ext/dom/token_list.c +++ b/ext/dom/token_list.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/token_list.h b/ext/dom/token_list.h index 7c8a6f612ffa..d5eb071f1882 100644 --- a/ext/dom/token_list.h +++ b/ext/dom/token_list.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index a63e43e92a77..419886bae4f7 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/xml_document.c b/ext/dom/xml_document.c index 66fd1d707aa0..e4f7542f1696 100644 --- a/ext/dom/xml_document.c +++ b/ext/dom/xml_document.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/xml_serializer.c b/ext/dom/xml_serializer.c index 7684057a391c..da43f24aab01 100644 --- a/ext/dom/xml_serializer.c +++ b/ext/dom/xml_serializer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/xml_serializer.h b/ext/dom/xml_serializer.h index 2d5c3bd84277..e686083a27aa 100644 --- a/ext/dom/xml_serializer.h +++ b/ext/dom/xml_serializer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index ce17c0810835..012fa9789e0d 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/xpath_callbacks.c b/ext/dom/xpath_callbacks.c index 816c925435ae..b1a2f808ca66 100644 --- a/ext/dom/xpath_callbacks.c +++ b/ext/dom/xpath_callbacks.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | diff --git a/ext/dom/xpath_callbacks.h b/ext/dom/xpath_callbacks.h index 3a4d8731f474..072f52196331 100644 --- a/ext/dom/xpath_callbacks.h +++ b/ext/dom/xpath_callbacks.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ From ca728f4055f4e6824148d6f4572e7742171d543a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:27:14 -0500 Subject: [PATCH 127/300] license-update: ext/enchant source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/enchant/enchant.c | 14 ++++++-------- ext/enchant/php_enchant.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index dd359527bee3..3c09be9077b0 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre-Alain Joye | | Ilia Alshanetsky | diff --git a/ext/enchant/php_enchant.h b/ext/enchant/php_enchant.h index 81150648d119..d87b2b6550ad 100644 --- a/ext/enchant/php_enchant.h +++ b/ext/enchant/php_enchant.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre-Alain Joye | +----------------------------------------------------------------------+ From c174ef7bded61397456e6c7673177eb39459c687 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:27:38 -0500 Subject: [PATCH 128/300] license-update: ext/exif source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/exif/exif.c | 14 ++++++-------- ext/exif/php_exif.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 904abede8f0f..91be074a0be3 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Marcus Boerger | diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h index 4ae5894f9036..5a4d2ec4d2a5 100644 --- a/ext/exif/php_exif.h +++ b/ext/exif/php_exif.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Marcus Boerger | From ebacd00e6e3b18d4a83d5e8aff70c8eab94d21f0 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:28:13 -0500 Subject: [PATCH 129/300] license-update: ext/ffi source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/ffi/ffi.c | 14 ++++++-------- ext/ffi/ffi.g | 28 ++++++++++++---------------- ext/ffi/ffi_parser.c | 14 ++++++-------- ext/ffi/php_ffi.h | 14 ++++++-------- 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 1650d0c59065..cc0c4c297447 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/ffi/ffi.g b/ext/ffi/ffi.g index 364837242890..9ab8ee404edf 100644 --- a/ext/ffi/ffi.g +++ b/ext/ffi/ffi.g @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ @@ -30,15 +28,13 @@ php llk.php ffi.g %{ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/ffi/ffi_parser.c b/ext/ffi/ffi_parser.c index 1067f80939f3..27f1469133fe 100644 --- a/ext/ffi/ffi_parser.c +++ b/ext/ffi/ffi_parser.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/ffi/php_ffi.h b/ext/ffi/php_ffi.h index ba92947e62bf..02fdb221c3df 100644 --- a/ext/ffi/php_ffi.h +++ b/ext/ffi/php_ffi.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ From 49760b2190b59c5c23c209d27b8733c605a1b39a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:29:10 -0500 Subject: [PATCH 130/300] license-update: ext/fileinfo source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/fileinfo/fileinfo.c | 14 ++++++-------- ext/fileinfo/php_fileinfo.h | 14 ++++++-------- ext/fileinfo/php_libmagic.c | 14 ++++++-------- ext/fileinfo/php_libmagic.h | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 50695981796e..6aa4520ffcc8 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ilia Alshanetsky | +----------------------------------------------------------------------+ diff --git a/ext/fileinfo/php_fileinfo.h b/ext/fileinfo/php_fileinfo.h index a0536294429b..50de6f79a537 100644 --- a/ext/fileinfo/php_fileinfo.h +++ b/ext/fileinfo/php_fileinfo.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ilia Alshanetsky | +----------------------------------------------------------------------+ diff --git a/ext/fileinfo/php_libmagic.c b/ext/fileinfo/php_libmagic.c index 05123fa8133a..efb78653c211 100644 --- a/ext/fileinfo/php_libmagic.c +++ b/ext/fileinfo/php_libmagic.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/ext/fileinfo/php_libmagic.h b/ext/fileinfo/php_libmagic.h index 23d0c3e8eaa1..59e8e091a487 100644 --- a/ext/fileinfo/php_libmagic.h +++ b/ext/fileinfo/php_libmagic.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ From c5b33888b005bd2aa185f2af9a91bba0462bef5a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:29:44 -0500 Subject: [PATCH 131/300] license-update: ext/filter source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/filter/callback_filter.c | 14 ++++++-------- ext/filter/filter.c | 14 ++++++-------- ext/filter/filter_private.h | 14 ++++++-------- ext/filter/logical_filters.c | 14 ++++++-------- ext/filter/php_filter.h | 14 ++++++-------- ext/filter/sanitizing_filters.c | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c index dea39c6cc7c3..688cbf072175 100644 --- a/ext/filter/callback_filter.c +++ b/ext/filter/callback_filter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 03f0f7887f92..9dbd6dceda53 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Derick Rethans | diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index 709b7fbc45ed..14975e7911a4 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 20760e656e76..c6653f29e3d7 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | | Pierre-A. Joye | diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h index 48ad5cc07943..ccf8b6b4883f 100644 --- a/ext/filter/php_filter.h +++ b/ext/filter/php_filter.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Derick Rethans | diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index 94cbd0c34bba..456b138ca934 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ From 929e489a8abdb75cf79c1f9c82a303e64387f93a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:30:23 -0500 Subject: [PATCH 132/300] license-update: ext/ftp source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/ftp/ftp.c | 14 ++++++-------- ext/ftp/ftp.h | 14 ++++++-------- ext/ftp/php_ftp.c | 14 ++++++-------- ext/ftp/php_ftp.h | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 0c1287a3e705..7172ac3e960f 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrew Skalski | | Stefan Esser (resume functions) | diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 241f92f57ec3..b336754c3f88 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrew Skalski | | Stefan Esser (resume functions) | diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 671281ee4729..8285f36a5628 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrew Skalski | | Stefan Esser (resume functions) | diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index b701f1331d0b..ee9cb50c4382 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrew Skalski | | Stefan Esser (resume functions) | From 8964e3f58f549431cadd829488b6b8e7a8e4def6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:31:19 -0500 Subject: [PATCH 133/300] license-update: ext/gd source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/gd/gd.c | 14 ++++++-------- ext/gd/libgd/gd_xbm.c | 14 ++++++-------- ext/gd/php_gd.h | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index ce2f74f6cdbd..c0cf361be055 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | diff --git a/ext/gd/libgd/gd_xbm.c b/ext/gd/libgd/gd_xbm.c index 3c655a2998c1..36eff58725dd 100644 --- a/ext/gd/libgd/gd_xbm.c +++ b/ext/gd/libgd/gd_xbm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 1ef57cb3c4d9..de83a8e0313e 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | From 4d3748235276f1e36b33a23eae8db3d8a399937d Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:32:39 -0500 Subject: [PATCH 134/300] license-update: ext/gettext source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/gettext/gettext.c | 14 ++++++-------- ext/gettext/php_gettext.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 6badea4a1769..172ae76d3876 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Alex Plotnick | +----------------------------------------------------------------------+ diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index f98e459f127c..5799ecf1d89b 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Alex Plotnick | +----------------------------------------------------------------------+ From b2319244bc4726045e8b4496d1e29a894a243462 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:33:24 -0500 Subject: [PATCH 135/300] license-update: ext/gmp source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/gmp/gmp.c | 14 ++++++-------- ext/gmp/php_gmp.h | 14 ++++++-------- ext/gmp/php_gmp_int.h | 12 ++++++++++++ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 318380808e01..cf6580e95e9b 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index 597c7a9146c2..220a36d64285 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/gmp/php_gmp_int.h b/ext/gmp/php_gmp_int.h index 32f1d32f592a..d6d0a6163ac4 100644 --- a/ext/gmp/php_gmp_int.h +++ b/ext/gmp/php_gmp_int.h @@ -1,3 +1,15 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + */ + /* interface header; needs to be installed; FIXME rename? */ #ifndef incl_PHP_GMP_INT_H From 03d95760c360ade2ec02a100dd7cf009250dabd9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:39:29 -0500 Subject: [PATCH 136/300] license-update: ext/hash source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/hash/hash.c | 14 ++++++-------- ext/hash/hash_adler32.c | 14 ++++++-------- ext/hash/hash_crc32.c | 14 ++++++-------- ext/hash/hash_fnv.c | 14 ++++++-------- ext/hash/hash_gost.c | 14 ++++++-------- ext/hash/hash_haval.c | 14 ++++++-------- ext/hash/hash_joaat.c | 14 ++++++-------- ext/hash/hash_md.c | 14 ++++++-------- ext/hash/hash_murmur.c | 14 ++++++-------- ext/hash/hash_ripemd.c | 14 ++++++-------- ext/hash/hash_sha.c | 14 ++++++-------- ext/hash/hash_sha3.c | 14 ++++++-------- ext/hash/hash_snefru.c | 14 ++++++-------- ext/hash/hash_tiger.c | 14 ++++++-------- ext/hash/hash_whirlpool.c | 14 ++++++-------- ext/hash/hash_xxhash.c | 14 ++++++-------- ext/hash/php_hash.h | 14 ++++++-------- ext/hash/php_hash_adler32.h | 14 ++++++-------- ext/hash/php_hash_crc32.h | 14 ++++++-------- ext/hash/php_hash_crc32_tables.h | 14 ++++++-------- ext/hash/php_hash_fnv.h | 14 ++++++-------- ext/hash/php_hash_gost.h | 14 ++++++-------- ext/hash/php_hash_haval.h | 14 ++++++-------- ext/hash/php_hash_joaat.h | 14 ++++++-------- ext/hash/php_hash_md.h | 14 ++++++-------- ext/hash/php_hash_murmur.h | 14 ++++++-------- ext/hash/php_hash_ripemd.h | 14 ++++++-------- ext/hash/php_hash_sha.h | 14 ++++++-------- ext/hash/php_hash_sha3.h | 14 ++++++-------- ext/hash/php_hash_snefru.h | 14 ++++++-------- ext/hash/php_hash_snefru_tables.h | 14 ++++++-------- ext/hash/php_hash_tiger.h | 14 ++++++-------- ext/hash/php_hash_tiger_tables.h | 14 ++++++-------- ext/hash/php_hash_whirlpool.h | 14 ++++++-------- ext/hash/php_hash_whirlpool_tables.h | 14 ++++++-------- ext/hash/php_hash_xxhash.h | 14 ++++++-------- 36 files changed, 216 insertions(+), 288 deletions(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 8a9494fb62d0..0f7d24275722 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | | Scott MacVicar | diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c index 3898ea60e877..2a40b3318cd5 100644 --- a/ext/hash/hash_adler32.c +++ b/ext/hash/hash_adler32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c index a770d0b55416..795cfcdf05b2 100644 --- a/ext/hash/hash_crc32.c +++ b/ext/hash/hash_crc32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c index 92d4922bd810..58101c4f2e6c 100644 --- a/ext/hash/hash_fnv.c +++ b/ext/hash/hash_fnv.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Maclean | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index bba585a11f9f..ad87754970b9 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c index 67bc2b2e4780..2adafdb189e2 100644 --- a/ext/hash/hash_haval.c +++ b/ext/hash/hash_haval.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c index 328f9292c4ca..0d7b64092f47 100644 --- a/ext/hash/hash_joaat.c +++ b/ext/hash/hash_joaat.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Martin Jansen | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c index dd299e695891..0bd48a9c823c 100644 --- a/ext/hash/hash_md.c +++ b/ext/hash/hash_md.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Taken from: ext/standard/md5.c | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_murmur.c b/ext/hash/hash_murmur.c index 0117b2e57d36..cd5d5f4be520 100644 --- a/ext/hash/hash_murmur.c +++ b/ext/hash/hash_murmur.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c index 4802fdf9a1fc..1b76f58ff098 100644 --- a/ext/hash/hash_ripemd.c +++ b/ext/hash/hash_ripemd.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c index 3129446fcde4..fd4d8ce5a36a 100644 --- a/ext/hash/hash_sha.c +++ b/ext/hash/hash_sha.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Steffan Esser | | Sara Golemon | diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c index 8fa0a4b4e522..d82840e81de6 100644 --- a/ext/hash/hash_sha3.c +++ b/ext/hash/hash_sha3.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c index b9b70f364208..5f08eb088229 100644 --- a/ext/hash/hash_snefru.c +++ b/ext/hash/hash_snefru.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c index 62d1b7347143..1153711d85d4 100644 --- a/ext/hash/hash_tiger.c +++ b/ext/hash/hash_tiger.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c index fa3c216a64c4..2a5b220d3a18 100644 --- a/ext/hash/hash_whirlpool.c +++ b/ext/hash/hash_whirlpool.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/hash_xxhash.c b/ext/hash/hash_xxhash.c index add922e8e84f..b6177905e691 100644 --- a/ext/hash/hash_xxhash.c +++ b/ext/hash/hash_xxhash.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index f56605a33be6..9eac5da78c8d 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h index bacb47ff1c91..c076893cb76f 100644 --- a/ext/hash/php_hash_adler32.h +++ b/ext/hash/php_hash_adler32.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h index b6accea17bb6..f50bff1c69ea 100644 --- a/ext/hash/php_hash_crc32.h +++ b/ext/hash/php_hash_crc32.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h index d126f177bdbe..28b70e4226b3 100644 --- a/ext/hash/php_hash_crc32_tables.h +++ b/ext/hash/php_hash_crc32_tables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h index e9d1ce8d0b44..5e82bc4dab66 100644 --- a/ext/hash/php_hash_fnv.h +++ b/ext/hash/php_hash_fnv.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Maclean | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h index 66992b09b976..f1116c3852d6 100644 --- a/ext/hash/php_hash_gost.h +++ b/ext/hash/php_hash_gost.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h index e3a3a31b3685..c857d84b0abd 100644 --- a/ext/hash/php_hash_haval.h +++ b/ext/hash/php_hash_haval.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h index fcc4cc3911bb..26e5adc03532 100644 --- a/ext/hash/php_hash_joaat.h +++ b/ext/hash/php_hash_joaat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Martin Jansen | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h index f648fbf7c3c2..f9abbd5583b5 100644 --- a/ext/hash/php_hash_md.h +++ b/ext/hash/php_hash_md.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Original Author: Rasmus Lerdorf | | Modified for pHASH by: Sara Golemon diff --git a/ext/hash/php_hash_murmur.h b/ext/hash/php_hash_murmur.h index 6180a9b8f341..1539011156b3 100644 --- a/ext/hash/php_hash_murmur.h +++ b/ext/hash/php_hash_murmur.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h index 0065450d21bb..1d30330d9e7f 100644 --- a/ext/hash/php_hash_ripemd.h +++ b/ext/hash/php_hash_ripemd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h index 50eef82e858a..e2c6eac30b4c 100644 --- a/ext/hash/php_hash_sha.h +++ b/ext/hash/php_hash_sha.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | SHA1 Author: Stefan Esser | | SHA256 Author: Sara Golemon | diff --git a/ext/hash/php_hash_sha3.h b/ext/hash/php_hash_sha3.h index 8381a8943b4d..2692fd5de766 100644 --- a/ext/hash/php_hash_sha3.h +++ b/ext/hash/php_hash_sha3.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h index df90e8e46968..2fbeb7c42ebe 100644 --- a/ext/hash/php_hash_snefru.h +++ b/ext/hash/php_hash_snefru.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h index 0fc186b14cbe..075b2fe3e620 100644 --- a/ext/hash/php_hash_snefru_tables.h +++ b/ext/hash/php_hash_snefru_tables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h index 92515c4dbf75..aa0f6cafbe8d 100644 --- a/ext/hash/php_hash_tiger.h +++ b/ext/hash/php_hash_tiger.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h index 594bf836fd04..f2d1bb69f1ec 100644 --- a/ext/hash/php_hash_tiger_tables.h +++ b/ext/hash/php_hash_tiger_tables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Michael Wallner | | Sara Golemon | diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h index f28ab234861b..b12e6c50a9f6 100644 --- a/ext/hash/php_hash_whirlpool.h +++ b/ext/hash/php_hash_whirlpool.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h index ef121efe9449..cd58d6c53a3e 100644 --- a/ext/hash/php_hash_whirlpool_tables.h +++ b/ext/hash/php_hash_whirlpool_tables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/ext/hash/php_hash_xxhash.h b/ext/hash/php_hash_xxhash.h index f099039f3711..e2003ba4c584 100644 --- a/ext/hash/php_hash_xxhash.h +++ b/ext/hash/php_hash_xxhash.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ From c8970b34c6012bf9a307c970f25ee2930755a6e2 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:39:49 -0500 Subject: [PATCH 137/300] license-update: ext/iconv source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/iconv/iconv.c | 14 ++++++-------- ext/iconv/php_iconv.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 914463ac03d6..5dfc5d9a1906 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rui Hirokawa | | Stig Bakken | diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index fcabdfaf6449..84a934e1e98b 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rui Hirokawa | | Stig Bakken | From bb068359d4410a6ceb50140e95c44be747b800b4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:45:06 -0500 Subject: [PATCH 138/300] license-update: ext/intl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/intl/breakiterator/breakiterator_class.cpp | 14 +++++++------- ext/intl/breakiterator/breakiterator_class.h | 14 +++++++------- ext/intl/breakiterator/breakiterator_iterators.cpp | 14 +++++++------- ext/intl/breakiterator/breakiterator_iterators.h | 14 +++++++------- ext/intl/breakiterator/breakiterator_methods.cpp | 14 +++++++------- .../breakiterator/codepointiterator_internal.cpp | 14 +++++++------- .../breakiterator/codepointiterator_internal.h | 14 +++++++------- .../breakiterator/codepointiterator_methods.cpp | 14 +++++++------- .../rulebasedbreakiterator_methods.cpp | 14 +++++++------- ext/intl/calendar/calendar_class.cpp | 14 +++++++------- ext/intl/calendar/calendar_class.h | 14 +++++++------- ext/intl/calendar/calendar_methods.cpp | 14 +++++++------- ext/intl/calendar/gregoriancalendar_methods.cpp | 14 +++++++------- ext/intl/collator/collator.h | 14 +++++++------- ext/intl/collator/collator_attr.cpp | 14 +++++++------- ext/intl/collator/collator_class.cpp | 14 +++++++------- ext/intl/collator/collator_class.h | 14 +++++++------- ext/intl/collator/collator_compare.cpp | 14 +++++++------- ext/intl/collator/collator_convert.cpp | 14 +++++++------- ext/intl/collator/collator_convert.h | 14 +++++++------- ext/intl/collator/collator_create.cpp | 14 +++++++------- ext/intl/collator/collator_error.cpp | 14 +++++++------- ext/intl/collator/collator_is_numeric.cpp | 14 +++++++------- ext/intl/collator/collator_is_numeric.h | 14 +++++++------- ext/intl/collator/collator_locale.cpp | 14 +++++++------- ext/intl/collator/collator_sort.cpp | 14 +++++++------- ext/intl/collator/collator_sort.h | 14 +++++++------- ext/intl/common/common_date.cpp | 14 +++++++------- ext/intl/common/common_date.h | 14 +++++++------- ext/intl/common/common_enum.cpp | 14 +++++++------- ext/intl/common/common_enum.h | 14 +++++++------- ext/intl/common/common_error.cpp | 14 +++++++------- ext/intl/converter/converter.cpp | 14 +++++++------- ext/intl/converter/converter.h | 14 +++++++------- ext/intl/dateformat/dateformat.cpp | 14 +++++++------- ext/intl/dateformat/dateformat.h | 14 +++++++------- ext/intl/dateformat/dateformat_attr.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_attrcpp.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_class.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_class.h | 14 +++++++------- ext/intl/dateformat/dateformat_create.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_create.h | 14 +++++++------- ext/intl/dateformat/dateformat_data.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_data.h | 14 +++++++------- ext/intl/dateformat/dateformat_format.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_format_object.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_helpers.cpp | 14 +++++++------- ext/intl/dateformat/dateformat_helpers.h | 14 +++++++------- ext/intl/dateformat/dateformat_parse.cpp | 14 +++++++------- ext/intl/dateformat/datepatterngenerator_class.cpp | 14 +++++++------- ext/intl/dateformat/datepatterngenerator_class.h | 14 +++++++------- .../dateformat/datepatterngenerator_methods.cpp | 14 +++++++------- ext/intl/formatter/formatter_attr.cpp | 14 +++++++------- ext/intl/formatter/formatter_class.cpp | 14 +++++++------- ext/intl/formatter/formatter_class.h | 14 +++++++------- ext/intl/formatter/formatter_data.cpp | 14 +++++++------- ext/intl/formatter/formatter_data.h | 14 +++++++------- ext/intl/formatter/formatter_format.cpp | 14 +++++++------- ext/intl/formatter/formatter_format.h | 14 +++++++------- ext/intl/formatter/formatter_main.cpp | 14 +++++++------- ext/intl/formatter/formatter_parse.cpp | 14 +++++++------- ext/intl/grapheme/grapheme.h | 14 +++++++------- ext/intl/grapheme/grapheme_string.cpp | 14 +++++++------- ext/intl/grapheme/grapheme_util.cpp | 14 +++++++------- ext/intl/grapheme/grapheme_util.h | 14 +++++++------- ext/intl/idn/idn.cpp | 14 ++++++-------- ext/intl/idn/idn.h | 14 ++++++-------- ext/intl/intl_common.h | 14 +++++++------- ext/intl/intl_convert.c | 14 +++++++------- ext/intl/intl_convert.h | 14 +++++++------- ext/intl/intl_convertcpp.cpp | 14 +++++++------- ext/intl/intl_convertcpp.h | 14 +++++++------- ext/intl/intl_cppshims.h | 14 +++++++------- ext/intl/intl_data.h | 14 +++++++------- ext/intl/intl_error.c | 14 +++++++------- ext/intl/intl_error.h | 14 +++++++------- ext/intl/listformatter/listformatter_class.cpp | 14 +++++++------- ext/intl/listformatter/listformatter_class.h | 14 +++++++------- ext/intl/locale/locale.cpp | 14 +++++++------- ext/intl/locale/locale.h | 14 +++++++------- ext/intl/locale/locale_class.cpp | 14 +++++++------- ext/intl/locale/locale_class.h | 14 +++++++------- ext/intl/locale/locale_methods.cpp | 14 +++++++------- ext/intl/msgformat/msgformat.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_attr.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_class.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_class.h | 14 +++++++------- ext/intl/msgformat/msgformat_data.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_data.h | 14 +++++++------- ext/intl/msgformat/msgformat_format.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_helpers.cpp | 14 +++++++------- ext/intl/msgformat/msgformat_helpers.h | 14 +++++++------- ext/intl/msgformat/msgformat_parse.cpp | 14 +++++++------- ext/intl/normalizer/normalizer.h | 14 +++++++------- ext/intl/normalizer/normalizer_class.cpp | 14 +++++++------- ext/intl/normalizer/normalizer_class.h | 14 +++++++------- ext/intl/normalizer/normalizer_normalize.cpp | 14 +++++++------- ext/intl/php_intl.c | 14 +++++++------- ext/intl/php_intl.h | 14 +++++++------- ext/intl/resourcebundle/resourcebundle.cpp | 14 +++++++------- ext/intl/resourcebundle/resourcebundle.h | 14 +++++++------- ext/intl/resourcebundle/resourcebundle_class.cpp | 14 +++++++------- ext/intl/resourcebundle/resourcebundle_class.h | 14 +++++++------- .../resourcebundle/resourcebundle_iterator.cpp | 14 +++++++------- ext/intl/resourcebundle/resourcebundle_iterator.h | 14 +++++++------- ext/intl/spoofchecker/spoofchecker_class.cpp | 14 +++++++------- ext/intl/spoofchecker/spoofchecker_class.h | 14 +++++++------- ext/intl/spoofchecker/spoofchecker_create.cpp | 14 +++++++------- ext/intl/spoofchecker/spoofchecker_main.cpp | 14 +++++++------- ext/intl/timezone/timezone_class.cpp | 14 +++++++------- ext/intl/timezone/timezone_class.h | 14 +++++++------- ext/intl/timezone/timezone_methods.cpp | 14 +++++++------- ext/intl/transliterator/transliterator.h | 14 +++++++------- ext/intl/transliterator/transliterator_class.cpp | 14 +++++++------- ext/intl/transliterator/transliterator_class.h | 14 +++++++------- ext/intl/transliterator/transliterator_methods.cpp | 14 +++++++------- ext/intl/uchar/uchar.cpp | 14 ++++++++++++++ ext/intl/uchar/uchar.h | 14 ++++++++++++++ 118 files changed, 838 insertions(+), 814 deletions(-) diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 4976d4ff675b..901ed1015536 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h index 0852d86e2a82..96d8bba626e2 100644 --- a/ext/intl/breakiterator/breakiterator_class.h +++ b/ext/intl/breakiterator/breakiterator_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 34176bf90e52..805057489013 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h index e52d066ac9ed..3ac07cd271c8 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.h +++ b/ext/intl/breakiterator/breakiterator_iterators.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index c9791d4b23ae..972cd28cf38e 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp index 3982a599af38..47d5df00c1be 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.cpp +++ b/ext/intl/breakiterator/codepointiterator_internal.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h index 8090bfbbd3cc..a64d49e24d5e 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.h +++ b/ext/intl/breakiterator/codepointiterator_internal.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index 49beb41be4e9..3b5044cb45a1 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index a7c322b1d816..1e1c2f0f6e5c 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 326b5475b73a..d09f04454790 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h index 167bded8f31b..540646ba3049 100644 --- a/ext/intl/calendar/calendar_class.h +++ b/ext/intl/calendar/calendar_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index c404286fe094..4828c6417300 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index 0cc3a94d4c56..b94548b54a65 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/collator/collator.h b/ext/intl/collator/collator.h index e92429f51179..959da9063e09 100644 --- a/ext/intl/collator/collator.h +++ b/ext/intl/collator/collator.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_attr.cpp b/ext/intl/collator/collator_attr.cpp index f56596deb6b0..14b8abf497b4 100644 --- a/ext/intl/collator/collator_attr.cpp +++ b/ext/intl/collator/collator_attr.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_class.cpp b/ext/intl/collator/collator_class.cpp index 293a089c2679..33c25845a864 100644 --- a/ext/intl/collator/collator_class.cpp +++ b/ext/intl/collator/collator_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h index a281b2bec8ad..af564f31e51b 100644 --- a/ext/intl/collator/collator_class.h +++ b/ext/intl/collator/collator_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_compare.cpp b/ext/intl/collator/collator_compare.cpp index 38e283a6d853..bac0bbf50b21 100644 --- a/ext/intl/collator/collator_compare.cpp +++ b/ext/intl/collator/collator_compare.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_convert.cpp b/ext/intl/collator/collator_convert.cpp index aa49661f8d77..dd3360a69092 100644 --- a/ext/intl/collator/collator_convert.cpp +++ b/ext/intl/collator/collator_convert.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h index 8c5356095b7a..1d65d9d2d76b 100644 --- a/ext/intl/collator/collator_convert.h +++ b/ext/intl/collator/collator_convert.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_create.cpp b/ext/intl/collator/collator_create.cpp index 59280bcdbed5..7aa715f8e091 100644 --- a/ext/intl/collator/collator_create.cpp +++ b/ext/intl/collator/collator_create.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_error.cpp b/ext/intl/collator/collator_error.cpp index aa333b5098a0..2a1eda8f9f36 100644 --- a/ext/intl/collator/collator_error.cpp +++ b/ext/intl/collator/collator_error.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_is_numeric.cpp b/ext/intl/collator/collator_is_numeric.cpp index b3cc52085dea..85a6eb695c0b 100644 --- a/ext/intl/collator/collator_is_numeric.cpp +++ b/ext/intl/collator/collator_is_numeric.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_is_numeric.h b/ext/intl/collator/collator_is_numeric.h index d30acd0b5843..e2f6ed83a178 100644 --- a/ext/intl/collator/collator_is_numeric.h +++ b/ext/intl/collator/collator_is_numeric.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_locale.cpp b/ext/intl/collator/collator_locale.cpp index 67b3d1342cc7..ea1393779846 100644 --- a/ext/intl/collator/collator_locale.cpp +++ b/ext/intl/collator/collator_locale.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_sort.cpp b/ext/intl/collator/collator_sort.cpp index 2f8685e61e30..2b1122cb747a 100644 --- a/ext/intl/collator/collator_sort.cpp +++ b/ext/intl/collator/collator_sort.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h index 53abc1028a0e..6b4c5766da6b 100644 --- a/ext/intl/collator/collator_sort.h +++ b/ext/intl/collator/collator_sort.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index f2ca077554b4..0a7aa023b43c 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h index 988f279294c3..a3a58eb3b037 100644 --- a/ext/intl/common/common_date.h +++ b/ext/intl/common/common_date.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index 8cf9796717f4..114dabdcc00a 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h index 6f0828528901..5c1f7495762f 100644 --- a/ext/intl/common/common_enum.h +++ b/ext/intl/common/common_enum.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/common/common_error.cpp b/ext/intl/common/common_error.cpp index cb12d8dff8f3..8d0cca52bb77 100644 --- a/ext/intl/common/common_error.cpp +++ b/ext/intl/common/common_error.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/converter/converter.cpp b/ext/intl/converter/converter.cpp index ad68909b5ea3..8921728fc9d7 100644 --- a/ext/intl/converter/converter.cpp +++ b/ext/intl/converter/converter.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/intl/converter/converter.h b/ext/intl/converter/converter.h index 5d779560811d..60967d196723 100644 --- a/ext/intl/converter/converter.h +++ b/ext/intl/converter/converter.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat.cpp b/ext/intl/dateformat/dateformat.cpp index cf2b445590bb..64454a8afde9 100644 --- a/ext/intl/dateformat/dateformat.cpp +++ b/ext/intl/dateformat/dateformat.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat.h b/ext/intl/dateformat/dateformat.h index 3e0b14cf6c0d..bff8d4e1ed72 100644 --- a/ext/intl/dateformat/dateformat.h +++ b/ext/intl/dateformat/dateformat.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_attr.cpp b/ext/intl/dateformat/dateformat_attr.cpp index 1ec55a806a7c..170a85889d53 100644 --- a/ext/intl/dateformat/dateformat_attr.cpp +++ b/ext/intl/dateformat/dateformat_attr.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index 13dadc9c9697..1391823ff0fe 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_class.cpp b/ext/intl/dateformat/dateformat_class.cpp index b6ccf9799007..03f2bc9a2d6a 100644 --- a/ext/intl/dateformat/dateformat_class.cpp +++ b/ext/intl/dateformat/dateformat_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h index e722c40b4bd9..458313a92502 100644 --- a/ext/intl/dateformat/dateformat_class.h +++ b/ext/intl/dateformat/dateformat_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 251f6f3fbc9b..4b055fc88eba 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | | Gustavo Lopes | diff --git a/ext/intl/dateformat/dateformat_create.h b/ext/intl/dateformat/dateformat_create.h index a15828e7794c..440f91d261d9 100644 --- a/ext/intl/dateformat/dateformat_create.h +++ b/ext/intl/dateformat/dateformat_create.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_data.cpp b/ext/intl/dateformat/dateformat_data.cpp index 42e7c9522055..6246257732c1 100644 --- a/ext/intl/dateformat/dateformat_data.cpp +++ b/ext/intl/dateformat/dateformat_data.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h index 962ffbade31d..a8dcef4c500b 100644 --- a/ext/intl/dateformat/dateformat_data.h +++ b/ext/intl/dateformat/dateformat_data.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_format.cpp b/ext/intl/dateformat/dateformat_format.cpp index 30570a5887c1..8b2a28d5c4d2 100644 --- a/ext/intl/dateformat/dateformat_format.cpp +++ b/ext/intl/dateformat/dateformat_format.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index a5113ce4cf9e..5b0950094d51 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp index 18dc594deddd..747105bb4f90 100644 --- a/ext/intl/dateformat/dateformat_helpers.cpp +++ b/ext/intl/dateformat/dateformat_helpers.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h index b931d9667e5f..f71e7f368706 100644 --- a/ext/intl/dateformat/dateformat_helpers.h +++ b/ext/intl/dateformat/dateformat_helpers.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/dateformat_parse.cpp b/ext/intl/dateformat/dateformat_parse.cpp index a82a20a42f96..667bbf98ac62 100644 --- a/ext/intl/dateformat/dateformat_parse.cpp +++ b/ext/intl/dateformat/dateformat_parse.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/datepatterngenerator_class.cpp b/ext/intl/dateformat/datepatterngenerator_class.cpp index 38faff751fb7..6a218fab72ff 100644 --- a/ext/intl/dateformat/datepatterngenerator_class.cpp +++ b/ext/intl/dateformat/datepatterngenerator_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Mel Dafert (mel@dafert.at) | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/datepatterngenerator_class.h b/ext/intl/dateformat/datepatterngenerator_class.h index eb8f7c433d0e..017bea2cca07 100644 --- a/ext/intl/dateformat/datepatterngenerator_class.h +++ b/ext/intl/dateformat/datepatterngenerator_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Mel Dafert (mel@dafert.at) | +----------------------------------------------------------------------+ diff --git a/ext/intl/dateformat/datepatterngenerator_methods.cpp b/ext/intl/dateformat/datepatterngenerator_methods.cpp index beaf10d9f507..f22be1c21fc1 100644 --- a/ext/intl/dateformat/datepatterngenerator_methods.cpp +++ b/ext/intl/dateformat/datepatterngenerator_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Mel Dafert (mel@dafert.at) | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_attr.cpp b/ext/intl/formatter/formatter_attr.cpp index 905a4415ef59..01108351a5d4 100644 --- a/ext/intl/formatter/formatter_attr.cpp +++ b/ext/intl/formatter/formatter_attr.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_class.cpp b/ext/intl/formatter/formatter_class.cpp index 214e1e57dae8..82843ba90911 100644 --- a/ext/intl/formatter/formatter_class.cpp +++ b/ext/intl/formatter/formatter_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h index bf21825b5f5f..1d3393fdd522 100644 --- a/ext/intl/formatter/formatter_class.h +++ b/ext/intl/formatter/formatter_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_data.cpp b/ext/intl/formatter/formatter_data.cpp index a9e48d0b14d8..593d746f1006 100644 --- a/ext/intl/formatter/formatter_data.cpp +++ b/ext/intl/formatter/formatter_data.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h index 35acc242a8db..183682bee6ae 100644 --- a/ext/intl/formatter/formatter_data.h +++ b/ext/intl/formatter/formatter_data.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_format.cpp b/ext/intl/formatter/formatter_format.cpp index 25d21cb20f1f..6b2651e4ead2 100644 --- a/ext/intl/formatter/formatter_format.cpp +++ b/ext/intl/formatter/formatter_format.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_format.h b/ext/intl/formatter/formatter_format.h index 0238d5d4b8b0..14aa91193ba2 100644 --- a/ext/intl/formatter/formatter_format.h +++ b/ext/intl/formatter/formatter_format.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_main.cpp b/ext/intl/formatter/formatter_main.cpp index a014323089a7..31c4cdcc485d 100644 --- a/ext/intl/formatter/formatter_main.cpp +++ b/ext/intl/formatter/formatter_main.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/formatter/formatter_parse.cpp b/ext/intl/formatter/formatter_parse.cpp index c7d0df8cbda0..b2dc2e8dcbdf 100644 --- a/ext/intl/formatter/formatter_parse.cpp +++ b/ext/intl/formatter/formatter_parse.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h index 8ec470d47927..b52f48f9d142 100644 --- a/ext/intl/grapheme/grapheme.h +++ b/ext/intl/grapheme/grapheme.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/grapheme/grapheme_string.cpp b/ext/intl/grapheme/grapheme_string.cpp index 36c0cc0f732c..9b463fcd94cf 100644 --- a/ext/intl/grapheme/grapheme_string.cpp +++ b/ext/intl/grapheme/grapheme_string.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/grapheme/grapheme_util.cpp b/ext/intl/grapheme/grapheme_util.cpp index a04f3db0b8a6..d5bbef6009cd 100644 --- a/ext/intl/grapheme/grapheme_util.cpp +++ b/ext/intl/grapheme/grapheme_util.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 57d2ace384f8..a1d67981d270 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/idn/idn.cpp b/ext/intl/idn/idn.cpp index 6c7e4d8c6d68..28708eb93508 100644 --- a/ext/intl/idn/idn.cpp +++ b/ext/intl/idn/idn.cpp @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre A. Joye | | Gustavo Lopes | diff --git a/ext/intl/idn/idn.h b/ext/intl/idn/idn.h index 596e63f207e0..cf3af63a26ae 100644 --- a/ext/intl/idn/idn.h +++ b/ext/intl/idn/idn.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre A. Joye | +----------------------------------------------------------------------+ diff --git a/ext/intl/intl_common.h b/ext/intl/intl_common.h index cef96325e9af..1fdb1c16efed 100644 --- a/ext/intl/intl_common.h +++ b/ext/intl/intl_common.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/intl_convert.c b/ext/intl/intl_convert.c index 39f70821e117..abbcc6c1fa73 100644 --- a/ext/intl/intl_convert.c +++ b/ext/intl/intl_convert.c @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/intl_convert.h b/ext/intl/intl_convert.h index 5cc3a671333d..443d373d55c2 100644 --- a/ext/intl/intl_convert.h +++ b/ext/intl/intl_convert.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/intl_convertcpp.cpp b/ext/intl/intl_convertcpp.cpp index b919c3fb4087..cd7614b3a6c6 100644 --- a/ext/intl/intl_convertcpp.cpp +++ b/ext/intl/intl_convertcpp.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/intl_convertcpp.h b/ext/intl/intl_convertcpp.h index 28948c2e01ca..ef4310bac4ff 100644 --- a/ext/intl/intl_convertcpp.h +++ b/ext/intl/intl_convertcpp.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/intl_cppshims.h b/ext/intl/intl_cppshims.h index 169448a2edf3..d2bc5f9a240d 100644 --- a/ext/intl/intl_cppshims.h +++ b/ext/intl/intl_cppshims.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index c818427e07e1..c36f0adf5665 100644 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index be6e53fb5439..f19a5ec617dc 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index d8d9fac97bf2..dd13cf84ebd2 100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/listformatter/listformatter_class.cpp b/ext/intl/listformatter/listformatter_class.cpp index 8a7f9ffef9c2..d50374393cce 100644 --- a/ext/intl/listformatter/listformatter_class.cpp +++ b/ext/intl/listformatter/listformatter_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bogdan Ungureanu | +----------------------------------------------------------------------+ diff --git a/ext/intl/listformatter/listformatter_class.h b/ext/intl/listformatter/listformatter_class.h index 8edbf8d63e2d..6aa43740604e 100644 --- a/ext/intl/listformatter/listformatter_class.h +++ b/ext/intl/listformatter/listformatter_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bogdan Ungureanu | +----------------------------------------------------------------------+ diff --git a/ext/intl/locale/locale.cpp b/ext/intl/locale/locale.cpp index 76b269ca85e3..bad1c775c1b0 100644 --- a/ext/intl/locale/locale.cpp +++ b/ext/intl/locale/locale.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/locale/locale.h b/ext/intl/locale/locale.h index 31aef035050d..1c40871d2065 100644 --- a/ext/intl/locale/locale.h +++ b/ext/intl/locale/locale.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/locale/locale_class.cpp b/ext/intl/locale/locale_class.cpp index 75fde45d53d6..a8d34f2e9f24 100644 --- a/ext/intl/locale/locale_class.cpp +++ b/ext/intl/locale/locale_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h index 64a661ca2b44..86cbc6ed9421 100644 --- a/ext/intl/locale/locale_class.h +++ b/ext/intl/locale/locale_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp index cff62b503395..6370b1282af8 100644 --- a/ext/intl/locale/locale_methods.cpp +++ b/ext/intl/locale/locale_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kirti Velankar | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat.cpp b/ext/intl/msgformat/msgformat.cpp index a9e1f71bfc60..3857e97b4a4a 100644 --- a/ext/intl/msgformat/msgformat.cpp +++ b/ext/intl/msgformat/msgformat.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_attr.cpp b/ext/intl/msgformat/msgformat_attr.cpp index e7ec006e5e79..15c3525b858f 100644 --- a/ext/intl/msgformat/msgformat_attr.cpp +++ b/ext/intl/msgformat/msgformat_attr.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_class.cpp b/ext/intl/msgformat/msgformat_class.cpp index e762febf0d1b..06ba7fa6fa67 100644 --- a/ext/intl/msgformat/msgformat_class.cpp +++ b/ext/intl/msgformat/msgformat_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h index 809fdec65418..e80c75cf2e17 100644 --- a/ext/intl/msgformat/msgformat_class.h +++ b/ext/intl/msgformat/msgformat_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_data.cpp b/ext/intl/msgformat/msgformat_data.cpp index f8b7ec39601e..c629e8a3d818 100644 --- a/ext/intl/msgformat/msgformat_data.cpp +++ b/ext/intl/msgformat/msgformat_data.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h index bac94cbec34c..121c8360efea 100644 --- a/ext/intl/msgformat/msgformat_data.h +++ b/ext/intl/msgformat/msgformat_data.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_format.cpp b/ext/intl/msgformat/msgformat_format.cpp index 8e3ec28b389e..c0a02ad8db17 100644 --- a/ext/intl/msgformat/msgformat_format.cpp +++ b/ext/intl/msgformat/msgformat_format.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c70463f95fba..399db1e8c0b0 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h index 20282526cbfb..c1a153783511 100644 --- a/ext/intl/msgformat/msgformat_helpers.h +++ b/ext/intl/msgformat/msgformat_helpers.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/msgformat/msgformat_parse.cpp b/ext/intl/msgformat/msgformat_parse.cpp index 28d7ce710802..b50dc1efed41 100644 --- a/ext/intl/msgformat/msgformat_parse.cpp +++ b/ext/intl/msgformat/msgformat_parse.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/ext/intl/normalizer/normalizer.h b/ext/intl/normalizer/normalizer.h index 3c6aa0e6eafc..c6feaa106eb1 100644 --- a/ext/intl/normalizer/normalizer.h +++ b/ext/intl/normalizer/normalizer.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/normalizer/normalizer_class.cpp b/ext/intl/normalizer/normalizer_class.cpp index 3838f7546325..1898df04e2e1 100644 --- a/ext/intl/normalizer/normalizer_class.cpp +++ b/ext/intl/normalizer/normalizer_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h index 8f88f215abcc..e30c29237041 100644 --- a/ext/intl/normalizer/normalizer_class.h +++ b/ext/intl/normalizer/normalizer_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/normalizer/normalizer_normalize.cpp b/ext/intl/normalizer/normalizer_normalize.cpp index 9cf809f27183..846eda64b4c8 100644 --- a/ext/intl/normalizer/normalizer_normalize.cpp +++ b/ext/intl/normalizer/normalizer_normalize.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ed Batutis | +----------------------------------------------------------------------+ diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 441b26ae088d..9882309c6f46 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h index a56c34f3dce4..1a9b4f769e86 100644 --- a/ext/intl/php_intl.h +++ b/ext/intl/php_intl.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Vadim Savchuk | | Dmitry Lakhtyuk | diff --git a/ext/intl/resourcebundle/resourcebundle.cpp b/ext/intl/resourcebundle/resourcebundle.cpp index 7d4f63521184..d3a41b7c8d92 100644 --- a/ext/intl/resourcebundle/resourcebundle.cpp +++ b/ext/intl/resourcebundle/resourcebundle.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h index c46908a8edff..e7c79c480d35 100644 --- a/ext/intl/resourcebundle/resourcebundle.h +++ b/ext/intl/resourcebundle/resourcebundle.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/resourcebundle/resourcebundle_class.cpp b/ext/intl/resourcebundle/resourcebundle_class.cpp index d88ba2ad1317..b6e62f2a4d4f 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.cpp +++ b/ext/intl/resourcebundle/resourcebundle_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h index 334532bde99b..f21ac5690930 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.h +++ b/ext/intl/resourcebundle/resourcebundle_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.cpp b/ext/intl/resourcebundle/resourcebundle_iterator.cpp index 7747b34adbd4..29288418437a 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.cpp +++ b/ext/intl/resourcebundle/resourcebundle_iterator.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h index c323d4e17b4c..762c12f363b5 100644 --- a/ext/intl/resourcebundle/resourcebundle_iterator.h +++ b/ext/intl/resourcebundle/resourcebundle_iterator.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Hans-Peter Oeri (University of St.Gallen) | +----------------------------------------------------------------------+ diff --git a/ext/intl/spoofchecker/spoofchecker_class.cpp b/ext/intl/spoofchecker/spoofchecker_class.cpp index ba4c64321f14..e3bc04766610 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.cpp +++ b/ext/intl/spoofchecker/spoofchecker_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h index 06701eb60e36..0b0244c69528 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.h +++ b/ext/intl/spoofchecker/spoofchecker_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/intl/spoofchecker/spoofchecker_create.cpp b/ext/intl/spoofchecker/spoofchecker_create.cpp index 1ed4055cccd1..f4b51492cac6 100644 --- a/ext/intl/spoofchecker/spoofchecker_create.cpp +++ b/ext/intl/spoofchecker/spoofchecker_create.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/intl/spoofchecker/spoofchecker_main.cpp b/ext/intl/spoofchecker/spoofchecker_main.cpp index e49ddec87a3c..e3e21ef72b79 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.cpp +++ b/ext/intl/spoofchecker/spoofchecker_main.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index c613edf5585f..cf528f1cc09d 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h index bbfd8adcae23..d1f1c5f8fe2c 100644 --- a/ext/intl/timezone/timezone_class.h +++ b/ext/intl/timezone/timezone_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 3de186a9ca03..29180f9caa2d 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/transliterator/transliterator.h b/ext/intl/transliterator/transliterator.h index f98ca0682965..2a86eb6781be 100644 --- a/ext/intl/transliterator/transliterator.h +++ b/ext/intl/transliterator/transliterator.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/transliterator/transliterator_class.cpp b/ext/intl/transliterator/transliterator_class.cpp index 3525872d77f6..1da1dbdab8ea 100644 --- a/ext/intl/transliterator/transliterator_class.cpp +++ b/ext/intl/transliterator/transliterator_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h index 7e02d6fa5e28..9d41f0ea2bbc 100644 --- a/ext/intl/transliterator/transliterator_class.h +++ b/ext/intl/transliterator/transliterator_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/transliterator/transliterator_methods.cpp b/ext/intl/transliterator/transliterator_methods.cpp index d8a8cbb7a49e..2dce4612e7a2 100644 --- a/ext/intl/transliterator/transliterator_methods.cpp +++ b/ext/intl/transliterator/transliterator_methods.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/intl/uchar/uchar.cpp b/ext/intl/uchar/uchar.cpp index f1f777f0ea3e..ccb642b9d416 100644 --- a/ext/intl/uchar/uchar.cpp +++ b/ext/intl/uchar/uchar.cpp @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Sara Golemon | + +----------------------------------------------------------------------+ + */ + extern "C" { #include "uchar.h" #include "intl_data.h" diff --git a/ext/intl/uchar/uchar.h b/ext/intl/uchar/uchar.h index 25bab1f2156f..7b472163ab0f 100644 --- a/ext/intl/uchar/uchar.h +++ b/ext/intl/uchar/uchar.h @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Sara Golemon | + +----------------------------------------------------------------------+ + */ + #ifndef incl_PHP_INTL_UCHAR_H #define incl_PHP_INTL_UCHAR_H From 1101afb73003d6ffca0351353e2043ee9a2e1c41 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:47:59 -0500 Subject: [PATCH 139/300] license-update: ext/json source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/json/json.c | 14 ++++++-------- ext/json/json_encoder.c | 14 ++++++-------- ext/json/json_parser.y | 14 ++++++-------- ext/json/json_scanner.re | 14 ++++++-------- ext/json/php_json.h | 14 ++++++-------- ext/json/php_json_encoder.h | 14 ++++++-------- ext/json/php_json_parser.h | 14 ++++++-------- ext/json/php_json_scanner.h | 14 ++++++-------- 8 files changed, 48 insertions(+), 64 deletions(-) diff --git a/ext/json/json.c b/ext/json/json.c index 079f67a5c400..3ba53e959c5d 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Omar Kilani | | Jakub Zelenka | diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index d84917e95c7b..424315eca7ec 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Omar Kilani | | Jakub Zelenka | diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y index 2fd4edfe3693..cf296ed9db62 100644 --- a/ext/json/json_parser.y +++ b/ext/json/json_parser.y @@ -2,15 +2,13 @@ %code top { /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/json/json_scanner.re b/ext/json/json_scanner.re index d6eaaf65b2e1..e4d25009132a 100644 --- a/ext/json/json_scanner.re +++ b/ext/json/json_scanner.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/json/php_json.h b/ext/json/php_json.h index bbe8be9d60ad..e2728835ed42 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Omar Kilani | | Jakub Zelenka | diff --git a/ext/json/php_json_encoder.h b/ext/json/php_json_encoder.h index d66d71cb5538..30cc1d564fa5 100644 --- a/ext/json/php_json_encoder.h +++ b/ext/json/php_json_encoder.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/json/php_json_parser.h b/ext/json/php_json_parser.h index 8fee3d11c6bf..4a7d64307c43 100644 --- a/ext/json/php_json_parser.h +++ b/ext/json/php_json_parser.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/json/php_json_scanner.h b/ext/json/php_json_scanner.h index a6de149391dc..90460cf9952a 100644 --- a/ext/json/php_json_scanner.h +++ b/ext/json/php_json_scanner.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jakub Zelenka | +----------------------------------------------------------------------+ From 43c1555851f2aabbf48cd1efe14a93955253dfce Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:48:17 -0500 Subject: [PATCH 140/300] license-update: ext/ldap source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/ldap/ldap.c | 14 ++++++-------- ext/ldap/php_ldap.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index fe8d7a5c5c67..f97761a42a2d 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Amitay Isaacs | | Eric Warnke | diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h index a8c4a77af801..a8591888fa83 100644 --- a/ext/ldap/php_ldap.h +++ b/ext/ldap/php_ldap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Amitay Isaacs | | Eric Warnke | From bded30ce211211463a91e9fda284743a685a95e9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:48:43 -0500 Subject: [PATCH 141/300] license-update: ext/lexbor source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/lexbor/php_lexbor.c | 14 ++++++-------- ext/lexbor/php_lexbor.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/lexbor/php_lexbor.c b/ext/lexbor/php_lexbor.c index af61f90291df..85f840624402 100644 --- a/ext/lexbor/php_lexbor.c +++ b/ext/lexbor/php_lexbor.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | | Mate Kocsis | diff --git a/ext/lexbor/php_lexbor.h b/ext/lexbor/php_lexbor.h index fbdc71746dca..155998388549 100644 --- a/ext/lexbor/php_lexbor.h +++ b/ext/lexbor/php_lexbor.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | | Mate Kocsis | From c2af0976a8aa3aabd355d9ba977cb81c38ec742e Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:49:16 -0500 Subject: [PATCH 142/300] license-update: ext/libxml source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/libxml/image_svg.c | 14 ++++++-------- ext/libxml/image_svg.h | 16 +++++++--------- ext/libxml/libxml.c | 14 ++++++-------- ext/libxml/mime_sniff.c | 14 ++++++-------- ext/libxml/php_libxml.h | 14 ++++++-------- 5 files changed, 31 insertions(+), 41 deletions(-) diff --git a/ext/libxml/image_svg.c b/ext/libxml/image_svg.c index 091f7e283168..69343fe298b0 100644 --- a/ext/libxml/image_svg.c +++ b/ext/libxml/image_svg.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/libxml/image_svg.h b/ext/libxml/image_svg.h index d023334af36b..b665c2c8d912 100644 --- a/ext/libxml/image_svg.h +++ b/ext/libxml/image_svg.h @@ -1,16 +1,14 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ - | Authors: Niels Dossche | + | Authors: Niels Dossche | +----------------------------------------------------------------------+ */ diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 5a0e1f3c7a09..1f3d7c4d8789 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Wez Furlong | diff --git a/ext/libxml/mime_sniff.c b/ext/libxml/mime_sniff.c index 14034f3db267..88c3b2d96451 100644 --- a/ext/libxml/mime_sniff.c +++ b/ext/libxml/mime_sniff.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Niels Dossche | +----------------------------------------------------------------------+ diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index eb10e7e4cb93..5896f70803f8 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Wez Furlong | From f141a56a67d0c93aac0ea17d9347529f72698ffb Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:50:12 -0500 Subject: [PATCH 143/300] license-update: ext/mbstring source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/mbstring/libmbfl/filters/mbfilter_singlebyte.c | 14 ++++++-------- ext/mbstring/libmbfl/filters/mbfilter_singlebyte.h | 14 ++++++-------- ext/mbstring/mb_gpc.c | 14 ++++++-------- ext/mbstring/mb_gpc.h | 14 ++++++-------- ext/mbstring/mbstring.c | 14 ++++++-------- ext/mbstring/mbstring.h | 14 ++++++-------- ext/mbstring/php_mbregex.c | 14 ++++++-------- ext/mbstring/php_mbregex.h | 14 ++++++-------- ext/mbstring/php_unicode.c | 14 ++++++-------- ext/mbstring/php_unicode.h | 14 ++++++-------- 10 files changed, 60 insertions(+), 80 deletions(-) diff --git a/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.c b/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.c index ebb44cc3154f..d8a536c0eea0 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.h b/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.h index 5cf331a51c7d..775ababfde08 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.h +++ b/ext/mbstring/libmbfl/filters/mbfilter_singlebyte.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 4445a0dc5a1b..d0ee90266b52 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rui Hirokawa | | Moriyoshi Koizumi | diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h index 63337755cdea..fdbb0c818238 100644 --- a/ext/mbstring/mb_gpc.h +++ b/ext/mbstring/mb_gpc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rui Hirokawa | | Moriyoshi Koizumi | diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 50355f784fb9..8780712aee96 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Tsukada Takuya | | Rui Hirokawa | diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 7256605bd246..c12c61290a15 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Tsukada Takuya | | Hironori Sato | diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index a830d978db75..baf9c57f41fb 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Tsukada Takuya | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h index 18a762d5a614..41c98b6d7465 100644 --- a/ext/mbstring/php_mbregex.h +++ b/ext/mbstring/php_mbregex.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c index 205c70b9cfb5..ce255e401364 100644 --- a/ext/mbstring/php_unicode.c +++ b/ext/mbstring/php_unicode.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong (wez@thebrainroom.com) | +----------------------------------------------------------------------+ diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h index 1326761943dc..ac96f9daee51 100644 --- a/ext/mbstring/php_unicode.h +++ b/ext/mbstring/php_unicode.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong (wez@thebrainroom.com) | +----------------------------------------------------------------------+ From 056894a34e4acb57c83285610c754da48013d835 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:51:15 -0500 Subject: [PATCH 144/300] license-update: ext/mysqli source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/mysqli/mysqli.c | 14 ++++++-------- ext/mysqli/mysqli_api.c | 14 ++++++-------- ext/mysqli/mysqli_driver.c | 14 ++++++-------- ext/mysqli/mysqli_exception.c | 14 ++++++-------- ext/mysqli/mysqli_mysqlnd.h | 14 ++++++-------- ext/mysqli/mysqli_nonapi.c | 14 ++++++-------- ext/mysqli/mysqli_priv.h | 14 ++++++-------- ext/mysqli/mysqli_prop.c | 14 ++++++-------- ext/mysqli/mysqli_report.c | 14 ++++++-------- ext/mysqli/mysqli_result_iterator.c | 14 ++++++-------- ext/mysqli/mysqli_warning.c | 14 ++++++-------- ext/mysqli/php_mysqli.h | 14 ++++++-------- ext/mysqli/php_mysqli_structs.h | 14 ++++++-------- 13 files changed, 78 insertions(+), 104 deletions(-) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index bcb8880e5785..c7d349706e45 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 259fc128237e..ccb1da6af738 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index d2c94d881b44..dadb132efc21 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index 7ebc29b60ba6..3f34b3e00501 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h index 5fb8f542b8fc..b15644c8e1f6 100644 --- a/ext/mysqli/mysqli_mysqlnd.h +++ b/ext/mysqli/mysqli_mysqlnd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 2e51dca3100f..1e46aeedd93b 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h index 5f7c49f0b297..97d9300a2b79 100644 --- a/ext/mysqli/mysqli_priv.h +++ b/ext/mysqli/mysqli_priv.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index 6d86a6ad4ca8..b54f6fd6ae44 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 06611310b0b0..28b5f151d729 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 5dbeaf1e3b22..013f41d38d0b 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 0bb730ef6cf6..a276ccf0b1ff 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Georg Richter | +----------------------------------------------------------------------+ diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index 7ee999b41e04..5f995a4bbc53 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index ceab4a44f395..40d3f7fcdeef 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Georg Richter | | Andrey Hristov | From e76a3368ffbf471b5a4071fd89fe2e8672cfb5fb Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:27:21 -0500 Subject: [PATCH 145/300] license-update: ext/mysqlnd source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/mysqlnd/mysql_float_to_double.h | 14 ++++++-------- ext/mysqlnd/mysqlnd.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_alloc.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_alloc.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_auth.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_auth.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_block_alloc.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_block_alloc.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_charset.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_charset.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_commands.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_commands.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_connection.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_connection.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_debug.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_debug.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_driver.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_enum_n_def.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_ext_plugin.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_ext_plugin.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_libmysql_compat.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_loaddata.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_plugin.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_plugin.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_priv.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_protocol_frame_codec.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_protocol_frame_codec.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_ps.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_ps.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_ps_codec.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_read_buffer.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_read_buffer.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_result.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_result.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_result_meta.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_result_meta.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_reverse_api.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_reverse_api.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_statistics.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_statistics.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_structs.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_vio.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_vio.h | 14 ++++++-------- ext/mysqlnd/mysqlnd_wireprotocol.c | 14 ++++++-------- ext/mysqlnd/mysqlnd_wireprotocol.h | 14 ++++++-------- ext/mysqlnd/php_mysqlnd.c | 14 ++++++-------- ext/mysqlnd/php_mysqlnd.h | 14 ++++++-------- 47 files changed, 282 insertions(+), 376 deletions(-) diff --git a/ext/mysqlnd/mysql_float_to_double.h b/ext/mysqlnd/mysql_float_to_double.h index a15458b52de2..f92196e792c9 100644 --- a/ext/mysqlnd/mysql_float_to_double.h +++ b/ext/mysqlnd/mysql_float_to_double.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Keyur Govande | +----------------------------------------------------------------------+ diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 3336d1752afd..032438063bea 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 06971b3487dd..12fa5fb723ae 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_alloc.h b/ext/mysqlnd/mysqlnd_alloc.h index deaef3748965..203d7207740a 100644 --- a/ext/mysqlnd/mysqlnd_alloc.h +++ b/ext/mysqlnd/mysqlnd_alloc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 07c393830905..8ff8d27d4ec3 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_auth.h b/ext/mysqlnd/mysqlnd_auth.h index 9ce14a2fc521..f4a0f3146094 100644 --- a/ext/mysqlnd/mysqlnd_auth.h +++ b/ext/mysqlnd/mysqlnd_auth.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index dafcbcc8bbb8..db836d3f7b92 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h index 7c9aac3b8e5f..31f315235d72 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.h +++ b/ext/mysqlnd/mysqlnd_block_alloc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index a767bab392e5..bd7fdaa16191 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h index a2b1e2f14831..401d6d98cec8 100644 --- a/ext/mysqlnd/mysqlnd_charset.h +++ b/ext/mysqlnd/mysqlnd_charset.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_commands.c b/ext/mysqlnd/mysqlnd_commands.c index a3aad43bbd4b..1bb38be089e6 100644 --- a/ext/mysqlnd/mysqlnd_commands.c +++ b/ext/mysqlnd/mysqlnd_commands.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_commands.h b/ext/mysqlnd/mysqlnd_commands.h index 4203b56ffc15..610de56325ae 100644 --- a/ext/mysqlnd/mysqlnd_commands.h +++ b/ext/mysqlnd/mysqlnd_commands.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 4a9732a02895..e3ca87bd7131 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_connection.h b/ext/mysqlnd/mysqlnd_connection.h index 39d7712b132c..ef71fbd4250c 100644 --- a/ext/mysqlnd/mysqlnd_connection.h +++ b/ext/mysqlnd/mysqlnd_connection.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index ff80c620bee1..094713223e8c 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index 24eb67ca1a74..3710551bffd4 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c index 2c1d997177aa..de46a5e2c623 100644 --- a/ext/mysqlnd/mysqlnd_driver.c +++ b/ext/mysqlnd/mysqlnd_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 851174032c40..abb5def974c8 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c index 2ca01d113e3b..5ba377e53433 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.c +++ b/ext/mysqlnd/mysqlnd_ext_plugin.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Johannes Schlüter | diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h index 8780ff463045..84cf6c004be4 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.h +++ b/ext/mysqlnd/mysqlnd_ext_plugin.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Johannes Schlüter | diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index 646b09d80f4c..0172b554caa0 100644 --- a/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index a1e04de27008..caa5205a08e1 100644 --- a/ext/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c index 4bd9894b8c4b..ffc6e8b2757a 100644 --- a/ext/mysqlnd/mysqlnd_plugin.c +++ b/ext/mysqlnd/mysqlnd_plugin.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_plugin.h b/ext/mysqlnd/mysqlnd_plugin.h index 82b2142fc9fc..04dfcb79cc40 100644 --- a/ext/mysqlnd/mysqlnd_plugin.h +++ b/ext/mysqlnd/mysqlnd_plugin.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index 1dbd1093dcac..daad00f0d3e6 100644 --- a/ext/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c index 570fba24d663..70a81befdd71 100644 --- a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c +++ b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_protocol_frame_codec.h b/ext/mysqlnd/mysqlnd_protocol_frame_codec.h index 63aedddb12ea..1ed6f233365b 100644 --- a/ext/mysqlnd/mysqlnd_protocol_frame_codec.h +++ b/ext/mysqlnd/mysqlnd_protocol_frame_codec.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 76a2eb640d1d..b9b112161570 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_ps.h b/ext/mysqlnd/mysqlnd_ps.h index 107e7b6748b9..32af2d423e52 100644 --- a/ext/mysqlnd/mysqlnd_ps.h +++ b/ext/mysqlnd/mysqlnd_ps.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index c60e3d327a8d..934e3637d6aa 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_read_buffer.c b/ext/mysqlnd/mysqlnd_read_buffer.c index 90963c99fa81..e662733e0a36 100644 --- a/ext/mysqlnd/mysqlnd_read_buffer.c +++ b/ext/mysqlnd/mysqlnd_read_buffer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_read_buffer.h b/ext/mysqlnd/mysqlnd_read_buffer.h index 7014f4369690..b3d4c9638303 100644 --- a/ext/mysqlnd/mysqlnd_read_buffer.h +++ b/ext/mysqlnd/mysqlnd_read_buffer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index ae8dc77b4cd9..1d43946f41d3 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h index fe414f0cd65c..db90b4d963cc 100644 --- a/ext/mysqlnd/mysqlnd_result.h +++ b/ext/mysqlnd/mysqlnd_result.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c index 92896ccb408e..6a772973c395 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.c +++ b/ext/mysqlnd/mysqlnd_result_meta.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h index e9726abae02a..d3c84776958a 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.h +++ b/ext/mysqlnd/mysqlnd_result_meta.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Johannes Schlüter | diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c index 982aac065eb0..539c8adaaa60 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.c +++ b/ext/mysqlnd/mysqlnd_reverse_api.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Johannes Schlüter | diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h index ee56666d5eaf..843fa728aacc 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.h +++ b/ext/mysqlnd/mysqlnd_reverse_api.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index 0d94303ea366..33a47843c9c8 100644 --- a/ext/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h index 02cd64450cb6..a576f67ffdb1 100644 --- a/ext/mysqlnd/mysqlnd_statistics.h +++ b/ext/mysqlnd/mysqlnd_statistics.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 02c31358da48..80d0abfcae6f 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_vio.c b/ext/mysqlnd/mysqlnd_vio.c index 3a3f7b207214..b6ea490e67b6 100644 --- a/ext/mysqlnd/mysqlnd_vio.c +++ b/ext/mysqlnd/mysqlnd_vio.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_vio.h b/ext/mysqlnd/mysqlnd_vio.h index a96fdb182b17..28f033bd749d 100644 --- a/ext/mysqlnd/mysqlnd_vio.h +++ b/ext/mysqlnd/mysqlnd_vio.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 36fd53233737..633a4cca1623 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index f24eb70f4a79..e5d38bc6737e 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index c21697828a9a..f8b2d72ebab9 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | diff --git a/ext/mysqlnd/php_mysqlnd.h b/ext/mysqlnd/php_mysqlnd.h index e7a981a5de3e..4da59ed965e8 100644 --- a/ext/mysqlnd/php_mysqlnd.h +++ b/ext/mysqlnd/php_mysqlnd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andrey Hristov | | Ulf Wendel | From bbf212685e5dac2a5c40bfadc78334dab3da9711 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 12:56:19 -0500 Subject: [PATCH 146/300] license-update: ext/odbc source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/odbc/odbc_utils.c | 14 ++++++-------- ext/odbc/php_odbc.c | 14 ++++++-------- ext/odbc/php_odbc.h | 14 ++++++-------- ext/odbc/php_odbc_includes.h | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/odbc/odbc_utils.c b/ext/odbc/odbc_utils.c index bc6674b9b5e5..742bf54bb292 100644 --- a/ext/odbc/odbc_utils.c +++ b/ext/odbc/odbc_utils.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Calvin Buckley | +----------------------------------------------------------------------+ diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 90ccb8af1ed1..96e1b8796140 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Sæther Bakken | | Andreas Karajannis | diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h index 6f6264a482d7..d2815b90d108 100644 --- a/ext/odbc/php_odbc.h +++ b/ext/odbc/php_odbc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Sæther Bakken | | Andreas Karajannis | diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index 058684c2ed03..1c53e35bf43a 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Sæther Bakken | | Andreas Karajannis | From 7a2303f89bffa0ecc4b5877f1a701ce2d844c5a3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:48:41 -0500 Subject: [PATCH 147/300] license-update: ext/opcache source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/opcache/ZendAccelerator.c | 14 +++++----- ext/opcache/ZendAccelerator.h | 14 +++++----- ext/opcache/jit/tls/zend_jit_tls.h | 28 ++++++++++---------- ext/opcache/jit/tls/zend_jit_tls_aarch64.c | 28 ++++++++++---------- ext/opcache/jit/tls/zend_jit_tls_darwin.c | 28 ++++++++++---------- ext/opcache/jit/tls/zend_jit_tls_win.c | 28 ++++++++++---------- ext/opcache/jit/tls/zend_jit_tls_x86.c | 28 ++++++++++---------- ext/opcache/jit/tls/zend_jit_tls_x86_64.c | 28 ++++++++++---------- ext/opcache/jit/zend_jit.c | 14 +++++----- ext/opcache/jit/zend_jit.h | 14 +++++----- ext/opcache/jit/zend_jit_helpers.c | 14 +++++----- ext/opcache/jit/zend_jit_internal.h | 14 +++++----- ext/opcache/jit/zend_jit_ir.c | 30 ++++++++++------------ ext/opcache/jit/zend_jit_trace.c | 14 +++++----- ext/opcache/jit/zend_jit_vm_helpers.c | 14 +++++----- ext/opcache/shared_alloc_mmap.c | 14 +++++----- ext/opcache/shared_alloc_posix.c | 14 +++++----- ext/opcache/shared_alloc_shm.c | 14 +++++----- ext/opcache/shared_alloc_win32.c | 14 +++++----- ext/opcache/zend_accelerator_api.c | 14 +++++----- ext/opcache/zend_accelerator_api.h | 14 +++++----- ext/opcache/zend_accelerator_blacklist.c | 14 +++++----- ext/opcache/zend_accelerator_blacklist.h | 14 +++++----- ext/opcache/zend_accelerator_debug.c | 14 +++++----- ext/opcache/zend_accelerator_debug.h | 14 +++++----- ext/opcache/zend_accelerator_hash.c | 14 +++++----- ext/opcache/zend_accelerator_hash.h | 14 +++++----- ext/opcache/zend_accelerator_module.c | 14 +++++----- ext/opcache/zend_accelerator_module.h | 14 +++++----- ext/opcache/zend_accelerator_util_funcs.c | 14 +++++----- ext/opcache/zend_accelerator_util_funcs.h | 14 +++++----- ext/opcache/zend_file_cache.c | 14 +++++----- ext/opcache/zend_file_cache.h | 14 +++++----- ext/opcache/zend_persist.c | 14 +++++----- ext/opcache/zend_persist.h | 14 +++++----- ext/opcache/zend_persist_calc.c | 14 +++++----- ext/opcache/zend_shared_alloc.c | 14 +++++----- ext/opcache/zend_shared_alloc.h | 14 +++++----- 38 files changed, 278 insertions(+), 354 deletions(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 7aa0e67c24a5..6352b74df33b 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 524a6f5e1213..91642e288d31 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/jit/tls/zend_jit_tls.h b/ext/opcache/jit/tls/zend_jit_tls.h index 5f9042926725..7faa76fa6a31 100644 --- a/ext/opcache/jit/tls/zend_jit_tls.h +++ b/ext/opcache/jit/tls/zend_jit_tls.h @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Arnaud Le Blanc | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | + +----------------------------------------------------------------------+ */ #ifndef ZEND_JIT_TLS_H diff --git a/ext/opcache/jit/tls/zend_jit_tls_aarch64.c b/ext/opcache/jit/tls/zend_jit_tls_aarch64.c index 24f0f88454b6..3258a3123ebb 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_aarch64.c +++ b/ext/opcache/jit/tls/zend_jit_tls_aarch64.c @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Arnaud Le Blanc | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | + +----------------------------------------------------------------------+ */ #include "Zend/zend_portability.h" diff --git a/ext/opcache/jit/tls/zend_jit_tls_darwin.c b/ext/opcache/jit/tls/zend_jit_tls_darwin.c index ee8a572e04a0..8857ef5e738c 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_darwin.c +++ b/ext/opcache/jit/tls/zend_jit_tls_darwin.c @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Dmitry Stogov | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ */ #include "Zend/zend_portability.h" diff --git a/ext/opcache/jit/tls/zend_jit_tls_win.c b/ext/opcache/jit/tls/zend_jit_tls_win.c index 23f0c1e79baa..5646f3dcba0b 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_win.c +++ b/ext/opcache/jit/tls/zend_jit_tls_win.c @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Dmitry Stogov | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ */ #include "Zend/zend_portability.h" diff --git a/ext/opcache/jit/tls/zend_jit_tls_x86.c b/ext/opcache/jit/tls/zend_jit_tls_x86.c index 4e06bbd1eacd..362dffb47785 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_x86.c +++ b/ext/opcache/jit/tls/zend_jit_tls_x86.c @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Arnaud Le Blanc | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | + +----------------------------------------------------------------------+ */ #include "zend_portability.h" diff --git a/ext/opcache/jit/tls/zend_jit_tls_x86_64.c b/ext/opcache/jit/tls/zend_jit_tls_x86_64.c index 11ffe495fcbb..1b2730c4be92 100644 --- a/ext/opcache/jit/tls/zend_jit_tls_x86_64.c +++ b/ext/opcache/jit/tls/zend_jit_tls_x86_64.c @@ -1,19 +1,17 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Arnaud Le Blanc | - * +----------------------------------------------------------------------+ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | + +----------------------------------------------------------------------+ */ #include "zend_portability.h" diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 244e1ad59987..738f204c5026 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/jit/zend_jit.h b/ext/opcache/jit/zend_jit.h index 9b8e054d2292..2671ddd23e2d 100644 --- a/ext/opcache/jit/zend_jit.h +++ b/ext/opcache/jit/zend_jit.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 70e691313b87..64a48068f378 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 22bab1ddd7ff..be27bcaf5341 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 20fb79cf2da7..2461d024dd6a 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -1,20 +1,18 @@ /* - * +----------------------------------------------------------------------+ - * | Zend JIT | - * +----------------------------------------------------------------------+ - * | Copyright (c) The PHP Group | - * +----------------------------------------------------------------------+ - * | This source file is subject to version 3.01 of the PHP license, | - * | that is bundled with this package in the file LICENSE, and is | - * | available through the world-wide-web at the following url: | - * | https://www.php.net/license/3_01.txt | - * | If you did not receive a copy of the PHP license and are unable to | - * | obtain it through the world-wide-web, please send a note to | - * | license@php.net so we can mail you a copy immediately. | - * +----------------------------------------------------------------------+ - * | Authors: Dmitry Stogov | - * +----------------------------------------------------------------------+ - */ + +----------------------------------------------------------------------+ + | Zend JIT | + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ #include "Zend/zend_types.h" #include "Zend/zend_type_info.h" diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 696a99035a78..4b3cb663686d 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index bed5ab59992e..1c7fb4073569 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/ext/opcache/shared_alloc_mmap.c b/ext/opcache/shared_alloc_mmap.c index cf5dbb29ebfd..a805912d0d75 100644 --- a/ext/opcache/shared_alloc_mmap.c +++ b/ext/opcache/shared_alloc_mmap.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/shared_alloc_posix.c b/ext/opcache/shared_alloc_posix.c index 3f1e097fe97c..36ed7950044f 100644 --- a/ext/opcache/shared_alloc_posix.c +++ b/ext/opcache/shared_alloc_posix.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/shared_alloc_shm.c b/ext/opcache/shared_alloc_shm.c index b9f8ca4524a0..e98ac615f860 100644 --- a/ext/opcache/shared_alloc_shm.c +++ b/ext/opcache/shared_alloc_shm.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index c51c459ed553..84bd32e9cbad 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_api.c b/ext/opcache/zend_accelerator_api.c index 27267e8791ab..907b6b96e705 100644 --- a/ext/opcache/zend_accelerator_api.c +++ b/ext/opcache/zend_accelerator_api.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/opcache/zend_accelerator_api.h b/ext/opcache/zend_accelerator_api.h index 4ea42f29d174..002a69eee9f3 100644 --- a/ext/opcache/zend_accelerator_api.h +++ b/ext/opcache/zend_accelerator_api.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index 631f8b34608f..56a4ceb4dc4d 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h index da6e04e31b7c..4a337dd9814b 100644 --- a/ext/opcache/zend_accelerator_blacklist.h +++ b/ext/opcache/zend_accelerator_blacklist.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c index b2a3105dc627..418ef805d633 100644 --- a/ext/opcache/zend_accelerator_debug.c +++ b/ext/opcache/zend_accelerator_debug.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_debug.h b/ext/opcache/zend_accelerator_debug.h index 4a19da57b5e6..d71a48893871 100644 --- a/ext/opcache/zend_accelerator_debug.h +++ b/ext/opcache/zend_accelerator_debug.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 5198c0b3b78c..e35528f7f414 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 2f9197385386..6091361a68c8 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 1eaa183f9df5..465b15cd9576 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h index 6eff0624bbbf..cd46e07d1d27 100644 --- a/ext/opcache/zend_accelerator_module.h +++ b/ext/opcache/zend_accelerator_module.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 1f4c8094ac89..90496e456593 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index fa248edeef55..a95b2095ebbd 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index dac6f3b482f5..af59b9b2c34a 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/zend_file_cache.h b/ext/opcache/zend_file_cache.h index 452f6b2c4c24..37868285b0da 100644 --- a/ext/opcache/zend_file_cache.h +++ b/ext/opcache/zend_file_cache.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 568db085bb2c..973e441edc80 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h index c8220217630e..453ae0811c17 100644 --- a/ext/opcache/zend_persist.h +++ b/ext/opcache/zend_persist.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 657cc03eb390..9ff37079193b 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 80ef36b8749d..b264f98a02b7 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/opcache/zend_shared_alloc.h b/ext/opcache/zend_shared_alloc.h index 108349b13f81..23d515f5b9f2 100644 --- a/ext/opcache/zend_shared_alloc.h +++ b/ext/opcache/zend_shared_alloc.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | From 4fa202ab28b9a5f5f5dddec9136b2c2c178d5fe2 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:15:26 -0500 Subject: [PATCH 148/300] license-update: ext/openssl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/openssl/openssl.c | 14 ++++++-------- ext/openssl/openssl_backend_common.c | 14 ++++++-------- ext/openssl/openssl_backend_v1.c | 14 ++++++-------- ext/openssl/openssl_backend_v3.c | 14 ++++++-------- ext/openssl/openssl_pwhash.c | 14 ++++++-------- ext/openssl/php_openssl.h | 14 ++++++-------- ext/openssl/php_openssl_backend.h | 14 ++++++-------- ext/openssl/xp_ssl.c | 14 ++++++-------- 8 files changed, 48 insertions(+), 64 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 65da0752b557..381a369d5718 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Venaas | | Wez Furlong | diff --git a/ext/openssl/openssl_backend_common.c b/ext/openssl/openssl_backend_common.c index 4ed92ca021bd..6eae715d4321 100644 --- a/ext/openssl/openssl_backend_common.c +++ b/ext/openssl/openssl_backend_common.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/openssl/openssl_backend_v1.c b/ext/openssl/openssl_backend_v1.c index b1f95cdb48b3..0c1ac6b955f6 100644 --- a/ext/openssl/openssl_backend_v1.c +++ b/ext/openssl/openssl_backend_v1.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/openssl/openssl_backend_v3.c b/ext/openssl/openssl_backend_v3.c index a9733b9bdd98..339ff53f7b62 100644 --- a/ext/openssl/openssl_backend_v3.c +++ b/ext/openssl/openssl_backend_v3.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/openssl/openssl_pwhash.c b/ext/openssl/openssl_pwhash.c index 69e9dae3fa99..0b439a731d1c 100644 --- a/ext/openssl/openssl_pwhash.c +++ b/ext/openssl/openssl_pwhash.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Remi Collet | +----------------------------------------------------------------------+ diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index e565707a3c40..9801f5458a76 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Venaas | | Wez Furlong . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jakub Zelenka | +----------------------------------------------------------------------+ diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 52a479d1612c..eea758da4713 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Daniel Lowrey | From eeee73116a10b8ae2549fdb86b661c0b074852f6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:01:05 -0500 Subject: [PATCH 149/300] license-update: ext/pcntl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pcntl/pcntl.c | 14 ++++++-------- ext/pcntl/php_pcntl.h | 14 ++++++-------- ext/pcntl/php_signal.c | 14 ++++++-------- ext/pcntl/php_signal.h | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b4e21e55b6e8..e9453b21329e 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jason Greene | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index aed96af380e2..17b86bca47d6 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jason Greene | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index 7f27ac33e45d..b0357d86f02b 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jason Greene | +----------------------------------------------------------------------+ diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h index 44cbd68999f1..7b103793e544 100644 --- a/ext/pcntl/php_signal.h +++ b/ext/pcntl/php_signal.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jason Greene | +----------------------------------------------------------------------+ From c090841405d59b7235b4663697a933e838cc7d0a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:01:21 -0500 Subject: [PATCH 150/300] license-update: ext/pcre source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pcre/php_pcre.c | 14 ++++++-------- ext/pcre/php_pcre.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index a251b7b09a9b..161cdf852c1e 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrei Zmievski | +----------------------------------------------------------------------+ diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h index e180d68a3d48..ebaa686a31c3 100644 --- a/ext/pcre/php_pcre.h +++ b/ext/pcre/php_pcre.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrei Zmievski | +----------------------------------------------------------------------+ From b765bbf85dc809f8ef447bdd32397233ed23d37e Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:02:08 -0500 Subject: [PATCH 151/300] license-update: ext/pdo source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo/pdo.c | 14 ++++++-------- ext/pdo/pdo_dbh.c | 14 ++++++-------- ext/pdo/pdo_sql_parser.h | 14 ++++++-------- ext/pdo/pdo_sql_parser.re | 14 ++++++-------- ext/pdo/pdo_sqlstate.c | 14 ++++++-------- ext/pdo/pdo_stmt.c | 14 ++++++-------- ext/pdo/php_pdo.h | 14 ++++++-------- ext/pdo/php_pdo_driver.h | 14 ++++++-------- ext/pdo/php_pdo_error.h | 14 ++++++-------- ext/pdo/php_pdo_int.h | 14 ++++++-------- 10 files changed, 60 insertions(+), 80 deletions(-) diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index 2966cd0be569..9a5f814304fc 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 34f19e364faa..21002ce3a93d 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | diff --git a/ext/pdo/pdo_sql_parser.h b/ext/pdo/pdo_sql_parser.h index 0701d984ae64..9baca65e5f90 100644 --- a/ext/pdo/pdo_sql_parser.h +++ b/ext/pdo/pdo_sql_parser.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 1897f9f238bf..d154a85287f2 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c index a44b95a9181d..089c1bdd027f 100644 --- a/ext/pdo/pdo_sqlstate.c +++ b/ext/pdo/pdo_sqlstate.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 50f16f23ead1..a8564cd8d39c 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h index 59789a04c73f..39443bb35c89 100644 --- a/ext/pdo/php_pdo.h +++ b/ext/pdo/php_pdo.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 9c5986ff8bce..9dc18f75bfe1 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h index 50c751a0f490..79d1c482d609 100644 --- a/ext/pdo/php_pdo_error.h +++ b/ext/pdo/php_pdo_error.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index e8befe9f819a..dde79af73aa0 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | From c44d6882f47a65ce8a8282a19a961b026e34b290 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:02:43 -0500 Subject: [PATCH 152/300] license-update: ext/pdo_dblib source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_dblib/dblib_driver.c | 14 ++++++-------- ext/pdo_dblib/dblib_stmt.c | 14 ++++++-------- ext/pdo_dblib/pdo_dblib.c | 14 ++++++-------- ext/pdo_dblib/php_pdo_dblib.h | 14 ++++++-------- ext/pdo_dblib/php_pdo_dblib_int.h | 14 ++++++-------- 5 files changed, 30 insertions(+), 40 deletions(-) diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index 68e251c2b6a9..42ba72b40ede 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Frank M. Kromann | diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index e6e91b60fa27..0b97b1dfb076 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Frank M. Kromann | diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index 9c59ddbc6184..47cf1497ef7d 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Frank M. Kromann | diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h index 7cd13d6eb4bb..60e3d8c082a6 100644 --- a/ext/pdo_dblib/php_pdo_dblib.h +++ b/ext/pdo_dblib/php_pdo_dblib.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Frank M. Kromann | diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index 2067d944c718..21ffa9c86243 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Frank M. Kromann | From 16158494a031e82b92412fc32c01a7c69087eab8 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:03:17 -0500 Subject: [PATCH 153/300] license-update: ext/pdo_firebird source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_firebird/firebird_driver.c | 14 ++++++-------- ext/pdo_firebird/firebird_statement.c | 14 ++++++-------- ext/pdo_firebird/pdo_firebird.c | 14 ++++++-------- ext/pdo_firebird/pdo_firebird_utils.cpp | 14 ++++++-------- ext/pdo_firebird/pdo_firebird_utils.h | 14 ++++++-------- ext/pdo_firebird/php_pdo_firebird.h | 14 ++++++-------- ext/pdo_firebird/php_pdo_firebird_int.h | 14 ++++++-------- 7 files changed, 42 insertions(+), 56 deletions(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index c77bf6d7c581..8193132beaf4 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ard Biesheuvel | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 8e917e2926a0..bdca5af974cf 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ard Biesheuvel | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index ece55926b0f4..74ba7f8994ca 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ard Biesheuvel | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/pdo_firebird_utils.cpp b/ext/pdo_firebird/pdo_firebird_utils.cpp index 715963eec17c..cd54da8cd9c6 100644 --- a/ext/pdo_firebird/pdo_firebird_utils.cpp +++ b/ext/pdo_firebird/pdo_firebird_utils.cpp @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Simonov Denis | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/pdo_firebird_utils.h b/ext/pdo_firebird/pdo_firebird_utils.h index 19b0d0ab4ba4..3a3ee4ab7c41 100644 --- a/ext/pdo_firebird/pdo_firebird_utils.h +++ b/ext/pdo_firebird/pdo_firebird_utils.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Simonov Denis | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h index 19ce061c959f..6d897dfd2933 100644 --- a/ext/pdo_firebird/php_pdo_firebird.h +++ b/ext/pdo_firebird/php_pdo_firebird.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ard Biesheuvel | +----------------------------------------------------------------------+ diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index a62c152ffab3..7e83b2687a72 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ard Biesheuvel | +----------------------------------------------------------------------+ From 16a56fddc51e8a8bff7da1375e0753461c46deb6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:03:46 -0500 Subject: [PATCH 154/300] license-update: ext/pdo_mysql source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_mysql/mysql_driver.c | 14 ++++++-------- ext/pdo_mysql/mysql_sql_parser.re | 14 ++++++-------- ext/pdo_mysql/mysql_statement.c | 14 ++++++-------- ext/pdo_mysql/pdo_mysql.c | 14 ++++++-------- ext/pdo_mysql/php_pdo_mysql.h | 14 ++++++-------- ext/pdo_mysql/php_pdo_mysql_int.h | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 808f4acbfa37..54a8803971ca 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | | Wez Furlong | diff --git a/ext/pdo_mysql/mysql_sql_parser.re b/ext/pdo_mysql/mysql_sql_parser.re index 01afbefaaa8d..9db54063889d 100644 --- a/ext/pdo_mysql/mysql_sql_parser.re +++ b/ext/pdo_mysql/mysql_sql_parser.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Matteo Beccati | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 8b2519ce90aa..f6b182fcb9ad 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | | Wez Furlong | diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index b45dafbf5d98..fe5ebc7e6ed8 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | | Johannes Schlueter | diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h index 650c51b497a2..55b2cded0f28 100644 --- a/ext/pdo_mysql/php_pdo_mysql.h +++ b/ext/pdo_mysql/php_pdo_mysql.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | +----------------------------------------------------------------------+ diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index ec49d6c311c3..baba729aa53d 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Schlossnagle | | Wez Furlong | From dd160cac27319954b8ce93368bb1082c5ce432b9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:04:15 -0500 Subject: [PATCH 155/300] license-update: ext/pdo_odbc source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_odbc/odbc_driver.c | 14 ++++++-------- ext/pdo_odbc/odbc_stmt.c | 14 ++++++-------- ext/pdo_odbc/pdo_odbc.c | 14 ++++++-------- ext/pdo_odbc/php_pdo_odbc.h | 14 ++++++-------- ext/pdo_odbc/php_pdo_odbc_int.h | 14 ++++++-------- 5 files changed, 30 insertions(+), 40 deletions(-) diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 7401023c573c..4c627419d18e 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 171fb7b7b1e9..a5601b04e782 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index 1181e314c4d0..47a19062947c 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h index 3f0417029784..6c72b6f2ebe9 100644 --- a/ext/pdo_odbc/php_pdo_odbc.h +++ b/ext/pdo_odbc/php_pdo_odbc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h index 473d70ff7076..18b45af21a02 100644 --- a/ext/pdo_odbc/php_pdo_odbc_int.h +++ b/ext/pdo_odbc/php_pdo_odbc_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ From eca7fb411580ecff041d2f76b030aeae54400a2a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:05:01 -0500 Subject: [PATCH 156/300] license-update: ext/pdo_pgsql source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_pgsql/pdo_pgsql.c | 14 ++++++-------- ext/pdo_pgsql/pgsql_driver.c | 14 ++++++-------- ext/pdo_pgsql/pgsql_sql_parser.re | 14 ++++++-------- ext/pdo_pgsql/pgsql_statement.c | 14 ++++++-------- ext/pdo_pgsql/php_pdo_pgsql.h | 14 ++++++-------- ext/pdo_pgsql/php_pdo_pgsql_int.h | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index e6849aed1195..d552aa5e61dd 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index be429075c51a..3cfb7a3fa01a 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Edin Kadribasic | | Ilia Alshanestsky | diff --git a/ext/pdo_pgsql/pgsql_sql_parser.re b/ext/pdo_pgsql/pgsql_sql_parser.re index caea615c4073..011fce56a1a0 100644 --- a/ext/pdo_pgsql/pgsql_sql_parser.re +++ b/ext/pdo_pgsql/pgsql_sql_parser.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Matteo Beccati | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 426a878d8eff..308fce2e3714 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Edin Kadribasic | | Ilia Alshanestsky | diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h index fa28214f71a7..345535108cb1 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql.h +++ b/ext/pdo_pgsql/php_pdo_pgsql.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | +----------------------------------------------------------------------+ diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 881b4e704650..47c9223540ad 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Edin Kadribasic | | Ilia Alshanestsky | From b943a1b0305fec344aa6dbe6e1c256741663edce Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:05:44 -0500 Subject: [PATCH 157/300] license-update: ext/pdo_sqlite source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pdo_sqlite/pdo_sqlite.c | 14 ++++++-------- ext/pdo_sqlite/php_pdo_sqlite.h | 14 ++++++-------- ext/pdo_sqlite/php_pdo_sqlite_int.h | 14 ++++++-------- ext/pdo_sqlite/sqlite_driver.c | 14 ++++++-------- ext/pdo_sqlite/sqlite_sql_parser.re | 14 ++++++-------- ext/pdo_sqlite/sqlite_statement.c | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c index 667948fea9f1..0e7e02df46a4 100644 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ b/ext/pdo_sqlite/pdo_sqlite.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h index c29a81ebb240..a567e8c87ee6 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite.h +++ b/ext/pdo_sqlite/php_pdo_sqlite.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h index 0cb09cfaa4fb..122f714040de 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite_int.h +++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 5a30d27193ec..39efa02dd583 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/sqlite_sql_parser.re b/ext/pdo_sqlite/sqlite_sql_parser.re index 5678e6025577..c836f6b2b499 100644 --- a/ext/pdo_sqlite/sqlite_sql_parser.re +++ b/ext/pdo_sqlite/sqlite_sql_parser.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Matteo Beccati | +----------------------------------------------------------------------+ diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index ffb8c1ad4b3c..ca82b1b09322 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ From 7740a4e8e4ca4a50acbfc6821b45dba74f365457 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:06:03 -0500 Subject: [PATCH 158/300] license-update: ext/pgsql source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/pgsql/pgsql.c | 14 ++++++-------- ext/pgsql/php_pgsql.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index c839eda553bc..27c736348239 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Jouni Ahto | diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 7a5770cb5936..a865a7ce73a4 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Jouni Ahto | From f069da66f54eaed481f22d2b0796e6ab36e89977 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:16:34 -0500 Subject: [PATCH 159/300] license-update: ext/phar source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/phar/dirstream.c | 14 ++++++-------- ext/phar/dirstream.h | 14 ++++++-------- ext/phar/func_interceptors.c | 14 ++++++-------- ext/phar/func_interceptors.h | 14 ++++++-------- ext/phar/makestub.php | 14 ++++++-------- ext/phar/phar.c | 14 ++++++-------- ext/phar/phar_internal.h | 14 ++++++-------- ext/phar/phar_object.c | 14 ++++++-------- ext/phar/phar_path_check.re | 14 ++++++-------- ext/phar/pharzip.h | 14 ++++++-------- ext/phar/php_phar.h | 14 ++++++-------- ext/phar/stream.c | 14 ++++++-------- ext/phar/stream.h | 14 ++++++-------- ext/phar/stub.h | 14 ++++++-------- ext/phar/tar.c | 14 ++++++-------- ext/phar/tar.h | 14 ++++++-------- ext/phar/util.c | 14 ++++++-------- ext/phar/zip.c | 14 ++++++-------- 18 files changed, 108 insertions(+), 144 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index f37599e7db11..51e5d70a6e65 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h index 4debfecde41a..41899f88a992 100644 --- a/ext/phar/dirstream.h +++ b/ext/phar/dirstream.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 5d5242e59009..fdaf0d3cb041 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | +----------------------------------------------------------------------+ diff --git a/ext/phar/func_interceptors.h b/ext/phar/func_interceptors.h index 06906ee79e80..af68b0410d4c 100644 --- a/ext/phar/func_interceptors.h +++ b/ext/phar/func_interceptors.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/makestub.php b/ext/phar/makestub.php index 34d270751bfb..e5cbe89ff4bd 100755 --- a/ext/phar/makestub.php +++ b/ext/phar/makestub.php @@ -35,15 +35,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension generated stub | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | +----------------------------------------------------------------------+ diff --git a/ext/phar/phar.c b/ext/phar/phar.c index bb08af18ff84..8cabe4bce2ab 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 62b5520ba50f..bce0f03d6eb2 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index d4b084217b5b..5aeedbfcbdd7 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/phar_path_check.re b/ext/phar/phar_path_check.re index 689ffaa51244..39b18bfc0b44 100644 --- a/ext/phar/phar_path_check.re +++ b/ext/phar/phar_path_check.re @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/phar/pharzip.h b/ext/phar/pharzip.h index 5c814747b692..5a827f7a7294 100644 --- a/ext/phar/pharzip.h +++ b/ext/phar/pharzip.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h index 18e3485fc3a9..f086f9cfff2d 100644 --- a/ext/phar/php_phar.h +++ b/ext/phar/php_phar.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 786b19551786..6694fec9479b 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/stream.h b/ext/phar/stream.h index 83b395b4cfca..cf40e3129c69 100644 --- a/ext/phar/stream.h +++ b/ext/phar/stream.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/stub.h b/ext/phar/stub.h index 2c62e05900ac..79887a62d7b8 100644 --- a/ext/phar/stub.h +++ b/ext/phar/stub.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension generated stub | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | +----------------------------------------------------------------------+ diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 0c93de243adc..aee0fc71c601 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Gregory Beaver | diff --git a/ext/phar/tar.h b/ext/phar/tar.h index 55ce5501eeb1..80e4586e8db9 100644 --- a/ext/phar/tar.h +++ b/ext/phar/tar.h @@ -4,15 +4,13 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Gregory Beaver | diff --git a/ext/phar/util.c b/ext/phar/util.c index fdadc4d9b6bf..3e54fcfc1d12 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -3,15 +3,13 @@ | phar php single-file executable PHP extension | | utility functions | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | | Marcus Boerger | diff --git a/ext/phar/zip.c b/ext/phar/zip.c index c342c8868d3e..e6a8cdad324a 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | ZIP archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gregory Beaver | +----------------------------------------------------------------------+ From c8316b205d8a8bf36a80f534904527e231217915 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:08:02 -0500 Subject: [PATCH 160/300] license-update: ext/posix source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/posix/php_posix.h | 14 ++++++-------- ext/posix/posix.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h index 79e6fe83ef9e..82208bb63088 100644 --- a/ext/posix/php_posix.h +++ b/ext/posix/php_posix.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kristian Koehntopp | +----------------------------------------------------------------------+ diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 76e14f6ecb0c..b44b73cc8dcf 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kristian Koehntopp | +----------------------------------------------------------------------+ From 712d22d0db359b93eec11d7e2b327e13491e43d3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:09:18 -0500 Subject: [PATCH 161/300] license-update: ext/random source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/random/csprng.c | 14 ++++++-------- ext/random/engine_mt19937.c | 14 ++++++-------- ext/random/engine_pcgoneseq128xslrr64.c | 14 ++++++-------- ext/random/engine_secure.c | 14 ++++++-------- ext/random/engine_user.c | 14 ++++++-------- ext/random/engine_xoshiro256starstar.c | 14 ++++++-------- ext/random/gammasection.c | 14 ++++++-------- ext/random/php_random.h | 14 ++++++-------- ext/random/php_random_csprng.h | 14 ++++++-------- ext/random/php_random_uint128.h | 14 ++++++-------- ext/random/php_random_zend_utils.h | 14 ++++++-------- ext/random/random.c | 14 ++++++-------- ext/random/randomizer.c | 14 ++++++-------- ext/random/zend_utils.c | 14 ++++++-------- 14 files changed, 84 insertions(+), 112 deletions(-) diff --git a/ext/random/csprng.c b/ext/random/csprng.c index 73832d7d0685..4c474fb86796 100644 --- a/ext/random/csprng.c +++ b/ext/random/csprng.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Tim Düsterhus | | Go Kudo | diff --git a/ext/random/engine_mt19937.c b/ext/random/engine_mt19937.c index f2cb2fd7e9bc..8940430a69f7 100644 --- a/ext/random/engine_mt19937.c +++ b/ext/random/engine_mt19937.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/random/engine_pcgoneseq128xslrr64.c b/ext/random/engine_pcgoneseq128xslrr64.c index 9ff4f911920b..9472ce918fef 100644 --- a/ext/random/engine_pcgoneseq128xslrr64.c +++ b/ext/random/engine_pcgoneseq128xslrr64.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Go Kudo | | | diff --git a/ext/random/engine_secure.c b/ext/random/engine_secure.c index 0a03a03bdf13..1fd0748e2b81 100644 --- a/ext/random/engine_secure.c +++ b/ext/random/engine_secure.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sammy Kaye Powers | | Go Kudo | diff --git a/ext/random/engine_user.c b/ext/random/engine_user.c index 955ddebdb99a..f759613ea8cf 100644 --- a/ext/random/engine_user.c +++ b/ext/random/engine_user.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Go Kudo | +----------------------------------------------------------------------+ diff --git a/ext/random/engine_xoshiro256starstar.c b/ext/random/engine_xoshiro256starstar.c index 1a054362f065..c26297a5f930 100644 --- a/ext/random/engine_xoshiro256starstar.c +++ b/ext/random/engine_xoshiro256starstar.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Go Kudo | | | diff --git a/ext/random/gammasection.c b/ext/random/gammasection.c index 732f8a2b0d9b..ef0352773a77 100644 --- a/ext/random/gammasection.c +++ b/ext/random/gammasection.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Tim Düsterhus | | | diff --git a/ext/random/php_random.h b/ext/random/php_random.h index e4d6b4bdf3d9..df53ad3fc55e 100644 --- a/ext/random/php_random.h +++ b/ext/random/php_random.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/random/php_random_csprng.h b/ext/random/php_random_csprng.h index 7fb0d7357f61..6028bbf62522 100644 --- a/ext/random/php_random_csprng.h +++ b/ext/random/php_random_csprng.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Tim Düsterhus | | Go Kudo | diff --git a/ext/random/php_random_uint128.h b/ext/random/php_random_uint128.h index 8c484ce5ba9f..22c0444e5094 100644 --- a/ext/random/php_random_uint128.h +++ b/ext/random/php_random_uint128.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Tim Düsterhus | | Go Kudo | diff --git a/ext/random/php_random_zend_utils.h b/ext/random/php_random_zend_utils.h index db37805904cb..5feba450f109 100644 --- a/ext/random/php_random_zend_utils.h +++ b/ext/random/php_random_zend_utils.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | | Tim Düsterhus | diff --git a/ext/random/random.c b/ext/random/random.c index f9feaadcbb15..dbc7ee50a080 100644 --- a/ext/random/random.c +++ b/ext/random/random.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sammy Kaye Powers | | Go Kudo | diff --git a/ext/random/randomizer.c b/ext/random/randomizer.c index a576cd12955a..0738380ca253 100644 --- a/ext/random/randomizer.c +++ b/ext/random/randomizer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Go Kudo | +----------------------------------------------------------------------+ diff --git a/ext/random/zend_utils.c b/ext/random/zend_utils.c index 64ba2c87ef70..19067f343afb 100644 --- a/ext/random/zend_utils.c +++ b/ext/random/zend_utils.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | | Tim Düsterhus | From 61ebc7ff9d8390e4949ae16efd238bb67481e431 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:10:04 -0500 Subject: [PATCH 162/300] license-update: ext/readline source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/readline/php_readline.h | 14 ++++++-------- ext/readline/readline.c | 14 ++++++-------- ext/readline/readline_cli.c | 14 ++++++-------- ext/readline/readline_cli.h | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h index f67238db663a..c1a337713069 100644 --- a/ext/readline/php_readline.h +++ b/ext/readline/php_readline.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/readline/readline.c b/ext/readline/readline.c index b9671ac1caa0..cbc0ebdd8713 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index 312129991c70..01c997a1ccaa 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | | Johannes Schlueter | diff --git a/ext/readline/readline_cli.h b/ext/readline/readline_cli.h index 6db09ce991ce..31c21d8eedc1 100644 --- a/ext/readline/readline_cli.h +++ b/ext/readline/readline_cli.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | | Johannes Schlueter | From a2cb54d70ac435abbb1892c35d21af03e9c736c6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:49:46 -0500 Subject: [PATCH 163/300] license-update: ext/reflection source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/reflection/php_reflection.c | 14 ++++++-------- ext/reflection/php_reflection.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4a10a950b910..e74b7fcb27a7 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Timm Friebe | | George Schlossnagle | diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h index dc2240734298..ba03f1d9ac2d 100644 --- a/ext/reflection/php_reflection.h +++ b/ext/reflection/php_reflection.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: George Schlossnagle | +----------------------------------------------------------------------+ From 25b633588aca2b1a290b93e120fd391165b438b0 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:11:28 -0500 Subject: [PATCH 164/300] license-update: ext/session source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/session/mod_files.c | 14 ++++++-------- ext/session/mod_files.h | 14 ++++++-------- ext/session/mod_mm.c | 14 ++++++-------- ext/session/mod_mm.h | 14 ++++++-------- ext/session/mod_user.c | 14 ++++++-------- ext/session/mod_user.h | 14 ++++++-------- ext/session/mod_user_class.c | 14 ++++++-------- ext/session/php_session.h | 14 ++++++-------- ext/session/session.c | 14 ++++++-------- 9 files changed, 54 insertions(+), 72 deletions(-) diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 858cab879db5..3a7f8aec4522 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h index 31ed4afbffcc..9eae00fb9c7a 100644 --- a/ext/session/mod_files.h +++ b/ext/session/mod_files.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index 521e553d54f2..ff8664c981a0 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h index b35e0b632ee9..990eab09147c 100644 --- a/ext/session/mod_mm.h +++ b/ext/session/mod_mm.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index a83f1bd36f8b..1bce9b3589b1 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h index 58772b48ec82..9c36c315819a 100644 --- a/ext/session/mod_user.h +++ b/ext/session/mod_user.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index 9adc97e67418..a6bd69c91a07 100644 --- a/ext/session/mod_user_class.c +++ b/ext/session/mod_user_class.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Arpad Ray | +----------------------------------------------------------------------+ diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 09a737cf64f3..08c08b9a024a 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/session/session.c b/ext/session/session.c index 5094e7412a88..14b443bf4c6e 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Andrei Zmievski | From 46bb4fc7ad0fa3464c9aca98663e06cb67de92f5 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:12:09 -0500 Subject: [PATCH 165/300] license-update: ext/shmop source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/shmop/php_shmop.h | 14 ++++++-------- ext/shmop/shmop.c | 16 ++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h index 8d1d3cd8fd44..265753ea454a 100644 --- a/ext/shmop/php_shmop.h +++ b/ext/shmop/php_shmop.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Slava Poliakov | | Ilia Alshanetsky | diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 67f060f3c82c..18e6cac9a0c9 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | PHP version 7 | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Slava Poliakov | | Ilia Alshanetsky | From 85d13943802779b0771a5a518de8db303de19940 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:12:33 -0500 Subject: [PATCH 166/300] license-update: ext/simplexml source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/simplexml/php_simplexml.h | 14 ++++++-------- ext/simplexml/php_simplexml_exports.h | 14 ++++++-------- ext/simplexml/simplexml.c | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h index 5d16794fa644..f8d78937b9d9 100644 --- a/ext/simplexml/php_simplexml.h +++ b/ext/simplexml/php_simplexml.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h index 4ae02674d6da..f1f519e85e12 100644 --- a/ext/simplexml/php_simplexml_exports.h +++ b/ext/simplexml/php_simplexml_exports.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | | Marcus Boerger | diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5c39b8e656f5..5b749a462492 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sterling Hughes | | Marcus Boerger | From f80f67923a576a5dce1124b7a1716d257d7b76bd Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:13:00 -0500 Subject: [PATCH 167/300] license-update: ext/snmp source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/snmp/php_snmp.h | 14 ++++++-------- ext/snmp/snmp.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h index ce9849588b19..21d544fa7b8b 100644 --- a/ext/snmp/php_snmp.h +++ b/ext/snmp/php_snmp.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Mike Jackson | diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 6c219d376e53..9b520bce902c 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Mike Jackson | From d14aad1d7b9e7fc8762033914609ce0ea333a7e0 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:14:10 -0500 Subject: [PATCH 168/300] license-update: ext/soap source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/soap/php_encoding.c | 14 ++++++-------- ext/soap/php_encoding.h | 14 ++++++-------- ext/soap/php_http.c | 14 ++++++-------- ext/soap/php_http.h | 14 ++++++-------- ext/soap/php_packet_soap.c | 14 ++++++-------- ext/soap/php_packet_soap.h | 14 ++++++-------- ext/soap/php_schema.c | 14 ++++++-------- ext/soap/php_schema.h | 14 ++++++-------- ext/soap/php_sdl.c | 14 ++++++-------- ext/soap/php_sdl.h | 14 ++++++-------- ext/soap/php_soap.h | 14 ++++++-------- ext/soap/php_xml.c | 14 ++++++-------- ext/soap/php_xml.h | 14 ++++++-------- ext/soap/soap.c | 14 ++++++-------- 14 files changed, 84 insertions(+), 112 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 0e9e77bef88e..1836ef3af7e8 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index ef05c9ebe787..e01154e17456 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 05a37bd1b9a3..1d030caf9d45 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h index 7716e86720bd..a01ea35f9849 100644 --- a/ext/soap/php_http.h +++ b/ext/soap/php_http.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c index dfb4ed544bbf..6cf94b0a3b36 100644 --- a/ext/soap/php_packet_soap.c +++ b/ext/soap/php_packet_soap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h index 5a9fc62418a6..569b23949659 100644 --- a/ext/soap/php_packet_soap.h +++ b/ext/soap/php_packet_soap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index dc6816034dea..73d6691af262 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h index 68035000e1e5..b92c8a8fb4c4 100644 --- a/ext/soap/php_schema.h +++ b/ext/soap/php_schema.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index ed659ca5193c..07c5dbf4f12e 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index a05e84fcbe99..7c9d8ce7382b 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 8ae2cebf0d6a..ebae8ca58a79 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index a2536b98f39b..d5daaef15983 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h index c967ac09d738..4a6d76427dd1 100644 --- a/ext/soap/php_xml.h +++ b/ext/soap/php_xml.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 75d88cd54158..0c8e7070b359 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brad Lafountain | | Shane Caraveo | From fb8adda7ab348205fcc0599d663dd0529eb72bb8 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:18:11 -0500 Subject: [PATCH 169/300] license-update: ext/sockets source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sockets/conversions.c | 14 ++++++++++++++ ext/sockets/conversions.h | 14 ++++++++++++++ ext/sockets/multicast.c | 14 ++++++-------- ext/sockets/multicast.h | 14 ++++++-------- ext/sockets/php_sockets.h | 14 ++++++-------- ext/sockets/sendrecvmsg.c | 14 ++++++-------- ext/sockets/sendrecvmsg.h | 14 ++++++++++++++ ext/sockets/sockaddr_conv.c | 14 ++++++++++++++ ext/sockets/sockaddr_conv.h | 14 ++++++++++++++ ext/sockets/sockets.c | 14 ++++++-------- ext/sockets/windows_common.h | 14 ++++++-------- 11 files changed, 106 insertions(+), 48 deletions(-) diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index 1c735ef5e6d8..4cbd4e3325ac 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Gustavo Lopes | + +----------------------------------------------------------------------+ + */ + #ifdef __sun /* to enable 'new' ancillary data layout instead */ # define _XPG4_2 diff --git a/ext/sockets/conversions.h b/ext/sockets/conversions.h index 1f1fd29c5c05..1d3ce11463d8 100644 --- a/ext/sockets/conversions.h +++ b/ext/sockets/conversions.h @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Gustavo Lopes | + +----------------------------------------------------------------------+ + */ + #ifndef PHP_SOCK_CONVERSIONS_H #define PHP_SOCK_CONVERSIONS_H 1 diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 522e6b346f66..88fcf21278d2 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index f2232921c6b9..5a40147cdd6f 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index 89c613ba4307..437d35b41032 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Chris Vandomelen | | Sterling Hughes | diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index cd7fd4839fb0..cc268bd68b0a 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ diff --git a/ext/sockets/sendrecvmsg.h b/ext/sockets/sendrecvmsg.h index fd68b178ce5c..f430affe6779 100644 --- a/ext/sockets/sendrecvmsg.h +++ b/ext/sockets/sendrecvmsg.h @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Gustavo Lopes | + +----------------------------------------------------------------------+ + */ + #ifndef PHP_SENDRECVMSG_H #define PHP_SENDRECVMSG_H 1 diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 333ef2533a11..949639d475f2 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Gustavo Lopes | + +----------------------------------------------------------------------+ + */ + #include #include #include "php_sockets.h" diff --git a/ext/sockets/sockaddr_conv.h b/ext/sockets/sockaddr_conv.h index 93104e6470fb..ebca73862ef8 100644 --- a/ext/sockets/sockaddr_conv.h +++ b/ext/sockets/sockaddr_conv.h @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Gustavo Lopes | + +----------------------------------------------------------------------+ + */ + #ifndef PHP_SOCKADR_CONV_H #define PHP_SOCKADR_CONV_H diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 4582de4bc8ec..fa84a7877ad6 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Chris Vandomelen | | Sterling Hughes | diff --git a/ext/sockets/windows_common.h b/ext/sockets/windows_common.h index 0b8cdfe2e5d9..9c7e711ffe5b 100644 --- a/ext/sockets/windows_common.h +++ b/ext/sockets/windows_common.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ #ifndef WINDOWS_COMMON_H From 1e9c7bde91423001349245c15263fb4ce1dac848 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:15:40 -0500 Subject: [PATCH 170/300] license-update: ext/sodium source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sodium/libsodium.c | 14 ++++++-------- ext/sodium/php_libsodium.h | 14 ++++++-------- ext/sodium/sodium_pwhash.c | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c index 62f44486a051..b6c3ae03f689 100644 --- a/ext/sodium/libsodium.c +++ b/ext/sodium/libsodium.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Frank Denis | +----------------------------------------------------------------------+ diff --git a/ext/sodium/php_libsodium.h b/ext/sodium/php_libsodium.h index 673541fe784c..8132472d684f 100644 --- a/ext/sodium/php_libsodium.h +++ b/ext/sodium/php_libsodium.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Frank Denis | +----------------------------------------------------------------------+ diff --git a/ext/sodium/sodium_pwhash.c b/ext/sodium/sodium_pwhash.c index 32e4f72634c3..ba48b0158cac 100644 --- a/ext/sodium/sodium_pwhash.c +++ b/ext/sodium/sodium_pwhash.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ From 07d3b6cf70d746ee05ad721e6d202dbbef3729be Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:17:02 -0500 Subject: [PATCH 171/300] license-update: ext/spl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/spl/php_spl.c | 14 ++++++-------- ext/spl/php_spl.h | 14 ++++++-------- ext/spl/spl_array.c | 14 ++++++-------- ext/spl/spl_array.h | 14 ++++++-------- ext/spl/spl_directory.c | 14 ++++++-------- ext/spl/spl_directory.h | 14 ++++++-------- ext/spl/spl_dllist.c | 14 ++++++-------- ext/spl/spl_dllist.h | 14 ++++++-------- ext/spl/spl_exceptions.c | 14 ++++++-------- ext/spl/spl_exceptions.h | 14 ++++++-------- ext/spl/spl_fixedarray.c | 14 ++++++-------- ext/spl/spl_fixedarray.h | 14 ++++++-------- ext/spl/spl_functions.c | 14 ++++++-------- ext/spl/spl_functions.h | 14 ++++++-------- ext/spl/spl_heap.c | 14 ++++++-------- ext/spl/spl_heap.h | 14 ++++++-------- ext/spl/spl_iterators.c | 14 ++++++-------- ext/spl/spl_iterators.h | 14 ++++++-------- ext/spl/spl_observer.c | 14 ++++++-------- ext/spl/spl_observer.h | 14 ++++++-------- 20 files changed, 120 insertions(+), 160 deletions(-) diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index a4f3284025f1..43fd04f7d021 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index c2f7ebf9eee1..b1d4f4416a79 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 09d42b384e3a..737260ad6f0d 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h index 86de7a955c5b..f99bb3f6fe88 100644 --- a/ext/spl/spl_array.h +++ b/ext/spl/spl_array.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index daaba27cbfc6..cae8ffabc672 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h index a2d1d8d85475..6d940e8aa8ef 100644 --- a/ext/spl/spl_directory.h +++ b/ext/spl/spl_directory.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index c72cae38a9ce..a4d89dc87bcf 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Etienne Kneuss | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_dllist.h b/ext/spl/spl_dllist.h index 1ade7c44a3f0..fb2204b2aca9 100644 --- a/ext/spl/spl_dllist.h +++ b/ext/spl/spl_dllist.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Etienne Kneuss | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c index 79449f35d840..8ceba1f7a6a5 100644 --- a/ext/spl/spl_exceptions.c +++ b/ext/spl/spl_exceptions.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h index 8c390f7646ec..be1de4f51d1b 100644 --- a/ext/spl/spl_exceptions.h +++ b/ext/spl/spl_exceptions.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 6f976923341b..82e09702219a 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Antony Dovgal | | Etienne Kneuss | diff --git a/ext/spl/spl_fixedarray.h b/ext/spl/spl_fixedarray.h index a6cb838b9fc9..e0661a95d872 100644 --- a/ext/spl/spl_fixedarray.h +++ b/ext/spl/spl_fixedarray.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Antony Dovgal | | Etienne Kneuss | diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index e3963aced7eb..2e04baa26dee 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h index 409ce9fcada6..1d5010030564 100644 --- a/ext/spl/spl_functions.h +++ b/ext/spl/spl_functions.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index eef25b9e3593..642fe4b95f05 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Etienne Kneuss | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_heap.h b/ext/spl/spl_heap.h index ccc0dd706bfe..153af1171544 100644 --- a/ext/spl/spl_heap.h +++ b/ext/spl/spl_heap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Etienne Kneuss | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 4f1a2a407bef..c77aa9c1cf4b 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index e77e34fb20c8..5b60705e9b23 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 45d2eeb5bb67..6e9ea0e1ba99 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | | Etienne Kneuss | diff --git a/ext/spl/spl_observer.h b/ext/spl/spl_observer.h index b7c22b2dfca0..08d3126d9c8b 100644 --- a/ext/spl/spl_observer.h +++ b/ext/spl/spl_observer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ From a0f032ec3dfd58d89832e63f8c755553f72a40f9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:17:32 -0500 Subject: [PATCH 172/300] license-update: ext/sqlite3 source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sqlite3/php_sqlite3.h | 14 ++++++-------- ext/sqlite3/php_sqlite3_structs.h | 14 ++++++-------- ext/sqlite3/sqlite3.c | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h index 79f8cf436030..8a9cf3af1598 100644 --- a/ext/sqlite3/php_sqlite3.h +++ b/ext/sqlite3/php_sqlite3.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 5d9f69cc5770..a43b2f76ca32 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 4591d6d83d56..7d73b9923695 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Scott MacVicar | +----------------------------------------------------------------------+ From 5164621436e8eb84952c9fdb4c931cd9a50754d9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:19:21 -0500 Subject: [PATCH 173/300] license-update: ext/standard source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/standard/array.c | 14 +++++------ ext/standard/assert.c | 14 +++++------ ext/standard/base64.c | 14 +++++------ ext/standard/base64.h | 14 +++++------ ext/standard/basic_functions.c | 14 +++++------ ext/standard/basic_functions.h | 14 +++++------ ext/standard/browscap.c | 14 +++++------ ext/standard/crc32.c | 14 +++++------ ext/standard/crc32.h | 14 +++++------ ext/standard/crc32_x86.c | 14 +++++------ ext/standard/crc32_x86.h | 14 +++++------ ext/standard/credits.c | 14 +++++------ ext/standard/credits.h | 14 +++++------ ext/standard/crypt.c | 14 +++++------ ext/standard/css.c | 14 +++++------ ext/standard/css.h | 14 +++++------ ext/standard/datetime.c | 14 +++++------ ext/standard/dir.c | 14 +++++------ ext/standard/dl.c | 14 +++++------ ext/standard/dl.h | 14 +++++------ ext/standard/dns.c | 14 +++++------ ext/standard/dns_win32.c | 14 +++++------ ext/standard/exec.c | 14 +++++------ ext/standard/exec.h | 14 +++++------ ext/standard/file.c | 14 +++++------ ext/standard/file.h | 14 +++++------ ext/standard/filestat.c | 14 +++++------ ext/standard/filters.c | 14 +++++------ ext/standard/flock_compat.c | 14 +++++------ ext/standard/flock_compat.h | 14 +++++------ ext/standard/formatted_print.c | 16 ++++++------ ext/standard/fsock.c | 14 +++++------ ext/standard/fsock.h | 14 +++++------ ext/standard/ftok.c | 14 +++++------ ext/standard/ftp_fopen_wrapper.c | 14 +++++------ ext/standard/head.c | 14 +++++------ ext/standard/head.h | 14 +++++------ ext/standard/hrtime.c | 14 +++++------ ext/standard/html.c | 14 +++++------ ext/standard/html.h | 14 +++++------ ext/standard/html_tables.h | 14 +++++------ ext/standard/html_tables/html_table_gen.php | 28 +++++++++------------ ext/standard/http.c | 14 +++++------ ext/standard/http_fopen_wrapper.c | 14 +++++------ ext/standard/image.c | 14 +++++------ ext/standard/incomplete_class.c | 14 +++++------ ext/standard/info.c | 14 +++++------ ext/standard/info.h | 14 +++++------ ext/standard/iptc.c | 14 +++++------ ext/standard/levenshtein.c | 14 +++++------ ext/standard/link.c | 16 +++++------- ext/standard/mail.c | 14 +++++------ ext/standard/math.c | 14 +++++------ ext/standard/md5.c | 14 +++++------ ext/standard/md5.h | 14 +++++------ ext/standard/metaphone.c | 14 +++++------ ext/standard/microtime.c | 14 +++++------ ext/standard/net.c | 14 +++++------ ext/standard/pack.c | 14 +++++------ ext/standard/pageinfo.c | 14 +++++------ ext/standard/pageinfo.h | 14 +++++------ ext/standard/password.c | 14 +++++------ ext/standard/php_array.h | 14 +++++------ ext/standard/php_assert.h | 14 +++++------ ext/standard/php_browscap.h | 14 +++++------ ext/standard/php_crypt.h | 14 +++++------ ext/standard/php_crypt_r.c | 14 +++++------ ext/standard/php_crypt_r.h | 14 +++++------ ext/standard/php_dir.h | 14 +++++------ ext/standard/php_dir_int.h | 14 +++++------ ext/standard/php_dns.h | 14 +++++------ ext/standard/php_ext_syslog.h | 14 +++++------ ext/standard/php_filestat.h | 14 +++++------ ext/standard/php_fopen_wrapper.c | 14 +++++------ ext/standard/php_fopen_wrappers.h | 14 +++++------ ext/standard/php_http.h | 14 +++++------ ext/standard/php_image.h | 14 +++++------ ext/standard/php_incomplete_class.h | 14 +++++------ ext/standard/php_mail.h | 14 +++++------ ext/standard/php_math.h | 14 +++++------ ext/standard/php_math_round_mode.h | 14 +++++------ ext/standard/php_net.h | 14 +++++------ ext/standard/php_password.h | 14 +++++------ ext/standard/php_standard.h | 16 +++++------- ext/standard/php_string.h | 14 +++++------ ext/standard/php_uuencode.h | 14 +++++------ ext/standard/php_var.h | 14 +++++------ ext/standard/php_versioning.h | 14 +++++------ ext/standard/proc_open.c | 14 +++++------ ext/standard/proc_open.h | 14 +++++------ ext/standard/quot_print.c | 14 +++++------ ext/standard/quot_print.h | 14 +++++------ ext/standard/scanf.c | 14 +++++------ ext/standard/scanf.h | 14 +++++------ ext/standard/sha1.c | 14 +++++------ ext/standard/sha1.h | 14 +++++------ ext/standard/soundex.c | 14 +++++------ ext/standard/streamsfuncs.c | 14 +++++------ ext/standard/streamsfuncs.h | 14 +++++------ ext/standard/string.c | 14 +++++------ ext/standard/syslog.c | 14 +++++------ ext/standard/type.c | 14 +++++------ ext/standard/uniqid.c | 14 +++++------ ext/standard/url.c | 14 +++++------ ext/standard/url.h | 14 +++++------ ext/standard/url_scanner_ex.h | 14 +++++------ ext/standard/url_scanner_ex.re | 14 +++++------ ext/standard/user_filters.c | 14 +++++------ ext/standard/uuencode.c | 14 +++++------ ext/standard/var.c | 14 +++++------ ext/standard/var_unserializer.re | 14 +++++------ ext/standard/versioning.c | 14 +++++------ 112 files changed, 679 insertions(+), 909 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 7db5dcb72944..e175b7b8d2f4 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 501ea5508dd3..a976aeda1494 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 02b8fa421be8..5c3f876ef2b9 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | | Xinchen Hui | diff --git a/ext/standard/base64.h b/ext/standard/base64.h index 19ff0b60d252..a866541b727b 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | | Xinchen Hui | diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a611433af537..ece7f1278f7e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 004279b9d1ae..6bd227eac5d2 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index ec9e3a59e4b8..7534615a946b 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index e99c3ca9f5a0..fdf9df37c337 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h index 261acdeb1fec..97f2bc01a282 100644 --- a/ext/standard/crc32.h +++ b/ext/standard/crc32.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/crc32_x86.c b/ext/standard/crc32_x86.c index 0b655fd6a483..5a6debc6f410 100644 --- a/ext/standard/crc32_x86.c +++ b/ext/standard/crc32_x86.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Frank Du | +----------------------------------------------------------------------+ diff --git a/ext/standard/crc32_x86.h b/ext/standard/crc32_x86.h index 91b5ba80e691..c46775f1af22 100644 --- a/ext/standard/crc32_x86.h +++ b/ext/standard/crc32_x86.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Frank Du | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 4e8722db4d66..2b38cbf3b4e9 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/standard/credits.h b/ext/standard/credits.h index a0c5d1e7d90c..2a346dd06ddd 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 54687f6cdf30..d8a9905cfc13 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Bakken | | Zeev Suraski | diff --git a/ext/standard/css.c b/ext/standard/css.c index 41efc028ff72..87387c9a3826 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Colin Viebrock | +----------------------------------------------------------------------+ diff --git a/ext/standard/css.h b/ext/standard/css.h index 6771541f5fc5..59dbef62204c 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Colin Viebrock | +----------------------------------------------------------------------+ diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 93f47f0f858b..b60182ee7f33 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/standard/dir.c b/ext/standard/dir.c index a7e080ce2abe..f313d5f539d1 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 209b0c1d3b01..63f627e51d88 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brian Schaffner | | Shane Caraveo | diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 58de973bf4b5..9354caa2ca8d 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Brian Schaffner | | Shane Caraveo | diff --git a/ext/standard/dns.c b/ext/standard/dns.c index a574d8dd9aeb..b3fcc1d236af 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: The typical suspects | | Pollita | diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 8caf5813395c..c9ff67e47b1e 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Pierre A. Joye | +----------------------------------------------------------------------+ diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 7bacc976eac5..0e5903420a3e 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | | Ilia Alshanetsky | diff --git a/ext/standard/exec.h b/ext/standard/exec.h index 1ad755363e3d..879334285020 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/file.c b/ext/standard/file.c index 364985f786b7..1841c242b870 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | diff --git a/ext/standard/file.h b/ext/standard/file.h index f8faebd02829..3c6160fd4bb1 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 01c392f39360..e41f6d1abb61 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/filters.c b/ext/standard/filters.c index c909211788b0..90dd471cf848 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: | | Wez Furlong (wez@thebrainroom.com) | diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index b7e1df7cbc98..6967c4358901 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index af0739bf1528..cfb6d82ba085 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b0fbfcc89099..4324e7c14dd7 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -1,16 +1,14 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ - | Author: Stig S�ther Bakken | + | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 2b9e00a57554..0b27a13e624c 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Paul Panotzki - Bunyip Information Systems | | Jim Winstead | diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 3789a01b7ea0..849d5052238c 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Paul Panotzki - Bunyip Information Systems | | Jim Winstead | diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 98715b2ee8a0..7f8702adbf84 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrew Sitnikov | +----------------------------------------------------------------------+ diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 92200e64f238..73407aaa401c 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jim Winstead | diff --git a/ext/standard/head.c b/ext/standard/head.c index 797d8d66c56a..69e8d1f794ff 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/head.h b/ext/standard/head.h index 0272fec2dc21..07c947f8ad0b 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/hrtime.c b/ext/standard/hrtime.c index 652531bd3ed4..216810b7df1b 100644 --- a/ext/standard/hrtime.c +++ b/ext/standard/hrtime.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Niklas Keller | | Author: Anatol Belski | diff --git a/ext/standard/html.c b/ext/standard/html.c index eaba9ddffc1d..c8920f497d75 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jaakko Hyvätti | diff --git a/ext/standard/html.h b/ext/standard/html.h index 40c595ba5d89..8576a5c8b9ce 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/html_tables.h b/ext/standard/html_tables.h index 2d17d3fa44be..16f30283fdd4 100644 --- a/ext/standard/html_tables.h +++ b/ext/standard/html_tables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php index bc76f6f7e945..a3b2d8807d70 100755 --- a/ext/standard/html_tables/html_table_gen.php +++ b/ext/standard/html_tables/html_table_gen.php @@ -2,15 +2,13 @@ . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gustavo Lopes | +----------------------------------------------------------------------+ @@ -22,15 +20,13 @@ $t = <<. | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/http.c b/ext/standard/http.c index 9954a34b69ea..99509e7ceb04 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 6d9f7331afb3..f3172180bed9 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jim Winstead | diff --git a/ext/standard/image.c b/ext/standard/image.c index 08cf8983d029..869371842006 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Marcus Boerger | diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 228e03fbe863..d794612f429d 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/info.c b/ext/standard/info.c index 952f0f92fe6e..90d882c15d34 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/standard/info.h b/ext/standard/info.h index 380d2b6e042a..6d1603dd8346 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 5482a3c6ff15..59db612a7337 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index d4688dcb9c13..efc71d2a2828 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Hartmut Holzgraefe | +----------------------------------------------------------------------+ diff --git a/ext/standard/link.c b/ext/standard/link.c index 24e3b515dc80..d92e74bb6743 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/mail.c b/ext/standard/mail.c index c909c0ed55dd..6aac0d364cf0 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/math.c b/ext/standard/math.c index 61534975c2f8..66fbfeaa9428 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jim Winstead | | Stig Sæther Bakken | diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 9d0f5f886a6b..204514053cf0 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Alexander Peslyak (Solar Designer) | | Lachlan Roche | diff --git a/ext/standard/md5.h b/ext/standard/md5.h index 5444abf46aec..30faa0ac258a 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Alexander Peslyak (Solar Designer) | | Rasmus Lerdorf | diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 6b80f2e3a8e0..816e5d28220e 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index ca8643eb5196..46e770dec3ee 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Paul Panotzki - Bunyip Information Systems | +----------------------------------------------------------------------+ diff --git a/ext/standard/net.c b/ext/standard/net.c index 942d804d42a4..199db6e80943 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 55da64897a2e..1ab5d4858cbe 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Chris Schneider | +----------------------------------------------------------------------+ diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index c1cbc59bfaa1..3ddda25ef0b7 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index 029ce8b97981..5ce81685f9ec 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/password.c b/ext/standard/password.c index a8aab315657c..a28ceb7e0ced 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anthony Ferrara | | Charles R. Portwood II | diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index a7eae0777d99..ab6c8494dd4e 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index 103a770e7601..c26e1f11681c 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index 4fc4f66a9233..85225bca0244 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index b7111dfd21b1..19c20c4a6c16 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Bakken | | Zeev Suraski | diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index bd30ce9ce8cb..15a1508be1cb 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Pierre Alain Joye . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Pierre Alain Joye . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Thies C. Arntzen | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_dir_int.h b/ext/standard/php_dir_int.h index 06faf4e678f4..17fcbab7e1cb 100644 --- a/ext/standard/php_dir_int.h +++ b/ext/standard/php_dir_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index 4e04799cdb8a..5b0a29f32bd1 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: The typical suspects | | Marcus Boerger | diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h index fd7958fad292..44c5ad1c02f4 100644 --- a/ext/standard/php_ext_syslog.h +++ b/ext/standard/php_ext_syslog.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index ef3c1cd60c72..c2ea6eed66e2 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index ea33ba490434..89c2d9c49b0c 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jim Winstead | diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 885e31ffa730..a7e027dcf89f 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jim Winstead | diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 9350be597ea1..6192d0e63cee 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index 6a4e0987d13d..ea57214bda0b 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Marcus Boerger | diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index 07eabf60d5dc..fb49eaf1b693 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index bebb526699d0..f7320f1d0700 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index 9ebd600537fd..cb0b9db21599 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jim Winstead | | Stig Sæther Bakken | diff --git a/ext/standard/php_math_round_mode.h b/ext/standard/php_math_round_mode.h index 9ab02de2c361..abc3c7e284a5 100644 --- a/ext/standard/php_math_round_mode.h +++ b/ext/standard/php_math_round_mode.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jim Winstead | | Stig Sæther Bakken | diff --git a/ext/standard/php_net.h b/ext/standard/php_net.h index 58739131232d..beabb12caac9 100644 --- a/ext/standard/php_net.h +++ b/ext/standard/php_net.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_password.h b/ext/standard/php_password.h index 5a6f3b2af5c9..6442b782c256 100644 --- a/ext/standard/php_password.h +++ b/ext/standard/php_password.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anthony Ferrara | | Charles R. Portwood II | diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h index 5bc792362bbd..34715e966683 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index ef62329ba8ed..86c331f8a7c5 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Sæther Bakken | diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index da3d601851d9..e3d810f1c95f 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ilia Alshanetsky | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index d70bbfed814a..8839a2f3df73 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jani Lehtimäki | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h index 307ac1234a8c..da3748079aa3 100644 --- a/ext/standard/php_versioning.h +++ b/ext/standard/php_versioning.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index ddce144161ca..edccbeae5646 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h index 2dba712f995f..6a9e0533bfd2 100644 --- a/ext/standard/proc_open.h +++ b/ext/standard/proc_open.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index a7132df2f7fd..f4954a88f8fa 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kirill Maximov | +----------------------------------------------------------------------+ diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h index 11b829d974b8..faf515210695 100644 --- a/ext/standard/quot_print.h +++ b/ext/standard/quot_print.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kirill Maximov (kir@rus.net) | +----------------------------------------------------------------------+ diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 408e5ede8881..980009c30640 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Clayton Collie | +----------------------------------------------------------------------+ diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index d2ef2fc0f2e8..c60a2b664ad4 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Clayton Collie | +----------------------------------------------------------------------+ diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 95f2b54d0fd0..4832756f577a 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stefan Esser | +----------------------------------------------------------------------+ diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index 046d6db2cc47..a1f4801736b1 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stefan Esser | +----------------------------------------------------------------------+ diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index 5c45f4d3ef67..527ef9537af3 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Bjørn Borud - Guardian Networks AS | +----------------------------------------------------------------------+ diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 506ce0dafed8..68f79783c6f8 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Sara Golemon | diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 41058472473d..7d6f523bfcd0 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/standard/string.c b/ext/standard/string.c index d7f76af633cf..ef9e66ab53f8 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Sæther Bakken | diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index c5d73eb008ec..44b902bf50b8 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ diff --git a/ext/standard/type.c b/ext/standard/type.c index 8256b3274ea2..7546216e5049 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index c0b9555ccefd..267851cd73ac 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ diff --git a/ext/standard/url.c b/ext/standard/url.c index 4ddf7f80c64f..089dca315f43 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/url.h b/ext/standard/url.h index 3885ecece578..f807ed67cf9b 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index e6b296324298..c39b71eebf8c 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index f2adb8c864bd..af605b8886cc 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | | Yasuo Ohgaki | diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index ac21e083efbb..816a798c4b00 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: | | Wez Furlong (wez@thebrainroom.com) | diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 0389fdd9f979..af70e3a2aa2c 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Ilia Alshanetsky | +----------------------------------------------------------------------+ diff --git a/ext/standard/var.c b/ext/standard/var.c index fc8b2f4f3784..7bf4e17a4cb5 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jani Lehtimäki | | Thies C. Arntzen | diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 353c7086d430..d5019d94dc0c 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 6995569fbf87..75968ca577fd 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ From 7a7df1f3a67c70bd11681efe0306f4ac00c0af0a Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:30:33 -0500 Subject: [PATCH 174/300] license-update: ext/sysvmsg source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sysvmsg/php_sysvmsg.h | 14 ++++++-------- ext/sysvmsg/sysvmsg.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h index e3be3ed32e31..c82cb09934da 100644 --- a/ext/sysvmsg/php_sysvmsg.h +++ b/ext/sysvmsg/php_sysvmsg.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index 65d29d12c0f9..c86404fc5c45 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ From 548eb95e5fb333e3ea29084800e0a7c6d51f7935 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:31:00 -0500 Subject: [PATCH 175/300] license-update: ext/sysvsem source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sysvsem/php_sysvsem.h | 14 ++++++-------- ext/sysvsem/sysvsem.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h index 05d420bf42a4..c40d6dde5f1c 100644 --- a/ext/sysvsem/php_sysvsem.h +++ b/ext/sysvsem/php_sysvsem.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Tom May | +----------------------------------------------------------------------+ diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index ce624ab4b237..e29283ea3f6e 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Tom May | | Gavin Sherry | From 850c177a0113c194a66b5a5d92cc6f55a2cd34af Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:31:21 -0500 Subject: [PATCH 176/300] license-update: ext/sysvshm source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/sysvshm/php_sysvshm.h | 14 ++++++-------- ext/sysvshm/sysvshm.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h index 9576349e06d8..b47a70c4e5e1 100644 --- a/ext/sysvshm/php_sysvshm.h +++ b/ext/sysvshm/php_sysvshm.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Christian Cartus | +----------------------------------------------------------------------+ diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index 7f064c50a294..29f153b19662 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Christian Cartus | +----------------------------------------------------------------------+ From 1fbfabe18febc5737bbfb0445e3d089320c8cbdf Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:31:40 -0500 Subject: [PATCH 177/300] license-update: ext/tidy source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/tidy/php_tidy.h | 14 ++++++-------- ext/tidy/tidy.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h index 2c31a92a8370..9449580a7ace 100644 --- a/ext/tidy/php_tidy.h +++ b/ext/tidy/php_tidy.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: John Coggeshall | +----------------------------------------------------------------------+ diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 496fb260976e..ba22c06ef494 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: John Coggeshall | +----------------------------------------------------------------------+ From 77d7c0e38d455cb1ebf435a90ce729dc827212a4 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:32:15 -0500 Subject: [PATCH 178/300] license-update: ext/tokenizer source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/tokenizer/php_tokenizer.h | 14 ++++++-------- ext/tokenizer/tokenizer.c | 14 ++++++-------- ext/tokenizer/tokenizer_data.c | 14 ++++++-------- ext/tokenizer/tokenizer_data_gen.php | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h index edc715de8d71..3acdebc4ac66 100644 --- a/ext/tokenizer/php_tokenizer.h +++ b/ext/tokenizer/php_tokenizer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrei Zmievski | +----------------------------------------------------------------------+ diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index e594bc62ab38..fdbdd5ddfb61 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrei Zmievski | +----------------------------------------------------------------------+ diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c index 0900c51d3d95..87b15b8bb345 100644 --- a/ext/tokenizer/tokenizer_data.c +++ b/ext/tokenizer/tokenizer_data.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Johannes Schlueter | +----------------------------------------------------------------------+ diff --git a/ext/tokenizer/tokenizer_data_gen.php b/ext/tokenizer/tokenizer_data_gen.php index 79753b6e81a5..0119b0cc0237 100755 --- a/ext/tokenizer/tokenizer_data_gen.php +++ b/ext/tokenizer/tokenizer_data_gen.php @@ -39,15 +39,13 @@ $result = <<. | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Johannes Schlueter | +----------------------------------------------------------------------+ From 113d1acdf00ae07a9523206c10d96dbcc53a9927 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:32:50 -0500 Subject: [PATCH 179/300] license-update: ext/uri source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/uri/php_uri.c | 14 ++++++-------- ext/uri/php_uri.h | 14 ++++++-------- ext/uri/php_uri_common.c | 14 ++++++-------- ext/uri/php_uri_common.h | 14 ++++++-------- ext/uri/uri_parser_php_parse_url.c | 14 ++++++-------- ext/uri/uri_parser_php_parse_url.h | 14 ++++++-------- ext/uri/uri_parser_rfc3986.c | 14 ++++++-------- ext/uri/uri_parser_rfc3986.h | 14 ++++++-------- ext/uri/uri_parser_whatwg.c | 14 ++++++-------- ext/uri/uri_parser_whatwg.h | 14 ++++++-------- 10 files changed, 60 insertions(+), 80 deletions(-) diff --git a/ext/uri/php_uri.c b/ext/uri/php_uri.c index 2adece125530..a9e20d09996f 100644 --- a/ext/uri/php_uri.c +++ b/ext/uri/php_uri.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/php_uri.h b/ext/uri/php_uri.h index 1ec3617b096c..2c8516585c0f 100644 --- a/ext/uri/php_uri.h +++ b/ext/uri/php_uri.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/php_uri_common.c b/ext/uri/php_uri_common.c index 5c48be475fb9..5d87b7847b34 100644 --- a/ext/uri/php_uri_common.c +++ b/ext/uri/php_uri_common.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/php_uri_common.h b/ext/uri/php_uri_common.h index 6fced64e372f..f081fd6b6fd0 100644 --- a/ext/uri/php_uri_common.h +++ b/ext/uri/php_uri_common.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/uri_parser_php_parse_url.c b/ext/uri/uri_parser_php_parse_url.c index b5f7ed2f81ac..ba0e2a2296a7 100644 --- a/ext/uri/uri_parser_php_parse_url.c +++ b/ext/uri/uri_parser_php_parse_url.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | | Tim Düsterhus | diff --git a/ext/uri/uri_parser_php_parse_url.h b/ext/uri/uri_parser_php_parse_url.h index 6cf532db8352..2dd2660fe153 100644 --- a/ext/uri/uri_parser_php_parse_url.h +++ b/ext/uri/uri_parser_php_parse_url.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | | Tim Düsterhus | diff --git a/ext/uri/uri_parser_rfc3986.c b/ext/uri/uri_parser_rfc3986.c index 419f3db5652b..172d7f08f144 100644 --- a/ext/uri/uri_parser_rfc3986.c +++ b/ext/uri/uri_parser_rfc3986.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/uri_parser_rfc3986.h b/ext/uri/uri_parser_rfc3986.h index 4d88478b6063..21f938c370ad 100644 --- a/ext/uri/uri_parser_rfc3986.h +++ b/ext/uri/uri_parser_rfc3986.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/uri_parser_whatwg.c b/ext/uri/uri_parser_whatwg.c index 2b47d31d79e1..d140357c18ed 100644 --- a/ext/uri/uri_parser_whatwg.c +++ b/ext/uri/uri_parser_whatwg.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ diff --git a/ext/uri/uri_parser_whatwg.h b/ext/uri/uri_parser_whatwg.h index e8bbb585fd66..3e9e2824e42b 100644 --- a/ext/uri/uri_parser_whatwg.h +++ b/ext/uri/uri_parser_whatwg.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Máté Kocsis | +----------------------------------------------------------------------+ From c3e63ae942d40b9e6eac6977f4fd8274a3cfb71b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:33:16 -0500 Subject: [PATCH 180/300] license-update: ext/xml source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/xml/compat.c | 14 ++++++-------- ext/xml/expat_compat.h | 14 ++++++-------- ext/xml/php_xml.h | 14 ++++++-------- ext/xml/xml.c | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 7e37bf1e412c..10bfa19af7af 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index a7faffbac504..721bad71080b 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h index 8be95fa7aa8f..982f39933d17 100644 --- a/ext/xml/php_xml.h +++ b/ext/xml/php_xml.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Sæther Bakken | | Thies C. Arntzen | diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 968fe4695467..d9df7920bb92 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stig Sæther Bakken | | Thies C. Arntzen | From 462bdf8a56b1c3b536b369450cb5ea32fb2d17e1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:33:35 -0500 Subject: [PATCH 181/300] license-update: ext/xmlreader source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/xmlreader/php_xmlreader.c | 14 ++++++-------- ext/xmlreader/php_xmlreader.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index da337fd6dabb..18a2612d9ede 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rob Richards | +----------------------------------------------------------------------+ diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h index b14b033a0eea..74d11c6bdbea 100644 --- a/ext/xmlreader/php_xmlreader.h +++ b/ext/xmlreader/php_xmlreader.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rob Richards | +----------------------------------------------------------------------+ From 4d9265558ad220fcc17e1cdc78a9fd9c3febb294 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:33:53 -0500 Subject: [PATCH 182/300] license-update: ext/xmlwriter source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/xmlwriter/php_xmlwriter.c | 14 ++++++-------- ext/xmlwriter/php_xmlwriter.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 8d343aadf263..838d5fdc481d 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rob Richards | | Pierre-A. Joye | diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h index e9a4dcb2aa49..6a0ae1c37abc 100644 --- a/ext/xmlwriter/php_xmlwriter.h +++ b/ext/xmlwriter/php_xmlwriter.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Rob Richards | | Pierre-A. Joye | From 7dafb839c3b6b0c24609cd3584ce546cb050dca3 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:34:25 -0500 Subject: [PATCH 183/300] license-update: ext/xsl source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/xsl/php_xsl.c | 14 ++++++-------- ext/xsl/php_xsl.h | 16 ++++++---------- ext/xsl/xsltprocessor.c | 14 ++++++-------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 1a307e934fea..474d167905df 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Christian Stocker | +----------------------------------------------------------------------+ diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index e0171ce9590c..54f19e866269 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index fe7ed9cd2bb4..230c7bd39cc2 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Stocker | | Rob Richards | From f04af71c0eb4e26d4d02a9af181e017105998733 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:20:14 -0500 Subject: [PATCH 184/300] license-update: ext/zend_test source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/zend_test/fiber.c | 14 ++++++-------- ext/zend_test/fiber.h | 14 ++++++-------- ext/zend_test/iterators.c | 14 ++++++-------- ext/zend_test/iterators.h | 14 ++++++-------- ext/zend_test/object_handlers.c | 14 ++++++-------- ext/zend_test/object_handlers.h | 14 ++++++-------- ext/zend_test/observer.c | 16 ++++++---------- ext/zend_test/observer.h | 16 ++++++---------- ext/zend_test/php_test.h | 16 ++++++---------- ext/zend_test/test.c | 16 ++++++---------- ext/zend_test/zend_mm_custom_handlers.c | 14 ++++++-------- ext/zend_test/zend_mm_custom_handlers.h | 14 ++++++-------- 12 files changed, 72 insertions(+), 104 deletions(-) diff --git a/ext/zend_test/fiber.c b/ext/zend_test/fiber.c index 199d1b28b8cd..da6f4c962d85 100644 --- a/ext/zend_test/fiber.c +++ b/ext/zend_test/fiber.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Aaron Piotrowski | +----------------------------------------------------------------------+ diff --git a/ext/zend_test/fiber.h b/ext/zend_test/fiber.h index ad5a4c7b3342..801d0a78af16 100644 --- a/ext/zend_test/fiber.h +++ b/ext/zend_test/fiber.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Aaron Piotrowski | +----------------------------------------------------------------------+ diff --git a/ext/zend_test/iterators.c b/ext/zend_test/iterators.c index 47ea017d892a..0171a91708e9 100644 --- a/ext/zend_test/iterators.c +++ b/ext/zend_test/iterators.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/iterators.h b/ext/zend_test/iterators.h index cef09109e239..070259094da8 100644 --- a/ext/zend_test/iterators.h +++ b/ext/zend_test/iterators.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/object_handlers.c b/ext/zend_test/object_handlers.c index 15e362605f8e..a5038dcba6dd 100644 --- a/ext/zend_test/object_handlers.c +++ b/ext/zend_test/object_handlers.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: George Peter Banyard | +----------------------------------------------------------------------+ diff --git a/ext/zend_test/object_handlers.h b/ext/zend_test/object_handlers.h index 528e047360f9..fa188d923667 100644 --- a/ext/zend_test/object_handlers.h +++ b/ext/zend_test/object_handlers.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: George Peter Banyard | +----------------------------------------------------------------------+ diff --git a/ext/zend_test/observer.c b/ext/zend_test/observer.c index e348987359b9..3a8b07778d5e 100644 --- a/ext/zend_test/observer.c +++ b/ext/zend_test/observer.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/observer.h b/ext/zend_test/observer.h index dd19fae2c527..28809a095cbe 100644 --- a/ext/zend_test/observer.h +++ b/ext/zend_test/observer.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/php_test.h b/ext/zend_test/php_test.h index 7ec6f5431234..e3cf4b4284ba 100644 --- a/ext/zend_test/php_test.h +++ b/ext/zend_test/php_test.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 7ab2272dd168..02252a2d43ed 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/ext/zend_test/zend_mm_custom_handlers.c b/ext/zend_test/zend_mm_custom_handlers.c index 2130065109ef..76628f8881b5 100644 --- a/ext/zend_test/zend_mm_custom_handlers.c +++ b/ext/zend_test/zend_mm_custom_handlers.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Florian Engelhardt | +----------------------------------------------------------------------+ diff --git a/ext/zend_test/zend_mm_custom_handlers.h b/ext/zend_test/zend_mm_custom_handlers.h index 7e0c8021e7e2..1db32562320b 100644 --- a/ext/zend_test/zend_mm_custom_handlers.h +++ b/ext/zend_test/zend_mm_custom_handlers.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Florian Engelhardt | +----------------------------------------------------------------------+ From 67347de7633bef39f02446195968a0c824356946 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:36:20 -0500 Subject: [PATCH 185/300] license-update: ext/zip source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/zip/php_zip.c | 14 ++++++-------- ext/zip/php_zip.h | 14 ++++++-------- ext/zip/zip_source.c | 14 ++++++-------- ext/zip/zip_stream.c | 14 ++++++-------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index bc1add5a8af5..1a65a1e87220 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Piere-Alain Joye | +----------------------------------------------------------------------+ diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 22e257f50872..4c7661256538 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre-Alain Joye | +----------------------------------------------------------------------+ diff --git a/ext/zip/zip_source.c b/ext/zip/zip_source.c index f0222bcd78a6..48b35862b903 100644 --- a/ext/zip/zip_source.c +++ b/ext/zip/zip_source.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Tim Starling | +----------------------------------------------------------------------+ diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index 9d6fb733575b..d4c24bd24e13 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Piere-Alain Joye | +----------------------------------------------------------------------+ From 40be849858f6a2ce6f7d1011cda53ecc506b1da9 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:39:11 -0500 Subject: [PATCH 186/300] license-update: ext/zlib source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/zlib/php_zlib.h | 16 +++++++--------- ext/zlib/zlib.c | 14 ++++++-------- ext/zlib/zlib_filter.c | 14 ++++++-------- ext/zlib/zlib_fopen_wrapper.c | 14 ++++++-------- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index b7a9484cd28f..c7286d5c858a 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -1,17 +1,15 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | - | Stefan R�hrich | + | Stefan Röhrich | | Michael Wallner | +----------------------------------------------------------------------+ */ diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index c6a56e172be4..dbbaf1a24157 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stefan Röhrich | diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 69c9a85465e8..b6393feb9083 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sara Golemon (pollita@php.net) | +----------------------------------------------------------------------+ diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 7420c0cc6ff2..aebf368a16ed 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong , based on work by: | | Hartmut Holzgraefe | From c3b755bfcad41deeaebb9a5df24dcfc439350759 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:39:57 -0500 Subject: [PATCH 187/300] license-update: ext_skel.php source headers RFC: https://wiki.php.net/rfc/php_license_update --- ext/ext_skel.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/ext_skel.php b/ext/ext_skel.php index d396dfa3da74..3237ca625c99 100755 --- a/ext/ext_skel.php +++ b/ext/ext_skel.php @@ -2,15 +2,13 @@ . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kalle Sommer Nielsen | +----------------------------------------------------------------------+ @@ -257,15 +255,13 @@ function process_source_tags($file, $short_name) { $header = <<<"HEADER" /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: $credits | +----------------------------------------------------------------------+ From b98e498b034e3cb5509b039af64d7c764788869b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:41:31 -0500 Subject: [PATCH 188/300] license-update: main/streams source headers RFC: https://wiki.php.net/rfc/php_license_update --- main/streams/cast.c | 14 ++++++-------- main/streams/filter.c | 14 ++++++-------- main/streams/glob_wrapper.c | 14 ++++++-------- main/streams/memory.c | 14 ++++++-------- main/streams/mmap.c | 14 ++++++-------- main/streams/php_stream_context.h | 14 ++++++-------- main/streams/php_stream_filter_api.h | 14 ++++++-------- main/streams/php_stream_glob_wrapper.h | 14 ++++++-------- main/streams/php_stream_mmap.h | 14 ++++++-------- main/streams/php_stream_plain_wrapper.h | 14 ++++++-------- main/streams/php_stream_transport.h | 14 ++++++-------- main/streams/php_stream_userspace.h | 14 ++++++-------- main/streams/php_streams_int.h | 14 ++++++-------- main/streams/plain_wrapper.c | 14 ++++++-------- main/streams/streams.c | 14 ++++++-------- main/streams/transports.c | 14 ++++++-------- main/streams/userspace.c | 14 ++++++-------- main/streams/xp_socket.c | 14 ++++++-------- 18 files changed, 108 insertions(+), 144 deletions(-) diff --git a/main/streams/cast.c b/main/streams/cast.c index 4dc8ddb5f6a3..10c93cbb3ffb 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/filter.c b/main/streams/filter.c index 2260bae82335..9ec144195693 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index fb056ce889fa..c7f1145de200 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/streams/memory.c b/main/streams/memory.c index 9cb94542df6f..44336f0e3e2b 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/streams/mmap.c b/main/streams/mmap.c index 6ed9c057969b..e3831636bcd4 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index cc001cced154..9373182f7c2e 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index cb4fdb5fd7f7..a61bc48815f5 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | With suggestions from: | diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h index 04de00a593dd..c9c7fdcf2463 100644 --- a/main/streams/php_stream_glob_wrapper.h +++ b/main/streams/php_stream_glob_wrapper.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index d477aa79481e..0f85e0269f47 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index ce1a6e3876d1..f44edcb16a97 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 96675af6daea..0125035aaa69 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h index 18e0f4028f2c..5b82a88d41a6 100644 --- a/main/streams/php_stream_userspace.h +++ b/main/streams/php_stream_userspace.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index 7580088fba31..abf68aeacb80 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 74d8877a7f38..69258158fbe3 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/streams.c b/main/streams/streams.c index 26f147632cef..31d1eda16790 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Borrowed code from: | diff --git a/main/streams/transports.c b/main/streams/transports.c index 83297d9a06ce..0a18d10f7433 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/main/streams/userspace.c b/main/streams/userspace.c index f5e25aa96c77..335ef3aa4f27 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Sara Golemon | diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index f21944313d32..77977a557fc6 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ From 715fcf1973b0a24935295197bd991578bf0071c2 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:46:20 -0500 Subject: [PATCH 189/300] license-update: main source headers RFC: https://wiki.php.net/rfc/php_license_update --- main/SAPI.c | 14 ++++++-------- main/SAPI.h | 14 ++++++-------- main/build-defs.h.in | 14 ++++++-------- main/explicit_bzero.c | 16 ++++++---------- main/fastcgi.c | 14 ++++++-------- main/fastcgi.h | 14 ++++++-------- main/fopen_wrappers.c | 14 ++++++-------- main/fopen_wrappers.h | 14 ++++++-------- main/getopt.c | 14 ++++++-------- main/http_status_codes.h | 14 ++++++-------- main/internal_functions.c.in | 14 ++++++-------- main/main.c | 14 ++++++-------- main/network.c | 14 ++++++-------- main/output.c | 14 ++++++-------- main/php.h | 14 ++++++-------- main/php_compat.h | 16 ++++++---------- main/php_content_types.c | 16 ++++++---------- main/php_content_types.h | 16 ++++++---------- main/php_getopt.h | 14 ++++++-------- main/php_globals.h | 14 ++++++-------- main/php_ini.c | 14 ++++++-------- main/php_ini.h | 14 ++++++-------- main/php_ini_builder.c | 14 ++++++-------- main/php_ini_builder.h | 14 ++++++-------- main/php_main.h | 14 ++++++-------- main/php_memory_streams.h | 14 ++++++-------- main/php_network.h | 14 ++++++-------- main/php_odbc_utils.c | 14 ++++++-------- main/php_odbc_utils.h | 14 ++++++-------- main/php_open_temporary_file.c | 14 ++++++-------- main/php_open_temporary_file.h | 14 ++++++-------- main/php_output.h | 14 ++++++-------- main/php_reentrancy.h | 14 ++++++-------- main/php_scandir.c | 14 ++++++-------- main/php_scandir.h | 14 ++++++-------- main/php_streams.h | 14 ++++++-------- main/php_syslog.c | 14 ++++++-------- main/php_syslog.h | 16 ++++++---------- main/php_ticks.c | 14 ++++++-------- main/php_ticks.h | 14 ++++++-------- main/php_variables.c | 14 ++++++-------- main/php_variables.h | 14 ++++++-------- main/reentrancy.c | 14 ++++++-------- main/rfc1867.c | 14 ++++++-------- main/rfc1867.h | 16 ++++++---------- main/safe_bcmp.c | 14 ++++++-------- main/snprintf.c | 16 ++++++---------- main/snprintf.h | 14 ++++++-------- main/spprintf.c | 14 ++++++-------- main/spprintf.h | 14 ++++++-------- main/strlcat.c | 16 ++++++---------- main/strlcpy.c | 16 ++++++---------- 52 files changed, 312 insertions(+), 434 deletions(-) diff --git a/main/SAPI.c b/main/SAPI.c index 2fd7e18adcea..144f727dd1fe 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Original design: Shane Caraveo | | Authors: Andi Gutmans | diff --git a/main/SAPI.h b/main/SAPI.h index 9196982f5495..e62f686603c4 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/build-defs.h.in b/main/build-defs.h.in index 72cd9c30fb74..2c62998fc586 100644 --- a/main/build-defs.h.in +++ b/main/build-defs.h.in @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | +----------------------------------------------------------------------+ diff --git a/main/explicit_bzero.c b/main/explicit_bzero.c index c49bdede6624..541c9f408e9a 100644 --- a/main/explicit_bzero.c +++ b/main/explicit_bzero.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/fastcgi.c b/main/fastcgi.c index 3488d6e21eae..a4853d8f0535 100644 --- a/main/fastcgi.c +++ b/main/fastcgi.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/main/fastcgi.h b/main/fastcgi.h index 8a1c0516a9c7..c1e7deb181f6 100644 --- a/main/fastcgi.h +++ b/main/fastcgi.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index b6f32ce309dc..a9e159efc8bf 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jim Winstead | diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index 1a1289836ba3..f92c7d6fd443 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Jim Winstead | +----------------------------------------------------------------------+ diff --git a/main/getopt.c b/main/getopt.c index 65ce94ae9bb0..516d1c41022b 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/http_status_codes.h b/main/http_status_codes.h index f29921122d57..e39ba21daf15 100644 --- a/main/http_status_codes.h +++ b/main/http_status_codes.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Andrea Faulds | +----------------------------------------------------------------------+ diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in index cef0a438c682..de22e2237dbe 100644 --- a/main/internal_functions.c.in +++ b/main/internal_functions.c.in @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/main/main.c b/main/main.c index bb5b700fe7ae..ad38ebdd06a6 100644 --- a/main/main.c +++ b/main/main.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Rasmus Lerdorf | diff --git a/main/network.c b/main/network.c index 54dbf2b8e580..f652cf555ffb 100644 --- a/main/network.c +++ b/main/network.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Venaas | | Streams work by Wez Furlong | diff --git a/main/output.c b/main/output.c index 98684955e394..72b42301a724 100644 --- a/main/output.c +++ b/main/output.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Thies C. Arntzen | diff --git a/main/php.h b/main/php.h index 32222cfca94e..44076b2c294d 100644 --- a/main/php.h +++ b/main/php.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/main/php_compat.h b/main/php_compat.h index 2f9f4c1c89e6..68bc4e7550f8 100644 --- a/main/php_compat.h +++ b/main/php_compat.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/php_content_types.c b/main/php_content_types.c index f01841986728..c727d0ed3314 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/php_content_types.h b/main/php_content_types.h index 6aab33e29421..e734bb1963cd 100644 --- a/main/php_content_types.h +++ b/main/php_content_types.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/php_getopt.h b/main/php_getopt.h index 0238881113a7..6f457f3a58da 100644 --- a/main/php_getopt.h +++ b/main/php_getopt.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/php_globals.h b/main/php_globals.h index 893bf25d26cb..f6f57e0045c8 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/php_ini.c b/main/php_ini.c index 4bac70e88778..9925eafad1fd 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/php_ini.h b/main/php_ini.h index 4253ce43fbe1..ffc2c36186c9 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/php_ini_builder.c b/main/php_ini_builder.c index d214a340343f..1063d014bc2a 100644 --- a/main/php_ini_builder.c +++ b/main/php_ini_builder.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Max Kellermann | +----------------------------------------------------------------------+ diff --git a/main/php_ini_builder.h b/main/php_ini_builder.h index 7f5be81c10ac..0ad70b6f68a7 100644 --- a/main/php_ini_builder.h +++ b/main/php_ini_builder.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Max Kellermann | +----------------------------------------------------------------------+ diff --git a/main/php_main.h b/main/php_main.h index bd28a0dee1d7..de2ace1c25ed 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h index 0b7f51ee6d90..cf83ba8e084e 100644 --- a/main/php_memory_streams.h +++ b/main/php_memory_streams.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/php_network.h b/main/php_network.h index 6700ab42dd3f..e6d3009a6c82 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Venaas | +----------------------------------------------------------------------+ diff --git a/main/php_odbc_utils.c b/main/php_odbc_utils.c index 5cba835f81e3..d3b18f2bd642 100644 --- a/main/php_odbc_utils.c +++ b/main/php_odbc_utils.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Calvin Buckley | +----------------------------------------------------------------------+ diff --git a/main/php_odbc_utils.h b/main/php_odbc_utils.h index 183957d6dd12..78353b49a814 100644 --- a/main/php_odbc_utils.h +++ b/main/php_odbc_utils.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Calvin Buckley | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index 3a410eb7fa2d..ffc1c754d9e6 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h index 1d8764a7487e..d9d8d8069190 100644 --- a/main/php_open_temporary_file.h +++ b/main/php_open_temporary_file.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/main/php_output.h b/main/php_output.h index 896f1e0a8fea..f0a26824936a 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michael Wallner | +----------------------------------------------------------------------+ diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h index 5a78df078698..f11ef17acb71 100644 --- a/main/php_reentrancy.h +++ b/main/php_reentrancy.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/main/php_scandir.c b/main/php_scandir.c index 7bf91bdf7f33..848a0cf96168 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Shane Caraveo | | Ilia Alshanetsky | diff --git a/main/php_scandir.h b/main/php_scandir.h index ec5565914247..76d27feb15ca 100644 --- a/main/php_scandir.h +++ b/main/php_scandir.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Shane Caraveo | | Ilia Alshanetsky | diff --git a/main/php_streams.h b/main/php_streams.h index 1c52539cfcae..d248de7a8168 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong (wez@thebrainroom.com) | +----------------------------------------------------------------------+ diff --git a/main/php_syslog.c b/main/php_syslog.c index 975a0423df17..a92b2518caab 100644 --- a/main/php_syslog.c +++ b/main/php_syslog.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Philip Prindeville | +----------------------------------------------------------------------+ diff --git a/main/php_syslog.h b/main/php_syslog.h index f2682d74f238..d3ff747311ac 100644 --- a/main/php_syslog.h +++ b/main/php_syslog.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/php_ticks.c b/main/php_ticks.c index 4c1e5113e965..c71082dfa2d1 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Bakken | +----------------------------------------------------------------------+ diff --git a/main/php_ticks.h b/main/php_ticks.h index 998f4364e5e9..43801a74e89d 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Bakken | +----------------------------------------------------------------------+ diff --git a/main/php_variables.c b/main/php_variables.c index 971e1c77ea9f..7453014fa2cc 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/main/php_variables.h b/main/php_variables.h index 5cb43890bd75..27a45e8daa3c 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Zeev Suraski | diff --git a/main/reentrancy.c b/main/reentrancy.c index bd050ff9ac68..a611841a397a 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/main/rfc1867.c b/main/rfc1867.c index 161a0e4e487f..0f55a380a85e 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Jani Taskinen | diff --git a/main/rfc1867.h b/main/rfc1867.h index bb690f15aa3e..cbe39c7b4f62 100644 --- a/main/rfc1867.h +++ b/main/rfc1867.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/safe_bcmp.c b/main/safe_bcmp.c index f52dbee5bafe..2a7d3b55945b 100644 --- a/main/safe_bcmp.c +++ b/main/safe_bcmp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: David Carlier | +----------------------------------------------------------------------+ diff --git a/main/snprintf.c b/main/snprintf.c index e9938c79659f..44c70dd86479 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/snprintf.h b/main/snprintf.h index d61ee5e39a69..b123810a77c0 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Stig Sæther Bakken | | Marcus Boerger | diff --git a/main/spprintf.c b/main/spprintf.c index 0dd7f1552e1c..7249c17cdda0 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/spprintf.h b/main/spprintf.h index 4da224845b3b..c1d2377d25a5 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/main/strlcat.c b/main/strlcat.c index b514a7e0d5d5..9590fd19229c 100644 --- a/main/strlcat.c +++ b/main/strlcat.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/main/strlcpy.c b/main/strlcpy.c index 9ca99311aa42..f7e563967377 100644 --- a/main/strlcpy.c +++ b/main/strlcpy.c @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ From 6d30bed24e0937af3b8357fac885d9a1bce33a96 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:47:08 -0500 Subject: [PATCH 190/300] license-update: sapi/apache2handler source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/apache2handler/apache_config.c | 14 ++++++-------- sapi/apache2handler/mod_php.c | 14 ++++++-------- sapi/apache2handler/php_apache.h | 14 ++++++-------- sapi/apache2handler/php_functions.c | 14 ++++++-------- sapi/apache2handler/sapi_apache2.c | 14 ++++++-------- 5 files changed, 30 insertions(+), 40 deletions(-) diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c index a31ba68f9281..1f9447e62938 100644 --- a/sapi/apache2handler/apache_config.c +++ b/sapi/apache2handler/apache_config.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/sapi/apache2handler/mod_php.c b/sapi/apache2handler/mod_php.c index c7308fe2df60..9228b3ec049c 100644 --- a/sapi/apache2handler/mod_php.c +++ b/sapi/apache2handler/mod_php.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Parts based on Apache 1.3 SAPI module by | diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h index c49dd2970880..18b4e5a75910 100644 --- a/sapi/apache2handler/php_apache.h +++ b/sapi/apache2handler/php_apache.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 942772958419..1baa1f5225e0 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 36862c9e41fc..83b3f02fb743 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Parts based on Apache 1.3 SAPI module by | From 8d814cd029221557a6d3d783fd88720ceaa4055d Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:47:39 -0500 Subject: [PATCH 191/300] license-update: sapi/cgi source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/cgi/cgi_main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 213870db54f1..f49507827e2d 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | From 316629d2add62cc14a4cbfb08a0eb88532284ddf Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:49:06 -0500 Subject: [PATCH 192/300] license-update: sapi/cli source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/cli/cli.h | 14 ++++++-------- sapi/cli/generate_mime_type_map.php | 14 ++++++-------- sapi/cli/mime_type_map.h | 14 ++++++-------- sapi/cli/php_cli.c | 14 ++++++-------- sapi/cli/php_cli_process_title.c | 14 ++++++-------- sapi/cli/php_cli_process_title.h | 14 ++++++-------- sapi/cli/php_cli_server.c | 14 ++++++-------- sapi/cli/php_cli_server.h | 14 ++++++-------- sapi/cli/ps_title.h | 14 ++++++-------- 9 files changed, 54 insertions(+), 72 deletions(-) diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h index 85b55af3845d..2f6ef95052ce 100644 --- a/sapi/cli/cli.h +++ b/sapi/cli/cli.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Johannes Schlueter | +----------------------------------------------------------------------+ diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php index c48766b0a3e5..d1a841268a97 100755 --- a/sapi/cli/generate_mime_type_map.php +++ b/sapi/cli/generate_mime_type_map.php @@ -57,15 +57,13 @@ echo <<
. | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | +----------------------------------------------------------------------+ diff --git a/sapi/cli/mime_type_map.h b/sapi/cli/mime_type_map.h index 505ae862d054..689e522dbaea 100644 --- a/sapi/cli/mime_type_map.h +++ b/sapi/cli/mime_type_map.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index d1781eab671c..b5109ab6f998 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | | Marcus Boerger | diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c index e6740576f6aa..5f682cb4cc93 100644 --- a/sapi/cli/php_cli_process_title.c +++ b/sapi/cli/php_cli_process_title.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Keyur Govande (kgovande@gmail.com) | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli_process_title.h b/sapi/cli/php_cli_process_title.h index 9527b4b4b6d4..3cb8c8b46162 100644 --- a/sapi/cli/php_cli_process_title.h +++ b/sapi/cli/php_cli_process_title.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Keyur Govande (kgovande@gmail.com) | +----------------------------------------------------------------------+ diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 3e943f0f5eaa..0dfbe2d3db2a 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | | Xinchen Hui | diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h index 2440a5b59996..6477ab180fb2 100644 --- a/sapi/cli/php_cli_server.h +++ b/sapi/cli/php_cli_server.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | +----------------------------------------------------------------------+ diff --git a/sapi/cli/ps_title.h b/sapi/cli/ps_title.h index 7436c2b25a94..99c9a290ee54 100644 --- a/sapi/cli/ps_title.h +++ b/sapi/cli/ps_title.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Keyur Govande | +----------------------------------------------------------------------+ From 8a95ef17e126887b644eb20124bfe7b9920133f0 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:49:32 -0500 Subject: [PATCH 193/300] license-update: sapi/embed source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/embed/php_embed.c | 14 ++++++-------- sapi/embed/php_embed.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 06cd1fb0763b..75249f97fc87 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | +----------------------------------------------------------------------+ diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h index 3a4844629dea..9cd582a939a5 100644 --- a/sapi/embed/php_embed.h +++ b/sapi/embed/php_embed.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | +----------------------------------------------------------------------+ From bfe88f101236ae04a5208f7953054f4fe7dbeac1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:50:30 -0500 Subject: [PATCH 194/300] license-update: sapi/fpm source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/fpm/fpm/events/epoll.c | 14 ++++++-------- sapi/fpm/fpm/events/epoll.h | 14 ++++++-------- sapi/fpm/fpm/events/kqueue.c | 14 ++++++-------- sapi/fpm/fpm/events/kqueue.h | 14 ++++++-------- sapi/fpm/fpm/events/poll.c | 14 ++++++-------- sapi/fpm/fpm/events/poll.h | 14 ++++++-------- sapi/fpm/fpm/events/port.c | 14 ++++++-------- sapi/fpm/fpm/events/port.h | 14 ++++++-------- sapi/fpm/fpm/events/select.c | 14 ++++++-------- sapi/fpm/fpm/events/select.h | 14 ++++++-------- sapi/fpm/fpm/fpm_main.c | 14 ++++++-------- sapi/fpm/status.html.in | 2 +- 12 files changed, 67 insertions(+), 89 deletions(-) diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c index 0a6eadb6aebe..2de3b463ae59 100644 --- a/sapi/fpm/fpm/events/epoll.c +++ b/sapi/fpm/fpm/events/epoll.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/epoll.h b/sapi/fpm/fpm/events/epoll.h index f20480c687c2..8b3d1867c0b1 100644 --- a/sapi/fpm/fpm/events/epoll.h +++ b/sapi/fpm/fpm/events/epoll.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c index 21939d341418..22b9d1a8d3ab 100644 --- a/sapi/fpm/fpm/events/kqueue.c +++ b/sapi/fpm/fpm/events/kqueue.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/kqueue.h b/sapi/fpm/fpm/events/kqueue.h index 1f68d44369ba..4690b065dfce 100644 --- a/sapi/fpm/fpm/events/kqueue.h +++ b/sapi/fpm/fpm/events/kqueue.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/poll.c b/sapi/fpm/fpm/events/poll.c index 30ebbc785d94..10085e83faa8 100644 --- a/sapi/fpm/fpm/events/poll.c +++ b/sapi/fpm/fpm/events/poll.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/poll.h b/sapi/fpm/fpm/events/poll.h index d9859160985c..24fa512eda9e 100644 --- a/sapi/fpm/fpm/events/poll.h +++ b/sapi/fpm/fpm/events/poll.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c index 73cf24c82c2c..848ac8e84afb 100644 --- a/sapi/fpm/fpm/events/port.c +++ b/sapi/fpm/fpm/events/port.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/port.h b/sapi/fpm/fpm/events/port.h index 65a29e8eac14..5768c891bdac 100644 --- a/sapi/fpm/fpm/events/port.h +++ b/sapi/fpm/fpm/events/port.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/select.c b/sapi/fpm/fpm/events/select.c index 66e8107f07c6..f6132b025747 100644 --- a/sapi/fpm/fpm/events/select.c +++ b/sapi/fpm/fpm/events/select.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/events/select.h b/sapi/fpm/fpm/events/select.h index 12f10220f5fb..e4cafde1ed9b 100644 --- a/sapi/fpm/fpm/events/select.h +++ b/sapi/fpm/fpm/events/select.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 83b00eb4c4d3..3a8435f9e6cc 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | diff --git a/sapi/fpm/status.html.in b/sapi/fpm/status.html.in index 31824234a3e8..aee7e5530597 100644 --- a/sapi/fpm/status.html.in +++ b/sapi/fpm/status.html.in @@ -2,7 +2,7 @@ From 27f7bb7eea4f612179617ca12a3940079c4ab00f Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:51:54 -0500 Subject: [PATCH 195/300] license-update: sapi/fuzzer source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/fuzzer/fuzzer-execute-common.h | 14 ++++++-------- sapi/fuzzer/fuzzer-execute.c | 14 ++++++-------- sapi/fuzzer/fuzzer-exif.c | 14 ++++++-------- sapi/fuzzer/fuzzer-function-jit.c | 14 ++++++-------- sapi/fuzzer/fuzzer-json.c | 14 ++++++-------- sapi/fuzzer/fuzzer-mbregex.c | 14 ++++++-------- sapi/fuzzer/fuzzer-mbstring.c | 14 ++++++-------- sapi/fuzzer/fuzzer-parser.c | 14 ++++++-------- sapi/fuzzer/fuzzer-sapi.c | 14 ++++++-------- sapi/fuzzer/fuzzer-sapi.h | 14 ++++++-------- sapi/fuzzer/fuzzer-tracing-jit.c | 14 ++++++-------- sapi/fuzzer/fuzzer-unserialize.c | 14 ++++++-------- sapi/fuzzer/fuzzer-unserializehash.c | 14 ++++++-------- sapi/fuzzer/fuzzer.h | 14 ++++++-------- 14 files changed, 84 insertions(+), 112 deletions(-) diff --git a/sapi/fuzzer/fuzzer-execute-common.h b/sapi/fuzzer/fuzzer-execute-common.h index 81b38df40da0..463ee37f65c4 100644 --- a/sapi/fuzzer/fuzzer-execute-common.h +++ b/sapi/fuzzer/fuzzer-execute-common.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-execute.c b/sapi/fuzzer/fuzzer-execute.c index aa456a175f54..be8707ef1f79 100644 --- a/sapi/fuzzer/fuzzer-execute.c +++ b/sapi/fuzzer/fuzzer-execute.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-exif.c b/sapi/fuzzer/fuzzer-exif.c index b3b263dd53aa..66de0735a727 100644 --- a/sapi/fuzzer/fuzzer-exif.c +++ b/sapi/fuzzer/fuzzer-exif.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-function-jit.c b/sapi/fuzzer/fuzzer-function-jit.c index d2117f0027c4..d949995f8a23 100644 --- a/sapi/fuzzer/fuzzer-function-jit.c +++ b/sapi/fuzzer/fuzzer-function-jit.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-json.c b/sapi/fuzzer/fuzzer-json.c index 78c8505c2f1d..5029cb9a585d 100644 --- a/sapi/fuzzer/fuzzer-json.c +++ b/sapi/fuzzer/fuzzer-json.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | | Stanislav Malyshev | diff --git a/sapi/fuzzer/fuzzer-mbregex.c b/sapi/fuzzer/fuzzer-mbregex.c index f96e593ba8d2..bd119a65626f 100644 --- a/sapi/fuzzer/fuzzer-mbregex.c +++ b/sapi/fuzzer/fuzzer-mbregex.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-mbstring.c b/sapi/fuzzer/fuzzer-mbstring.c index 44fda696b6fa..92ea3aae9997 100644 --- a/sapi/fuzzer/fuzzer-mbstring.c +++ b/sapi/fuzzer/fuzzer-mbstring.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-parser.c b/sapi/fuzzer/fuzzer-parser.c index 28030d95d9a3..64fd9b8a9ac1 100644 --- a/sapi/fuzzer/fuzzer-parser.c +++ b/sapi/fuzzer/fuzzer-parser.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | | Stanislav Malyshev | diff --git a/sapi/fuzzer/fuzzer-sapi.c b/sapi/fuzzer/fuzzer-sapi.c index 80915d0bbc19..96fe75ab7a8a 100644 --- a/sapi/fuzzer/fuzzer-sapi.c +++ b/sapi/fuzzer/fuzzer-sapi.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | | Stanislav Malyshev | diff --git a/sapi/fuzzer/fuzzer-sapi.h b/sapi/fuzzer/fuzzer-sapi.h index 4ee2cb3fbc17..2cd3de7120f8 100644 --- a/sapi/fuzzer/fuzzer-sapi.h +++ b/sapi/fuzzer/fuzzer-sapi.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | | Stanislav Malyshev | diff --git a/sapi/fuzzer/fuzzer-tracing-jit.c b/sapi/fuzzer/fuzzer-tracing-jit.c index 65d661f139cf..e15f5b4bac51 100644 --- a/sapi/fuzzer/fuzzer-tracing-jit.c +++ b/sapi/fuzzer/fuzzer-tracing-jit.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-unserialize.c b/sapi/fuzzer/fuzzer-unserialize.c index 8a889883a97d..beee0d20195e 100644 --- a/sapi/fuzzer/fuzzer-unserialize.c +++ b/sapi/fuzzer/fuzzer-unserialize.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | +----------------------------------------------------------------------+ diff --git a/sapi/fuzzer/fuzzer-unserializehash.c b/sapi/fuzzer/fuzzer-unserializehash.c index 447e95d0ee81..7bee0b80956f 100644 --- a/sapi/fuzzer/fuzzer-unserializehash.c +++ b/sapi/fuzzer/fuzzer-unserializehash.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/sapi/fuzzer/fuzzer.h b/sapi/fuzzer/fuzzer.h index 387b6fa8b295..1e6a8875adb9 100644 --- a/sapi/fuzzer/fuzzer.h +++ b/sapi/fuzzer/fuzzer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Johannes Schlüter | +----------------------------------------------------------------------+ From c4ec4e2eb5ad11931881c867aa238fbbf5c3f6ee Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:52:30 -0500 Subject: [PATCH 196/300] license-update: sapi/litespeed source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/litespeed/lsapi_main.c | 14 ++++++-------- sapi/litespeed/lsapidef.h | 14 ++++++-------- sapi/litespeed/lsapilib.c | 14 ++++++-------- sapi/litespeed/lsapilib.h | 14 ++++++-------- sapi/litespeed/lscriu.c | 14 ++++++-------- sapi/litespeed/lscriu.h | 14 ++++++-------- 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index dea92b8b83cf..8ea7fce5200f 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h index 22a8dec30c83..b880ccb7e1ab 100644 --- a/sapi/litespeed/lsapidef.h +++ b/sapi/litespeed/lsapidef.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 9d8408c61339..bbe14a77a64f 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h index 58850eadb173..922114b73be3 100644 --- a/sapi/litespeed/lsapilib.h +++ b/sapi/litespeed/lsapilib.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lscriu.c b/sapi/litespeed/lscriu.c index 9d4096ec1c31..9ea8f51fdf29 100644 --- a/sapi/litespeed/lscriu.c +++ b/sapi/litespeed/lscriu.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ diff --git a/sapi/litespeed/lscriu.h b/sapi/litespeed/lscriu.h index b96218bc7086..80c2028b01b6 100644 --- a/sapi/litespeed/lscriu.h +++ b/sapi/litespeed/lscriu.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ From e1984cbd0643bd88f5b08f02dc31630e9ea1632f Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:54:43 -0500 Subject: [PATCH 197/300] license-update: sapi/phpdbg source headers RFC: https://wiki.php.net/rfc/php_license_update --- sapi/phpdbg/create-test.php | 14 ++++++-------- sapi/phpdbg/phpdbg.c | 14 ++++++-------- sapi/phpdbg/phpdbg.h | 14 ++++++-------- sapi/phpdbg/phpdbg_bp.c | 14 ++++++-------- sapi/phpdbg/phpdbg_bp.h | 14 ++++++-------- sapi/phpdbg/phpdbg_break.c | 14 ++++++-------- sapi/phpdbg/phpdbg_break.h | 14 ++++++-------- sapi/phpdbg/phpdbg_btree.c | 14 ++++++-------- sapi/phpdbg/phpdbg_btree.h | 14 ++++++-------- sapi/phpdbg/phpdbg_cmd.c | 14 ++++++-------- sapi/phpdbg/phpdbg_cmd.h | 14 ++++++-------- sapi/phpdbg/phpdbg_frame.c | 14 ++++++-------- sapi/phpdbg/phpdbg_frame.h | 14 ++++++-------- sapi/phpdbg/phpdbg_help.c | 14 ++++++-------- sapi/phpdbg/phpdbg_help.h | 14 ++++++-------- sapi/phpdbg/phpdbg_info.c | 14 ++++++-------- sapi/phpdbg/phpdbg_info.h | 14 ++++++-------- sapi/phpdbg/phpdbg_io.c | 14 ++++++-------- sapi/phpdbg/phpdbg_io.h | 14 ++++++-------- sapi/phpdbg/phpdbg_lexer.h | 14 ++++++-------- sapi/phpdbg/phpdbg_list.c | 14 ++++++-------- sapi/phpdbg/phpdbg_list.h | 14 ++++++-------- sapi/phpdbg/phpdbg_out.c | 14 ++++++-------- sapi/phpdbg/phpdbg_out.h | 14 ++++++-------- sapi/phpdbg/phpdbg_print.c | 14 ++++++-------- sapi/phpdbg/phpdbg_print.h | 14 ++++++-------- sapi/phpdbg/phpdbg_prompt.c | 14 ++++++-------- sapi/phpdbg/phpdbg_prompt.h | 14 ++++++-------- sapi/phpdbg/phpdbg_set.c | 14 ++++++-------- sapi/phpdbg/phpdbg_set.h | 14 ++++++-------- sapi/phpdbg/phpdbg_sigsafe.c | 14 ++++++++++++++ sapi/phpdbg/phpdbg_sigsafe.h | 14 ++++++++++++++ sapi/phpdbg/phpdbg_utils.c | 14 ++++++-------- sapi/phpdbg/phpdbg_utils.h | 14 ++++++-------- sapi/phpdbg/phpdbg_watch.c | 14 ++++++-------- sapi/phpdbg/phpdbg_watch.h | 14 ++++++-------- sapi/phpdbg/phpdbg_win.c | 14 ++++++-------- sapi/phpdbg/phpdbg_win.h | 14 ++++++-------- 38 files changed, 244 insertions(+), 288 deletions(-) diff --git a/sapi/phpdbg/create-test.php b/sapi/phpdbg/create-test.php index 616cf9f4e4da..c3ddd1c28231 100755 --- a/sapi/phpdbg/create-test.php +++ b/sapi/phpdbg/create-test.php @@ -3,15 +3,13 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bob Weinand | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 4227acae4f19..278e2657862f 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index e5f6413b060e..6aa9c9f696a5 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 069111a1dd4d..4dfa89d4b0fe 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h index e357b7388e69..3736804af9f9 100644 --- a/sapi/phpdbg/phpdbg_bp.h +++ b/sapi/phpdbg/phpdbg_bp.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c index 481e4b8693be..801c8b36b0ce 100644 --- a/sapi/phpdbg/phpdbg_break.c +++ b/sapi/phpdbg/phpdbg_break.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_break.h b/sapi/phpdbg/phpdbg_break.h index aa88f3245b60..c51ba5197969 100644 --- a/sapi/phpdbg/phpdbg_break.h +++ b/sapi/phpdbg/phpdbg_break.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_btree.c b/sapi/phpdbg/phpdbg_btree.c index 81571c17c01a..f7c554884d9d 100644 --- a/sapi/phpdbg/phpdbg_btree.c +++ b/sapi/phpdbg/phpdbg_btree.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_btree.h b/sapi/phpdbg/phpdbg_btree.h index bd0c1cf37a0b..8626830828df 100644 --- a/sapi/phpdbg/phpdbg_btree.h +++ b/sapi/phpdbg/phpdbg_btree.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index 9877d60de95c..5c124563ed91 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h index 95edd073012a..53f8e1b596e4 100644 --- a/sapi/phpdbg/phpdbg_cmd.h +++ b/sapi/phpdbg/phpdbg_cmd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index 01b19de80a99..b08a877b707a 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h index 75d4da1fc56f..1875bf9e353e 100644 --- a/sapi/phpdbg/phpdbg_frame.h +++ b/sapi/phpdbg/phpdbg_frame.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index 1fef964ea74c..99a1c2bfb5af 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h index e4c9dd63881c..03d9df00ddc5 100644 --- a/sapi/phpdbg/phpdbg_help.h +++ b/sapi/phpdbg/phpdbg_help.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index 9c93cd2b88ef..ee579e81df02 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_info.h b/sapi/phpdbg/phpdbg_info.h index c0f19c7b0aa7..7f9ffc1aa93a 100644 --- a/sapi/phpdbg/phpdbg_info.h +++ b/sapi/phpdbg/phpdbg_info.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index 742455b73f1d..e89b11dd00b6 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h index 04eeaa0293a6..25a895eebce1 100644 --- a/sapi/phpdbg/phpdbg_io.h +++ b/sapi/phpdbg/phpdbg_io.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h index 439f8cd003c2..e3242cb4778a 100644 --- a/sapi/phpdbg/phpdbg_lexer.h +++ b/sapi/phpdbg/phpdbg_lexer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 00ef995d897e..505b04e81f91 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h index f112157e5963..5001af05ba7b 100644 --- a/sapi/phpdbg/phpdbg_list.h +++ b/sapi/phpdbg/phpdbg_list.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index 34f640ab6e53..6104112b232f 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h index 473638bce891..9905fa3a7d30 100644 --- a/sapi/phpdbg/phpdbg_out.h +++ b/sapi/phpdbg/phpdbg_out.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index b0f8d4cb2940..5075ce924d72 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_print.h b/sapi/phpdbg/phpdbg_print.h index 7529bbc9943a..692ece90fc78 100644 --- a/sapi/phpdbg/phpdbg_print.h +++ b/sapi/phpdbg/phpdbg_print.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 873fd652a32d..9435e25ca00b 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h index b7b5df687d25..669601ced157 100644 --- a/sapi/phpdbg/phpdbg_prompt.h +++ b/sapi/phpdbg/phpdbg_prompt.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index d6b19a7e551a..3fbfa3cc8b07 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_set.h b/sapi/phpdbg/phpdbg_set.h index 2caeccdffc7c..5dd77e3b4eea 100644 --- a/sapi/phpdbg/phpdbg_set.h +++ b/sapi/phpdbg/phpdbg_set.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c index af9465a3cad6..ff8f2741f85e 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.c +++ b/sapi/phpdbg/phpdbg_sigsafe.c @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Bob Weinand | + +----------------------------------------------------------------------+ +*/ + #include "phpdbg_sigsafe.h" #include "phpdbg.h" diff --git a/sapi/phpdbg/phpdbg_sigsafe.h b/sapi/phpdbg/phpdbg_sigsafe.h index 7b7599e07ea0..fc07b1a5ec39 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.h +++ b/sapi/phpdbg/phpdbg_sigsafe.h @@ -1,3 +1,17 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Bob Weinand | + +----------------------------------------------------------------------+ +*/ + #ifndef PHPDBG_SIGSAFE_H #define PHPDBG_SIGSAFE_H diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index 728baa92124c..c8689ba340de 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index 34ab5c3a6b55..6a6366aabc03 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c index 03804eeaa252..4ba46f3c326f 100644 --- a/sapi/phpdbg/phpdbg_watch.c +++ b/sapi/phpdbg/phpdbg_watch.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h index 56f4b29379ca..380140fd9f1f 100644 --- a/sapi/phpdbg/phpdbg_watch.h +++ b/sapi/phpdbg/phpdbg_watch.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c index 033991f0d901..2c03c85e2c6b 100644 --- a/sapi/phpdbg/phpdbg_win.c +++ b/sapi/phpdbg/phpdbg_win.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | diff --git a/sapi/phpdbg/phpdbg_win.h b/sapi/phpdbg/phpdbg_win.h index 89bf278a3f62..6fafc950c1c3 100644 --- a/sapi/phpdbg/phpdbg_win.h +++ b/sapi/phpdbg/phpdbg_win.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | From ac0b05dd5132b7d8f21aefd565d7adbf3a9cec53 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:55:24 -0500 Subject: [PATCH 198/300] license-update: scripts source headers RFC: https://wiki.php.net/rfc/php_license_update --- scripts/dev/check_parameters.php | 14 ++++++-------- scripts/dev/genfiles | 14 ++++++-------- scripts/dev/search_underscores.php | 14 ++++++-------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php index f32e4e5806b1..83c19d0b4ef6 100755 --- a/scripts/dev/check_parameters.php +++ b/scripts/dev/check_parameters.php @@ -2,15 +2,13 @@ . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Nuno Lopes | +----------------------------------------------------------------------+ diff --git a/scripts/dev/genfiles b/scripts/dev/genfiles index b8d35cff6bf6..a7068e8c3f81 100755 --- a/scripts/dev/genfiles +++ b/scripts/dev/genfiles @@ -1,15 +1,13 @@ #!/bin/sh # # +----------------------------------------------------------------------+ -# | Copyright (c) The PHP Group | +# | Copyright © The PHP Group and Contributors. | # +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | https://www.php.net/license/3_01.txt | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | +# | This source file is subject to the Modified BSD License that is | +# | bundled with this package in the file LICENSE, and is available | +# | through the World Wide Web at . | +# | | +# | SPDX-License-Identifier: BSD-3-Clause | # +----------------------------------------------------------------------+ # | Authors: Sascha Schumann | # +----------------------------------------------------------------------+ diff --git a/scripts/dev/search_underscores.php b/scripts/dev/search_underscores.php index 42e4c876e054..da442987405e 100755 --- a/scripts/dev/search_underscores.php +++ b/scripts/dev/search_underscores.php @@ -3,15 +3,13 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ From 1fb8acd9b667853a7323ae22381b092acb4592db Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:55:48 -0500 Subject: [PATCH 199/300] license-update: TSRM source headers RFC: https://wiki.php.net/rfc/php_license_update --- TSRM/tsrm_win32.c | 14 ++++++-------- TSRM/tsrm_win32.h | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 4c8fc9d19aa9..90317ab64b19 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Daniel Beulshausen | +----------------------------------------------------------------------+ diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h index c5bdc492be1b..9c16bd7c654b 100644 --- a/TSRM/tsrm_win32.h +++ b/TSRM/tsrm_win32.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Daniel Beulshausen | +----------------------------------------------------------------------+ From bd07d1b71a7f275e547fc42d2958150f80201aae Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:58:59 -0500 Subject: [PATCH 200/300] license-update: win32 source headers RFC: https://wiki.php.net/rfc/php_license_update --- win32/build/Makefile | 14 ++++++-------- win32/build/buildconf.js | 14 ++++++-------- win32/build/confutils.js | 14 ++++++-------- win32/build/deplister.c | 14 ++++++-------- win32/build/phpize.js.in | 14 ++++++-------- win32/codepage.c | 14 ++++++-------- win32/codepage.h | 14 ++++++-------- win32/console.c | 14 ++++++-------- win32/console.h | 14 ++++++-------- win32/dllmain.c | 14 ++++++-------- win32/ftok.c | 14 ++++++-------- win32/getrusage.c | 14 ++++++-------- win32/getrusage.h | 14 ++++++-------- win32/globals.c | 14 ++++++-------- win32/ioutil.c | 14 ++++++-------- win32/ioutil.h | 14 ++++++-------- win32/ipc.h | 14 ++++++-------- win32/nice.c | 14 ++++++-------- win32/nice.h | 14 ++++++-------- win32/php_registry.h | 14 ++++++-------- win32/php_win32_globals.h | 14 ++++++-------- win32/registry.c | 14 ++++++-------- win32/select.c | 14 ++++++-------- win32/select.h | 14 ++++++-------- win32/signal.c | 14 ++++++-------- win32/sockets.c | 14 ++++++-------- win32/sockets.h | 14 ++++++-------- win32/syslog.h | 14 ++++++-------- win32/winutil.c | 14 ++++++-------- win32/winutil.h | 16 ++++++---------- 30 files changed, 180 insertions(+), 242 deletions(-) diff --git a/win32/build/Makefile b/win32/build/Makefile index b6c4ec6a1967..e9308bc43cdb 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -1,13 +1,11 @@ # +----------------------------------------------------------------------+ -# | Copyright (c) The PHP Group | +# | Copyright © The PHP Group and Contributors. | # +----------------------------------------------------------------------+ -# | This source file is subject to version 3.01 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | https://www.php.net/license/3_01.txt | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | +# | This source file is subject to the Modified BSD License that is | +# | bundled with this package in the file LICENSE, and is available | +# | through the World Wide Web at . | +# | | +# | SPDX-License-Identifier: BSD-3-Clause | # +----------------------------------------------------------------------+ # | Author: Wez Furlong | # +----------------------------------------------------------------------+ diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js index fc19d7cfcb5d..52b8a7d0fd39 100644 --- a/win32/build/buildconf.js +++ b/win32/build/buildconf.js @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3acb9ad203cc..36484e71f8fb 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1,15 +1,13 @@ // Utils for configure script /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/build/deplister.c b/win32/build/deplister.c index 212773b5db62..2cd8c02f1aed 100644 --- a/win32/build/deplister.c +++ b/win32/build/deplister.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in index 2be46a476b35..dd81aa6d24e1 100644 --- a/win32/build/phpize.js.in +++ b/win32/build/phpize.js.in @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Pierre Joye | +----------------------------------------------------------------------+ diff --git a/win32/codepage.c b/win32/codepage.c index b8c2301fb708..1a723efa4496 100644 --- a/win32/codepage.c +++ b/win32/codepage.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/codepage.h b/win32/codepage.h index 4666430cdad3..779589b54c90 100644 --- a/win32/codepage.h +++ b/win32/codepage.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/console.c b/win32/console.c index 9b485610888c..44b614e52b52 100644 --- a/win32/console.c +++ b/win32/console.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michele Locati | +----------------------------------------------------------------------+ diff --git a/win32/console.h b/win32/console.h index b3fae6166b73..ccce50b728b8 100644 --- a/win32/console.h +++ b/win32/console.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Michele Locati | +----------------------------------------------------------------------+ diff --git a/win32/dllmain.c b/win32/dllmain.c index 4ad94fe1e5f2..168bef2baa22 100644 --- a/win32/dllmain.c +++ b/win32/dllmain.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/ftok.c b/win32/ftok.c index 76e47ec48e1a..996f44deaf0d 100644 --- a/win32/ftok.c +++ b/win32/ftok.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/getrusage.c b/win32/getrusage.c index 61c54510a2c6..a0aae9c68679 100644 --- a/win32/getrusage.c +++ b/win32/getrusage.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kalle Sommer Nielsen | +----------------------------------------------------------------------+ diff --git a/win32/getrusage.h b/win32/getrusage.h index adfa4ac1a2d9..6016f70a10ac 100644 --- a/win32/getrusage.h +++ b/win32/getrusage.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kalle Sommer Nielsen | +----------------------------------------------------------------------+ diff --git a/win32/globals.c b/win32/globals.c index 13760cb1cb56..a50b1ef2b978 100644 --- a/win32/globals.c +++ b/win32/globals.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/ioutil.c b/win32/ioutil.c index c9464c947448..0d77649796a7 100644 --- a/win32/ioutil.c +++ b/win32/ioutil.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/ioutil.h b/win32/ioutil.h index affe7607455b..7ed222d61382 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/ipc.h b/win32/ipc.h index 2651acfe31ee..b3a0fecb47a4 100644 --- a/win32/ipc.h +++ b/win32/ipc.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/nice.c b/win32/nice.c index 004ad93ee9d7..98bcc56bf4bd 100644 --- a/win32/nice.c +++ b/win32/nice.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kalle Sommer Nielsen | +----------------------------------------------------------------------+ diff --git a/win32/nice.h b/win32/nice.h index 7f86cf182653..c6183fb052ab 100644 --- a/win32/nice.h +++ b/win32/nice.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Kalle Sommer Nielsen | +----------------------------------------------------------------------+ diff --git a/win32/php_registry.h b/win32/php_registry.h index 4fb586e882a0..82628d82f95a 100644 --- a/win32/php_registry.h +++ b/win32/php_registry.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h index 733c32c1c93d..1c1f939e21a8 100644 --- a/win32/php_win32_globals.h +++ b/win32/php_win32_globals.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/registry.c b/win32/registry.c index 81378b0f46a5..3597d57c85a4 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/win32/select.c b/win32/select.c index 0cd7b8529559..988f037d7a4c 100644 --- a/win32/select.c +++ b/win32/select.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/select.h b/win32/select.h index 75146d1a47f3..d2214c4e9ce8 100644 --- a/win32/select.h +++ b/win32/select.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | +----------------------------------------------------------------------+ diff --git a/win32/signal.c b/win32/signal.c index 89548a2405c4..c04fe860437d 100644 --- a/win32/signal.c +++ b/win32/signal.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/win32/sockets.c b/win32/sockets.c index 85c045d2388e..ce0e20f248b7 100644 --- a/win32/sockets.c +++ b/win32/sockets.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Chris Vandomelen | | Sterling Hughes | diff --git a/win32/sockets.h b/win32/sockets.h index 45eb78ab1e23..e30774de1d23 100644 --- a/win32/sockets.h +++ b/win32/sockets.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Chris Vandomelen | | Sterling Hughes | diff --git a/win32/syslog.h b/win32/syslog.h index 8869243bc33a..39f0b15b2cfb 100644 --- a/win32/syslog.h +++ b/win32/syslog.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sterling Hughes | +----------------------------------------------------------------------+ diff --git a/win32/winutil.c b/win32/winutil.c index cab4b5bac9b4..d43a1059ca87 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | * Pierre Joye | diff --git a/win32/winutil.h b/win32/winutil.h index 043195067529..20c06628eaad 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -1,16 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ From 3c85b1521fff0c0c07adff8b0cf46bbecc82ccd6 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:21:21 -0500 Subject: [PATCH 201/300] license-update: Zend/Optimizer source headers RFC: https://wiki.php.net/rfc/php_license_update --- Zend/Optimizer/block_pass.c | 14 ++++++-------- Zend/Optimizer/compact_literals.c | 14 ++++++-------- Zend/Optimizer/compact_vars.c | 14 ++++++-------- Zend/Optimizer/dce.c | 14 ++++++-------- Zend/Optimizer/dfa_pass.c | 14 ++++++-------- Zend/Optimizer/escape_analysis.c | 14 ++++++-------- Zend/Optimizer/nop_removal.c | 14 ++++++-------- Zend/Optimizer/optimize_func_calls.c | 14 ++++++-------- Zend/Optimizer/optimize_temp_vars_5.c | 14 ++++++-------- Zend/Optimizer/pass1.c | 14 ++++++-------- Zend/Optimizer/pass3.c | 14 ++++++-------- Zend/Optimizer/sccp.c | 14 ++++++-------- Zend/Optimizer/scdf.c | 14 ++++++-------- Zend/Optimizer/scdf.h | 14 ++++++-------- Zend/Optimizer/ssa_integrity.c | 14 ++++++-------- Zend/Optimizer/zend_call_graph.c | 14 ++++++-------- Zend/Optimizer/zend_call_graph.h | 14 ++++++-------- Zend/Optimizer/zend_cfg.c | 14 ++++++-------- Zend/Optimizer/zend_cfg.h | 14 ++++++-------- Zend/Optimizer/zend_dfg.c | 14 ++++++-------- Zend/Optimizer/zend_dfg.h | 14 ++++++-------- Zend/Optimizer/zend_dump.c | 14 ++++++-------- Zend/Optimizer/zend_dump.h | 14 ++++++-------- Zend/Optimizer/zend_func_info.c | 14 ++++++-------- Zend/Optimizer/zend_func_info.h | 14 ++++++-------- Zend/Optimizer/zend_inference.c | 14 ++++++-------- Zend/Optimizer/zend_inference.h | 14 ++++++-------- Zend/Optimizer/zend_optimizer.c | 14 ++++++-------- Zend/Optimizer/zend_optimizer.h | 14 ++++++-------- Zend/Optimizer/zend_optimizer_internal.h | 14 ++++++-------- Zend/Optimizer/zend_ssa.c | 14 ++++++-------- Zend/Optimizer/zend_ssa.h | 14 ++++++-------- Zend/Optimizer/zend_worklist.h | 14 ++++++-------- 33 files changed, 198 insertions(+), 264 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index 61a69dae51e1..c85b444640a8 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c index 447a034530e1..cf74dd8fc147 100644 --- a/Zend/Optimizer/compact_literals.c +++ b/Zend/Optimizer/compact_literals.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/Zend/Optimizer/compact_vars.c b/Zend/Optimizer/compact_vars.c index 9898714a17c5..b4a861d3595c 100644 --- a/Zend/Optimizer/compact_vars.c +++ b/Zend/Optimizer/compact_vars.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Removing unused variables | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/dce.c b/Zend/Optimizer/dce.c index a529f5a1944a..0780ac190cdd 100644 --- a/Zend/Optimizer/dce.c +++ b/Zend/Optimizer/dce.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, DCE - Dead Code Elimination | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | | Dmitry Stogov | diff --git a/Zend/Optimizer/dfa_pass.c b/Zend/Optimizer/dfa_pass.c index cfc6b27b3d21..77dc322fbdec 100644 --- a/Zend/Optimizer/dfa_pass.c +++ b/Zend/Optimizer/dfa_pass.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/escape_analysis.c b/Zend/Optimizer/escape_analysis.c index 5ace81f35220..8dbd6855d68d 100644 --- a/Zend/Optimizer/escape_analysis.c +++ b/Zend/Optimizer/escape_analysis.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache, Escape Analysis | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/nop_removal.c b/Zend/Optimizer/nop_removal.c index 7de3919ee8cb..0a6a04fc4a9b 100644 --- a/Zend/Optimizer/nop_removal.c +++ b/Zend/Optimizer/nop_removal.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/optimize_func_calls.c b/Zend/Optimizer/optimize_func_calls.c index 62b50464e87b..69c371207ddc 100644 --- a/Zend/Optimizer/optimize_func_calls.c +++ b/Zend/Optimizer/optimize_func_calls.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/Zend/Optimizer/optimize_temp_vars_5.c b/Zend/Optimizer/optimize_temp_vars_5.c index de0b189d5dca..6a5c99f4755b 100644 --- a/Zend/Optimizer/optimize_temp_vars_5.c +++ b/Zend/Optimizer/optimize_temp_vars_5.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/pass1.c b/Zend/Optimizer/pass1.c index 4be966c25d89..962bdb6e4be3 100644 --- a/Zend/Optimizer/pass1.c +++ b/Zend/Optimizer/pass1.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/pass3.c b/Zend/Optimizer/pass3.c index 5c31de7bc49c..2d2a44685226 100644 --- a/Zend/Optimizer/pass3.c +++ b/Zend/Optimizer/pass3.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 0758c4d0faf2..ba94e9b7b91f 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, SCCP - Sparse Conditional Constant Propagation | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | | Dmitry Stogov | diff --git a/Zend/Optimizer/scdf.c b/Zend/Optimizer/scdf.c index cf7b80bc8665..31f40a7ed9f9 100644 --- a/Zend/Optimizer/scdf.c +++ b/Zend/Optimizer/scdf.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Sparse Conditional Data Flow Propagation Framework | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/scdf.h b/Zend/Optimizer/scdf.h index c3f1d8e885c2..d7bee4b73816 100644 --- a/Zend/Optimizer/scdf.h +++ b/Zend/Optimizer/scdf.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Call Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/ssa_integrity.c b/Zend/Optimizer/ssa_integrity.c index 4c720714ca58..34a2b3a9ef64 100644 --- a/Zend/Optimizer/ssa_integrity.c +++ b/Zend/Optimizer/ssa_integrity.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, SSA validation | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index 884b481aceb8..bb80e21a2465 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Call Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index 8810dc1a560e..57c6bdffe998 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Call Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_cfg.c b/Zend/Optimizer/zend_cfg.c index bdb3a0570539..837515169d70 100644 --- a/Zend/Optimizer/zend_cfg.c +++ b/Zend/Optimizer/zend_cfg.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, CFG - Control Flow Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_cfg.h b/Zend/Optimizer/zend_cfg.h index 8096565e8038..3ed635ecdedc 100644 --- a/Zend/Optimizer/zend_cfg.h +++ b/Zend/Optimizer/zend_cfg.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, CFG - Control Flow Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_dfg.c b/Zend/Optimizer/zend_dfg.c index b6c0e3d801bb..72e15693a844 100644 --- a/Zend/Optimizer/zend_dfg.c +++ b/Zend/Optimizer/zend_dfg.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, DFG - Data Flow Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_dfg.h b/Zend/Optimizer/zend_dfg.h index af3d761ba29f..464ea6bb2ebe 100644 --- a/Zend/Optimizer/zend_dfg.h +++ b/Zend/Optimizer/zend_dfg.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, DFG - Data Flow Graph | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_dump.c b/Zend/Optimizer/zend_dump.c index 56a2f65d6fb2..c6cc5193b2dc 100644 --- a/Zend/Optimizer/zend_dump.c +++ b/Zend/Optimizer/zend_dump.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Bytecode Visualisation | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_dump.h b/Zend/Optimizer/zend_dump.h index 671f7c064fb2..45740d9609cb 100644 --- a/Zend/Optimizer/zend_dump.h +++ b/Zend/Optimizer/zend_dump.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Bytecode Visualisation | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_func_info.c b/Zend/Optimizer/zend_func_info.c index cec52f7e9860..185fcc40be67 100644 --- a/Zend/Optimizer/zend_func_info.c +++ b/Zend/Optimizer/zend_func_info.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Func Info | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/Zend/Optimizer/zend_func_info.h b/Zend/Optimizer/zend_func_info.h index db00d843ee10..6b5b51cac58b 100644 --- a/Zend/Optimizer/zend_func_info.h +++ b/Zend/Optimizer/zend_func_info.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, Func Info | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 601b37a868af..05d33d3d75fb 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, e-SSA based Type & Range Inference | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_inference.h b/Zend/Optimizer/zend_inference.h index 1b626fa2ee22..e6b4207c7494 100644 --- a/Zend/Optimizer/zend_inference.h +++ b/Zend/Optimizer/zend_inference.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, e-SSA based Type & Range Inference | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index f8cbefdaaf2b..59a87823eb56 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/zend_optimizer.h b/Zend/Optimizer/zend_optimizer.h index 43a0f60a2321..d2847c92869c 100644 --- a/Zend/Optimizer/zend_optimizer.h +++ b/Zend/Optimizer/zend_optimizer.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/zend_optimizer_internal.h b/Zend/Optimizer/zend_optimizer_internal.h index 869275811e3d..d01df56260bc 100644 --- a/Zend/Optimizer/zend_optimizer_internal.h +++ b/Zend/Optimizer/zend_optimizer_internal.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index e30159f8f3c6..fa2901b89421 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, SSA - Static Single Assignment Form | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Nikita Popov | diff --git a/Zend/Optimizer/zend_ssa.h b/Zend/Optimizer/zend_ssa.h index 4f591618750f..ee9faf9bfd23 100644 --- a/Zend/Optimizer/zend_ssa.h +++ b/Zend/Optimizer/zend_ssa.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine, SSA - Static Single Assignment Form | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/Optimizer/zend_worklist.h b/Zend/Optimizer/zend_worklist.h index 85e7b111d5c9..ea03048e9756 100644 --- a/Zend/Optimizer/zend_worklist.h +++ b/Zend/Optimizer/zend_worklist.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andy Wingo | +----------------------------------------------------------------------+ From 084a10afefa77b1de63744b4f022b72e7c99939f Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 15:30:13 -0500 Subject: [PATCH 202/300] license-update: Zend source headers RFC: https://wiki.php.net/rfc/php_license_update --- Zend/zend.c | 14 ++++++-------- Zend/zend.h | 14 ++++++-------- Zend/zend_API.c | 14 ++++++-------- Zend/zend_API.h | 14 ++++++-------- Zend/zend_alloc.c | 14 ++++++-------- Zend/zend_alloc.h | 14 ++++++-------- Zend/zend_alloc_sizes.h | 14 ++++++-------- Zend/zend_arena.h | 14 ++++++-------- Zend/zend_ast.c | 14 ++++++-------- Zend/zend_ast.h | 14 ++++++-------- Zend/zend_atomic.c | 14 +++++++------- Zend/zend_atomic.h | 14 +++++++------- Zend/zend_attributes.c | 14 ++++++-------- Zend/zend_attributes.h | 14 ++++++-------- Zend/zend_autoload.c | 14 ++++++-------- Zend/zend_autoload.h | 14 ++++++-------- Zend/zend_bitset.h | 14 ++++++-------- Zend/zend_build.h | 14 ++++++-------- Zend/zend_builtin_functions.c | 14 ++++++-------- Zend/zend_builtin_functions.h | 14 ++++++-------- Zend/zend_call_stack.c | 14 ++++++-------- Zend/zend_call_stack.h | 14 ++++++-------- Zend/zend_closures.c | 14 ++++++-------- Zend/zend_closures.h | 14 ++++++-------- Zend/zend_compile.c | 14 ++++++-------- Zend/zend_compile.h | 14 ++++++-------- Zend/zend_config.w32.h | 14 ++++++-------- Zend/zend_constants.c | 14 ++++++-------- Zend/zend_constants.h | 14 ++++++-------- Zend/zend_cpuinfo.c | 14 ++++++-------- Zend/zend_cpuinfo.h | 14 ++++++-------- Zend/zend_default_classes.c | 14 ++++++-------- Zend/zend_dtrace.c | 14 ++++++-------- Zend/zend_dtrace.d | 14 ++++++-------- Zend/zend_dtrace.h | 14 ++++++-------- Zend/zend_enum.c | 14 ++++++-------- Zend/zend_enum.h | 14 ++++++-------- Zend/zend_errors.h | 14 ++++++-------- Zend/zend_exceptions.c | 14 ++++++-------- Zend/zend_exceptions.h | 14 ++++++-------- Zend/zend_execute.c | 14 ++++++-------- Zend/zend_execute.h | 14 ++++++-------- Zend/zend_execute_API.c | 14 ++++++-------- Zend/zend_extensions.c | 14 ++++++-------- Zend/zend_extensions.h | 14 ++++++-------- Zend/zend_fibers.c | 14 ++++++-------- Zend/zend_fibers.h | 14 ++++++-------- Zend/zend_float.c | 14 ++++++-------- Zend/zend_float.h | 14 ++++++-------- Zend/zend_frameless_function.c | 14 ++++++-------- Zend/zend_frameless_function.h | 14 ++++++-------- Zend/zend_gc.c | 14 ++++++-------- Zend/zend_gc.h | 14 ++++++-------- Zend/zend_gdb.c | 14 ++++++-------- Zend/zend_gdb.h | 14 ++++++-------- Zend/zend_generators.c | 14 ++++++-------- Zend/zend_generators.h | 14 ++++++-------- Zend/zend_globals.h | 14 ++++++-------- Zend/zend_globals_macros.h | 14 ++++++-------- Zend/zend_hash.c | 14 ++++++-------- Zend/zend_hash.h | 14 ++++++-------- Zend/zend_highlight.c | 14 ++++++-------- Zend/zend_highlight.h | 14 ++++++-------- Zend/zend_hrtime.c | 14 ++++++-------- Zend/zend_hrtime.h | 14 ++++++-------- Zend/zend_inheritance.c | 14 ++++++-------- Zend/zend_inheritance.h | 14 ++++++-------- Zend/zend_ini.c | 14 ++++++-------- Zend/zend_ini.h | 14 ++++++-------- Zend/zend_ini_parser.y | 14 ++++++-------- Zend/zend_ini_scanner.h | 14 ++++++-------- Zend/zend_ini_scanner.l | 14 ++++++-------- Zend/zend_interfaces.c | 14 ++++++-------- Zend/zend_interfaces.h | 14 ++++++-------- Zend/zend_iterators.c | 14 ++++++-------- Zend/zend_iterators.h | 14 ++++++-------- Zend/zend_language_parser.y | 14 ++++++-------- Zend/zend_language_scanner.h | 14 ++++++-------- Zend/zend_language_scanner.l | 14 ++++++-------- Zend/zend_lazy_objects.c | 14 ++++++-------- Zend/zend_lazy_objects.h | 14 ++++++-------- Zend/zend_list.c | 14 ++++++-------- Zend/zend_list.h | 14 ++++++-------- Zend/zend_llist.c | 14 ++++++-------- Zend/zend_llist.h | 14 ++++++-------- Zend/zend_long.h | 14 ++++++-------- Zend/zend_map_ptr.h | 14 ++++++-------- Zend/zend_max_execution_timer.c | 14 ++++++-------- Zend/zend_max_execution_timer.h | 14 ++++++-------- Zend/zend_mmap.h | 16 +++++++++------- Zend/zend_modules.h | 14 ++++++-------- Zend/zend_multibyte.c | 14 ++++++-------- Zend/zend_multibyte.h | 14 ++++++-------- Zend/zend_multiply.h | 14 ++++++-------- Zend/zend_object_handlers.c | 14 ++++++-------- Zend/zend_object_handlers.h | 14 ++++++-------- Zend/zend_objects.c | 14 ++++++-------- Zend/zend_objects.h | 14 ++++++-------- Zend/zend_objects_API.c | 14 ++++++-------- Zend/zend_objects_API.h | 14 ++++++-------- Zend/zend_observer.c | 14 ++++++-------- Zend/zend_observer.h | 14 ++++++-------- Zend/zend_opcode.c | 14 ++++++-------- Zend/zend_operators.c | 14 ++++++-------- Zend/zend_operators.h | 14 ++++++-------- Zend/zend_portability.h | 14 ++++++-------- Zend/zend_property_hooks.c | 14 ++++++-------- Zend/zend_property_hooks.h | 14 ++++++-------- Zend/zend_ptr_stack.c | 14 ++++++-------- Zend/zend_ptr_stack.h | 14 ++++++-------- Zend/zend_range_check.h | 14 ++++++-------- Zend/zend_signal.c | 19 +++++++++---------- Zend/zend_signal.h | 15 ++++++--------- Zend/zend_smart_str.c | 14 ++++++-------- Zend/zend_smart_str.h | 14 ++++++-------- Zend/zend_smart_str_public.h | 14 ++++++-------- Zend/zend_smart_string.h | 14 ++++++-------- Zend/zend_smart_string_public.h | 14 ++++++-------- Zend/zend_sort.c | 14 ++++++-------- Zend/zend_sort.h | 14 ++++++-------- Zend/zend_stack.c | 14 ++++++-------- Zend/zend_stack.h | 14 ++++++-------- Zend/zend_stream.c | 14 ++++++-------- Zend/zend_stream.h | 14 ++++++-------- Zend/zend_string.c | 14 ++++++-------- Zend/zend_string.h | 14 ++++++-------- Zend/zend_strtod.h | 14 ++++++-------- Zend/zend_strtod_int.h | 14 ++++++-------- Zend/zend_system_id.c | 14 ++++++-------- Zend/zend_system_id.h | 14 ++++++-------- Zend/zend_type_info.h | 14 ++++++-------- Zend/zend_types.h | 14 ++++++-------- Zend/zend_variables.c | 14 ++++++-------- Zend/zend_variables.h | 14 ++++++-------- Zend/zend_verify_type_inference.h | 14 ++++++-------- Zend/zend_virtual_cwd.c | 14 ++++++-------- Zend/zend_virtual_cwd.h | 14 ++++++-------- Zend/zend_vm.h | 14 ++++++-------- Zend/zend_vm_def.h | 14 ++++++-------- Zend/zend_vm_execute.h | 14 ++++++-------- Zend/zend_vm_gen.php | 28 ++++++++++++---------------- Zend/zend_vm_opcodes.c | 14 ++++++-------- Zend/zend_vm_opcodes.h | 14 ++++++-------- Zend/zend_vm_trace_handlers.h | 14 ++++++-------- Zend/zend_vm_trace_lines.h | 14 ++++++-------- Zend/zend_vm_trace_map.h | 14 ++++++-------- Zend/zend_weakrefs.c | 14 ++++++-------- Zend/zend_weakrefs.h | 14 ++++++-------- 148 files changed, 902 insertions(+), 1192 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 2a5988273bcd..bcd2ea77a2ea 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend.h b/Zend/zend.h index b41693639ca0..24ba93d9d573 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 4d4ba2652866..c4bbf17c905a 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_API.h b/Zend/zend_API.h index e56ded4e8f1b..223a2b7c7535 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index bca2190976c7..08452ad5afbb 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 264e13848d1b..3f263cd0b044 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_alloc_sizes.h b/Zend/zend_alloc_sizes.h index 502b982a5052..efb05bca4e19 100644 --- a/Zend/zend_alloc_sizes.h +++ b/Zend/zend_alloc_sizes.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_arena.h b/Zend/zend_arena.h index 37cda28f29db..5e21e52aebbb 100644 --- a/Zend/zend_arena.h +++ b/Zend/zend_arena.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index cc4a2a8226fe..165106b33a30 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bob Weinand | | Dmitry Stogov | diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index e2807b03d1f5..4a45d8b4f47b 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bob Weinand | | Dmitry Stogov | diff --git a/Zend/zend_atomic.c b/Zend/zend_atomic.c index 4151e5e539de..98a39c583437 100644 --- a/Zend/zend_atomic.c +++ b/Zend/zend_atomic.c @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Levi Morrison | +----------------------------------------------------------------------+ diff --git a/Zend/zend_atomic.h b/Zend/zend_atomic.h index bcbc6681c928..31558996c3c3 100644 --- a/Zend/zend_atomic.h +++ b/Zend/zend_atomic.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Levi Morrison | +----------------------------------------------------------------------+ diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index cba95810ba49..66917ba7bba4 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Benjamin Eberlei | | Martin Schröder | diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h index f8b61ac9d166..ef75e21c7fb2 100644 --- a/Zend/zend_attributes.h +++ b/Zend/zend_attributes.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Benjamin Eberlei | | Martin Schröder | diff --git a/Zend/zend_autoload.c b/Zend/zend_autoload.c index bc74efa1afda..bd154a1a85d5 100644 --- a/Zend/zend_autoload.c +++ b/Zend/zend_autoload.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gina Peter Banyard | +----------------------------------------------------------------------+ diff --git a/Zend/zend_autoload.h b/Zend/zend_autoload.h index fde4a4a82e9a..3124076c39b2 100644 --- a/Zend/zend_autoload.h +++ b/Zend/zend_autoload.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Gina Peter Banyard | +----------------------------------------------------------------------+ diff --git a/Zend/zend_bitset.h b/Zend/zend_bitset.h index d990b6a2a871..877f2aaabc05 100644 --- a/Zend/zend_bitset.h +++ b/Zend/zend_bitset.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend OPcache JIT | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_build.h b/Zend/zend_build.h index c604fb311a74..acddf8381da1 100644 --- a/Zend/zend_build.h +++ b/Zend/zend_build.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 0a0f50362598..5a69660d98ad 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index 237b34b2927b..5c8d5002d651 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_call_stack.c b/Zend/zend_call_stack.c index ed86ecc74a23..8de1696a5314 100644 --- a/Zend/zend_call_stack.c +++ b/Zend/zend_call_stack.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ diff --git a/Zend/zend_call_stack.h b/Zend/zend_call_stack.h index 58e91694f93f..35d3f6c4994a 100644 --- a/Zend/zend_call_stack.h +++ b/Zend/zend_call_stack.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index cca69985a0df..65cf6038160a 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Seiler | | Dmitry Stogov | diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index 8bea4ffb051e..bb7a00c90f9b 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Seiler | | Dmitry Stogov | diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 176dc40b05f1..66ce34827815 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 77beacabbb92..502b96f93811 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index a44a8b9f70d2..befd7cefa18a 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 8704c523d113..5652d11e564c 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index 3d7f60920bc1..ed1428a1703b 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c index 9f8f1354be06..9dc1621f61e8 100644 --- a/Zend/zend_cpuinfo.c +++ b/Zend/zend_cpuinfo.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Xinchen Hui | +----------------------------------------------------------------------+ diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index 7e53ba654dd4..e0f49c39f05e 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Xinchen Hui | +----------------------------------------------------------------------+ diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index 7ab9b8325a39..8568c72f1342 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sterling Hughes | | Marcus Boerger | diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c index dfc43a85139b..05612afe03c1 100644 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: David Soria Parra | +----------------------------------------------------------------------+ diff --git a/Zend/zend_dtrace.d b/Zend/zend_dtrace.d index 6920d0e3602a..00f6fff96709 100644 --- a/Zend/zend_dtrace.d +++ b/Zend/zend_dtrace.d @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: David Soria Parra | +----------------------------------------------------------------------+ diff --git a/Zend/zend_dtrace.h b/Zend/zend_dtrace.h index 53ccaca4e407..c37dbfdb58be 100644 --- a/Zend/zend_dtrace.h +++ b/Zend/zend_dtrace.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: David Soria Parra | +----------------------------------------------------------------------+ diff --git a/Zend/zend_enum.c b/Zend/zend_enum.c index 6e9c68810d4b..33b2f44243df 100644 --- a/Zend/zend_enum.c +++ b/Zend/zend_enum.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ilija Tovilo | +----------------------------------------------------------------------+ diff --git a/Zend/zend_enum.h b/Zend/zend_enum.h index 4d0799e4f0ac..12301712a23b 100644 --- a/Zend/zend_enum.h +++ b/Zend/zend_enum.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ilija Tovilo | +----------------------------------------------------------------------+ diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h index 954be61a0aec..3f7efcde8676 100644 --- a/Zend/zend_errors.h +++ b/Zend/zend_errors.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index bc794fa3b902..1086031ff20d 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Marcus Boerger | diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index e5a6be2f32fe..5d167039f78b 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Marcus Boerger | diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index adfc2727d1dd..3d2ca115064d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ef385b3ac4dc..960eeb2671c0 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 66849c09cacc..315a00674d17 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index a4e5a38f90d8..7b87cd8daa58 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index 4de8ad5414c2..e272d3d2ae6e 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_fibers.c b/Zend/zend_fibers.c index 248b4f401a71..bfb67f31c865 100644 --- a/Zend/zend_fibers.c +++ b/Zend/zend_fibers.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Aaron Piotrowski | | Martin Schröder | diff --git a/Zend/zend_fibers.h b/Zend/zend_fibers.h index 9442019bfa25..6c31aca4e088 100644 --- a/Zend/zend_fibers.h +++ b/Zend/zend_fibers.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Aaron Piotrowski | | Martin Schröder | diff --git a/Zend/zend_float.c b/Zend/zend_float.c index 90af0c4a5f90..5afd9251988a 100644 --- a/Zend/zend_float.c +++ b/Zend/zend_float.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Seiler | +----------------------------------------------------------------------+ diff --git a/Zend/zend_float.h b/Zend/zend_float.h index 63e0f6f7f69b..402a173412c7 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Christian Seiler | +----------------------------------------------------------------------+ diff --git a/Zend/zend_frameless_function.c b/Zend/zend_frameless_function.c index 7ccda0cfb570..79c0fb68fdc1 100644 --- a/Zend/zend_frameless_function.c +++ b/Zend/zend_frameless_function.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/Zend/zend_frameless_function.h b/Zend/zend_frameless_function.h index d64ca7ee15e2..8548c3a08e46 100644 --- a/Zend/zend_frameless_function.h +++ b/Zend/zend_frameless_function.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 930903ac25e9..e5309bf9a683 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: David Wang | | Dmitry Stogov | diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index 06f550647bd7..bc5bd32da41c 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: David Wang | | Dmitry Stogov | diff --git a/Zend/zend_gdb.c b/Zend/zend_gdb.c index 5975d8c29c09..cbe0c95bf128 100644 --- a/Zend/zend_gdb.c +++ b/Zend/zend_gdb.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/Zend/zend_gdb.h b/Zend/zend_gdb.h index aad0fefb097b..fc6231e20265 100644 --- a/Zend/zend_gdb.h +++ b/Zend/zend_gdb.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | | Xinchen Hui | diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 14e981fb77fb..9d7e3d047cbc 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | | Bob Weinand | diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h index e7b01fb20ad7..e36f09b0ffd8 100644 --- a/Zend/zend_generators.h +++ b/Zend/zend_generators.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Nikita Popov | | Bob Weinand | diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index db202dda66cb..7cab72c25bed 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h index d3cd9f923eee..d485ea1ad3eb 100644 --- a/Zend/zend_globals_macros.h +++ b/Zend/zend_globals_macros.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 7bcb97c392bc..6549d5542492 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 6d6c29b5e6bc..c015ec6fd4ed 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index c5fc874b9cb5..44ee64fe2991 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h index adc1d3c8c81e..c25c1143276f 100644 --- a/Zend/zend_highlight.h +++ b/Zend/zend_highlight.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_hrtime.c b/Zend/zend_hrtime.c index 773e0525cadd..819f95c47662 100644 --- a/Zend/zend_hrtime.c +++ b/Zend/zend_hrtime.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Niklas Keller | | Author: Anatol Belski | diff --git a/Zend/zend_hrtime.h b/Zend/zend_hrtime.h index f3bc4deeaf50..464c7e571d5b 100644 --- a/Zend/zend_hrtime.h +++ b/Zend/zend_hrtime.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Niklas Keller | | Author: Anatol Belski | diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 69f3be91fa06..47312801e10e 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h index 7171a9385f3b..6d19d694f18c 100644 --- a/Zend/zend_inheritance.h +++ b/Zend/zend_inheritance.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 85739415feb3..8beda13f1be5 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index d2419bb160fd..f33294a65842 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Zeev Suraski | +----------------------------------------------------------------------+ diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index c936e7ba96f4..ab118f684527 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -4,15 +4,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Jani Taskinen | diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index 9a6c84fce429..ad6e16b31481 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 5f9b77e6a3d8..1d192336902a 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Jani Taskinen | diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 404dd9db893e..5b0efff6d53e 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index 883e482f510c..d6b733ab9110 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | +----------------------------------------------------------------------+ diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index 64dbb0541a80..6070f324fa27 100644 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index 75549188ed6b..5178cd66c2d1 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Wez Furlong | | Marcus Boerger | diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 25035a693426..3549dda0f65e 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -3,15 +3,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index c494564ba234..f8315ea2c1ed 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 1c985189fd3c..2a99c71b2718 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | | Nuno Lopes | diff --git a/Zend/zend_lazy_objects.c b/Zend/zend_lazy_objects.c index e88ecf9fbe65..7005582d72bc 100644 --- a/Zend/zend_lazy_objects.c +++ b/Zend/zend_lazy_objects.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ diff --git a/Zend/zend_lazy_objects.h b/Zend/zend_lazy_objects.h index fc0a908e7ad2..c850e6553faa 100644 --- a/Zend/zend_lazy_objects.h +++ b/Zend/zend_lazy_objects.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ diff --git a/Zend/zend_list.c b/Zend/zend_list.c index 10aa9174cfcc..15033d5cd276 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_list.h b/Zend/zend_list.h index 55ccf78dca10..dbddadb9bb9b 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index 28a275e6fce7..ee74700ea2a4 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index 848543eba0a6..dfce304af0a8 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_long.h b/Zend/zend_long.h index fef237701f3b..2b44b9d1540b 100644 --- a/Zend/zend_long.h +++ b/Zend/zend_long.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/Zend/zend_map_ptr.h b/Zend/zend_map_ptr.h index 4dfa0e5043ef..308617eb8df0 100644 --- a/Zend/zend_map_ptr.h +++ b/Zend/zend_map_ptr.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_max_execution_timer.c b/Zend/zend_max_execution_timer.c index 005ce14868a0..5d0eb1219c0b 100644 --- a/Zend/zend_max_execution_timer.c +++ b/Zend/zend_max_execution_timer.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kévin Dunglas | +----------------------------------------------------------------------+ diff --git a/Zend/zend_max_execution_timer.h b/Zend/zend_max_execution_timer.h index 6557d6c91845..3839ea4cf676 100644 --- a/Zend/zend_max_execution_timer.h +++ b/Zend/zend_max_execution_timer.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Kévin Dunglas | +----------------------------------------------------------------------+ diff --git a/Zend/zend_mmap.h b/Zend/zend_mmap.h index 201fd84d074d..6443300a8f15 100644 --- a/Zend/zend_mmap.h +++ b/Zend/zend_mmap.h @@ -1,12 +1,14 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright © Zend by Perforce and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Max Kellermann | +----------------------------------------------------------------------+ diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index a8076c0fb905..31c98f784c65 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index fc130162f083..713ce64dca29 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Masaki Fujimoto | | Rui Hirokawa | diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h index 16ba56ec69fd..645293b743f9 100644 --- a/Zend/zend_multibyte.h +++ b/Zend/zend_multibyte.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Masaki Fujimoto | | Rui Hirokawa | diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 716e3ba4b571..6ca36bbc485e 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Ard Biesheuvel | diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 90f0e1099619..f6bd5ec177b0 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 3e922343eb15..f14f4b722cd9 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 6f6a82638944..d74de714d55e 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h index 712fd442da5a..444673642515 100644 --- a/Zend/zend_objects.h +++ b/Zend/zend_objects.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 2e6ddd2f4d8b..11ec0fd84852 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index 7fe1b8bbdf1d..7df13a080f45 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_observer.c b/Zend/zend_observer.c index bee20bdbc20d..518a3b3bda8f 100644 --- a/Zend/zend_observer.c +++ b/Zend/zend_observer.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Levi Morrison | | Sammy Kaye Powers | diff --git a/Zend/zend_observer.h b/Zend/zend_observer.h index cfec5200055a..03be4af9428e 100644 --- a/Zend/zend_observer.h +++ b/Zend/zend_observer.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Levi Morrison | | Sammy Kaye Powers | diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 35de02b55729..dce6f2d1aee9 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index c0ca71d3ff05..cc9f8932c48e 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 408b2eee65c8..93041b0c0e26 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 33a3e79a212e..caa7510975ba 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_property_hooks.c b/Zend/zend_property_hooks.c index 57e22f23ad7b..2c87b7123e44 100644 --- a/Zend/zend_property_hooks.c +++ b/Zend/zend_property_hooks.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ilija Tovilo | +----------------------------------------------------------------------+ diff --git a/Zend/zend_property_hooks.h b/Zend/zend_property_hooks.h index 3793fa1a683c..c141398cdce3 100644 --- a/Zend/zend_property_hooks.h +++ b/Zend/zend_property_hooks.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ilija Tovilo | +----------------------------------------------------------------------+ diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index fdabdeb61cef..fe79d1ce7cd5 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index 3ef1478fe4c3..15c92999238b 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_range_check.h b/Zend/zend_range_check.h index 9c822493fa3e..fa82012ec23d 100644 --- a/Zend/zend_range_check.h +++ b/Zend/zend_range_check.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c index 83f8aa0852db..2e4b398aa965 100644 --- a/Zend/zend_signal.c +++ b/Zend/zend_signal.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Signal Handling | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Lucas Nealan | | Arnaud Le Blanc | @@ -22,8 +20,9 @@ Facebook Inc. as the original contributor of this module by leaving this note intact in the source code. - All other licensing and usage conditions are those of the PHP Group. -*/ + All other licensing and usage conditions are those of the PHP Group and + Contributors. + */ #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/Zend/zend_signal.h b/Zend/zend_signal.h index e88892da35aa..973f0c302b21 100644 --- a/Zend/zend_signal.h +++ b/Zend/zend_signal.h @@ -2,20 +2,17 @@ +----------------------------------------------------------------------+ | Zend Signal Handling | +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Lucas Nealan | | Arnaud Le Blanc | +----------------------------------------------------------------------+ - */ #ifndef ZEND_SIGNAL_H diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c index 0124ed7885d6..e6475c1dd626 100644 --- a/Zend/zend_smart_str.c +++ b/Zend/zend_smart_str.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_smart_str.h b/Zend/zend_smart_str.h index affbb5c50ac2..cb81cd2361c8 100644 --- a/Zend/zend_smart_str.h +++ b/Zend/zend_smart_str.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/Zend/zend_smart_str_public.h b/Zend/zend_smart_str_public.h index 6a3b526254e4..d08ee49e47e0 100644 --- a/Zend/zend_smart_str_public.h +++ b/Zend/zend_smart_str_public.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ diff --git a/Zend/zend_smart_string.h b/Zend/zend_smart_string.h index 9f04e1a340ad..e8655681186b 100644 --- a/Zend/zend_smart_string.h +++ b/Zend/zend_smart_string.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | | Xinchen Hui | diff --git a/Zend/zend_smart_string_public.h b/Zend/zend_smart_string_public.h index 543e1d37a4ef..8b2bfbedb271 100644 --- a/Zend/zend_smart_string_public.h +++ b/Zend/zend_smart_string_public.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sascha Schumann | | Xinchen Hui | diff --git a/Zend/zend_sort.c b/Zend/zend_sort.c index 355d2d1bad58..cefddaefb2de 100644 --- a/Zend/zend_sort.c +++ b/Zend/zend_sort.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Xinchen Hui | | Sterling Hughes | diff --git a/Zend/zend_sort.h b/Zend/zend_sort.h index 5954575dbc25..ad51b4f47d94 100644 --- a/Zend/zend_sort.h +++ b/Zend/zend_sort.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Xinchen Hui | | Sterling Hughes | diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c index 5d9cc166367e..63606956ffeb 100644 --- a/Zend/zend_stack.c +++ b/Zend/zend_stack.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h index a2edc12b1fb4..afaf7b548ea5 100644 --- a/Zend/zend_stack.h +++ b/Zend/zend_stack.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 8e11841ad265..d559b78a7fa7 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Scott MacVicar | diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index 33d8656dad5e..16fb5516df3f 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Wez Furlong | | Scott MacVicar | diff --git a/Zend/zend_string.c b/Zend/zend_string.c index 348f37999efd..fc3aebb8b6ef 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 69c2edd13b3d..929800c73caf 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h index 4e0d85a7d216..00fedcd02d92 100644 --- a/Zend/zend_strtod.h +++ b/Zend/zend_strtod.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Derick Rethans | +----------------------------------------------------------------------+ diff --git a/Zend/zend_strtod_int.h b/Zend/zend_strtod_int.h index 06a02618e9e6..4a1a04e9671c 100644 --- a/Zend/zend_strtod_int.h +++ b/Zend/zend_strtod_int.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Anatol Belski | +----------------------------------------------------------------------+ diff --git a/Zend/zend_system_id.c b/Zend/zend_system_id.c index 2c3ebab0f480..ead694375b6d 100644 --- a/Zend/zend_system_id.c +++ b/Zend/zend_system_id.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Sammy Kaye Powers | | Dmitry Stogov | diff --git a/Zend/zend_system_id.h b/Zend/zend_system_id.h index b6785f8d7b67..ae39381a52a3 100644 --- a/Zend/zend_system_id.h +++ b/Zend/zend_system_id.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: Sammy Kaye Powers | +----------------------------------------------------------------------+ diff --git a/Zend/zend_type_info.h b/Zend/zend_type_info.h index eeab7bf0431d..462ffb33cf10 100644 --- a/Zend/zend_type_info.h +++ b/Zend/zend_type_info.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 22dbfa9be879..9516d3225970 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 00f10b08f80a..71e3bd4db3f4 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index d90ad9951782..90a5190ce435 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_verify_type_inference.h b/Zend/zend_verify_type_inference.h index 8e9cbcbc181f..bd80e1edbfcd 100644 --- a/Zend/zend_verify_type_inference.h +++ b/Zend/zend_verify_type_inference.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 94183e3724c4..f8dabd507783 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Sascha Schumann | diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h index 21735f6dfae5..0c543bba5c68 100644 --- a/Zend/zend_virtual_cwd.h +++ b/Zend/zend_virtual_cwd.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Sascha Schumann | diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index c9c41c75c72a..cdbedd33545d 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 5a7e6d6d1165..47d96929d1a3 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a2a064377d8c..2440fe63426e 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index ed0256832d58..5135d81ece8c 100755 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -4,15 +4,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ @@ -23,15 +21,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 87cd00a6f8b5..427572091548 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 7aae4d0e55f1..dd1765a49b0c 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | diff --git a/Zend/zend_vm_trace_handlers.h b/Zend/zend_vm_trace_handlers.h index eaf97e012cac..b11c6e159644 100644 --- a/Zend/zend_vm_trace_handlers.h +++ b/Zend/zend_vm_trace_handlers.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_vm_trace_lines.h b/Zend/zend_vm_trace_lines.h index 740e18776395..f4565a362d76 100644 --- a/Zend/zend_vm_trace_lines.h +++ b/Zend/zend_vm_trace_lines.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_vm_trace_map.h b/Zend/zend_vm_trace_map.h index d84aa0442d26..1a1fac1f2058 100644 --- a/Zend/zend_vm_trace_map.h +++ b/Zend/zend_vm_trace_map.h @@ -2,15 +2,13 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend by Perforce and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 16b972eb0c20..7303226a5d42 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: krakjoe@php.net | +----------------------------------------------------------------------+ diff --git a/Zend/zend_weakrefs.h b/Zend/zend_weakrefs.h index 00d4fbcc6bc4..41662c33a300 100644 --- a/Zend/zend_weakrefs.h +++ b/Zend/zend_weakrefs.h @@ -1,14 +1,12 @@ /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: krakjoe@php.net | +----------------------------------------------------------------------+ From 3ba0b9c81db506e6bb47e259539dd40b116557ef Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:13:00 -0500 Subject: [PATCH 203/300] license-update: run-tests.php source headers RFC: https://wiki.php.net/rfc/php_license_update --- run-extra-tests.php | 14 ++++++-------- run-tests.php | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/run-extra-tests.php b/run-extra-tests.php index 725f2b58c373..16dfac69d13a 100755 --- a/run-extra-tests.php +++ b/run-extra-tests.php @@ -2,15 +2,13 @@ . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ */ diff --git a/run-tests.php b/run-tests.php index 68d2cb69256d..b0bdc15518ee 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2,15 +2,13 @@ . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Ilia Alshanetsky | | Preston L. Bannister | From 1b93524e0d2432524d809a69170383c586c4ecde Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:13:47 -0500 Subject: [PATCH 204/300] license-update: docs source headers RFC: https://wiki.php.net/rfc/php_license_update --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 12f3a0600a94..40f8dbfb5ed2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,5 @@ # Makefile for php-src/docs -# Copyright (c) The PHP Group +# Copyright © The PHP Group and Contributors. # If people set these on the make command line, use 'em From 19cb3b054dabc79fec7b3162ed96e7d03d03548f Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:15:42 -0500 Subject: [PATCH 205/300] license-update: version info output RFC: https://wiki.php.net/rfc/php_license_update --- Zend/zend.c | 2 +- ext/opcache/ZendAccelerator.c | 6 +++--- ext/reflection/tests/ReflectionZendExtension.phpt | 6 +++--- main/main.c | 2 +- sapi/cgi/tests/001.phpt | 4 ++-- sapi/cli/tests/001.phpt | 4 ++-- sapi/cli/tests/bug80092.phpt | 2 +- sapi/fpm/tests/main-version.phpt | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index bcd2ea77a2ea..0afa7d580ab9 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -76,7 +76,7 @@ ZEND_API bool zend_dtrace_enabled; /* version information */ static char *zend_version_info; static uint32_t zend_version_info_length; -#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) Zend Technologies\n" +#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright © Zend by Perforce\n" #define PRINT_ZVAL_INDENT 4 /* true multithread-shared globals */ diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 6352b74df33b..3d005b3835a7 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -5161,9 +5161,9 @@ static void accel_activate(void) { static zend_extension opcache_extension_entry = { ACCELERATOR_PRODUCT_NAME, /* name */ PHP_VERSION, /* version */ - "Zend Technologies", /* author */ - "http://www.zend.com/", /* URL */ - "Copyright (c)", /* copyright */ + "Zend by Perforce", /* author */ + "https://www.zend.com/", /* URL */ + "Copyright ©", /* copyright */ accel_startup, /* startup */ NULL, /* shutdown */ accel_activate, /* per-script activation */ diff --git a/ext/reflection/tests/ReflectionZendExtension.phpt b/ext/reflection/tests/ReflectionZendExtension.phpt index c9c8f18cf553..a9825ff78abc 100644 --- a/ext/reflection/tests/ReflectionZendExtension.phpt +++ b/ext/reflection/tests/ReflectionZendExtension.phpt @@ -14,8 +14,8 @@ var_dump($reflection->getURL()); var_dump($reflection->getVersion() === PHP_VERSION); ?> --EXPECT-- -string(17) "Zend Technologies" -string(13) "Copyright (c)" +string(16) "Zend by Perforce" +string(12) "Copyright ©" string(12) "Zend OPcache" -string(20) "http://www.zend.com/" +string(21) "https://www.zend.com/" bool(true) diff --git a/main/main.c b/main/main.c index ad38ebdd06a6..cc3f1cae2586 100644 --- a/main/main.c +++ b/main/main.c @@ -145,7 +145,7 @@ PHPAPI char *php_get_version(sapi_module_struct *sapi_module) " GCOV" #endif ); - smart_string_appends(&version_info, "Copyright (c) The PHP Group\n"); + smart_string_appends(&version_info, "Copyright © The PHP Group and Contributors\n"); const char *build_provider = php_build_provider(); if (build_provider) { diff --git a/sapi/cgi/tests/001.phpt b/sapi/cgi/tests/001.phpt index c990a77efaee..00fc656f75bc 100644 --- a/sapi/cgi/tests/001.phpt +++ b/sapi/cgi/tests/001.phpt @@ -16,6 +16,6 @@ echo "Done\n"; ?> --EXPECTF-- string(%d) "PHP %s (cgi%s (built: %s -Copyright (c) The PHP Group -%AZend Engine v%s, Copyright (c) Zend Technologies%A" +Copyright © The PHP Group and Contributors +%AZend Engine v%s, Copyright © Zend by Perforce%A" Done diff --git a/sapi/cli/tests/001.phpt b/sapi/cli/tests/001.phpt index bb85ad434357..8038c3e78b76 100644 --- a/sapi/cli/tests/001.phpt +++ b/sapi/cli/tests/001.phpt @@ -13,6 +13,6 @@ echo "Done\n"; ?> --EXPECTF-- string(%d) "PHP %s (cli) (built: %s)%s -Copyright (c) The PHP Group -%AZend Engine v%s, Copyright (c) Zend Technologies%A" +Copyright © The PHP Group and Contributors +%AZend Engine v%s, Copyright © Zend by Perforce%A" Done diff --git a/sapi/cli/tests/bug80092.phpt b/sapi/cli/tests/bug80092.phpt index eac60e7e3778..a05620f1975d 100644 --- a/sapi/cli/tests/bug80092.phpt +++ b/sapi/cli/tests/bug80092.phpt @@ -41,6 +41,6 @@ foreach (explode("\n", $output) as $line) { --EXPECTF-- preloaded PHP %s -Copyright (c) The PHP Group +Copyright © The PHP Group and Contributors %AZend Engine %s %A with Zend OPcache %a diff --git a/sapi/fpm/tests/main-version.phpt b/sapi/fpm/tests/main-version.phpt index 8c7dbe78c92e..29a7cbf4568f 100644 --- a/sapi/fpm/tests/main-version.phpt +++ b/sapi/fpm/tests/main-version.phpt @@ -15,6 +15,6 @@ echo "Done\n"; ?> --EXPECTF-- string(%d) "PHP %s (fpm%s (built: %s -Copyright (c) The PHP Group -%AZend Engine v%s, Copyright (c) Zend Technologies%A" +Copyright © The PHP Group and Contributors +%AZend Engine v%s, Copyright © Zend by Perforce%A" Done From 7fd4d3aa93cdaca1b65da28daac26a70bd6c8545 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 13:29:50 -0500 Subject: [PATCH 206/300] license-update: update phpinfo() license statements RFC: https://wiki.php.net/rfc/php_license_update --- ext/standard/info.c | 82 ++++++++++++++----- .../tests/general_functions/phpinfo.phpt | 4 +- sapi/cli/tests/019.phpt | 39 +++++++-- 3 files changed, 94 insertions(+), 31 deletions(-) diff --git a/ext/standard/info.c b/ext/standard/info.c index 90d882c15d34..1c85443bc53f 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1019,35 +1019,77 @@ PHPAPI ZEND_COLD void php_print_info(int flag) if (flag & PHP_INFO_LICENSE) { if (!sapi_module.phpinfo_as_text) { - SECTION("PHP License"); + SECTION("License"); php_info_print_box_start(0); php_info_print("

\n"); - php_info_print("This program is free software; you can redistribute it and/or modify "); - php_info_print("it under the terms of the PHP License as published by the PHP Group "); - php_info_print("and included in the distribution in the file: LICENSE\n"); + php_info_print("PHP is free software: you can redistribute it and/or modify it under the "); + php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); php_info_print("

\n"); - php_info_print("

"); - php_info_print("This program is distributed in the hope that it will be useful, "); - php_info_print("but WITHOUT ANY WARRANTY; without even the implied warranty of "); - php_info_print("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); + php_info_print("

\n"); + php_info_print("Copyright © 1999–2025, The PHP Group and Contributors.
\n"); + php_info_print("Copyright © 1999–2025, Zend by Perforce.\n"); php_info_print("

\n"); - php_info_print("

"); - php_info_print("If you did not receive a copy of the PHP license, or have any questions about "); - php_info_print("PHP licensing, please contact license@php.net.\n"); + php_info_print("

\n"); + php_info_print("Redistribution and use in source and binary forms, with or without "); + php_info_print("modification, are permitted provided that the following conditions are met:\n"); + php_info_print("

\n"); + php_info_print("
    \n"); + php_info_print("
  1. Redistributions of source code must retain the above copyright notice, this "); + php_info_print("list of conditions and the following disclaimer.
  2. \n"); + php_info_print("
  3. Redistributions in binary form must reproduce the above copyright notice, "); + php_info_print("this list of conditions and the following disclaimer in the documentation "); + php_info_print("and/or other materials provided with the distribution.
  4. \n"); + php_info_print("
  5. Neither the name of the copyright holder nor the names of its "); + php_info_print("contributors may be used to endorse or promote products derived from "); + php_info_print("this software without specific prior written permission.
  6. \n"); + php_info_print("
\n"); + php_info_print("

\n"); + php_info_print("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" "); + php_info_print("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE "); + php_info_print("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE "); + php_info_print("DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE "); + php_info_print("FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL "); + php_info_print("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR "); + php_info_print("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER "); + php_info_print("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, "); + php_info_print("OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE "); + php_info_print("OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"); php_info_print("

\n"); php_info_print_box_end(); } else { - php_info_print("\nPHP License\n"); - php_info_print("This program is free software; you can redistribute it and/or modify\n"); - php_info_print("it under the terms of the PHP License as published by the PHP Group\n"); - php_info_print("and included in the distribution in the file: LICENSE\n"); php_info_print("\n"); - php_info_print("This program is distributed in the hope that it will be useful,\n"); - php_info_print("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); - php_info_print("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); + php_info_print("License\n"); + php_info_print("\n"); + php_info_print("PHP is free software: you can redistribute it and/or modify it under the\n"); + php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); + php_info_print("\n"); + php_info_print("Copyright © 1999–2025, The PHP Group and Contributors.\n"); + php_info_print("Copyright © 1999–2025, Zend by Perforce.\n"); + php_info_print("\n"); + php_info_print("Redistribution and use in source and binary forms, with or without\n"); + php_info_print("modification, are permitted provided that the following conditions are met:\n"); + php_info_print("\n"); + php_info_print("1. Redistributions of source code must retain the above copyright notice, this\n"); + php_info_print(" list of conditions and the following disclaimer.\n"); + php_info_print("\n"); + php_info_print("2. Redistributions in binary form must reproduce the above copyright notice,\n"); + php_info_print(" this list of conditions and the following disclaimer in the documentation\n"); + php_info_print(" and/or other materials provided with the distribution.\n"); + php_info_print("\n"); + php_info_print("3. Neither the name of the copyright holder nor the names of its\n"); + php_info_print(" contributors may be used to endorse or promote products derived from\n"); + php_info_print(" this software without specific prior written permission.\n"); php_info_print("\n"); - php_info_print("If you did not receive a copy of the PHP license, or have any\n"); - php_info_print("questions about PHP licensing, please contact license@php.net.\n"); + php_info_print("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n"); + php_info_print("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n"); + php_info_print("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n"); + php_info_print("DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n"); + php_info_print("FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"); + php_info_print("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n"); + php_info_print("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n"); + php_info_print("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n"); + php_info_print("OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"); + php_info_print("OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"); } } diff --git a/ext/standard/tests/general_functions/phpinfo.phpt b/ext/standard/tests/general_functions/phpinfo.phpt index ac7cabd340d8..a7503ec0bc41 100644 --- a/ext/standard/tests/general_functions/phpinfo.phpt +++ b/ext/standard/tests/general_functions/phpinfo.phpt @@ -57,7 +57,7 @@ Environment %r(.*?)%r PHP Variables %r(.*?)%r -PHP License +License %r(.*?)%r bool(true) -- @@ -66,6 +66,6 @@ bool(true) -- phpinfo() -PHP License +License %r(.+?)%r bool(true) diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index 481ea2228b34..670f1e921deb 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -21,16 +21,37 @@ echo "\nDone\n"; phpinfo() PHP Version => %s %a -PHP License -This program is free software; you can redistribute it and/or modify -it under the terms of the PHP License as published by the PHP Group -and included in the distribution in the file: LICENSE +License -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +PHP is free software: you can redistribute it and/or modify it under the +terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause): -If you did not receive a copy of the PHP license, or have any -questions about PHP licensing, please contact license@php.net. +Copyright © 1999–2025, The PHP Group and Contributors. +Copyright © 1999–2025, Zend by Perforce. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Done From f414d448b9cdf38a9623960622de6527152e5b3b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:17:19 -0500 Subject: [PATCH 207/300] license-update: man pages RFC: https://wiki.php.net/rfc/php_license_update --- ext/phar/phar.1.in | 18 +++++------------- sapi/cli/php.1.in | 18 +++++------------- sapi/fpm/php-fpm.8.in | 20 ++++++-------------- sapi/phpdbg/phpdbg.1.in | 18 +++++------------- scripts/man1/php-config.1.in | 18 +++++------------- scripts/man1/phpize.1.in | 18 +++++------------- 6 files changed, 31 insertions(+), 79 deletions(-) diff --git a/ext/phar/phar.1.in b/ext/phar/phar.1.in index db22d40abc3f..8dffd2cf2dd0 100644 --- a/ext/phar/phar.1.in +++ b/ext/phar/phar.1.in @@ -511,17 +511,9 @@ contributors all around the world. .SH VERSION INFORMATION This manpage describes \fBphar\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in index 797ef3242b6a..30626015ce77 100644 --- a/sapi/cli/php.1.in +++ b/sapi/cli/php.1.in @@ -456,17 +456,9 @@ contributors all around the world. .SH VERSION INFORMATION This manpage describes \fBphp\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in index 941b911ed08f..6a46c9419e67 100644 --- a/sapi/fpm/php-fpm.8.in +++ b/sapi/fpm/php-fpm.8.in @@ -203,21 +203,13 @@ contributors all around the world. .SH VERSION INFORMATION This manpage describes \fBphp-fpm\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .PD 0 .P -Copyright (c) 2007-2009, Andrei Nigmatulin +Copyright \(co 2007-2009, Andrei Nigmatulin .PD 1 .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ diff --git a/sapi/phpdbg/phpdbg.1.in b/sapi/phpdbg/phpdbg.1.in index 56badf0cca95..8fa3532a1176 100644 --- a/sapi/phpdbg/phpdbg.1.in +++ b/sapi/phpdbg/phpdbg.1.in @@ -121,17 +121,9 @@ contributors all around the world. .SH VERSION INFORMATION This manpage describes \fBphpdbg\fP, for PHP version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in index 9944ac91d79b..a3762f26c0c1 100644 --- a/scripts/man1/php-config.1.in +++ b/scripts/man1/php-config.1.in @@ -81,17 +81,9 @@ PHP version as integer .SH VERSION INFORMATION This manpage describes \fBphp\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ diff --git a/scripts/man1/phpize.1.in b/scripts/man1/phpize.1.in index 410a79c54475..19507ca5bb0f 100644 --- a/scripts/man1/phpize.1.in +++ b/scripts/man1/phpize.1.in @@ -32,17 +32,9 @@ Prints API version information .SH VERSION INFORMATION This manpage describes \fBphp\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co The PHP Group +Copyright \(co The PHP Group and Contributors .LP -This source file is subject to version 3.01 of the PHP license, -that is bundled with this package in the file LICENSE, and is -available through the world-wide-web at the following url: -.PD 0 -.P -.B https://www.php.net/license/3_01.txt -.PD 1 -.P -If you did not receive a copy of the PHP license and are unable to -obtain it through the world-wide-web, please send a note to -.B license@php.net -so we can mail you a copy immediately. +This source file is subject to the Modified BSD License that is +bundled with this package in the file LICENSE, and is available +through the World Wide Web at +.B https://www.php.net/license/ From a6eaf954a9707691270b5e665ebac319a81138cd Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:17:42 -0500 Subject: [PATCH 208/300] license-update: LICENSE files RFC: https://wiki.php.net/rfc/php_license_update --- LICENSE | 91 +++++++++++++++------------------------------------- Zend/LICENSE | 56 -------------------------------- 2 files changed, 25 insertions(+), 122 deletions(-) delete mode 100644 Zend/LICENSE diff --git a/LICENSE b/LICENSE index 16af9a6ae1e7..e77e0f3baf13 100644 --- a/LICENSE +++ b/LICENSE @@ -1,68 +1,27 @@ --------------------------------------------------------------------- - The PHP License, version 3.01 -Copyright (c) 1999 - 2026 The PHP Group. All rights reserved. --------------------------------------------------------------------- +Copyright © 1999–2026, The PHP Group and Contributors. +Copyright © 1999–2026, Zend by Perforce. Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP software, freely available from - ". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . - -PHP includes the Zend Engine, freely available at -. +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Zend/LICENSE b/Zend/LICENSE deleted file mode 100644 index 51f5cccde950..000000000000 --- a/Zend/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ --------------------------------------------------------------------- - The Zend Engine License, Version 2.00 -Copyright (c) 1999-2006 Zend Technologies Ltd. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. The names "Zend" and "Zend Engine" must not be used to endorse - or promote products derived from this software without prior - permission from Zend Technologies Ltd. For written permission, - please contact license@zend.com. - - 4. Zend Technologies Ltd. may publish revised and/or new versions - of the license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by Zend Technologies Ltd. No one other than Zend - Technologies Ltd. has the right to modify the terms applicable - to covered code created under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes the Zend Engine, freely available at - http://www.zend.com" - - 6. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "The Zend Engine is freely available at http://www.zend.com" - -THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND -TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - --------------------------------------------------------------------- From e8684c308082e446da58b0d99d68d38c9dfb7e20 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:18:12 -0500 Subject: [PATCH 209/300] license-update: configure message RFC: https://wiki.php.net/rfc/php_license_update --- configure.ac | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 214c0ab91b2a..6c517ecc0a1e 100644 --- a/configure.ac +++ b/configure.ac @@ -1846,11 +1846,11 @@ cat < Date: Sat, 28 Jun 2025 14:19:08 -0500 Subject: [PATCH 210/300] license-update: README and CONTRIBUTING docs RFC: https://wiki.php.net/rfc/php_license_update --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +++--- CONTRIBUTING.md | 18 ++++++++---------- README.md | 6 ++++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 4f5bef65ed1f..296835e02e0d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -31,10 +31,10 @@ body: Please make sure that the used PHP version [is a supported version](https://www.php.net/supported-versions.php). placeholder: | PHP 8.5.2 (cli) (built: Jan 21 2026 17:35:28) (NTS) - Copyright (c) The PHP Group + Copyright © The PHP Group and Contributors Built by Ubuntu - Zend Engine v4.5.2, Copyright (c) Zend Technologies - with Zend OPcache v8.5.2, Copyright (c), by Zend Technologies + Zend Engine v4.5.2, Copyright © Zend by Perforce + with Zend OPcache v8.5.2, Copyright ©, Zend by Perforce render: plain validations: required: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 041b27f96dfb..7f2635e7d4f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,8 +37,8 @@ implement RFCs. Please be sure to include tests as appropriate! By submitting a pull request, you certify that you have the necessary rights to submit the work, that the work does not violate any third-party rights (including those of your employer, if applicable), and that you license your -contribution under the PHP License or under another license if explicitly -accepted by the PHP project maintainers. +contribution under the [Modified BSD License](LICENSE) or under another license +if explicitly accepted by the PHP project maintainers. If you are fixing a bug, then please submit your PR against the lowest actively supported branch of PHP that the bug affects (only green branches on @@ -439,15 +439,13 @@ New source code files should include the following header block: ```c /* +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | + | Copyright © The PHP Group and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Author: | +----------------------------------------------------------------------+ diff --git a/README.md b/README.md index 545baa720967..3f4e0534ede2 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,10 @@ PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your -blog to the most popular websites in the world. PHP is distributed under the -[PHP License v3.01](LICENSE). +blog to the most popular websites in the world. + +PHP is distributed under the [Modified BSD License](LICENSE) +(SPDX-License-Identifier: `BSD-3-Clause`). [![Test](https://github.com/php/php-src/actions/workflows/test.yml/badge.svg)](https://github.com/php/php-src/actions/workflows/test.yml) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://issues.oss-fuzz.com/issues?q=project:php) From 65200a4c67afa326317611dfe3679cfd029ca5e1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 28 Jun 2025 14:28:48 -0500 Subject: [PATCH 211/300] license-update: license info for mysqlnd plugin RFC: https://wiki.php.net/rfc/php_license_update --- ext/mysqlnd/mysqlnd_auth.c | 8 ++++---- ext/mysqlnd/mysqlnd_charset.c | 2 +- ext/mysqlnd/mysqlnd_debug.c | 2 +- ext/mysqlnd/mysqlnd_driver.c | 2 +- ext/mysqlnd/mysqlnd_plugin.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 8ff8d27d4ec3..3504caa2dea1 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -585,7 +585,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_native_auth_plugin = "auth_plugin_mysql_native_password", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* no statistics , will be filled later if there are some */ @@ -638,7 +638,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_pam_authentication_plugin "auth_plugin_mysql_clear_password", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* no statistics , will be filled later if there are some */ @@ -934,7 +934,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_sha256_authentication_plu "auth_plugin_sha256_password", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel ", { NULL, /* no statistics , will be filled later if there are some */ @@ -1295,7 +1295,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_caching_sha2_auth_plugin "auth_plugin_caching_sha2_password", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Johannes Schlüter ", { NULL, /* no statistics , will be filled later if there are some */ diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index bd7fdaa16191..b9ba0577c84a 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -974,7 +974,7 @@ static struct st_mysqlnd_plugin_charsets mysqlnd_plugin_charsets_plugin = "charsets", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* no statistics , will be filled later if there are some */ diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 094713223e8c..80765f36131c 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -740,7 +740,7 @@ static struct st_mysqlnd_plugin_trace_log mysqlnd_plugin_trace_log_plugin = "debug_trace", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* no statistics , will be filled later if there are some */ diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c index de46a5e2c623..deef03b9a3c1 100644 --- a/ext/mysqlnd/mysqlnd_driver.c +++ b/ext/mysqlnd/mysqlnd_driver.c @@ -36,7 +36,7 @@ static struct st_mysqlnd_plugin_core mysqlnd_plugin_core = "mysqlnd", MYSQLND_VERSION_ID, PHP_MYSQLND_VERSION, - "PHP License 3.01", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov , Ulf Wendel , Georg Richter ", { NULL, /* will be filled later */ diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c index ffc6e8b2757a..4209676daf10 100644 --- a/ext/mysqlnd/mysqlnd_plugin.c +++ b/ext/mysqlnd/mysqlnd_plugin.c @@ -45,7 +45,7 @@ static struct st_mysqlnd_typeii_plugin_example mysqlnd_example_plugin = "example", 10001L, "1.00.01", - "PHP License", + "Modified BSD License (BSD-3-Clause)", "Andrey Hristov ", { NULL, /* will be filled later */ From cc4ce2b42efeadd53af6cc85b57caa391d1ea250 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sat, 10 Jan 2026 23:50:01 -0600 Subject: [PATCH 212/300] license-update: remove copyright years from info output RFC: https://wiki.php.net/rfc/php_license_update --- ext/standard/info.c | 8 ++++---- sapi/cli/tests/019.phpt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/standard/info.c b/ext/standard/info.c index 1c85443bc53f..558822cc67a2 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1026,8 +1026,8 @@ PHPAPI ZEND_COLD void php_print_info(int flag) php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); php_info_print("

\n"); php_info_print("

\n"); - php_info_print("Copyright © 1999–2025, The PHP Group and Contributors.
\n"); - php_info_print("Copyright © 1999–2025, Zend by Perforce.\n"); + php_info_print("Copyright © The PHP Group and Contributors.
\n"); + php_info_print("Copyright © Zend by Perforce.\n"); php_info_print("

\n"); php_info_print("

\n"); php_info_print("Redistribution and use in source and binary forms, with or without "); @@ -1063,8 +1063,8 @@ PHPAPI ZEND_COLD void php_print_info(int flag) php_info_print("PHP is free software: you can redistribute it and/or modify it under the\n"); php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); php_info_print("\n"); - php_info_print("Copyright © 1999–2025, The PHP Group and Contributors.\n"); - php_info_print("Copyright © 1999–2025, Zend by Perforce.\n"); + php_info_print("Copyright © The PHP Group and Contributors.\n"); + php_info_print("Copyright © Zend by Perforce.\n"); php_info_print("\n"); php_info_print("Redistribution and use in source and binary forms, with or without\n"); php_info_print("modification, are permitted provided that the following conditions are met:\n"); diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index 670f1e921deb..6fde11668f11 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -26,8 +26,8 @@ License PHP is free software: you can redistribute it and/or modify it under the terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause): -Copyright © 1999–2025, The PHP Group and Contributors. -Copyright © 1999–2025, Zend by Perforce. +Copyright © The PHP Group and Contributors. +Copyright © Zend by Perforce. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From e4394946c2feeab74e79ae5c289a4c0120967dd1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 4 Feb 2026 20:48:33 -0600 Subject: [PATCH 213/300] license-update: update Zend copyright name RFC: https://wiki.php.net/rfc/php_license_update --- LICENSE | 2 +- Zend/zend.c | 3 ++- Zend/zend.h | 3 ++- Zend/zend_API.c | 3 ++- Zend/zend_API.h | 3 ++- Zend/zend_alloc.c | 3 ++- Zend/zend_alloc.h | 3 ++- Zend/zend_alloc_sizes.h | 3 ++- Zend/zend_arena.h | 3 ++- Zend/zend_ast.c | 3 ++- Zend/zend_ast.h | 3 ++- Zend/zend_attributes.c | 3 ++- Zend/zend_attributes.h | 3 ++- Zend/zend_autoload.c | 3 ++- Zend/zend_autoload.h | 3 ++- Zend/zend_build.h | 3 ++- Zend/zend_builtin_functions.c | 3 ++- Zend/zend_builtin_functions.h | 3 ++- Zend/zend_call_stack.c | 3 ++- Zend/zend_call_stack.h | 3 ++- Zend/zend_closures.c | 3 ++- Zend/zend_closures.h | 3 ++- Zend/zend_compile.c | 3 ++- Zend/zend_compile.h | 3 ++- Zend/zend_config.w32.h | 3 ++- Zend/zend_constants.c | 3 ++- Zend/zend_constants.h | 3 ++- Zend/zend_cpuinfo.c | 3 ++- Zend/zend_cpuinfo.h | 3 ++- Zend/zend_default_classes.c | 3 ++- Zend/zend_dtrace.c | 3 ++- Zend/zend_dtrace.d | 3 ++- Zend/zend_dtrace.h | 3 ++- Zend/zend_enum.c | 3 ++- Zend/zend_enum.h | 3 ++- Zend/zend_errors.h | 3 ++- Zend/zend_exceptions.c | 3 ++- Zend/zend_exceptions.h | 3 ++- Zend/zend_execute.c | 3 ++- Zend/zend_execute.h | 3 ++- Zend/zend_execute_API.c | 3 ++- Zend/zend_extensions.c | 3 ++- Zend/zend_extensions.h | 3 ++- Zend/zend_fibers.c | 3 ++- Zend/zend_fibers.h | 3 ++- Zend/zend_float.c | 3 ++- Zend/zend_float.h | 3 ++- Zend/zend_frameless_function.c | 3 ++- Zend/zend_frameless_function.h | 3 ++- Zend/zend_gc.c | 3 ++- Zend/zend_gc.h | 3 ++- Zend/zend_gdb.c | 3 ++- Zend/zend_gdb.h | 3 ++- Zend/zend_generators.c | 3 ++- Zend/zend_generators.h | 3 ++- Zend/zend_globals.h | 3 ++- Zend/zend_globals_macros.h | 3 ++- Zend/zend_hash.c | 3 ++- Zend/zend_hash.h | 3 ++- Zend/zend_highlight.c | 3 ++- Zend/zend_highlight.h | 3 ++- Zend/zend_inheritance.c | 3 ++- Zend/zend_inheritance.h | 3 ++- Zend/zend_ini.c | 3 ++- Zend/zend_ini.h | 3 ++- Zend/zend_ini_parser.y | 3 ++- Zend/zend_ini_scanner.h | 3 ++- Zend/zend_ini_scanner.l | 3 ++- Zend/zend_interfaces.c | 3 ++- Zend/zend_interfaces.h | 3 ++- Zend/zend_iterators.c | 3 ++- Zend/zend_iterators.h | 3 ++- Zend/zend_language_parser.y | 3 ++- Zend/zend_language_scanner.h | 3 ++- Zend/zend_language_scanner.l | 3 ++- Zend/zend_lazy_objects.c | 3 ++- Zend/zend_lazy_objects.h | 3 ++- Zend/zend_list.c | 3 ++- Zend/zend_list.h | 3 ++- Zend/zend_llist.c | 3 ++- Zend/zend_llist.h | 3 ++- Zend/zend_long.h | 3 ++- Zend/zend_map_ptr.h | 3 ++- Zend/zend_mmap.h | 3 ++- Zend/zend_modules.h | 3 ++- Zend/zend_multibyte.c | 3 ++- Zend/zend_multibyte.h | 3 ++- Zend/zend_multiply.h | 3 ++- Zend/zend_object_handlers.c | 3 ++- Zend/zend_object_handlers.h | 3 ++- Zend/zend_objects.c | 3 ++- Zend/zend_objects.h | 3 ++- Zend/zend_objects_API.c | 3 ++- Zend/zend_objects_API.h | 3 ++- Zend/zend_observer.c | 3 ++- Zend/zend_observer.h | 3 ++- Zend/zend_opcode.c | 3 ++- Zend/zend_operators.c | 3 ++- Zend/zend_operators.h | 3 ++- Zend/zend_portability.h | 3 ++- Zend/zend_property_hooks.c | 3 ++- Zend/zend_property_hooks.h | 3 ++- Zend/zend_ptr_stack.c | 3 ++- Zend/zend_ptr_stack.h | 3 ++- Zend/zend_range_check.h | 3 ++- Zend/zend_sort.c | 3 ++- Zend/zend_sort.h | 3 ++- Zend/zend_stack.c | 3 ++- Zend/zend_stack.h | 3 ++- Zend/zend_stream.c | 3 ++- Zend/zend_stream.h | 3 ++- Zend/zend_string.c | 3 ++- Zend/zend_string.h | 3 ++- Zend/zend_strtod.h | 3 ++- Zend/zend_strtod_int.h | 3 ++- Zend/zend_type_info.h | 3 ++- Zend/zend_types.h | 3 ++- Zend/zend_variables.c | 3 ++- Zend/zend_variables.h | 3 ++- Zend/zend_verify_type_inference.h | 3 ++- Zend/zend_vm.h | 3 ++- Zend/zend_vm_def.h | 3 ++- Zend/zend_vm_execute.h | 3 ++- Zend/zend_vm_gen.php | 6 ++++-- Zend/zend_vm_opcodes.c | 3 ++- Zend/zend_vm_opcodes.h | 3 ++- Zend/zend_vm_trace_handlers.h | 3 ++- Zend/zend_vm_trace_lines.h | 3 ++- Zend/zend_vm_trace_map.h | 3 ++- ext/standard/info.c | 5 +++-- sapi/cli/tests/019.phpt | 3 ++- 131 files changed, 264 insertions(+), 133 deletions(-) diff --git a/LICENSE b/LICENSE index e77e0f3baf13..ee42a57fffbb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Copyright © 1999–2026, The PHP Group and Contributors. -Copyright © 1999–2026, Zend by Perforce. +Copyright © 1999–2026, Zend Technologies Ltd., a subsidiary company of Perforce Software, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/Zend/zend.c b/Zend/zend.c index 0afa7d580ab9..f4236053af3d 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend.h b/Zend/zend.h index 24ba93d9d573..0d5303192b57 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_API.c b/Zend/zend_API.c index c4bbf17c905a..7c38779a564a 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 223a2b7c7535..17f7ce3263f8 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 08452ad5afbb..942a8b8e1309 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 3f263cd0b044..ff51c4fe8652 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_alloc_sizes.h b/Zend/zend_alloc_sizes.h index efb05bca4e19..f806056ad9d3 100644 --- a/Zend/zend_alloc_sizes.h +++ b/Zend/zend_alloc_sizes.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_arena.h b/Zend/zend_arena.h index 5e21e52aebbb..9b917a47e927 100644 --- a/Zend/zend_arena.h +++ b/Zend/zend_arena.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 165106b33a30..a7e26711cd17 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index 4a45d8b4f47b..32882f5205f7 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index 66917ba7bba4..71f0d788e921 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h index ef75e21c7fb2..c044ef073cc8 100644 --- a/Zend/zend_attributes.h +++ b/Zend/zend_attributes.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_autoload.c b/Zend/zend_autoload.c index bd154a1a85d5..2ca3d7eea022 100644 --- a/Zend/zend_autoload.c +++ b/Zend/zend_autoload.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_autoload.h b/Zend/zend_autoload.h index 3124076c39b2..84e6ab80b5af 100644 --- a/Zend/zend_autoload.h +++ b/Zend/zend_autoload.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_build.h b/Zend/zend_build.h index acddf8381da1..8ba7064042e3 100644 --- a/Zend/zend_build.h +++ b/Zend/zend_build.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 5a69660d98ad..1fe4bcf3ee50 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index 5c8d5002d651..018d0cdb1c1d 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_call_stack.c b/Zend/zend_call_stack.c index 8de1696a5314..aa23c2e3e2fa 100644 --- a/Zend/zend_call_stack.c +++ b/Zend/zend_call_stack.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_call_stack.h b/Zend/zend_call_stack.h index 35d3f6c4994a..c0b84334239d 100644 --- a/Zend/zend_call_stack.h +++ b/Zend/zend_call_stack.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 65cf6038160a..56090cddcafb 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index bb7a00c90f9b..2ff4934f2a3a 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 66ce34827815..78cc114223d0 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 502b96f93811..3b85d52c1870 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index befd7cefa18a..629d7b4437f2 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 5652d11e564c..18292203bee9 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index ed1428a1703b..9461ac764c90 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c index 9dc1621f61e8..6fc42ca39e6c 100644 --- a/Zend/zend_cpuinfo.c +++ b/Zend/zend_cpuinfo.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index e0f49c39f05e..2290a702475d 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index 8568c72f1342..cc534e04549d 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c index 05612afe03c1..1052022f3bed 100644 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_dtrace.d b/Zend/zend_dtrace.d index 00f6fff96709..9ff085031178 100644 --- a/Zend/zend_dtrace.d +++ b/Zend/zend_dtrace.d @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_dtrace.h b/Zend/zend_dtrace.h index c37dbfdb58be..ada77ce664e3 100644 --- a/Zend/zend_dtrace.h +++ b/Zend/zend_dtrace.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_enum.c b/Zend/zend_enum.c index 33b2f44243df..f175e3e6bcc9 100644 --- a/Zend/zend_enum.c +++ b/Zend/zend_enum.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_enum.h b/Zend/zend_enum.h index 12301712a23b..96c9317d47c0 100644 --- a/Zend/zend_enum.h +++ b/Zend/zend_enum.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h index 3f7efcde8676..831e4a9b912a 100644 --- a/Zend/zend_errors.h +++ b/Zend/zend_errors.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 1086031ff20d..d23fb647af9d 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index 5d167039f78b..f9b472598012 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 3d2ca115064d..a4871bc3bebd 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 960eeb2671c0..cb2c9e144801 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 315a00674d17..5bead7034b9a 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 7b87cd8daa58..4459c3015d15 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index e272d3d2ae6e..1e6887e444a6 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_fibers.c b/Zend/zend_fibers.c index bfb67f31c865..c91436050856 100644 --- a/Zend/zend_fibers.c +++ b/Zend/zend_fibers.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_fibers.h b/Zend/zend_fibers.h index 6c31aca4e088..d4726f97ddd2 100644 --- a/Zend/zend_fibers.h +++ b/Zend/zend_fibers.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_float.c b/Zend/zend_float.c index 5afd9251988a..12fd0fd74f7f 100644 --- a/Zend/zend_float.c +++ b/Zend/zend_float.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_float.h b/Zend/zend_float.h index 402a173412c7..12aa02005c2a 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_frameless_function.c b/Zend/zend_frameless_function.c index 79c0fb68fdc1..be390744fd92 100644 --- a/Zend/zend_frameless_function.c +++ b/Zend/zend_frameless_function.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_frameless_function.h b/Zend/zend_frameless_function.h index 8548c3a08e46..241507aa99e7 100644 --- a/Zend/zend_frameless_function.h +++ b/Zend/zend_frameless_function.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index e5309bf9a683..5de2b69bf568 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index bc5bd32da41c..b72b90ccd5ef 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_gdb.c b/Zend/zend_gdb.c index cbe0c95bf128..0c2a82a144c0 100644 --- a/Zend/zend_gdb.c +++ b/Zend/zend_gdb.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_gdb.h b/Zend/zend_gdb.h index fc6231e20265..554791f5255a 100644 --- a/Zend/zend_gdb.h +++ b/Zend/zend_gdb.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 9d7e3d047cbc..52d409f2e69b 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h index e36f09b0ffd8..73dd9ddc1f91 100644 --- a/Zend/zend_generators.h +++ b/Zend/zend_generators.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 7cab72c25bed..8257df32e831 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h index d485ea1ad3eb..bde10a0989d1 100644 --- a/Zend/zend_globals_macros.h +++ b/Zend/zend_globals_macros.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 6549d5542492..2913af9c2b5f 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index c015ec6fd4ed..6a695aeef449 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index 44ee64fe2991..a3c65932ca4d 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h index c25c1143276f..2e399f408063 100644 --- a/Zend/zend_highlight.h +++ b/Zend/zend_highlight.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 47312801e10e..b2c4de6b396b 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h index 6d19d694f18c..fdcbd95764b3 100644 --- a/Zend/zend_inheritance.h +++ b/Zend/zend_inheritance.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 8beda13f1be5..e4aec28c7b07 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index f33294a65842..16bc234d5849 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index ab118f684527..d35853ab5acd 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -4,7 +4,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index ad6e16b31481..c013564a10f4 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 1d192336902a..7fd51654ac82 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 5b0efff6d53e..49169dfca234 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index d6b733ab9110..3aeac4fc8146 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index 6070f324fa27..c05434486f89 100644 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index 5178cd66c2d1..973903768405 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 3549dda0f65e..b4dda00404ea 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -3,7 +3,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index f8315ea2c1ed..e502d91411b5 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 2a99c71b2718..07f2d44cb5c6 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_lazy_objects.c b/Zend/zend_lazy_objects.c index 7005582d72bc..a8316768ef5f 100644 --- a/Zend/zend_lazy_objects.c +++ b/Zend/zend_lazy_objects.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_lazy_objects.h b/Zend/zend_lazy_objects.h index c850e6553faa..8e66ee3facd6 100644 --- a/Zend/zend_lazy_objects.h +++ b/Zend/zend_lazy_objects.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_list.c b/Zend/zend_list.c index 15033d5cd276..4e96ce0ec7da 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_list.h b/Zend/zend_list.h index dbddadb9bb9b..108bd3fc3e7f 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index ee74700ea2a4..95ce31764bfc 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index dfce304af0a8..a92b8a59648c 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_long.h b/Zend/zend_long.h index 2b44b9d1540b..303bacd03d4c 100644 --- a/Zend/zend_long.h +++ b/Zend/zend_long.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_map_ptr.h b/Zend/zend_map_ptr.h index 308617eb8df0..af3b5178aa4a 100644 --- a/Zend/zend_map_ptr.h +++ b/Zend/zend_map_ptr.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_mmap.h b/Zend/zend_mmap.h index 6443300a8f15..d56196c24687 100644 --- a/Zend/zend_mmap.h +++ b/Zend/zend_mmap.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index 31c98f784c65..3a98b1c06e29 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index 713ce64dca29..28be8126b117 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h index 645293b743f9..41480ed6f86b 100644 --- a/Zend/zend_multibyte.h +++ b/Zend/zend_multibyte.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 6ca36bbc485e..6457f85f64fb 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index f6bd5ec177b0..d0b4590d4a02 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index f14f4b722cd9..ec71c427ffce 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index d74de714d55e..9fe46b6b6d2a 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h index 444673642515..44a8038a0fa7 100644 --- a/Zend/zend_objects.h +++ b/Zend/zend_objects.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 11ec0fd84852..537cad8a3644 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index 7df13a080f45..694ef398e374 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_observer.c b/Zend/zend_observer.c index 518a3b3bda8f..f5f90c3c1f13 100644 --- a/Zend/zend_observer.c +++ b/Zend/zend_observer.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_observer.h b/Zend/zend_observer.h index 03be4af9428e..f4ade29285db 100644 --- a/Zend/zend_observer.h +++ b/Zend/zend_observer.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index dce6f2d1aee9..0c6b22473514 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index cc9f8932c48e..8d861adb394e 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 93041b0c0e26..2dc6dbfbfc6d 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index caa7510975ba..e4d90058a699 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_property_hooks.c b/Zend/zend_property_hooks.c index 2c87b7123e44..dd6fe95ef57a 100644 --- a/Zend/zend_property_hooks.c +++ b/Zend/zend_property_hooks.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_property_hooks.h b/Zend/zend_property_hooks.h index c141398cdce3..9c88cccb0c07 100644 --- a/Zend/zend_property_hooks.h +++ b/Zend/zend_property_hooks.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index fe79d1ce7cd5..67cc836a240c 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index 15c92999238b..6a6376f79dae 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_range_check.h b/Zend/zend_range_check.h index fa82012ec23d..8db867434399 100644 --- a/Zend/zend_range_check.h +++ b/Zend/zend_range_check.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_sort.c b/Zend/zend_sort.c index cefddaefb2de..ac559141dd97 100644 --- a/Zend/zend_sort.c +++ b/Zend/zend_sort.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_sort.h b/Zend/zend_sort.h index ad51b4f47d94..03c63bb12e17 100644 --- a/Zend/zend_sort.h +++ b/Zend/zend_sort.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c index 63606956ffeb..d999d684d05d 100644 --- a/Zend/zend_stack.c +++ b/Zend/zend_stack.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h index afaf7b548ea5..66c90f0b5217 100644 --- a/Zend/zend_stack.h +++ b/Zend/zend_stack.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index d559b78a7fa7..0627ae145939 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index 16fb5516df3f..ed2bef941e2a 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_string.c b/Zend/zend_string.c index fc3aebb8b6ef..a9e1a7dea099 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 929800c73caf..430f4dec02e2 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h index 00fedcd02d92..fa557ed2a0c3 100644 --- a/Zend/zend_strtod.h +++ b/Zend/zend_strtod.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_strtod_int.h b/Zend/zend_strtod_int.h index 4a1a04e9671c..4de5c225ccd8 100644 --- a/Zend/zend_strtod_int.h +++ b/Zend/zend_strtod_int.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_type_info.h b/Zend/zend_type_info.h index 462ffb33cf10..1e0045558383 100644 --- a/Zend/zend_type_info.h +++ b/Zend/zend_type_info.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 9516d3225970..dc6ea2c800ee 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 71e3bd4db3f4..02c286ac486a 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index 90a5190ce435..9c6040a75bcb 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_verify_type_inference.h b/Zend/zend_verify_type_inference.h index bd80e1edbfcd..807bf21e3910 100644 --- a/Zend/zend_verify_type_inference.h +++ b/Zend/zend_verify_type_inference.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index cdbedd33545d..093b1158bd82 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 47d96929d1a3..391b82241e47 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 2440fe63426e..a2e5eac491dc 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 5135d81ece8c..cef44695be85 100755 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -4,7 +4,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | @@ -21,7 +22,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 427572091548..0ece3e6f0c66 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index dd1765a49b0c..b63177e2421e 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_trace_handlers.h b/Zend/zend_vm_trace_handlers.h index b11c6e159644..e7510f406711 100644 --- a/Zend/zend_vm_trace_handlers.h +++ b/Zend/zend_vm_trace_handlers.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_trace_lines.h b/Zend/zend_vm_trace_lines.h index f4565a362d76..8c194edbcde1 100644 --- a/Zend/zend_vm_trace_lines.h +++ b/Zend/zend_vm_trace_lines.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/Zend/zend_vm_trace_map.h b/Zend/zend_vm_trace_map.h index 1a1fac1f2058..18c705b454d5 100644 --- a/Zend/zend_vm_trace_map.h +++ b/Zend/zend_vm_trace_map.h @@ -2,7 +2,8 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright © Zend by Perforce and Contributors. | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ | This source file is subject to the Modified BSD License that is | | bundled with this package in the file LICENSE, and is available | diff --git a/ext/standard/info.c b/ext/standard/info.c index 558822cc67a2..9e716023568a 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1027,7 +1027,7 @@ PHPAPI ZEND_COLD void php_print_info(int flag) php_info_print("

\n"); php_info_print("

\n"); php_info_print("Copyright © The PHP Group and Contributors.
\n"); - php_info_print("Copyright © Zend by Perforce.\n"); + php_info_print("Copyright © Zend Technologies Ltd., a subsidiary company of Perforce Software, Inc.\n"); php_info_print("

\n"); php_info_print("

\n"); php_info_print("Redistribution and use in source and binary forms, with or without "); @@ -1064,7 +1064,8 @@ PHPAPI ZEND_COLD void php_print_info(int flag) php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); php_info_print("\n"); php_info_print("Copyright © The PHP Group and Contributors.\n"); - php_info_print("Copyright © Zend by Perforce.\n"); + php_info_print("Copyright © Zend Technologies Ltd., a subsidiary company of\n"); + php_info_print(" Perforce Software, Inc.\n"); php_info_print("\n"); php_info_print("Redistribution and use in source and binary forms, with or without\n"); php_info_print("modification, are permitted provided that the following conditions are met:\n"); diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index 6fde11668f11..fe5f95dbc34c 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -27,7 +27,8 @@ PHP is free software: you can redistribute it and/or modify it under the terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause): Copyright © The PHP Group and Contributors. -Copyright © Zend by Perforce. +Copyright © Zend Technologies Ltd., a subsidiary company of + Perforce Software, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From 06b3376eb3635ce4d591904318980dd91db75e0b Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 4 Feb 2026 21:03:30 -0600 Subject: [PATCH 214/300] license-update: revise license statement in phpinfo RFC: https://wiki.php.net/rfc/php_license_update --- ext/standard/info.c | 8 ++++---- sapi/cli/tests/019.phpt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/standard/info.c b/ext/standard/info.c index 9e716023568a..dcb01bc08220 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1022,8 +1022,8 @@ PHPAPI ZEND_COLD void php_print_info(int flag) SECTION("License"); php_info_print_box_start(0); php_info_print("

\n"); - php_info_print("PHP is free software: you can redistribute it and/or modify it under the "); - php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); + php_info_print("PHP is free software. You may redistribute it and/or modify it under the "); + php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause).\n"); php_info_print("

\n"); php_info_print("

\n"); php_info_print("Copyright © The PHP Group and Contributors.
\n"); @@ -1060,8 +1060,8 @@ PHPAPI ZEND_COLD void php_print_info(int flag) php_info_print("\n"); php_info_print("License\n"); php_info_print("\n"); - php_info_print("PHP is free software: you can redistribute it and/or modify it under the\n"); - php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause):\n"); + php_info_print("PHP is free software. You may redistribute it and/or modify it under the\n"); + php_info_print("terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause).\n"); php_info_print("\n"); php_info_print("Copyright © The PHP Group and Contributors.\n"); php_info_print("Copyright © Zend Technologies Ltd., a subsidiary company of\n"); diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index fe5f95dbc34c..4045c648ab0a 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -23,8 +23,8 @@ PHP Version => %s %a License -PHP is free software: you can redistribute it and/or modify it under the -terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause): +PHP is free software. You may redistribute it and/or modify it under the +terms of the Modified BSD License (SPDX-License-Identifier: BSD-3-Clause). Copyright © The PHP Group and Contributors. Copyright © Zend Technologies Ltd., a subsidiary company of From 361084086dd805a7111dad7316510ba7733d8b71 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 3 Apr 2026 20:06:51 -0500 Subject: [PATCH 215/300] license-update: update license header in ext/intl/rangeformatter sources RFC: https://wiki.php.net/rfc/php_license_update --- ext/intl/rangeformatter/rangeformatter_class.cpp | 14 +++++++------- ext/intl/rangeformatter/rangeformatter_class.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ext/intl/rangeformatter/rangeformatter_class.cpp b/ext/intl/rangeformatter/rangeformatter_class.cpp index 2042966177cb..e80e3bc02079 100644 --- a/ext/intl/rangeformatter/rangeformatter_class.cpp +++ b/ext/intl/rangeformatter/rangeformatter_class.cpp @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bogdan Ungureanu | +----------------------------------------------------------------------+ diff --git a/ext/intl/rangeformatter/rangeformatter_class.h b/ext/intl/rangeformatter/rangeformatter_class.h index 661641c2ce0f..6e911403be3f 100644 --- a/ext/intl/rangeformatter/rangeformatter_class.h +++ b/ext/intl/rangeformatter/rangeformatter_class.h @@ -1,12 +1,12 @@ /* +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | https://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | +----------------------------------------------------------------------+ | Authors: Bogdan Ungureanu | +----------------------------------------------------------------------+ From cef6fbe64cba619c77959d15b6e8115f5a7c7fc6 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 12 Apr 2026 16:44:21 +0530 Subject: [PATCH 216/300] Decrease zend.max_allowed_stack_size in stack_limit_015.phpt With the stack size of 128K the compile-time stack guard does not fire on 32bit Windows tests, reducing it to 64K Closes GH-21736 --- Zend/tests/stack_limit/stack_limit_015.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/tests/stack_limit/stack_limit_015.phpt b/Zend/tests/stack_limit/stack_limit_015.phpt index b725523b7840..88ff544e9f33 100644 --- a/Zend/tests/stack_limit/stack_limit_015.phpt +++ b/Zend/tests/stack_limit/stack_limit_015.phpt @@ -9,7 +9,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_ --EXTENSIONS-- zend_test --INI-- -zend.max_allowed_stack_size=128K +zend.max_allowed_stack_size=64K --FILE-- Date: Sun, 12 Apr 2026 15:42:42 +0200 Subject: [PATCH 217/300] [ci skip] Update EXTENSIONS status and update CODEOWNERS --- .github/CODEOWNERS | 11 +---------- EXTENSIONS | 18 +++++++++--------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 99e4030a9326..3b6d79ae8a4e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,18 +16,16 @@ /.github @TimWolla /build/gen_stub.php @kocsismate -/ext/bcmath @Girgias @ndossche @SakiTakamachi +/ext/bcmath @Girgias @SakiTakamachi /ext/curl @adoy /ext/date @derickr /ext/dba @Girgias -/ext/dom @ndossche /ext/ffi @dstogov /ext/gd @devnexen /ext/gettext @devnexen /ext/gmp @Girgias /ext/intl @devnexen /ext/json @bukka -/ext/libxml @ndossche /ext/mbstring @alexdowad @youkidearitai /ext/mysqli @bukka @kamil-tekiela /ext/mysqlnd @bukka @kamil-tekiela @SakiTakamachi @@ -46,16 +44,9 @@ /ext/random @TimWolla @zeriyoshi /ext/reflection @DanielEScherzer /ext/session @Girgias -/ext/simplexml @ndossche -/ext/soap @ndossche /ext/sockets @devnexen /ext/spl @Girgias /ext/standard @bukka -/ext/tidy @ndossche -/ext/xml @ndossche -/ext/xmlreader @ndossche -/ext/xmlwriter @ndossche -/ext/xsl @ndossche /main @bukka /sapi/fpm @bukka /Zend/Optimizer @dstogov diff --git a/EXTENSIONS b/EXTENSIONS index e1eee3c0239c..effe8b8cbce2 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -171,56 +171,56 @@ PRIMARY MAINTAINER: Christian Stocker (2003 - 2011) Rob Richards (2003 - 2012) Marcus Börger (2003 - 2006) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- EXTENSION: simplexml PRIMARY MAINTAINER: Marcus Börger (2003 - 2008) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- EXTENSION: soap PRIMARY MAINTAINER: Dmitry Stogov (2004 - 2018) Nora Dossche (2024 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xml PRIMARY MAINTAINER: Thies C. Arntzen (1999 - 2002) Rob Richards (2003 - 2013) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: libxml PRIMARY MAINTAINER: Rob Richards (2003 - 2009) Christian Stocker (2004 - 2011) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xmlreader PRIMARY MAINTAINER: Rob Richards (2004 - 2010) Christian Stocker (2004 - 2004) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xmlwriter PRIMARY MAINTAINER: Rob Richards (2004 - 2010) Pierre-Alain Joye (2005-2009) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: xsl PRIMARY MAINTAINER: Christian Stocker (2003 - 2011) Rob Richards (2003 - 2010) Nora Dossche (2023 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working SINCE: 5.0 ------------------------------------------------------------------------------- @@ -487,7 +487,7 @@ PRIMARY MAINTAINER: John Coggeshall (2003 - 2006) Ilia Alshanetsky (2003 - 2009) Nuno Lopes (2006 - 2012) Nora Dossche (2025 - 2026) -MAINTENANCE: Odd fixes +MAINTENANCE: Orphan STATUS: Working ------------------------------------------------------------------------------- EXTENSION: tokenizer From 5e6b90e2cc018e032ed83dc23dbf4b1534401bba Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 12 Apr 2026 12:43:19 -0400 Subject: [PATCH 218/300] Fix GH-21730: Mt19937::__debugInfo() leaks state HashTable when the serialize callback fails (#21733) Mt19937::__debugInfo() allocates a temporary HashTable with array_init(&t), calls the engine's serialize callback, and then inserts t into the return value. If the callback returns false, the method throws and hits RETURN_THROWS() before inserting t, so the HashTable leaks. PcgOneseq128XslRr64 and Xoshiro256StarStar alias the same method and share the leak. Niels Dossche fixed the same pattern in __serialize() via GH-20383 (720e0069829). That cleanup didn't touch __debugInfo(). Apply the same reordering here: insert t into return_value first, then let the callback populate it. RETURN_THROWS() then unwinds the return value cleanly. The path is latent in stock PHP because the three built-in serialize callbacks (mt19937, pcg, xoshiro) all return true, so no user code reaches the leak today. I'm fixing it for symmetry with GH-20383 and to keep the pattern from regressing if a future engine grows a failing serialize path. Closes GH-21730 --- ext/random/engine_mt19937.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/random/engine_mt19937.c b/ext/random/engine_mt19937.c index 640099909103..b76e89ac1d6e 100644 --- a/ext/random/engine_mt19937.c +++ b/ext/random/engine_mt19937.c @@ -392,11 +392,11 @@ PHP_METHOD(Random_Engine_Mt19937, __debugInfo) if (engine->engine.algo->serialize) { array_init(&t); + zend_hash_str_add(Z_ARR_P(return_value), "__states", strlen("__states"), &t); if (!engine->engine.algo->serialize(engine->engine.state, Z_ARRVAL(t))) { zend_throw_exception(NULL, "Engine serialize failed", 0); RETURN_THROWS(); } - zend_hash_str_add(Z_ARR_P(return_value), "__states", strlen("__states"), &t); } } /* }}} */ From 1a428e528f9c67d67e0b6bff5b036e04f9f9203e Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 12 Apr 2026 13:51:30 -0400 Subject: [PATCH 219/300] Fix GH-21731: Random\Engine\Xoshiro256StarStar::__unserialize() accepts all-zero state (#21732) The constructor rejects a seed that would leave the internal state all zero, because xoshiro256** with zero state produces 0 on every call forever. The unserialize callback didn't check the same invariant. A caller feeding a crafted serialized payload through __unserialize() ended up with a live engine that returned 0 from every operation. Match the constructor: reject the all-zero state from the unserialize callback too. The Mt19937-aliased __unserialize() wrapper turns the false return into the standard "Invalid serialization data" exception. Closes GH-21731 --- NEWS | 4 ++++ ext/random/engine_xoshiro256starstar.c | 4 ++++ .../xoshiro256starstar_unserialize_zero_state.phpt | 14 ++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt diff --git a/NEWS b/NEWS index 07653ef6a37f..24846881de96 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,10 @@ PHP NEWS - OpenSSL: . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) +- Random: + . Fixed bug GH-21731 (Random\Engine\Xoshiro256StarStar::__unserialize() + accepts all-zero state). (iliaal) + - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) diff --git a/ext/random/engine_xoshiro256starstar.c b/ext/random/engine_xoshiro256starstar.c index 1a054362f065..12db8198978d 100644 --- a/ext/random/engine_xoshiro256starstar.c +++ b/ext/random/engine_xoshiro256starstar.c @@ -151,6 +151,10 @@ static bool unserialize(void *state, HashTable *data) } } + if (UNEXPECTED(s->state[0] == 0 && s->state[1] == 0 && s->state[2] == 0 && s->state[3] == 0)) { + return false; + } + return true; } diff --git a/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt b/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt new file mode 100644 index 000000000000..6ebcd03e8570 --- /dev/null +++ b/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt @@ -0,0 +1,14 @@ +--TEST-- +GH-21731: Xoshiro256StarStar::__unserialize() must reject the all-zero state +--FILE-- +getMessage(), PHP_EOL; +} + +?> +--EXPECT-- +Invalid serialization data for Random\Engine\Xoshiro256StarStar object From f90e532f368745a2a8128100a69175a0a806ea9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 12 Apr 2026 19:53:12 +0200 Subject: [PATCH 220/300] Fix order in NEWS --- NEWS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 338e14bee080..9da98b15f204 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,10 @@ PHP NEWS - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) +- DOM: + . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns + declarations after setAttributeNS()). (David Carlier) + - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) @@ -29,10 +33,6 @@ PHP NEWS . Fix memory leak regression in openssl_pbkdf2(). (ndossche) . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) -- DOM: - . Fixed bug GH-21566 (Dom\XMLDocument::C14N() emits duplicate xmlns - declarations after setAttributeNS()). (David Carlier) - - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) From e5850340f49eab3853f9ee693cfd45d8513eb949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20=27Marc=C3=A3o=27=20Aurelio?= Date: Mon, 13 Apr 2026 07:15:05 -0300 Subject: [PATCH 221/300] Fix GH-21699: callable resolution must fail if error handler threw during self/parent/static deprecations (#21712) When resolving string callables using self::, parent::, or static::, zend_is_callable_check_class() emits E_DEPRECATED. If the user error handler throws, EG(exception) is set but the function could still return true, leading to trampoline allocation and a failed assertion in shutdown_executor(). Return false from zend_is_callable_check_class() when EG(exception) is set after handling. --- NEWS | 2 ++ Zend/tests/gh16799.phpt | 7 ++++++- Zend/tests/gh_21699.phpt | 31 +++++++++++++++++++++++++++++++ Zend/tests/gh_21699_parent.phpt | 32 ++++++++++++++++++++++++++++++++ Zend/tests/gh_21699_static.phpt | 31 +++++++++++++++++++++++++++++++ Zend/zend_API.c | 4 ++++ 6 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/gh_21699.phpt create mode 100644 Zend/tests/gh_21699_parent.phpt create mode 100644 Zend/tests/gh_21699_static.phpt diff --git a/NEWS b/NEWS index 24846881de96..a09ef9491f08 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS . Fixed bug GH-21478 (Forward property operations to real instance for initialized lazy proxies). (iliaal) . Fixed bug GH-21605 (Missing addref for Countable::count()). (ilutov) + . Fixed bug GH-21699 (Assertion failure in shutdown_executor when resolving + self::/parent::/static:: callables if the error handler throws). - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) diff --git a/Zend/tests/gh16799.phpt b/Zend/tests/gh16799.phpt index ce1dbd5b1655..d31d1a5705c6 100644 --- a/Zend/tests/gh16799.phpt +++ b/Zend/tests/gh16799.phpt @@ -15,7 +15,12 @@ Test::test(); --EXPECTF-- Fatal error: Uncaught Exception: Use of "static" in callables is deprecated in %s:%d Stack trace: -#0 %s(%d): {closure:%s:%d}(8192, 'Use of "static"...', %s, %d) +#0 %s(%d): {closure:%s}(8192, 'Use of "static"%s', '%s', %d) #1 %s(%d): Test::test() #2 {main} + +Next TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, (null) in %s:%d +Stack trace: +#0 %s(%d): Test::test() +#1 {main} thrown in %s on line %d diff --git a/Zend/tests/gh_21699.phpt b/Zend/tests/gh_21699.phpt new file mode 100644 index 000000000000..49b58365dabf --- /dev/null +++ b/Zend/tests/gh_21699.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-21699: Assertion failure in shutdown_executor when error handler throws during self:: callable resolution +--FILE-- +test(); +?> +--EXPECTF-- +Fatal error: Uncaught Exception in %s:%d +Stack trace: +#0 %s(%d): {closure:%s}(%d, 'Use of "self" i%s', '%s', %d) +#1 %s(%d): bar->test() +#2 {main} + +Next TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, (null) in %s:%d +Stack trace: +#0 %s(%d): bar->test() +#1 {main} + thrown in %s on line %d diff --git a/Zend/tests/gh_21699_parent.phpt b/Zend/tests/gh_21699_parent.phpt new file mode 100644 index 000000000000..73cae41f3f5b --- /dev/null +++ b/Zend/tests/gh_21699_parent.phpt @@ -0,0 +1,32 @@ +--TEST-- +GH-21699 (parent::): no shutdown_executor trampoline assertion when error handler throws during parent:: callable resolution +--FILE-- +test(); +?> +--EXPECTF-- +Fatal error: Uncaught Exception in %s:%d +Stack trace: +#0 %s(%d): {closure:%s}(%d, 'Use of "parent"%s', '%s', %d) +#1 %s(%d): Child->test() +#2 {main} + +Next TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, (null) in %s:%d +Stack trace: +#0 %s(%d): Child->test() +#1 {main} + thrown in %s on line %d diff --git a/Zend/tests/gh_21699_static.phpt b/Zend/tests/gh_21699_static.phpt new file mode 100644 index 000000000000..4d9604ebe77b --- /dev/null +++ b/Zend/tests/gh_21699_static.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-21699 (static::): no shutdown_executor trampoline assertion when error handler throws during static:: callable resolution +--FILE-- +test(); +?> +--EXPECTF-- +Fatal error: Uncaught Exception in %s:%d +Stack trace: +#0 %s(%d): {closure:%s}(%d, 'Use of "static"%s', '%s', %d) +#1 %s(%d): bar->test() +#2 {main} + +Next TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, (null) in %s:%d +Stack trace: +#0 %s(%d): bar->test() +#1 {main} + thrown in %s on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e529c48b5ac2..3c9891a00e92 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3849,6 +3849,10 @@ static bool zend_is_callable_check_class(zend_string *name, zend_class_entry *sc if (error) zend_spprintf(error, 0, "class \"%.*s\" not found", (int)name_len, ZSTR_VAL(name)); } ZSTR_ALLOCA_FREE(lcname, use_heap); + /* User error handlers may throw from deprecations above; do not report callable as valid. */ + if (UNEXPECTED(EG(exception))) { + return false; + } return ret; } /* }}} */ From d64eb790f6aa63bdc23dd2788630afc50ce4a387 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Apr 2026 11:16:07 +0100 Subject: [PATCH 222/300] Fix-up NEWS --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a09ef9491f08..6c284c501b0a 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ PHP NEWS initialized lazy proxies). (iliaal) . Fixed bug GH-21605 (Missing addref for Countable::count()). (ilutov) . Fixed bug GH-21699 (Assertion failure in shutdown_executor when resolving - self::/parent::/static:: callables if the error handler throws). + self::/parent::/static:: callables if the error handler throws). (macoaure) - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) From 08dad097025bddd5a6d11cd864866a25b0966e67 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 13 Apr 2026 06:35:20 -0400 Subject: [PATCH 223/300] Fix GH-8561, GH-8562, GH-8563, GH-8564: SplFileObject iterator desync (#21679) * Fix GH-8562: SplFileObject::current() returns wrong value after next() SplFileObject::next() without READ_AHEAD cleared the cached line and incremented current_line_num but didn't advance the stream. When called without a preceding current() (e.g. rewind() then next()), the stream position stayed put, so the subsequent current() read stale data. Read a line to advance the stream when next() is called with no cached line. Closes GH-8562 * Fix GH-8561: SplFileObject key()/current() desync after fgets() fgets() read a line into the cache and incremented the line counter, but left the cached line in place. The subsequent current() returned the stale cached value instead of reading the next line from the stream's actual position. Clear the cached line after fgets() copies it to the return value. This forces current() to re-read from the stream, which has already advanced past the fgets'd line. Closes GH-8561 * Fix GH-8563, GH-8564: SplFileObject EOF handling for seek() and next() spl_filesystem_file_read_ex() treated a NULL buffer from php_stream_get_line as a successful read of an empty line, creating a phantom cached line at EOF. This caused seek() to give inconsistent results between SplFileObject and SplTempFileObject (GH-8563), and next() to increment the line counter indefinitely past EOF (GH-8564). Return FAILURE when php_stream_get_line returns NULL, matching the behavior of the existing php_stream_eof check. In seek(), break out of the loop on EOF instead of returning, so the post-loop cleanup runs consistently. In next(), return early at EOF without incrementing. Make __toString() return empty string at EOF instead of throwing. Closes GH-8563 Closes GH-8564 * Refine fgets() to reuse cached line when present When current() reads a line into the cache without advancing line_num, a subsequent fgets() would re-read the stream and return the next line, skipping the cached one and leaving key() out of sync with current() for the rest of the iteration. Use the cached line if present; otherwise read a fresh line. Either way, advance line_num by one. --- ext/spl/spl_directory.c | 51 ++++++++++++------- .../SplFileObject_key_error001.phpt | 2 +- .../SplFileObject_key_error002.phpt | 2 +- ext/spl/tests/SplFileObject/bug81477.phpt | 1 - .../SplFileObject/fgetcsv_blank_file.phpt | 5 +- ext/spl/tests/SplFileObject/gh8561.phpt | 30 +++++++++++ ext/spl/tests/SplFileObject/gh8563.phpt | 29 +++++++++++ ext/spl/tests/SplFileObject/gh8564.phpt | 20 ++++++++ ext/spl/tests/gh13685.phpt | 4 +- ext/spl/tests/gh8562.phpt | 27 ++++++++++ 10 files changed, 144 insertions(+), 27 deletions(-) create mode 100644 ext/spl/tests/SplFileObject/gh8561.phpt create mode 100644 ext/spl/tests/SplFileObject/gh8563.phpt create mode 100644 ext/spl/tests/SplFileObject/gh8564.phpt create mode 100644 ext/spl/tests/gh8562.phpt diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index cae8ffabc672..1468cec6ccf3 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1811,21 +1811,24 @@ static zend_result spl_filesystem_file_read_ex(spl_filesystem_object *intern, bo } if (!buf) { - intern->u.file.current_line = ZSTR_EMPTY_ALLOC(); - } else { - if (!csv && SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_DROP_NEW_LINE)) { - if (line_len > 0 && buf[line_len - 1] == '\n') { + if (!silent) { + spl_filesystem_file_cannot_read(intern); + } + return FAILURE; + } + + if (!csv && SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_DROP_NEW_LINE)) { + if (line_len > 0 && buf[line_len - 1] == '\n') { + line_len--; + if (line_len > 0 && buf[line_len - 1] == '\r') { line_len--; - if (line_len > 0 && buf[line_len - 1] == '\r') { - line_len--; - } - buf[line_len] = '\0'; } + buf[line_len] = '\0'; } - - intern->u.file.current_line = zend_string_init(buf, line_len, /* persistent */ false); - efree(buf); } + + intern->u.file.current_line = zend_string_init(buf, line_len, /* persistent */ false); + efree(buf); intern->u.file.current_line_num += line_add; return SUCCESS; @@ -2091,10 +2094,17 @@ PHP_METHOD(SplFileObject, fgets) CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); - if (spl_filesystem_file_read_ex(intern, /* silent */ false, /* line_add */ 1, /* csv */ false) == FAILURE) { - RETURN_THROWS(); + if (intern->u.file.current_line) { + RETVAL_STR_COPY(intern->u.file.current_line); + spl_filesystem_file_free_line(intern); + intern->u.file.current_line_num++; + } else { + if (spl_filesystem_file_read_ex(intern, /* silent */ false, /* line_add */ 1, /* csv */ false) == FAILURE) { + RETURN_THROWS(); + } + RETVAL_STR_COPY(intern->u.file.current_line); + spl_filesystem_file_free_line(intern); } - RETURN_STR_COPY(intern->u.file.current_line); } /* }}} */ /* {{{ Return current line from file */ @@ -2140,6 +2150,12 @@ PHP_METHOD(SplFileObject, next) ZEND_PARSE_PARAMETERS_NONE(); + if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) { + if (spl_filesystem_file_read_line(ZEND_THIS, intern, true) == FAILURE) { + return; + } + } + spl_filesystem_file_free_line(intern); if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { spl_filesystem_file_read_line(ZEND_THIS, intern, true); @@ -2627,7 +2643,7 @@ PHP_METHOD(SplFileObject, seek) for (i = 0; i < line_pos; i++) { if (spl_filesystem_file_read_line(ZEND_THIS, intern, true) == FAILURE) { - return; + break; } } if (line_pos > 0 && !SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { @@ -2646,9 +2662,8 @@ PHP_METHOD(SplFileObject, __toString) if (!intern->u.file.current_line) { ZEND_ASSERT(Z_ISUNDEF(intern->u.file.current_zval)); - zend_result result = spl_filesystem_file_read_line(ZEND_THIS, intern, false); - if (UNEXPECTED(result != SUCCESS)) { - RETURN_THROWS(); + if (spl_filesystem_file_read_line(ZEND_THIS, intern, true) == FAILURE) { + RETURN_EMPTY_STRING(); } } diff --git a/ext/spl/tests/SplFileObject/SplFileObject_key_error001.phpt b/ext/spl/tests/SplFileObject/SplFileObject_key_error001.phpt index 0c21d0b905e9..7d0e3ae8d969 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_key_error001.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_key_error001.phpt @@ -18,5 +18,5 @@ var_dump($s->key()); var_dump($s->valid()); ?> --EXPECT-- -int(14) +int(12) bool(false) diff --git a/ext/spl/tests/SplFileObject/SplFileObject_key_error002.phpt b/ext/spl/tests/SplFileObject/SplFileObject_key_error002.phpt index 8fc9b7fef0a5..0834dbc0524f 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_key_error002.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_key_error002.phpt @@ -18,5 +18,5 @@ var_dump($s->key()); var_dump($s->valid()); ?> --EXPECT-- -int(13) +int(12) bool(false) diff --git a/ext/spl/tests/SplFileObject/bug81477.phpt b/ext/spl/tests/SplFileObject/bug81477.phpt index f7730a791aa0..421c74dc4d68 100644 --- a/ext/spl/tests/SplFileObject/bug81477.phpt +++ b/ext/spl/tests/SplFileObject/bug81477.phpt @@ -21,7 +21,6 @@ string(8) "baz,bat " string(10) "more,data " -string(0) "" --CLEAN-- rewind(); var_dump($file->fgetcsv()); ?> --EXPECT-- -array(1) { - [0]=> - NULL -} +bool(false) bool(false) diff --git a/ext/spl/tests/SplFileObject/gh8561.phpt b/ext/spl/tests/SplFileObject/gh8561.phpt new file mode 100644 index 000000000000..adf36afb8b29 --- /dev/null +++ b/ext/spl/tests/SplFileObject/gh8561.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-8561 (SplFileObject: key() and current() unsynchronized after fgets()) +--FILE-- +fwrite("line {$i}" . PHP_EOL); +} + +// Case 1: rewind + fgets, then key/current +$file->rewind(); +$file->fgets(); +echo "After rewind+fgets: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; + +// Case 2: multiple fgets +$file->rewind(); +$file->fgets(); +$file->fgets(); +echo "After rewind+fgets+fgets: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; + +// Case 3: current then fgets +$file->rewind(); +$file->current(); +$file->fgets(); +echo "After current+fgets: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; +?> +--EXPECT-- +After rewind+fgets: key=1 current=line 1 +After rewind+fgets+fgets: key=2 current=line 2 +After current+fgets: key=1 current=line 1 diff --git a/ext/spl/tests/SplFileObject/gh8563.phpt b/ext/spl/tests/SplFileObject/gh8563.phpt new file mode 100644 index 000000000000..03891750f8bf --- /dev/null +++ b/ext/spl/tests/SplFileObject/gh8563.phpt @@ -0,0 +1,29 @@ +--TEST-- +GH-8563 (Different results for seek() on SplFileObject and SplTempFileObject) +--FILE-- +fwrite("line {$i}" . PHP_EOL); + $file_02->fwrite("line {$i}" . PHP_EOL); +} + +$file_01->rewind(); +$file_02->rewind(); + +$file_01->seek(10); +$file_02->seek(10); + +echo 'SplFileObject: ' . $file_01->key() . "\n"; +echo 'SplTempFileObject: ' . $file_02->key() . "\n"; +?> +--CLEAN-- + +--EXPECT-- +SplFileObject: 5 +SplTempFileObject: 5 diff --git a/ext/spl/tests/SplFileObject/gh8564.phpt b/ext/spl/tests/SplFileObject/gh8564.phpt new file mode 100644 index 000000000000..ff16893c4c6b --- /dev/null +++ b/ext/spl/tests/SplFileObject/gh8564.phpt @@ -0,0 +1,20 @@ +--TEST-- +GH-8564 (SplFileObject: next() moves to nonexistent indexes) +--FILE-- +fwrite("line {$i}" . PHP_EOL); +} + +$file->rewind(); +for ($i = 0; $i < 10; $file->next(), $i++); +echo "next() 10x: key=" . $file->key() . " valid=" . var_export($file->valid(), true) . "\n"; + +$file->rewind(); +$file->seek(10); +echo "seek(10): key=" . $file->key() . " valid=" . var_export($file->valid(), true) . "\n"; +?> +--EXPECT-- +next() 10x: key=5 valid=false +seek(10): key=5 valid=false diff --git a/ext/spl/tests/gh13685.phpt b/ext/spl/tests/gh13685.phpt index 0f679d0e93fc..2bdddec4584e 100644 --- a/ext/spl/tests/gh13685.phpt +++ b/ext/spl/tests/gh13685.phpt @@ -44,9 +44,9 @@ try { string(14) ""A", "B", "C" " string(13) ""D", "E", "F"" -Cannot read from file php://temp +string(0) "" --- Use csv control --- string(14) ""A", "B", "C" " string(13) ""D", "E", "F"" -Cannot read from file php://temp +string(0) "" diff --git a/ext/spl/tests/gh8562.phpt b/ext/spl/tests/gh8562.phpt new file mode 100644 index 000000000000..40b2554f5794 --- /dev/null +++ b/ext/spl/tests/gh8562.phpt @@ -0,0 +1,27 @@ +--TEST-- +GH-8562 (SplFileObject::current() returns wrong result after call to next()) +--FILE-- +fwrite("line {$i}" . PHP_EOL); +} + +$file->rewind(); +$file->next(); +echo "After rewind+next: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; + +$file->rewind(); +$file->next(); +$file->next(); +echo "After rewind+next+next: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; + +$file->rewind(); +$file->current(); +$file->next(); +echo "After current+next: key=" . $file->key() . " current=" . trim($file->current()) . "\n"; +?> +--EXPECT-- +After rewind+next: key=1 current=line 1 +After rewind+next+next: key=2 current=line 2 +After current+next: key=1 current=line 1 From 159b4ee08602774fa64671e86e8bb4381ca74fbb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 13 Apr 2026 11:37:59 +0100 Subject: [PATCH 224/300] Add NEWS entry for SplFileObject iterator fixes --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index a7ad6778875b..f5c9cfa75502 100644 --- a/NEWS +++ b/NEWS @@ -133,6 +133,8 @@ PHP NEWS - SPL: . DirectoryIterator key can now work better with filesystem supporting larger directory indexing. (David Carlier) + . Fix bugs GH-8561, GH-8562, GH-8563, and GH-8564 (Fixing various + SplFileObject iterator desync bugs). (iliaal) - Sqlite3: . Fix NUL byte truncation in sqlite3 TEXT column handling. (ndossche) From d0167e73e9a8d808b85b3b6aba00d16216459b1f Mon Sep 17 00:00:00 2001 From: Pratik Bhujel Date: Mon, 13 Apr 2026 17:32:23 +0545 Subject: [PATCH 225/300] ext/snmp: rename argument and variables to be more consistent and informative (#21723) --- ext/snmp/snmp.c | 137 +++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 66 deletions(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 9b520bce902c..ecea48883d52 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -654,7 +654,7 @@ static void php_free_objid_query(struct objid_query *objid_query, HashTable* oid static bool php_snmp_parse_oid( zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht, zend_string *type_str, HashTable *type_ht, zend_string *value_str, HashTable *value_ht, - uint32_t oid_argument_offset, uint32_t type_argument_offset, uint32_t value_argument_offset + uint32_t oid_arg_num, uint32_t type_arg_num, uint32_t value_arg_num ) { char *pptr; uint32_t idx_type = 0, idx_value = 0; @@ -681,7 +681,7 @@ static bool php_snmp_parse_oid( ZEND_ASSERT(type_str && value_str); if (ZSTR_LEN(type_str) != 1) { - zend_argument_value_error(type_argument_offset, "must be a single character"); + zend_argument_value_error(type_arg_num, "must be a single character"); efree(objid_query->vars); return false; } @@ -692,7 +692,7 @@ static bool php_snmp_parse_oid( objid_query->count++; } else if (oid_ht) { /* we got objid array */ if (zend_hash_num_elements(oid_ht) == 0) { - zend_argument_value_error(oid_argument_offset, "must not be empty when passed as an array"); + zend_argument_value_error(oid_arg_num, "must not be empty when passed as an array"); return false; } objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht), 0); @@ -737,14 +737,14 @@ static bool php_snmp_parse_oid( char ptype = *ZSTR_VAL(type); zend_string_release(type); if (len != 1) { - zend_argument_value_error(type_argument_offset, "must be a single character"); + zend_argument_value_error(type_arg_num, "must be a single character"); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } objid_query->vars[objid_query->count].type = ptype; idx_type++; } else { - zend_argument_value_error(type_argument_offset, "must contain a type for object ID '%s'", ZSTR_VAL(tmp)); + zend_argument_value_error(type_arg_num, "must contain a type for object ID '%s'", ZSTR_VAL(tmp)); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } @@ -779,7 +779,7 @@ static bool php_snmp_parse_oid( objid_query->vars[objid_query->count].value = ZSTR_VAL(tmp); idx_value++; } else { - zend_argument_value_error(value_argument_offset, "must contain a value for object ID '%s'", ZSTR_VAL(tmp)); + zend_argument_value_error(value_arg_num, "must contain a value for object ID '%s'", ZSTR_VAL(tmp)); php_free_objid_query(objid_query, oid_ht, value_ht, st); return false; } @@ -826,7 +826,7 @@ static bool php_snmp_parse_oid( /* {{{ snmp_session_init allocates memory for session and session->peername, caller should free it manually using snmp_session_free() and efree() */ -static bool snmp_session_init(php_snmp_session **session_p, int version, zend_string *hostname, zend_string *community, zend_long timeout, zend_long retries, int hostname_argument_offset, int timeout_argument_offset) +static bool snmp_session_init(php_snmp_session **session_p, int version, zend_string *hostname, zend_string *community, zend_long timeout, zend_long retries, uint32_t hostname_arg_num, uint32_t timeout_arg_num) { php_snmp_session *session; char *pptr, *host_ptr; @@ -841,23 +841,23 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st ZEND_ASSERT(community != NULL); if (ZSTR_LEN(hostname) >= MAX_NAME_LEN) { - zend_argument_value_error(hostname_argument_offset, "length must be lower than %d", MAX_NAME_LEN); + zend_argument_value_error(hostname_arg_num, "length must be lower than %d", MAX_NAME_LEN); return false; } if (ZSTR_LEN(community) == 0) { - zend_argument_must_not_be_empty_error(hostname_argument_offset + 1); + zend_argument_must_not_be_empty_error(hostname_arg_num + 1); return false; } - if (timeout_argument_offset != -1) { + if (timeout_arg_num != 0) { if (timeout < -1 || timeout > LONG_MAX) { - zend_argument_value_error(timeout_argument_offset, "must be between -1 and %ld", LONG_MAX); + zend_argument_value_error(timeout_arg_num, "must be between -1 and %ld", LONG_MAX); return false; } if (retries < -1 || retries > INT_MAX) { - zend_argument_value_error(timeout_argument_offset + 1, "must be between -1 and %d", INT_MAX); + zend_argument_value_error(timeout_arg_num + 1, "must be between -1 and %d", INT_MAX); return false; } } @@ -888,14 +888,14 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st char *pport = pptr + 2; tmp_port = atoi(pport); if (tmp_port < 0 || tmp_port > USHRT_MAX) { - zend_argument_value_error(hostname_argument_offset, "remote port must be between 0 and %u", USHRT_MAX); + zend_argument_value_error(hostname_arg_num, "remote port must be between 0 and %u", USHRT_MAX); return false; } remote_port = (unsigned short)tmp_port; } *pptr = '\0'; } else { - zend_argument_value_error(hostname_argument_offset, "has a malformed IPv6 address, closing square bracket missing"); + zend_argument_value_error(hostname_arg_num, "has a malformed IPv6 address, closing square bracket missing"); return false; } } else { /* IPv4 address */ @@ -903,7 +903,7 @@ static bool snmp_session_init(php_snmp_session **session_p, int version, zend_st char *pport = pptr + 1; tmp_port = atoi(pport); if (tmp_port < 0 || tmp_port > USHRT_MAX) { - zend_argument_value_error(hostname_argument_offset, "remote port must be between 0 and %u", USHRT_MAX); + zend_argument_value_error(hostname_arg_num, "remote port must be between 0 and %u", USHRT_MAX); return false; } remote_port = (unsigned short)tmp_port; @@ -1112,13 +1112,13 @@ static ZEND_ATTRIBUTE_NONNULL bool snmp_session_gen_sec_key(struct snmp_session /* }}} */ /* {{{ Set context Engine Id in the snmpv3 session */ -static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string * contextEngineID, uint32_t contextEngineID_argument_offset) +static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string *contextEngineID, uint32_t context_engine_id_arg_num) { size_t ebuf_len = 32, eout_len = 0; uint8_t *ebuf = (uint8_t *) emalloc(ebuf_len); if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, ZSTR_VAL(contextEngineID))) { - zend_argument_value_error(contextEngineID_argument_offset, "must be a valid context engine ID"); + zend_argument_value_error(context_engine_id_arg_num, "must be a valid context engine ID"); efree(ebuf); return false; } @@ -1134,13 +1134,13 @@ static bool snmp_session_set_contextEngineID(struct snmp_session *s, zend_string /* }}} */ /* {{{ Set all snmpv3-related security options - * auth_protocol_argnum and contextEngineID_argument_offset are the userland + * auth_protocol_arg_num and context_engine_id_arg_num are the userland * argument numbers used for error reporting. */ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp_session *session, zend_string *sec_level, zend_string *auth_protocol, zend_string *auth_passphrase, zend_string *priv_protocol, zend_string *priv_passphrase, zend_string *contextName, zend_string *contextEngineID, - uint32_t auth_protocol_argnum, uint32_t contextEngineID_argument_offset) + uint32_t auth_protocol_arg_num, uint32_t context_engine_id_arg_num) { /* Setting the security level. */ @@ -1152,7 +1152,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp if (session->securityLevel == SNMP_SEC_LEVEL_AUTHNOPRIV || session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) { if (!auth_protocol) { - zend_argument_value_error(auth_protocol_argnum, "cannot be null when security level is \"authNoPriv\" or \"authPriv\""); + zend_argument_value_error(auth_protocol_arg_num, "cannot be null when security level is \"authNoPriv\" or \"authPriv\""); return false; } @@ -1163,7 +1163,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp } if (!auth_passphrase) { - zend_argument_value_error(auth_protocol_argnum + 1, "cannot be null when security level is \"authNoPriv\" or \"authPriv\""); + zend_argument_value_error(auth_protocol_arg_num + 1, "cannot be null when security level is \"authNoPriv\" or \"authPriv\""); return false; } @@ -1176,7 +1176,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp if (session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) { if (!priv_protocol) { - zend_argument_value_error(auth_protocol_argnum + 2, "cannot be null when security level is \"authPriv\""); + zend_argument_value_error(auth_protocol_arg_num + 2, "cannot be null when security level is \"authPriv\""); return false; } @@ -1187,7 +1187,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp } if (!priv_passphrase) { - zend_argument_value_error(auth_protocol_argnum + 3, "cannot be null when security level is \"authPriv\""); + zend_argument_value_error(auth_protocol_arg_num + 3, "cannot be null when security level is \"authPriv\""); return false; } @@ -1206,7 +1206,7 @@ static ZEND_ATTRIBUTE_NONNULL_ARGS(2) bool snmp_session_set_security(struct snmp } /* Setting contextEngineIS if specified */ - if (contextEngineID && ZSTR_LEN(contextEngineID) && !snmp_session_set_contextEngineID(session, contextEngineID, contextEngineID_argument_offset)) { + if (contextEngineID && ZSTR_LEN(contextEngineID) && !snmp_session_set_contextEngineID(session, contextEngineID, context_engine_id_arg_num)) { /* Warning message sent already, just bail out */ return false; } @@ -1226,15 +1226,17 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) { zend_string *oid_str, *type_str = NULL, *value_str = NULL; HashTable *oid_ht, *type_ht = NULL, *value_ht = NULL; - zend_string *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL, *a5 = NULL, *a6 = NULL, *a7 = NULL; + zend_string *hostname = NULL, *community_or_security_name = NULL; + zend_string *security_level = NULL, *auth_protocol = NULL, *auth_passphrase = NULL; + zend_string *privacy_protocol = NULL, *privacy_passphrase = NULL; bool use_orignames = 0, suffix_keys = 0; zend_long timeout = SNMP_DEFAULT_TIMEOUT; zend_long retries = SNMP_DEFAULT_RETRIES; struct objid_query objid_query; php_snmp_session *session; int session_less_mode = (getThis() == NULL); - int timeout_argument_offset = -1; - uint32_t oid_argument_offset = 1, type_argument_offset = 0, value_argument_offset = 0; + uint32_t timeout_arg_num = 0; + uint32_t oid_arg_num = 1, type_arg_num = 0, value_arg_num = 0; php_snmp_object *snmp_object; php_snmp_object glob_snmp_object; @@ -1247,13 +1249,13 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) if (version == SNMP_VERSION_3) { if (st & SNMP_CMD_SET) { ZEND_PARSE_PARAMETERS_START(10, 12) - Z_PARAM_PATH_STR(a1) - Z_PARAM_PATH_STR(a2) - Z_PARAM_STR(a3) - Z_PARAM_STR(a4) - Z_PARAM_STR(a5) - Z_PARAM_STR(a6) - Z_PARAM_STR(a7) + Z_PARAM_PATH_STR(hostname) + Z_PARAM_PATH_STR(community_or_security_name) + Z_PARAM_STR(security_level) + Z_PARAM_STR(auth_protocol) + Z_PARAM_STR(auth_passphrase) + Z_PARAM_STR(privacy_protocol) + Z_PARAM_STR(privacy_passphrase) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_ARRAY_HT_OR_STR(type_ht, type_str) Z_PARAM_ARRAY_HT_OR_STR(value_ht, value_str) @@ -1262,37 +1264,37 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) Z_PARAM_LONG(retries) ZEND_PARSE_PARAMETERS_END(); - timeout_argument_offset = 10; - oid_argument_offset = 8; - type_argument_offset = 9; - value_argument_offset = 10; + timeout_arg_num = 10; + oid_arg_num = 8; + type_arg_num = 9; + value_arg_num = 10; } else { /* SNMP_CMD_GET * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ ZEND_PARSE_PARAMETERS_START(8, 10) - Z_PARAM_PATH_STR(a1) - Z_PARAM_PATH_STR(a2) - Z_PARAM_STR(a3) - Z_PARAM_STR(a4) - Z_PARAM_STR(a5) - Z_PARAM_STR(a6) - Z_PARAM_STR(a7) + Z_PARAM_PATH_STR(hostname) + Z_PARAM_PATH_STR(community_or_security_name) + Z_PARAM_STR(security_level) + Z_PARAM_STR(auth_protocol) + Z_PARAM_STR(auth_passphrase) + Z_PARAM_STR(privacy_protocol) + Z_PARAM_STR(privacy_passphrase) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_OPTIONAL Z_PARAM_LONG(timeout) Z_PARAM_LONG(retries) ZEND_PARSE_PARAMETERS_END(); - timeout_argument_offset = 9; - oid_argument_offset = 8; + timeout_arg_num = 9; + oid_arg_num = 8; } } else { if (st & SNMP_CMD_SET) { ZEND_PARSE_PARAMETERS_START(5, 7) - Z_PARAM_PATH_STR(a1) - Z_PARAM_PATH_STR(a2) + Z_PARAM_PATH_STR(hostname) + Z_PARAM_PATH_STR(community_or_security_name) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_ARRAY_HT_OR_STR(type_ht, type_str) Z_PARAM_ARRAY_HT_OR_STR(value_ht, value_str) @@ -1301,26 +1303,26 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) Z_PARAM_LONG(retries) ZEND_PARSE_PARAMETERS_END(); - timeout_argument_offset = 6; - oid_argument_offset = 3; - type_argument_offset = 4; - value_argument_offset = 5; + timeout_arg_num = 6; + oid_arg_num = 3; + type_arg_num = 4; + value_arg_num = 5; } else { /* SNMP_CMD_GET * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ ZEND_PARSE_PARAMETERS_START(3, 5) - Z_PARAM_PATH_STR(a1) - Z_PARAM_PATH_STR(a2) + Z_PARAM_PATH_STR(hostname) + Z_PARAM_PATH_STR(community_or_security_name) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) Z_PARAM_OPTIONAL Z_PARAM_LONG(timeout) Z_PARAM_LONG(retries) ZEND_PARSE_PARAMETERS_END(); - timeout_argument_offset = 4; - oid_argument_offset = 3; + timeout_arg_num = 4; + oid_arg_num = 3; } } } else { @@ -1330,8 +1332,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) Z_PARAM_ARRAY_HT_OR_STR(type_ht, type_str) Z_PARAM_ARRAY_HT_OR_STR(value_ht, value_str) ZEND_PARSE_PARAMETERS_END(); - type_argument_offset = 2; - value_argument_offset = 3; + type_arg_num = 2; + value_arg_num = 3; } else if (st & SNMP_CMD_WALK) { ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_ARRAY_HT_OR_STR(oid_ht, oid_str) @@ -1362,17 +1364,17 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) } if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str, value_ht, - oid_argument_offset, type_argument_offset, value_argument_offset)) { + oid_arg_num, type_arg_num, value_arg_num)) { RETURN_FALSE; } if (session_less_mode) { - if (!snmp_session_init(&session, version, a1, a2, timeout, retries, 1, timeout_argument_offset)) { + if (!snmp_session_init(&session, version, hostname, community_or_security_name, timeout, retries, 1, timeout_arg_num)) { php_free_objid_query(&objid_query, oid_ht, value_ht, st); snmp_session_free(&session); RETURN_FALSE; } - if (version == SNMP_VERSION_3 && !snmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL, 4, 0)) { + if (version == SNMP_VERSION_3 && !snmp_session_set_security(session, security_level, auth_protocol, auth_passphrase, privacy_protocol, privacy_passphrase, NULL, NULL, 4, 0)) { php_free_objid_query(&objid_query, oid_ht, value_ht, st); snmp_session_free(&session); /* An error has already been emitted, just bail out. */ @@ -1729,7 +1731,11 @@ PHP_METHOD(SNMP, setSecurity) { php_snmp_object *snmp_object; zval *object = ZEND_THIS; - zend_string *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL, *a5 = NULL, *a6 = NULL, *a7 = NULL; + zend_string *security_level = NULL, *auth_protocol = NULL, *auth_passphrase = NULL; + zend_string *privacy_protocol = NULL, *privacy_passphrase = NULL; + zend_string *context_name = NULL, *context_engine_id = NULL; + uint32_t auth_protocol_arg_num = 2; + uint32_t context_engine_id_arg_num = 7; snmp_object = Z_SNMP_P(object); if (!snmp_object->session) { @@ -1737,12 +1743,11 @@ PHP_METHOD(SNMP, setSecurity) RETURN_THROWS(); } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|SSSSSS", &a1, &a2, &a3, &a4,&a5, &a6, &a7) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|SSSSSS", &security_level, &auth_protocol, &auth_passphrase, &privacy_protocol, &privacy_passphrase, &context_name, &context_engine_id) == FAILURE) { RETURN_THROWS(); } - /* authProtocol is argument #2 and contextEngineId is argument #7. */ - if (!snmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7, 2, 7)) { + if (!snmp_session_set_security(snmp_object->session, security_level, auth_protocol, auth_passphrase, privacy_protocol, privacy_passphrase, context_name, context_engine_id, auth_protocol_arg_num, context_engine_id_arg_num)) { /* An error has already been emitted, just bail out. */ RETURN_FALSE; } From d1670fb7e1958abe74b934470ffc01d775aa6725 Mon Sep 17 00:00:00 2001 From: "Hans Krentel (hakre)" Date: Sat, 11 Apr 2026 23:55:41 +0200 Subject: [PATCH 226/300] Add date.timezone=UTC to the INI overwrites in run-tests.php Supersedes GH-21665 Closes GH-21729 --- run-tests.php | 1 + 1 file changed, 1 insertion(+) diff --git a/run-tests.php b/run-tests.php index 195d17fa0a03..e4a4563f93fc 100755 --- a/run-tests.php +++ b/run-tests.php @@ -304,6 +304,7 @@ function main(): void 'zend.exception_ignore_args=0', 'zend.exception_string_param_max_len=15', 'short_open_tag=0', + 'date.timezone=UTC', ]; $no_file_cache = '-d opcache.file_cache= -d opcache.file_cache_only=0'; From 91b0aebae7ad16c7e0cc71deb0effe02e10d751a Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 13 Apr 2026 15:01:56 +0100 Subject: [PATCH 227/300] Remove charsets plugin (#21714) --- UPGRADING.INTERNALS | 1 + ext/mysqlnd/mysqlnd_charset.c | 34 ---------------------------------- ext/mysqlnd/mysqlnd_charset.h | 14 -------------- 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 5da8d205be74..3a24fcce4772 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -133,6 +133,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES . Dropped session_options parameter from all methods in mysqlnd_auth. The same information is present in conn->options and should be used instead. + . Removed charsets plugin. - ext/session: . php_session_flush() now returns a bool rather than a zend_result. diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index b9ba0577c84a..eacf74240fd1 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -967,40 +967,6 @@ PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset /* }}} */ -static struct st_mysqlnd_plugin_charsets mysqlnd_plugin_charsets_plugin = -{ - { - MYSQLND_PLUGIN_API_VERSION, - "charsets", - MYSQLND_VERSION_ID, - PHP_MYSQLND_VERSION, - "Modified BSD License (BSD-3-Clause)", - "Andrey Hristov , Ulf Wendel , Georg Richter ", - { - NULL, /* no statistics , will be filled later if there are some */ - NULL, /* no statistics */ - }, - { - NULL /* plugin shutdown */ - } - }, - {/* methods */ - mysqlnd_find_charset_nr, - mysqlnd_find_charset_name, - mysqlnd_cset_escape_quotes, - mysqlnd_cset_escape_slashes - } -}; - - -/* {{{ mysqlnd_charsets_plugin_register */ -void -mysqlnd_charsets_plugin_register(void) -{ - mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_charsets_plugin); -} -/* }}} */ - #if MYSQLND_CHARSETS_SANITY_CHECK void mysqlnd_charsets_sanity_check(void) { diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h index 401d6d98cec8..d5e621e38eb1 100644 --- a/ext/mysqlnd/mysqlnd_charset.h +++ b/ext/mysqlnd/mysqlnd_charset.h @@ -26,18 +26,4 @@ PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const chars PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, const size_t escapestr_len); -struct st_mysqlnd_plugin_charsets -{ - const struct st_mysqlnd_plugin_header plugin_header; - struct - { - const MYSQLND_CHARSET * (*const find_charset_by_nr)(unsigned int charsetnr); - const MYSQLND_CHARSET * (*const find_charset_by_name)(const char * const name); - zend_ulong (*const escape_quotes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, const size_t escapestr_len); - zend_ulong (*const escape_slashes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, const size_t escapestr_len); - } methods; -}; - -void mysqlnd_charsets_plugin_register(void); - #endif /* MYSQLND_CHARSET_H */ From 9b6f83e1bb61c226bc4dc5a2c35b83ba563f8343 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 13 Apr 2026 12:44:04 -0400 Subject: [PATCH 228/300] ext/pdo_odbc: Require non-empty string when building string buffer (#21652) A buggy driver could do this and get PDO_ODBC stuck in this loop. Require a non-empty string, so an empty one breaks like the SQL_NO_DATA case. Fixes GH-21534 --- ext/pdo_odbc/odbc_stmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index ea9d5c788f57..c114f721a7a7 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -710,7 +710,7 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, zval *result, enum pdo str = zend_string_realloc(str, used + 256, 0); memcpy(ZSTR_VAL(str) + used, buf2, 256); used = used + 255; - } else if (rc==SQL_SUCCESS) { + } else if (rc == SQL_SUCCESS && C->fetched_len != 0) { str = zend_string_realloc(str, used + C->fetched_len, 0); memcpy(ZSTR_VAL(str) + used, buf2, C->fetched_len); used = used + C->fetched_len; From 9d30bd57251147c3af70fe6ee6001558bef6bc10 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 13 Apr 2026 12:48:24 -0400 Subject: [PATCH 229/300] Finish deprecation of $row < 1 (#21053) odbc_fetch_row was changed to have $row be nullable and null by default instead of using 0, but still accepted 0 due to old code being explicit. Use ValueError for non-null $row < 1 instead. --- ext/odbc/php_odbc.c | 11 +++++------ ext/odbc/tests/odbc_fetch_array_001.phpt | 2 +- ext/odbc/tests/odbc_fetch_into_001.phpt | 2 +- ext/odbc/tests/odbc_fetch_object_001.phpt | 2 +- ext/odbc/tests/odbc_fetch_row_001.phpt | 11 +++++++---- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 96e1b8796140..95c872c293f1 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1340,12 +1340,11 @@ static void php_odbc_fetch(INTERNAL_FUNCTION_PARAMETERS, bool return_array, php_ result = Z_ODBC_RESULT_P(pv_res); CHECK_ODBC_RESULT(result); - /* TODO deprecate $row argument values less than 1 after PHP 8.4 - * for functions other than odbc_fetch_row (see GH-13910) - */ - if (!result_type && !pv_row_is_null && pv_row < 1) { - php_error_docref(NULL, E_WARNING, "Argument #3 ($row) must be greater than or equal to 1"); - RETURN_FALSE; + if (!pv_row_is_null && pv_row < 1) { + /* row arg no differs between callers */ + zend_argument_value_error(pv_res_arr == return_value ? 2 : 3, + "must be greater than or equal to 1"); + RETURN_THROWS(); } if (result->numcols == 0) { diff --git a/ext/odbc/tests/odbc_fetch_array_001.phpt b/ext/odbc/tests/odbc_fetch_array_001.phpt index bf13ed25e4d6..e7d4ccf328b6 100644 --- a/ext/odbc/tests/odbc_fetch_array_001.phpt +++ b/ext/odbc/tests/odbc_fetch_array_001.phpt @@ -17,7 +17,7 @@ odbc_exec($conn, 'INSERT INTO fetch_array VALUES (1), (2)'); $res = odbc_exec($conn, 'SELECT * FROM fetch_array'); var_dump(odbc_fetch_array($res)); -var_dump(odbc_fetch_array($res, 0)); +var_dump(odbc_fetch_array($res, null)); var_dump(odbc_fetch_array($res, 2)); var_dump(odbc_fetch_array($res, 4)); diff --git a/ext/odbc/tests/odbc_fetch_into_001.phpt b/ext/odbc/tests/odbc_fetch_into_001.phpt index 19f7f79268c5..e420475f02cc 100644 --- a/ext/odbc/tests/odbc_fetch_into_001.phpt +++ b/ext/odbc/tests/odbc_fetch_into_001.phpt @@ -20,7 +20,7 @@ $arr = []; var_dump(odbc_fetch_into($res, $arr)); var_dump($arr); $arr = []; -var_dump(odbc_fetch_into($res, $arr, 0)); +var_dump(odbc_fetch_into($res, $arr, null)); var_dump($arr); $arr = []; var_dump(odbc_fetch_into($res, $arr, 2)); diff --git a/ext/odbc/tests/odbc_fetch_object_001.phpt b/ext/odbc/tests/odbc_fetch_object_001.phpt index 62a8fc3b2c7e..eb553409639f 100644 --- a/ext/odbc/tests/odbc_fetch_object_001.phpt +++ b/ext/odbc/tests/odbc_fetch_object_001.phpt @@ -17,7 +17,7 @@ odbc_exec($conn, 'INSERT INTO fetch_object VALUES (1), (2)'); $res = odbc_exec($conn, 'SELECT * FROM fetch_object'); var_dump(odbc_fetch_object($res)); -var_dump(odbc_fetch_object($res, 0)); +var_dump(odbc_fetch_object($res, null)); var_dump(odbc_fetch_object($res, 2)); var_dump(odbc_fetch_object($res, 4)); diff --git a/ext/odbc/tests/odbc_fetch_row_001.phpt b/ext/odbc/tests/odbc_fetch_row_001.phpt index 576bb15414ce..fbadc8272590 100644 --- a/ext/odbc/tests/odbc_fetch_row_001.phpt +++ b/ext/odbc/tests/odbc_fetch_row_001.phpt @@ -17,7 +17,11 @@ odbc_exec($conn, 'INSERT INTO fetch_row VALUES (1), (2)'); $res = odbc_exec($conn, 'SELECT * FROM fetch_row'); -var_dump(odbc_fetch_row($res, 0)); +try { + var_dump(odbc_fetch_row($res, 0)); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump(odbc_fetch_row($res, null)); var_dump(odbc_result($res, 'test')); @@ -39,9 +43,8 @@ require 'config.inc'; $conn = odbc_connect($dsn, $user, $pass); odbc_exec($conn, 'DROP TABLE fetch_row'); ?> ---EXPECTF-- -Warning: odbc_fetch_row(): Argument #3 ($row) must be greater than or equal to 1 in %s on line %d -bool(false) +--EXPECT-- +odbc_fetch_row(): Argument #2 ($row) must be greater than or equal to 1 bool(true) string(1) "1" bool(true) From 72c12ea01a404085fd637d2f750dee38be42c3d3 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 13 Apr 2026 05:53:49 +0100 Subject: [PATCH 230/300] Add myself to DOM/XML/SOAP/SimpleXML/XMLReader/Writer and XSL. close GH-21741 --- .github/CODEOWNERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3b6d79ae8a4e..91f207e0c66c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,11 +20,13 @@ /ext/curl @adoy /ext/date @derickr /ext/dba @Girgias +/ext/dom @devnexen /ext/ffi @dstogov /ext/gd @devnexen /ext/gettext @devnexen /ext/gmp @Girgias /ext/intl @devnexen +/ext/libxml @devnexen /ext/json @bukka /ext/mbstring @alexdowad @youkidearitai /ext/mysqli @bukka @kamil-tekiela @@ -44,9 +46,15 @@ /ext/random @TimWolla @zeriyoshi /ext/reflection @DanielEScherzer /ext/session @Girgias +/ext/simplexml @devnexen +/ext/soap @devnexen /ext/sockets @devnexen /ext/spl @Girgias /ext/standard @bukka +/ext/xml @devnexen +/ext/xmlreader @devnexen +/ext/xmlwriter @devnexen +/ext/xsl @devnexen /main @bukka /sapi/fpm @bukka /Zend/Optimizer @dstogov From ebb6e4f5f8d6e10c853b533da423eaf86e0e7a1d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 17:09:36 +0100 Subject: [PATCH 231/300] Zend/zend_execute.c: add const qualifiers --- Zend/zend_execute.c | 82 +++++++++++++++++++++++++++------------------ Zend/zend_execute.h | 6 ++-- 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a4871bc3bebd..8b688c4adc7b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -646,7 +646,7 @@ static zend_never_inline ZEND_COLD void zend_throw_access_uninit_prop_by_ref_err } /* this should modify object only if it's empty */ -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_error(const zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_error(const zval *object, const zval *property OPLINE_DC EXECUTE_DATA_DC) { zend_string *tmp_property_name; zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); @@ -1709,7 +1709,7 @@ static zend_never_inline void zend_binary_assign_op_typed_prop(const zend_proper } } -static zend_never_inline zend_long zend_check_string_offset(zval *dim, int type EXECUTE_DATA_DC) +static zend_never_inline zend_long zend_check_string_offset(const zval *dim, int type EXECUTE_DATA_DC) { zend_long offset; @@ -2184,7 +2184,7 @@ static zend_property_info *zend_get_prop_not_accepting_double(zend_reference *re return NULL; } -static ZEND_COLD zend_long zend_throw_incdec_ref_error(zend_property_info *error_prop OPLINE_DC) +static ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info *error_prop OPLINE_DC) { zend_string *type_str = zend_type_to_string(error_prop->type); if (ZEND_IS_INCREMENT(opline->opcode)) { @@ -2206,7 +2206,7 @@ static ZEND_COLD zend_long zend_throw_incdec_ref_error(zend_property_info *error } } -static ZEND_COLD zend_long zend_throw_incdec_prop_error(zend_property_info *prop OPLINE_DC) { +static ZEND_COLD zend_long zend_throw_incdec_prop_error(const zend_property_info *prop OPLINE_DC) { zend_string *type_str = zend_type_to_string(prop->type); if (ZEND_IS_INCREMENT(opline->opcode)) { zend_type_error("Cannot increment property %s::$%s of type %s past its maximal value", @@ -2257,7 +2257,7 @@ static void zend_incdec_typed_ref(zend_reference *ref, zval *copy OPLINE_DC EXEC } } -static void zend_incdec_typed_prop(zend_property_info *prop_info, zval *var_ptr, zval *copy OPLINE_DC EXECUTE_DATA_DC) +static void zend_incdec_typed_prop(const zend_property_info *prop_info, zval *var_ptr, zval *copy OPLINE_DC EXECUTE_DATA_DC) { zval tmp; @@ -2287,7 +2287,7 @@ static void zend_incdec_typed_prop(zend_property_info *prop_info, zval *var_ptr, } } -static void zend_pre_incdec_property_zval(zval *prop, zend_property_info *prop_info OPLINE_DC EXECUTE_DATA_DC) +static void zend_pre_incdec_property_zval(zval *prop, const zend_property_info *prop_info OPLINE_DC EXECUTE_DATA_DC) { if (EXPECTED(Z_TYPE_P(prop) == IS_LONG)) { if (ZEND_IS_INCREMENT(opline->opcode)) { @@ -2325,7 +2325,7 @@ static void zend_pre_incdec_property_zval(zval *prop, zend_property_info *prop_i } } -static void zend_post_incdec_property_zval(zval *prop, zend_property_info *prop_info OPLINE_DC EXECUTE_DATA_DC) +static void zend_post_incdec_property_zval(zval *prop, const zend_property_info *prop_info OPLINE_DC EXECUTE_DATA_DC) { if (EXPECTED(Z_TYPE_P(prop) == IS_LONG)) { ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(prop)); @@ -2553,7 +2553,7 @@ ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_method(co zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(method)); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_method_call(zval *object, zval *function_name) +static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_method_call(const zval *object, const zval *function_name) { zend_throw_error(NULL, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_zval_value_name(object)); @@ -2617,7 +2617,7 @@ ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_call_stack_size_err } #endif /* ZEND_CHECK_STACK_LIMIT */ -static ZEND_COLD void zend_binary_assign_op_dim_slow(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC) +static ZEND_COLD void zend_binary_assign_op_dim_slow(const zval *container, const zval *dim OPLINE_DC EXECUTE_DATA_DC) { if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { if (opline->op2_type == IS_UNUSED) { @@ -3051,7 +3051,7 @@ static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_UNSET(z zend_fetch_dimension_address(result, container_ptr, dim, dim_type, BP_VAR_UNSET EXECUTE_DATA_CC); } -static zend_always_inline void zend_fetch_dimension_address_read(zval *result, zval *container, zval *dim, int dim_type, int type, bool is_list, bool slow EXECUTE_DATA_DC) +static zend_always_inline void zend_fetch_dimension_address_read(zval *result, const zval *container, zval *dim, int dim_type, int type, bool is_list, bool slow EXECUTE_DATA_DC) { zval *retval; @@ -3205,36 +3205,36 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z } } -static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_R(zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_R(const zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) { zval *result = EX_VAR(opline->result.var); zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R, 0, 0 EXECUTE_DATA_CC); } -static zend_never_inline void zend_fetch_dimension_address_read_R_slow(zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void zend_fetch_dimension_address_read_R_slow(const zval *container, zval *dim OPLINE_DC EXECUTE_DATA_DC) { zval *result = EX_VAR(opline->result.var); zend_fetch_dimension_address_read(result, container, dim, IS_CV, BP_VAR_R, 0, 1 EXECUTE_DATA_CC); } -static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_IS(zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_read_IS(const zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) { zval *result = EX_VAR(opline->result.var); zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS, 0, 0 EXECUTE_DATA_CC); } -static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void ZEND_FASTCALL zend_fetch_dimension_address_LIST_r(const zval *container, zval *dim, int dim_type OPLINE_DC EXECUTE_DATA_DC) { zval *result = EX_VAR(opline->result.var); zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_R, 1, 0 EXECUTE_DATA_CC); } -ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type) +ZEND_API void zend_fetch_dimension_const(zval *result, const zval *container, zval *dim, int type) { zend_fetch_dimension_address_read(result, container, dim, IS_TMP_VAR, type, 0, 0 NO_EXECUTE_DATA_CC); } -static zend_never_inline zval* ZEND_FASTCALL zend_find_array_dim_slow(HashTable *ht, zval *offset EXECUTE_DATA_DC) +static zend_never_inline zval* ZEND_FASTCALL zend_find_array_dim_slow(HashTable *ht, const zval *offset EXECUTE_DATA_DC) { zend_ulong hval; @@ -3289,7 +3289,7 @@ static zend_never_inline zval* ZEND_FASTCALL zend_find_array_dim_slow(HashTable } } -static zend_never_inline bool ZEND_FASTCALL zend_isset_dim_slow(zval *container, zval *offset EXECUTE_DATA_DC) +static zend_never_inline bool ZEND_FASTCALL zend_isset_dim_slow(const zval *container, zval *offset EXECUTE_DATA_DC) { if (/*OP2_TYPE == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { offset = ZVAL_UNDEFINED_OP2(); @@ -3328,7 +3328,7 @@ static zend_never_inline bool ZEND_FASTCALL zend_isset_dim_slow(zval *container, } } -static zend_never_inline bool ZEND_FASTCALL zend_isempty_dim_slow(zval *container, zval *offset EXECUTE_DATA_DC) +static zend_never_inline bool ZEND_FASTCALL zend_isempty_dim_slow(const zval *container, zval *offset EXECUTE_DATA_DC) { if (/*OP2_TYPE == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { offset = ZVAL_UNDEFINED_OP2(); @@ -3367,7 +3367,7 @@ static zend_never_inline bool ZEND_FASTCALL zend_isempty_dim_slow(zval *containe } } -static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, zval *key OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable *ht, const zval *key OPLINE_DC EXECUTE_DATA_DC) { zend_string *str; zend_ulong hval; @@ -3426,7 +3426,7 @@ static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable } static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( - zval *subject, zval *key OPLINE_DC EXECUTE_DATA_DC) + const zval *subject, const zval *key OPLINE_DC EXECUTE_DATA_DC) { if (Z_TYPE_P(key) == IS_UNDEF) { ZVAL_UNDEFINED_OP1(); @@ -3440,7 +3440,7 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( } } -static zend_always_inline bool promotes_to_array(zval *val) { +static zend_always_inline bool promotes_to_array(const zval *val) { return Z_TYPE_P(val) <= IS_FALSE || (Z_ISREF_P(val) && Z_TYPE_P(Z_REFVAL_P(val)) <= IS_FALSE); } @@ -3504,8 +3504,18 @@ static zend_never_inline bool zend_handle_fetch_obj_flags( return 1; } -static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, zend_property_info **prop_info_p OPLINE_DC EXECUTE_DATA_DC) -{ +static zend_always_inline void zend_fetch_property_address( + zval *result, + const zval *container, + uint32_t container_op_type, + const zval *prop_ptr, + uint32_t prop_op_type, + void **cache_slot, + int type, + uint32_t flags, + zend_property_info **prop_info_p + OPLINE_DC EXECUTE_DATA_DC +) { zval *ptr; zend_object *zobj; zend_string *name, *tmp_name; @@ -3650,8 +3660,14 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c } } -static zend_always_inline void zend_assign_to_property_reference(zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) -{ +static zend_always_inline void zend_assign_to_property_reference( + const zval *container, + uint32_t container_op_type, + const zval *prop_ptr, + uint32_t prop_op_type, + zval *value_ptr + OPLINE_DC EXECUTE_DATA_DC +) { zval variable, *variable_ptr = &variable; void **cache_addr = (prop_op_type == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_RETURNS_FUNCTION) : NULL; zend_refcounted *garbage = NULL; @@ -3689,25 +3705,25 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container } } -static zend_never_inline void zend_assign_to_property_reference_this_const(zval *container, zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void zend_assign_to_property_reference_this_const(const zval *container, const zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) { zend_assign_to_property_reference(container, IS_UNUSED, prop_ptr, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); } -static zend_never_inline void zend_assign_to_property_reference_var_const(zval *container, zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void zend_assign_to_property_reference_var_const(const zval *container, const zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) { zend_assign_to_property_reference(container, IS_VAR, prop_ptr, IS_CONST, value_ptr OPLINE_CC EXECUTE_DATA_CC); } -static zend_never_inline void zend_assign_to_property_reference_this_var(zval *container, zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void zend_assign_to_property_reference_this_var(const zval *container, const zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) { zend_assign_to_property_reference(container, IS_UNUSED, prop_ptr, IS_VAR, value_ptr OPLINE_CC EXECUTE_DATA_CC); } -static zend_never_inline void zend_assign_to_property_reference_var_var(zval *container, zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) +static zend_never_inline void zend_assign_to_property_reference_var_var(const zval *container, const zval *prop_ptr, zval *value_ptr OPLINE_DC EXECUTE_DATA_DC) { zend_assign_to_property_reference(container, IS_VAR, prop_ptr, IS_VAR, value_ptr OPLINE_CC EXECUTE_DATA_CC); @@ -4480,7 +4496,7 @@ ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name) /* ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len) /* {{{ */ { - zval *zv = zend_hash_str_find(EG(function_table), name, len); + const zval *zv = zend_hash_str_find(EG(function_table), name, len); if (EXPECTED(zv != NULL)) { zend_function *fbc = Z_FUNC_P(zv); @@ -4904,7 +4920,7 @@ static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, /* Handle the split range for loop vars */ if (catch_op_num) { - zend_op *final_op = EX(func)->op_array.opcodes + range->end; + const zend_op *final_op = EX(func)->op_array.opcodes + range->end; if (final_op->extended_value & ZEND_FREE_ON_RETURN && (final_op->opcode == ZEND_FE_FREE || final_op->opcode == ZEND_FREE)) { if (catch_op_num < range->end + final_op->op2.num) { continue; @@ -5192,7 +5208,7 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_object(zend_o } /* }}} */ -static zend_never_inline zend_execute_data *zend_init_dynamic_call_array(zend_array *function, uint32_t num_args) /* {{{ */ +static zend_never_inline zend_execute_data *zend_init_dynamic_call_array(const zend_array *function, uint32_t num_args) /* {{{ */ { zend_function *fbc; void *object_or_called_scope; @@ -5283,7 +5299,7 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_array(zend_ar #define ZEND_FAKE_OP_ARRAY ((zend_op_array*)(intptr_t)-1) -static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval *inc_filename_zv, int type) /* {{{ */ +static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(const zval *inc_filename_zv, int type) /* {{{ */ { zend_op_array *new_op_array = NULL; zend_string *tmp_inc_filename; diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index cb2c9e144801..92ce8a0dcbb2 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -134,7 +134,7 @@ ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_l ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, uint8_t value_type, bool strict); ZEND_API zval* zend_assign_to_typed_ref_ex(zval *variable_ptr, zval *value, uint8_t value_type, bool strict, zend_refcounted **garbage_ptr); -static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, uint8_t value_type) +static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, const zval *value, uint8_t value_type) { zend_refcounted *ref = NULL; @@ -210,7 +210,7 @@ static zend_always_inline zval* zend_assign_to_variable_ex(zval *variable_ptr, z return variable_ptr; } -static zend_always_inline void zend_safe_assign_to_variable_noref(zval *variable_ptr, zval *value) { +static zend_always_inline void zend_safe_assign_to_variable_noref(zval *variable_ptr, const zval *value) { if (Z_REFCOUNTED_P(variable_ptr)) { ZEND_ASSERT(Z_TYPE_P(variable_ptr) != IS_REFERENCE); zend_refcounted *ref = Z_COUNTED_P(variable_ptr); @@ -484,7 +484,7 @@ ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name); ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len); ZEND_API void ZEND_FASTCALL zend_init_func_run_time_cache(zend_op_array *op_array); -ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type); +ZEND_API void zend_fetch_dimension_const(zval *result, const zval *container, zval *dim, int type); ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var); From f4db0d08bfbb741e7da1dd719b4b1301aea400b7 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 6 Apr 2026 18:32:24 +0100 Subject: [PATCH 232/300] Zend/zend_execute.c: use zend_never_inline ZEND_COLD rather than ZEND_COLD zend_never_inline to align the coding style with the rest of the file --- Zend/zend_execute.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 8b688c4adc7b..fb9c1587e7b4 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -835,7 +835,7 @@ ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool s return zend_verify_weak_scalar_type_hint(type_mask, arg); } -ZEND_COLD zend_never_inline void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant) +zend_never_inline ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant) { zend_string *type_str = zend_type_to_string(c->type); @@ -845,7 +845,7 @@ ZEND_COLD zend_never_inline void zend_verify_class_constant_type_error(const zen zend_string_release(type_str); } -ZEND_COLD zend_never_inline void zend_verify_property_type_error(const zend_property_info *info, const zval *property) +zend_never_inline ZEND_COLD void zend_verify_property_type_error(const zend_property_info *info, const zval *property) { zend_string *type_str; @@ -863,7 +863,7 @@ ZEND_COLD zend_never_inline void zend_verify_property_type_error(const zend_prop zend_string_release(type_str); } -ZEND_COLD zend_never_inline void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property) +zend_never_inline ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property) { /* we _may_ land here in case reading already errored and runtime cache thus has not been updated (i.e. it contains a valid but unrelated info) */ if (EG(exception)) { From 933ae15c0a9e1968aaa258f5c4f2832008ec17bb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 17:14:44 +0100 Subject: [PATCH 233/300] Zend/zend_execute.c: mark some error functions as static Those are never used outside of zend_execute.c so no reason to export them in a header --- Zend/zend_execute.c | 8 ++++---- Zend/zend_execute.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index fb9c1587e7b4..c575fc4c738c 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -835,7 +835,7 @@ ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool s return zend_verify_weak_scalar_type_hint(type_mask, arg); } -zend_never_inline ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant) +static zend_never_inline ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant) { zend_string *type_str = zend_type_to_string(c->type); @@ -845,7 +845,7 @@ zend_never_inline ZEND_COLD void zend_verify_class_constant_type_error(const zen zend_string_release(type_str); } -zend_never_inline ZEND_COLD void zend_verify_property_type_error(const zend_property_info *info, const zval *property) +static zend_never_inline ZEND_COLD void zend_verify_property_type_error(const zend_property_info *info, const zval *property) { zend_string *type_str; @@ -863,7 +863,7 @@ zend_never_inline ZEND_COLD void zend_verify_property_type_error(const zend_prop zend_string_release(type_str); } -zend_never_inline ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property) +static zend_never_inline ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property) { /* we _may_ land here in case reading already errored and runtime cache thus has not been updated (i.e. it contains a valid but unrelated info) */ if (EG(exception)) { @@ -3921,7 +3921,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info zend_string_release(type_str); } -ZEND_API ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { +static ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s and property %s::$%s of type %s, as this would result in an inconsistent type conversion", diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 92ce8a0dcbb2..c724ac78e1f3 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -585,11 +585,8 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal ZEND_API bool zend_verify_class_constant_type(const zend_class_constant *c, const zend_string *name, zval *constant); -ZEND_COLD void zend_verify_class_constant_type_error(const zend_class_constant *c, const zend_string *name, const zval *constant); ZEND_API bool zend_verify_property_type(const zend_property_info *info, zval *property, bool strict); -ZEND_COLD void zend_verify_property_type_error(const zend_property_info *info, const zval *property); -ZEND_COLD void zend_magic_get_property_type_inconsistency_error(const zend_property_info *info, const zval *property); #define ZEND_REF_ADD_TYPE_SOURCE(ref, source) \ zend_ref_add_type_source(&ZEND_REF_TYPE_SOURCES(ref), source) From 6b159ca83cfd5cb09726925cd7d6c10179034726 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 17:11:35 +0100 Subject: [PATCH 234/300] Zend/zend_execute.c: mark error functions as zend_never_inline For consistency with other functions --- Zend/zend_execute.c | 48 ++++++++++++++++++++++----------------------- Zend/zend_execute.h | 34 ++++++++++++++++---------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c575fc4c738c..21d2280d48fe 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -604,7 +604,7 @@ static zend_never_inline ZEND_COLD zval *zend_wrong_assign_to_variable_reference return zend_assign_to_variable_ex(variable_ptr, value_ptr, IS_TMP_VAR, EX_USES_STRICT_TYPES(), garbage_ptr); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num) { const zend_execute_data *execute_data = EG(current_execute_data); zend_string *func_name = get_function_or_method_name(EX(call)->func); @@ -680,7 +680,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_erro } } -static ZEND_COLD void zend_verify_type_error_common( +static zend_never_inline ZEND_COLD void zend_verify_type_error_common( const zend_function *zf, const zend_arg_info *arg_info, const zval *value, const char **fname, const char **fsep, const char **fclass, zend_string **need_msg, const char **given_kind) @@ -703,7 +703,7 @@ static ZEND_COLD void zend_verify_type_error_common( } } -ZEND_API ZEND_COLD void zend_verify_arg_error( +ZEND_API zend_never_inline ZEND_COLD void zend_verify_arg_error( const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value) { const zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data; @@ -880,7 +880,7 @@ static zend_never_inline ZEND_COLD void zend_magic_get_property_type_inconsisten zend_string_release(type_str); } -ZEND_COLD void zend_match_unhandled_error(const zval *value) +zend_never_inline ZEND_COLD void zend_match_unhandled_error(const zval *value) { zend_long max_len = EG(exception_string_param_max_len); smart_str msg = {0}; @@ -900,35 +900,35 @@ ZEND_COLD void zend_match_unhandled_error(const zval *value) smart_str_free(&msg); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error( +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error( const zend_property_info *info) { zend_readonly_property_modification_error_ex( ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name)); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex( +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex( const char *class_name, const char *prop_name) { zend_throw_error(NULL, "Cannot modify readonly property %s::$%s", class_name, prop_name); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info) { zend_throw_error(NULL, "Cannot indirectly modify readonly property %s::$%s", ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name)); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(const uint8_t type) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(const uint8_t type) { zend_type_error("Cannot use value of type %s as class constant name", zend_get_type_by_const(type)); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info) { zend_throw_error(NULL, "Object was released while assigning to property %s::$%s", ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name)); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error( +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error( const zend_property_info *prop_info, const char *operation ) { const zend_class_entry *scope; @@ -1321,7 +1321,7 @@ ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_exe return 0; } -ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc) +ZEND_API zend_never_inline ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc) { zend_error_noreturn(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()", fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "", @@ -1392,7 +1392,7 @@ static void zend_verify_internal_func_info(const zend_function *fn, const zval * } #endif -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data) { const zend_execute_data *ptr = EX(prev_execute_data); @@ -1417,7 +1417,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_ } } -ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zval *value) +ZEND_API zend_never_inline ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zval *value) { const zend_arg_info *arg_info = &zf->common.arg_info[-1]; const char *fname, *fsep, *fclass; @@ -1433,7 +1433,7 @@ ZEND_API ZEND_COLD void zend_verify_return_error(const zend_function *zf, const zend_string_release(need_msg); } -ZEND_API ZEND_COLD void zend_verify_never_error(const zend_function *zf) +ZEND_API zend_never_inline ZEND_COLD void zend_verify_never_error(const zend_function *zf) { zend_string *func_name = get_function_or_method_name(zf); @@ -1444,7 +1444,7 @@ ZEND_API ZEND_COLD void zend_verify_never_error(const zend_function *zf) } #if ZEND_DEBUG -static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const zval *value) +static zend_never_inline ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const zval *value) { const zend_arg_info *arg_info = &zf->common.arg_info[-1]; const char *fname, *fsep, *fclass; @@ -1458,7 +1458,7 @@ static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg); } -static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind) +static zend_never_inline ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind) { const char *fname = ZSTR_VAL(zf->common.function_name); const char *fsep; @@ -1497,7 +1497,7 @@ ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *re } #endif -static ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf) +static zend_never_inline ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf) { /* VERIFY_RETURN_TYPE is not emitted for "void" functions, so this is always an error. */ zend_verify_return_error(zf, NULL); @@ -1754,7 +1754,7 @@ static zend_never_inline zend_long zend_check_string_offset(const zval *dim, int return zval_get_long_func(dim, /* is_strict */ false); } -ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void) +ZEND_API zend_never_inline ZEND_COLD void zend_wrong_string_offset_error(void) { const char *msg = NULL; const zend_execute_data *execute_data = EG(current_execute_data); @@ -2184,7 +2184,7 @@ static zend_property_info *zend_get_prop_not_accepting_double(zend_reference *re return NULL; } -static ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info *error_prop OPLINE_DC) +static zend_never_inline ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info *error_prop OPLINE_DC) { zend_string *type_str = zend_type_to_string(error_prop->type); if (ZEND_IS_INCREMENT(opline->opcode)) { @@ -2206,7 +2206,7 @@ static ZEND_COLD zend_long zend_throw_incdec_ref_error(const zend_property_info } } -static ZEND_COLD zend_long zend_throw_incdec_prop_error(const zend_property_info *prop OPLINE_DC) { +static zend_never_inline ZEND_COLD zend_long zend_throw_incdec_prop_error(const zend_property_info *prop OPLINE_DC) { zend_string *type_str = zend_type_to_string(prop->type); if (ZEND_IS_INCREMENT(opline->opcode)) { zend_type_error("Cannot increment property %s::$%s of type %s past its maximal value", @@ -3425,7 +3425,7 @@ static zend_never_inline bool ZEND_FASTCALL zend_array_key_exists_fast(HashTable } } -static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( +static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( const zval *subject, const zval *key OPLINE_DC EXECUTE_DATA_DC) { if (Z_TYPE_P(key) == IS_UNDEF) { @@ -3894,7 +3894,7 @@ ZEND_API zval* ZEND_FASTCALL zend_fetch_static_property(zend_execute_data *ex, i return result; } -ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { +ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Reference with value of type %s held by property %s::$%s of type %s is not compatible with property %s::$%s of type %s", @@ -3910,7 +3910,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info zend_string_release(type2_str); } -ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv) { +ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv) { zend_string *type_str = zend_type_to_string(prop->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s", zend_zval_value_name(zv), @@ -3921,7 +3921,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info zend_string_release(type_str); } -static ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { +static zend_never_inline ZEND_COLD void zend_throw_conflicting_coercion_error(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv) { zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s and property %s::$%s of type %s, as this would result in an inconsistent type conversion", diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index c724ac78e1f3..8f6b8804298b 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -60,7 +60,7 @@ ZEND_API zend_result zend_eval_stringl_ex(const char *str, size_t str_len, zval /* export zend_pass_function to allow comparisons against it */ extern ZEND_API const zend_internal_function zend_pass_function; -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(const zend_execute_data *execute_data); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_nodiscard_function(const zend_function *fbc); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_class_constant(const zend_class_constant *c, const zend_string *constant_name); @@ -80,31 +80,31 @@ typedef enum { ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref_ex(const zend_property_info *prop_info, zval *orig_val, bool strict, zend_verify_prop_assignable_by_ref_context context); ZEND_API bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(const zend_property_info *prop_info, zval *orig_val, bool strict); -ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv); -ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv); +ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_zval(const zend_property_info *prop, const zval *zv); +ZEND_API zend_never_inline ZEND_COLD void zend_throw_ref_type_error_type(const zend_property_info *prop1, const zend_property_info *prop2, const zval *zv); ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval); ZEND_API ZEND_COLD zval* ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset); -ZEND_API ZEND_COLD void zend_wrong_string_offset_error(void); +ZEND_API zend_never_inline ZEND_COLD void zend_wrong_string_offset_error(void); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(const char *class_name, const char *prop_name); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error(const zend_property_info *info); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_modification_error_ex(const char *class_name, const char *prop_name); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_readonly_property_indirect_modification_error(const zend_property_info *info); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_class_constant_type_error(uint8_t type); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_object_released_while_assigning_to_property_error(const zend_property_info *info); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void); ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_property_info *prop_info); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *prop_info, const char *operation); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_asymmetric_visibility_property_modification_error(const zend_property_info *prop_info, const char *operation); ZEND_API bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, bool strict, bool is_internal_arg); -ZEND_API ZEND_COLD void zend_verify_arg_error( +ZEND_API zend_never_inline ZEND_COLD void zend_verify_arg_error( const zend_function *zf, const zend_arg_info *arg_info, uint32_t arg_num, const zval *value); -ZEND_API ZEND_COLD void zend_verify_return_error( +ZEND_API zend_never_inline ZEND_COLD void zend_verify_return_error( const zend_function *zf, const zval *value); -ZEND_API ZEND_COLD void zend_verify_never_error( +ZEND_API zend_never_inline ZEND_COLD void zend_verify_never_error( const zend_function *zf); ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref); ZEND_API bool zend_check_user_type_slow( @@ -112,7 +112,7 @@ ZEND_API bool zend_check_user_type_slow( #if ZEND_DEBUG ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call); -ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc); +ZEND_API zend_never_inline ZEND_COLD void zend_internal_call_arginfo_violation(const zend_function *fbc); ZEND_API bool zend_verify_internal_return_type(const zend_function *zf, zval *ret); #endif @@ -471,7 +471,7 @@ ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API uint32_t zend_get_executed_lineno(void); ZEND_API zend_class_entry *zend_get_executed_scope(void); ZEND_API bool zend_is_executing(void); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num); ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals); ZEND_API void zend_unset_timeout(void); @@ -615,7 +615,7 @@ ZEND_API bool zend_verify_property_type(const zend_property_info *info, zval *pr } \ } while (0) -ZEND_COLD void zend_match_unhandled_error(const zval *value); +zend_never_inline ZEND_COLD void zend_match_unhandled_error(const zval *value); /* Call this to handle the timeout or the interrupt function. It will set * EG(vm_interrupt) to false. From bc42a8744fbeb85faec1d7f0e7e37a5830bcc403 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 17:27:42 +0100 Subject: [PATCH 235/300] Zend/zend_execute.c: mark zend_non_static_method_call() as ZEND_COLD zend_never_inline For consistency with other functions --- Zend/zend_execute.c | 2 +- Zend/zend_execute.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 21d2280d48fe..474e8a826e14 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2559,7 +2559,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_invalid_method_call(c Z_STRVAL_P(function_name), zend_zval_value_name(object)); } -ZEND_API void ZEND_FASTCALL zend_non_static_method_call(const zend_function *fbc) +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_non_static_method_call(const zend_function *fbc) { zend_throw_error( zend_ce_error, diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 8f6b8804298b..ba48b19bcfe1 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -511,7 +511,7 @@ ZEND_API ZEND_ATTRIBUTE_DEPRECATED HashTable *zend_unfinished_execution_gc(zend_ ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer, bool suspended_by_yield); ZEND_API zval* ZEND_FASTCALL zend_fetch_static_property(zend_execute_data *ex, int fetch_type); ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_method(const zend_class_entry *ce, const zend_string *method); -ZEND_API void ZEND_FASTCALL zend_non_static_method_call(const zend_function *fbc); +ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_non_static_method_call(const zend_function *fbc); ZEND_API void zend_frameless_observed_call(zend_execute_data *execute_data); From d648cc1087efa03ba412b66562bc20b971849037 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 2 Apr 2026 17:38:10 +0100 Subject: [PATCH 236/300] Zend/zend_execute.c: use uint32_t type instead of int type --- Zend/zend_execute.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 474e8a826e14..85461eaa1569 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -4905,9 +4905,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */ { - int i; - - for (i = 0; i < EX(func)->op_array.last_live_range; i++) { + for (uint32_t i = 0; i < EX(func)->op_array.last_live_range; i++) { const zend_live_range *range = &EX(func)->op_array.live_range[i]; if (range->start > op_num) { /* further blocks will not be relevant... */ From 6c5bed3c5671acfbbd53cc31edff06407dab3f93 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 2 Apr 2026 15:28:33 +0200 Subject: [PATCH 237/300] Fix missing addref for __unset Fixes GH-21603 Closes GH-21604 --- NEWS | 1 + Zend/tests/gh21603.phpt | 22 ++++++++++++++++++++++ Zend/zend_object_handlers.c | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 Zend/tests/gh21603.phpt diff --git a/NEWS b/NEWS index 6c284c501b0a..8c423fe61cec 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP NEWS . Fixed bug GH-21605 (Missing addref for Countable::count()). (ilutov) . Fixed bug GH-21699 (Assertion failure in shutdown_executor when resolving self::/parent::/static:: callables if the error handler throws). (macoaure) + . Fixed bug GH-21603 (Missing addref for __unset). (ilutov) - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) diff --git a/Zend/tests/gh21603.phpt b/Zend/tests/gh21603.phpt new file mode 100644 index 000000000000..ab2fbc44e797 --- /dev/null +++ b/Zend/tests/gh21603.phpt @@ -0,0 +1,22 @@ +--TEST-- +GH-21603: Missing addref for __unset +--CREDITS-- +cnwangjihe +--FILE-- +prop); + +?> +--EXPECTF-- +object(C)#%d (0) { +} diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 28fd8254249c..50f563b2c605 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1653,9 +1653,11 @@ ZEND_API void zend_std_unset_property(zend_object *zobj, zend_string *name, void } if (!((*guard) & IN_UNSET)) { /* have unsetter - try with it! */ + GC_ADDREF(zobj); (*guard) |= IN_UNSET; /* prevent circular unsetting */ zend_std_call_unsetter(zobj, name); (*guard) &= ~IN_UNSET; + OBJ_RELEASE(zobj); return; } else if (UNEXPECTED(IS_WRONG_PROPERTY_OFFSET(property_offset))) { /* Trigger the correct error */ From d0d1627f25df295cc3c081e9e36a4cf290472923 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 14 Apr 2026 14:29:29 +0100 Subject: [PATCH 238/300] ext/phar: add missing EXTENSIONS section for test (#21744) --- ext/phar/tests/invalid_string_phar_mungserver.phpt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/phar/tests/invalid_string_phar_mungserver.phpt b/ext/phar/tests/invalid_string_phar_mungserver.phpt index 46de113f6c08..8128987dacbc 100644 --- a/ext/phar/tests/invalid_string_phar_mungserver.phpt +++ b/ext/phar/tests/invalid_string_phar_mungserver.phpt @@ -1,5 +1,7 @@ --TEST-- Passing invalid string to Phar::mungServer() +--EXTENSIONS-- +phar --FILE-- Date: Tue, 14 Apr 2026 10:27:40 -0400 Subject: [PATCH 239/300] UPGRADING: document SplFileObject iterator fixes in PHP 8.6 (#21753) Add an SPL entry to section 1 covering the behavior changes from GH-8561, GH-8562, GH-8563, and GH-8564, so library authors can adapt code that relied on the prior desynced behavior. --- UPGRADING | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UPGRADING b/UPGRADING index e64b65e7b0b8..5e32a5418b52 100644 --- a/UPGRADING +++ b/UPGRADING @@ -59,6 +59,18 @@ PHP 8.6 UPGRADE NOTES with empty data (e.g. to destroy the session) should implement the same logic in their updateTimestamp() method. +- SPL: + . SplFileObject::next() now advances the stream when no prior current() + call has cached a line. A subsequent current() call returns the new + line rather than the previous one. + . SplFileObject::fgets() no longer caches the returned line for + subsequent current() calls. current() now re-reads from the current + stream position instead of returning the line fgets() just returned. + . SplFileObject::next() past EOF no longer increments key() without + bound. SplFileObject::seek() past EOF now produces the same key() + value as SplTempFileObject; the two previously returned different + values. + - Standard: . Form feed (\f) is now added in the default trimmed characters of trim(), rtrim() and ltrim(). RFC: https://wiki.php.net/rfc/trim_form_feed From 1195f271d068e57f692027a6e293865e97495eca Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 14 Apr 2026 15:28:29 +0100 Subject: [PATCH 240/300] ext/phar: restructure code to be more legible (#21745) --- ext/phar/func_interceptors.c | 82 +++++++++++++++++------------------- ext/phar/util.c | 2 +- 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index fdaf0d3cb041..01a0faeaab9e 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -57,7 +57,7 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_len; /* retrieving a file within the current directory, so use this if possible */ - entry = phar_fix_filepath(entry, &entry_len, 1); + entry = phar_fix_filepath(entry, &entry_len, true); if (entry[0] == '/') { spprintf(&name, 4096, "phar://%s%s", arch, entry); @@ -117,19 +117,18 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool } } else { size_t entry_len = ZSTR_LEN(filename); - char *entry = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &entry_len, 1); + char *entry = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &entry_len, true); + bool is_in_phar; if (entry[0] == '/') { - if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) { - /* this file is not in the phar, use the original path */ -notfound: - efree(entry); - efree(arch); - return NULL; - } + is_in_phar = zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1); } else { - if (!zend_hash_str_exists(&(phar->manifest), entry, entry_len)) { - goto notfound; - } + is_in_phar = zend_hash_str_exists(&(phar->manifest), entry, entry_len); + } + /* this file is not in the phar, use the original path */ + if (!is_in_phar) { + efree(entry); + efree(arch); + return NULL; } /* auto-convert to phar:// */ if (entry[0] == '/') { @@ -483,7 +482,6 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ size_t arch_len, entry_len; zend_string *fname; zend_stat_t sb = {0}; - phar_entry_info *data = NULL; phar_archive_data *phar; fname = zend_get_executed_filename_ex(); @@ -513,15 +511,18 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ goto skip_phar; } splitted: - entry = phar_fix_filepath(entry, &entry_len, 1); + entry = phar_fix_filepath(entry, &entry_len, true); + const phar_entry_info *data = NULL; if (entry[0] == '/') { - if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) { + data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + if (data) { efree(entry); goto stat_entry; } goto notfound; } - if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) { + data = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); + if (data) { efree(entry); goto stat_entry; } @@ -552,8 +553,9 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ PHAR_G(cwd) = "/"; PHAR_G(cwd_len) = 0; /* clean path without cwd */ - entry = phar_fix_filepath(entry, &entry_len, 1); - if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) { + entry = phar_fix_filepath(entry, &entry_len, true); + data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + if (data) { PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; efree(entry); @@ -755,20 +757,18 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { phar_entry_info *etemp; - entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1); + entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, true); if (entry[0] == '/') { - if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) { - /* this file is not in the current directory, use the original path */ -found_it: - efree(entry); - efree(arch); - RETURN_BOOL(!etemp->is_dir); - } + etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); } else { - if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) { - goto found_it; - } + etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); } + if (etemp) { + efree(entry); + efree(arch); + RETURN_BOOL(!etemp->is_dir); + } + /* this file is not in the current directory, use the original path */ } if (entry != filename) { efree(entry); @@ -800,7 +800,7 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ goto skip_phar; } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch, *entry; + char *arch; size_t arch_len, entry_len; zend_string *fname = zend_get_executed_filename_ex(); @@ -813,29 +813,25 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { phar_archive_data *phar; - entry = filename; + char *entry = filename; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = filename_len; /* retrieving a file within the current directory, so use this if possible */ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { phar_entry_info *etemp; - entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1); + entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, true); if (entry[0] == '/') { - if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) { - /* this file is not in the current directory, use the original path */ -found_it: - efree(entry); - efree(arch); - RETURN_BOOL(etemp->link); - } + etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); } else { - if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) { - goto found_it; - } + etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); + } + efree(entry); + if (etemp) { + efree(arch); + RETURN_BOOL(etemp->link); } } - efree(entry); efree(arch); RETURN_FALSE; } diff --git a/ext/phar/util.c b/ext/phar/util.c index 3e54fcfc1d12..ad2c16de2ccc 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -317,7 +317,7 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data } try_len = ZSTR_LEN(filename); - test = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &try_len, 1); + test = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &try_len, true); if (*test == '/') { if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) { From 3948dbe4729a59649cb5b793594fd62fc01e4dcb Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 14 Apr 2026 19:06:12 +0100 Subject: [PATCH 241/300] ext/phar: use zend_string* and concat API for constructor argument --- ext/phar/phar_object.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 5aeedbfcbdd7..f522d52ba6c4 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1179,20 +1179,29 @@ PHP_METHOD(Phar, __construct) phar_obj->archive = phar_data; phar_obj->spl.oth_handler = &phar_spl_foreign_handler; + zend_string *file_name_for_recursive_director_iterator_constructor; if (entry) { - fname_len = spprintf(&fname, 0, "phar://%s%s", phar_data->fname, entry); + file_name_for_recursive_director_iterator_constructor = zend_string_concat3( + ZEND_STRL("phar://"), + phar_data->fname, phar_data->fname_len, + entry, entry_len + ); efree(entry); } else { - fname_len = spprintf(&fname, 0, "phar://%s", phar_data->fname); + file_name_for_recursive_director_iterator_constructor = zend_string_concat2( + ZEND_STRL("phar://"), + phar_data->fname, phar_data->fname_len + ); } - ZVAL_STRINGL(&arg1, fname, fname_len); + ZVAL_STR(&arg1, file_name_for_recursive_director_iterator_constructor); ZVAL_LONG(&arg2, flags); zend_call_known_instance_method_with_2_params(spl_ce_RecursiveDirectoryIterator->constructor, Z_OBJ_P(ZEND_THIS), NULL, &arg1, &arg2); - zval_ptr_dtor(&arg1); + /* Freeing arg1 */ + zend_string_release_ex(file_name_for_recursive_director_iterator_constructor, false); if (!phar_data->is_persistent) { phar_obj->archive->is_data = is_data; @@ -1202,7 +1211,6 @@ PHP_METHOD(Phar, __construct) } phar_obj->spl.info_class = phar_ce_entry; - efree(fname); } /* }}} */ From e1c5049ed9bb6c62dc7ff59515ad8ab2e81a3fa6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 14 Apr 2026 14:37:43 +0100 Subject: [PATCH 242/300] ext/phar: refactor phar_fix_filepath() to return zend_string* rather than out params --- ext/phar/func_interceptors.c | 113 +++++++++++++++-------------------- ext/phar/phar.c | 96 ++++++++++++++--------------- ext/phar/phar_internal.h | 2 +- ext/phar/util.c | 28 ++++----- 4 files changed, 112 insertions(+), 127 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 01a0faeaab9e..a8867ed57cd5 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -38,8 +38,8 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch, *entry; - size_t arch_len, entry_len; + char *arch; + size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -53,18 +53,16 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ php_stream *stream; char *name; - entry = estrndup(filename, filename_len); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - entry_len = filename_len; /* retrieving a file within the current directory, so use this if possible */ - entry = phar_fix_filepath(entry, &entry_len, true); + zend_string *entry = phar_fix_filepath(filename, filename_len, true); - if (entry[0] == '/') { - spprintf(&name, 4096, "phar://%s%s", arch, entry); + if (ZSTR_VAL(entry)[0] == '/') { + spprintf(&name, 4096, "phar://%s%s", arch, ZSTR_VAL(entry)); } else { - spprintf(&name, 4096, "phar://%s/%s", arch, entry); + spprintf(&name, 4096, "phar://%s/%s", arch, ZSTR_VAL(entry)); } - efree(entry); + zend_string_release_ex(entry, false); efree(arch); if (zcontext) { context = php_stream_context_from_zval(zcontext, 0); @@ -116,32 +114,31 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool return NULL; } } else { - size_t entry_len = ZSTR_LEN(filename); - char *entry = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &entry_len, true); + zend_string *entry = phar_fix_filepath(ZSTR_VAL(filename), ZSTR_LEN(filename), true); bool is_in_phar; - if (entry[0] == '/') { - is_in_phar = zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1); + if (ZSTR_VAL(entry)[0] == '/') { + is_in_phar = zend_hash_str_exists(&(phar->manifest), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1); } else { - is_in_phar = zend_hash_str_exists(&(phar->manifest), entry, entry_len); + is_in_phar = zend_hash_exists(&(phar->manifest), entry); } /* this file is not in the phar, use the original path */ if (!is_in_phar) { - efree(entry); + zend_string_release_ex(entry, false); efree(arch); return NULL; } /* auto-convert to phar:// */ - if (entry[0] == '/') { - ZEND_ASSERT(strlen("phar://") + arch_len + entry_len < 4096); + if (ZSTR_VAL(entry)[0] == '/') { + ZEND_ASSERT(strlen("phar://") + arch_len + ZSTR_LEN(entry) < 4096); name = zend_string_concat3( "phar://", strlen("phar://"), arch, arch_len, - entry, entry_len + ZSTR_VAL(entry), ZSTR_LEN(entry) ); } else { - name = strpprintf(4096, "phar://%s/%s", arch, entry); + name = strpprintf(4096, "phar://%s/%s", arch, ZSTR_VAL(entry)); } - efree(entry); + zend_string_release_ex(entry, false); } efree(arch); @@ -478,8 +475,8 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ } if (!IS_ABSOLUTE_PATH(filename, filename_length) && !strstr(filename, "://")) { - char *arch, *entry; - size_t arch_len, entry_len; + char *arch; + size_t arch_len; zend_string *fname; zend_stat_t sb = {0}; phar_archive_data *phar; @@ -495,39 +492,34 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ if (PHAR_G(last_phar) && ZSTR_LEN(fname) - 7 >= PHAR_G(last_phar_name_len) && !memcmp(ZSTR_VAL(fname) + 7, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len))) { arch = estrndup(PHAR_G(last_phar_name), PHAR_G(last_phar_name_len)); arch_len = PHAR_G(last_phar_name_len); - entry = estrndup(filename, filename_length); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - entry_len = filename_length; phar = PHAR_G(last_phar); goto splitted; } if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { - entry = estrndup(filename, filename_length); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - entry_len = filename_length; if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { efree(arch); - efree(entry); goto skip_phar; } -splitted: - entry = phar_fix_filepath(entry, &entry_len, true); +splitted:; + zend_string *entry = phar_fix_filepath(filename, filename_length, true); const phar_entry_info *data = NULL; - if (entry[0] == '/') { - data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + if (ZSTR_VAL(entry)[0] == '/') { + data = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1); if (data) { - efree(entry); + zend_string_release_ex(entry, false); goto stat_entry; } goto notfound; } - data = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); + data = zend_hash_find_ptr(&(phar->manifest), entry); if (data) { - efree(entry); + zend_string_release_ex(entry, false); goto stat_entry; } - if (zend_hash_str_exists(&(phar->virtual_dirs), entry, entry_len)) { - efree(entry); + if (zend_hash_exists(&(phar->virtual_dirs), entry)) { + zend_string_release_ex(entry, false); efree(arch); if (IS_EXISTS_CHECK(type)) { RETURN_TRUE; @@ -544,31 +536,29 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ size_t save_len; notfound: - efree(entry); + zend_string_release_ex(entry, false); save = PHAR_G(cwd); save_len = PHAR_G(cwd_len); /* this file is not in the current directory, use the original path */ - entry = estrndup(filename, filename_length); - entry_len = filename_length; PHAR_G(cwd) = "/"; PHAR_G(cwd_len) = 0; /* clean path without cwd */ - entry = phar_fix_filepath(entry, &entry_len, true); - data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + entry = phar_fix_filepath(filename, filename_length, true); + data = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1); if (data) { PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; - efree(entry); + zend_string_release_ex(entry, false); if (IS_EXISTS_CHECK(type)) { efree(arch); RETURN_TRUE; } goto stat_entry; } - if (zend_hash_str_exists(&(phar->virtual_dirs), entry + 1, entry_len - 1)) { + if (zend_hash_str_exists(&(phar->virtual_dirs), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1)) { PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; - efree(entry); + zend_string_release_ex(entry, false); efree(arch); if (IS_EXISTS_CHECK(type)) { RETURN_TRUE; @@ -583,7 +573,7 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ } PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; - efree(entry); + zend_string_release_ex(entry, false); efree(arch); /* Error Occurred */ if (!IS_EXISTS_CHECK(type)) { @@ -737,8 +727,8 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ goto skip_phar; } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch, *entry; - size_t arch_len, entry_len; + char *arch; + size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -750,29 +740,24 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { phar_archive_data *phar; - entry = filename; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - entry_len = filename_len; /* retrieving a file within the current directory, so use this if possible */ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { phar_entry_info *etemp; - entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, true); - if (entry[0] == '/') { - etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + zend_string *entry = phar_fix_filepath(filename, filename_len, true); + if (ZSTR_VAL(entry)[0] == '/') { + etemp = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1); } else { - etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); + etemp = zend_hash_find_ptr(&(phar->manifest), entry); } + zend_string_release_ex(entry, false); if (etemp) { - efree(entry); efree(arch); RETURN_BOOL(!etemp->is_dir); } /* this file is not in the current directory, use the original path */ } - if (entry != filename) { - efree(entry); - } efree(arch); RETURN_FALSE; } @@ -801,7 +786,7 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { char *arch; - size_t arch_len, entry_len; + size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -813,20 +798,18 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { phar_archive_data *phar; - char *entry = filename; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - entry_len = filename_len; /* retrieving a file within the current directory, so use this if possible */ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { phar_entry_info *etemp; - entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, true); - if (entry[0] == '/') { - etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1); + zend_string *entry = phar_fix_filepath(filename, filename_len, true); + if (ZSTR_VAL(entry)[0] == '/') { + etemp = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(entry) + 1, ZSTR_LEN(entry) - 1); } else { - etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len); + etemp = zend_hash_find_ptr(&(phar->manifest), entry); } - efree(entry); + zend_string_release_ex(entry, false); if (etemp) { efree(arch); RETURN_BOOL(etemp->link); diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 8cabe4bce2ab..b5cd3cbba437 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2059,31 +2059,29 @@ static bool php_check_dots(const char *element, size_t n) /* {{{ */ /** * Remove .. and . references within a phar filename */ -char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd) /* {{{ */ +zend_string* phar_fix_filepath(const char *path, size_t path_length, bool use_cwd) /* {{{ */ { - char *newpath; - size_t newpath_len; - char *ptr; - char *tok; - size_t ptr_length, path_length = *new_len; - - if (PHAR_G(cwd_len) && use_cwd && path_length > 2 && path[0] == '.' && path[1] == '/') { - newpath_len = PHAR_G(cwd_len); - newpath = emalloc(strlen(path) + newpath_len + 1); - memcpy(newpath, PHAR_G(cwd), newpath_len); + zend_string *new_path; + size_t new_path_len; + size_t ptr_length; + + if (use_cwd && PHAR_G(cwd_len) && path_length > 2 && path[0] == '.' && path[1] == '/') { + new_path = zend_string_alloc(path_length + path_length + 1, false); + new_path_len = PHAR_G(cwd_len); + memcpy(ZSTR_VAL(new_path), PHAR_G(cwd), PHAR_G(cwd_len)); } else { - newpath = emalloc(strlen(path) + 2); - newpath[0] = '/'; - newpath_len = 1; + new_path = zend_string_alloc(path_length + 2, false); + ZSTR_VAL(new_path)[0] = '/'; + new_path_len = 1; } - ptr = path; + const char *ptr = path; if (*ptr == '/') { ++ptr; } - tok = ptr; + const char *tok = ptr; do { ptr = memchr(ptr, '/', path_length - (ptr - path)); @@ -2093,46 +2091,42 @@ char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd) /* {{{ */ switch (path_length - (tok - path)) { case 1: if (*tok == '.') { - efree(path); - *new_len = 1; - efree(newpath); - return estrndup("/", 1); + zend_string_release_ex(new_path, false); + return ZSTR_CHAR('/'); } break; case 2: if (tok[0] == '.' && tok[1] == '.') { - efree(path); - *new_len = 1; - efree(newpath); - return estrndup("/", 1); + zend_string_release_ex(new_path, false); + return ZSTR_CHAR('/'); } } - efree(newpath); - return path; + zend_string_release_ex(new_path, false); + return zend_string_init(path, path_length, false); } while (ptr) { ptr_length = ptr - tok; last_time: if (IS_DIRECTORY_UP(tok, ptr_length)) { - while (newpath_len > 1 && !IS_BACKSLASH(newpath[newpath_len - 1])) { - newpath_len--; + while (new_path_len > 1 && !IS_BACKSLASH(ZSTR_VAL(new_path)[new_path_len - 1])) { + new_path_len--; } - if (newpath[0] != '/') { - newpath[newpath_len] = '\0'; - } else if (newpath_len > 1) { - --newpath_len; + if (ZSTR_VAL(new_path)[0] != '/') { + ZSTR_VAL(new_path)[new_path_len] = '\0'; + } else if (new_path_len > 1) { + --new_path_len; } } else if (!IS_DIRECTORY_CURRENT(tok, ptr_length)) { - if (newpath_len > 1) { - newpath[newpath_len++] = '/'; - memcpy(newpath + newpath_len, tok, ptr_length+1); + if (new_path_len > 1) { + ZSTR_VAL(new_path)[new_path_len++] = '/'; + memcpy(ZSTR_VAL(new_path) + new_path_len, tok, ptr_length+1); } else { - memcpy(newpath + newpath_len, tok, ptr_length+1); + memcpy(ZSTR_VAL(new_path) + new_path_len, tok, ptr_length+1); } - newpath_len += ptr_length; + new_path_len += ptr_length; } if (ptr == path + path_length) { @@ -2152,10 +2146,8 @@ char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd) /* {{{ */ } } - efree(path); - *new_len = newpath_len; - newpath[newpath_len] = '\0'; - return erealloc(newpath, newpath_len + 1); + ZSTR_VAL(new_path)[new_path_len] = '\0'; + return zend_string_realloc(new_path, new_path_len, false); } /* }}} */ @@ -2224,12 +2216,22 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a if (entry) { if (ext_str[ext_len]) { - *entry_len = filename_len - *arch_len; - *entry = estrndup(ext_str+ext_len, *entry_len); - #ifdef PHP_WIN32 - phar_unixify_path_separators(*entry, *entry_len); - #endif - *entry = phar_fix_filepath(*entry, entry_len, 0); + size_t computed_entry_len = filename_len - *arch_len; +#ifdef PHP_WIN32 + /* TODO: can we handle the unixify path in phar_fix_filepath() directly ? */ + char *fixed_path_for_windows = estrndup(ext_str+ext_len, computed_entry_len); + phar_unixify_path_separators(fixed_path_for_windows, computed_entry_len); + zend_string *entry_str = phar_fix_filepath(fixed_path_for_windows, computed_entry_len, false); + *entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str)); + *entry_len = ZSTR_LEN(entry_str); + zend_string_release_ex(entry_str, false); + efree(fixed_path_for_windows); +#else + zend_string *entry_str = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false); + *entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str)); + *entry_len = ZSTR_LEN(entry_str); + zend_string_release_ex(entry_str, false); +#endif } else { *entry_len = 1; *entry = estrndup("/", 1); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index bce0f03d6eb2..a2b7e67a2e81 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -427,7 +427,7 @@ const char *phar_compress_filter(const phar_entry_info *entry, bool return_unkno void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t filename_len, char *path, size_t path_len); zend_string *phar_find_in_include_path(zend_string *file, phar_archive_data **pphar); -char *phar_fix_filepath(char *path, size_t *new_len, bool use_cwd); +zend_string* phar_fix_filepath(const char *path, size_t path_length, bool use_cwd); ZEND_ATTRIBUTE_NONNULL phar_entry_info * phar_open_jit(const phar_archive_data *phar, phar_entry_info *entry, char **error); void phar_parse_metadata_lazy(const char *buffer, phar_metadata_tracker *tracker, uint32_t zip_metadata_len, bool persistent); bool phar_metadata_tracker_has_data(const phar_metadata_tracker* tracker, bool persistent); diff --git a/ext/phar/util.c b/ext/phar/util.c index ad2c16de2ccc..aad6e5f7f085 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -266,7 +266,7 @@ zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t fil zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data **pphar) /* {{{ */ { zend_string *ret; - char *path, *arch, *test; + char *path, *arch; size_t arch_len; phar_archive_data *phar; @@ -305,8 +305,6 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data } if (*ZSTR_VAL(filename) == '.') { - size_t try_len; - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { efree(arch); return NULL; @@ -316,25 +314,27 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data *pphar = phar; } - try_len = ZSTR_LEN(filename); - test = phar_fix_filepath(estrndup(ZSTR_VAL(filename), ZSTR_LEN(filename)), &try_len, true); - - if (*test == '/') { - if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) { - ret = strpprintf(0, "phar://%s%s", arch, test); + zend_string *test = phar_fix_filepath(ZSTR_VAL(filename), ZSTR_LEN(filename), true); + if (ZSTR_VAL(test)[0] == '/') { + if (zend_hash_str_exists(&(phar->manifest), ZSTR_VAL(test) + 1, ZSTR_LEN(test) - 1)) { + ret = zend_string_concat3( + "phar://", strlen("phar://"), + arch, arch_len, + ZSTR_VAL(test), ZSTR_LEN(test) + ); + zend_string_release_ex(test, false); efree(arch); - efree(test); return ret; } } else { - if (zend_hash_str_exists(&(phar->manifest), test, try_len)) { - ret = strpprintf(0, "phar://%s/%s", arch, test); + if (zend_hash_exists(&(phar->manifest), test)) { + ret = strpprintf(0, "phar://%s/%s", arch, ZSTR_VAL(test)); + zend_string_release_ex(test, false); efree(arch); - efree(test); return ret; } } - efree(test); + zend_string_release_ex(test, false); } spprintf(&path, MAXPATHLEN + 1 + strlen(PG(include_path)), "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path)); From b8c3bf91a21727236be1f3da400663c2c07d6014 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 15 Apr 2026 12:35:37 +0100 Subject: [PATCH 243/300] ext/phar: Drop unnecessary Windows code as filepath is already unixied. (#21764) This code is effectively doing an unnecessary allocation and work that has already been done. --- ext/phar/phar.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index b5cd3cbba437..02a2f09f9527 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2217,21 +2217,12 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a if (entry) { if (ext_str[ext_len]) { size_t computed_entry_len = filename_len - *arch_len; -#ifdef PHP_WIN32 - /* TODO: can we handle the unixify path in phar_fix_filepath() directly ? */ - char *fixed_path_for_windows = estrndup(ext_str+ext_len, computed_entry_len); - phar_unixify_path_separators(fixed_path_for_windows, computed_entry_len); - zend_string *entry_str = phar_fix_filepath(fixed_path_for_windows, computed_entry_len, false); - *entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str)); - *entry_len = ZSTR_LEN(entry_str); - zend_string_release_ex(entry_str, false); - efree(fixed_path_for_windows); -#else + /* We don't need to unixify the path on Windows, + * as ext_str is derived from filename that was already unixify */ zend_string *entry_str = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false); *entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str)); *entry_len = ZSTR_LEN(entry_str); zend_string_release_ex(entry_str, false); -#endif } else { *entry_len = 1; *entry = estrndup("/", 1); From edd99f7b5a8b7e3e7db05c8b9c152e7c3ed2f993 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 15 Apr 2026 13:49:30 +0200 Subject: [PATCH 244/300] ext/ldap: Enable ldap_set_rebind_proc() on Windows (#21749) Windows uses OpenLDAP which provides ldap_set_rebind_proc() with a 3-arg-signature: https://github.com/winlibs/openldap --- ext/ldap/config.w32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32 index 7dbb353dd80b..c6a7049aa1c6 100644 --- a/ext/ldap/config.w32 +++ b/ext/ldap/config.w32 @@ -24,7 +24,7 @@ if (PHP_LDAP != "no") { AC_DEFINE('HAVE_LDAP_WHOAMI_S', 1); AC_DEFINE('HAVE_LDAP_REFRESH_S', 1); AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION', 1); - + AC_DEFINE('HAVE_3ARG_SETREBINDPROC', 1); } else { WARNING("ldap not enabled; libraries and headers not found"); } From fbd30175115a206e95f70c3ddbac16ec6f3b302e Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Wed, 15 Apr 2026 08:49:37 -0700 Subject: [PATCH 245/300] GH-21754: sapi/cli: avoid deprecation messages with `--rf` and methods (#21758) --- NEWS | 4 ++++ sapi/cli/php_cli.c | 18 +++++++++++++++--- sapi/cli/tests/004.phpt | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 8c423fe61cec..f3b3e3a6aa38 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ PHP NEWS self::/parent::/static:: callables if the error handler throws). (macoaure) . Fixed bug GH-21603 (Missing addref for __unset). (ilutov) +- CLI: + . Fixed bug GH-21754 (`--rf` command line option with a method triggers + ext/reflection deprecation warnings). (DanielEScherzer) + - Curl: . Add support for brotli and zstd on Windows. (Shivam Mathur) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 9444f3d6253a..4b19cf0604c6 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1042,13 +1042,25 @@ static int do_cli(int argc, char **argv) /* {{{ */ } ZVAL_STRING(&arg, reflection_what); - object_init_ex(&ref, pce); memset(&execute_data, 0, sizeof(zend_execute_data)); execute_data.func = (zend_function *) &zend_pass_function; EG(current_execute_data) = &execute_data; - zend_call_known_instance_method_with_1_params( - pce->constructor, Z_OBJ(ref), NULL, &arg); + // Avoid deprecation warnings from ReflectionMethod::__construct() + // with one argument + if (pce == reflection_method_ptr) { + zend_function *create_from_method = zend_hash_str_find_ptr( + &(pce->function_table), + "createfrommethodname", + strlen( "createFromMethodName" ) + ); + zend_call_known_function( + create_from_method, NULL, pce, &ref, 1, &arg, NULL); + } else { + object_init_ex(&ref, pce); + zend_call_known_instance_method_with_1_params( + pce->constructor, Z_OBJ(ref), NULL, &arg); + } if (EG(exception)) { zval rv; diff --git a/sapi/cli/tests/004.phpt b/sapi/cli/tests/004.phpt index 83da934c8ff1..69dc46b5b902 100644 --- a/sapi/cli/tests/004.phpt +++ b/sapi/cli/tests/004.phpt @@ -12,6 +12,9 @@ $php = getenv('TEST_PHP_EXECUTABLE_ESCAPED'); var_dump(`$php -n --rf unknown`); var_dump(`$php -n --rf echo`); var_dump(`$php -n --rf phpinfo`); +// Regression tests for https://github.com/php/php-src/issues/21754 +var_dump(`$php -n --rf ReflectionMethod::__construct`); +var_dump(`$php -n --rf ReflectionMethod::missing`); echo "Done\n"; ?> @@ -28,5 +31,16 @@ string(155) "Function [ function phpinfo ] { - Return [ true ] } +" +string(213) "Method [ public method __construct ] { + + - Parameters [2] { + Parameter #0 [ object|string $objectOrMethod ] + Parameter #1 [ ?string $method = null ] + } +} + +" +string(61) "Exception: Method ReflectionMethod::missing() does not exist " Done From f437b8b0e9f6177608968a38c00bcfd74032b9bc Mon Sep 17 00:00:00 2001 From: Jorg Adam Sowa Date: Wed, 15 Apr 2026 18:42:11 +0200 Subject: [PATCH 246/300] docs: add error message wording conventions to CODING_STANDARDS (#21761) --- CODING_STANDARDS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md index 47b76717c839..3a53d0e258ca 100644 --- a/CODING_STANDARDS.md +++ b/CODING_STANDARDS.md @@ -79,6 +79,16 @@ rewritten to comply with these rules. return value for functions that perform some operation that may succeed or fail. +1. When throwing a `ValueError` or emitting a warning, use consistent + phrasing for error messages. Common patterns are: + + * Type errors: `must be of type int` (use the type name, not e.g. `must be an integer`) + * Range/boundary: `must be between X and Y` / `must be greater than [or equal to] X` / `must be less than X` / `must be finite` + * String constraints: `must not contain any null bytes` / `must not be empty` / `must be a single character` + * Valid value: `must be a valid X` (e.g. `must be a valid encoding`, `must be a valid calendar ID`) + * Enum-like: `must be one of X, Y, or Z` + * Structural: `must have X` / `must have key X` / `must have N elements` + ## User functions/methods naming conventions 1. Function names for user-level functions should be enclosed with in the From 16baee5aafad148c297fff4ae861607e3d13ca2c Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 14 Mar 2026 14:30:10 +0100 Subject: [PATCH 247/300] Upgrade Lexbor to v2.7.0 Co-authored-by: Ilija Tovilo --- ext/dom/config.m4 | 17 +- ext/dom/config.w32 | 10 +- ext/dom/lexbor/lexbor/core/base.h | 6 +- ext/dom/lexbor/lexbor/core/def.h | 2 + ext/dom/lexbor/lexbor/core/diyfp.c | 36 +- ext/dom/lexbor/lexbor/core/diyfp.h | 35 +- ext/dom/lexbor/lexbor/core/dtoa.c | 63 +- ext/dom/lexbor/lexbor/core/dtoa.h | 34 +- ext/dom/lexbor/lexbor/core/hash.c | 9 +- ext/dom/lexbor/lexbor/core/in.c | 3 +- ext/dom/lexbor/lexbor/core/shs.c | 10 +- ext/dom/lexbor/lexbor/core/str.c | 31 +- ext/dom/lexbor/lexbor/core/str.h | 7 +- ext/dom/lexbor/lexbor/core/str_res.h | 138 +- ext/dom/lexbor/lexbor/core/strtod.c | 38 +- ext/dom/lexbor/lexbor/core/strtod.h | 34 +- ext/dom/lexbor/lexbor/css/at_rule.c | 449 ++ ext/dom/lexbor/lexbor/css/at_rule.h | 50 +- ext/dom/lexbor/lexbor/css/at_rule/const.h | 9 +- ext/dom/lexbor/lexbor/css/at_rule/res.h | 17 +- ext/dom/lexbor/lexbor/css/at_rule/state.c | 374 ++ ext/dom/lexbor/lexbor/css/at_rule/state.h | 108 +- ext/dom/lexbor/lexbor/css/at_rule/types.h | 60 + ext/dom/lexbor/lexbor/css/base.h | 21 +- ext/dom/lexbor/lexbor/css/blank.c | 389 ++ ext/dom/lexbor/lexbor/css/blank.h | 38 + ext/dom/lexbor/lexbor/css/css.c | 39 +- ext/dom/lexbor/lexbor/css/css.h | 4 +- ext/dom/lexbor/lexbor/css/declaration.c | 86 + ext/dom/lexbor/lexbor/css/declaration.h | 17 +- ext/dom/lexbor/lexbor/css/log.c | 2 +- ext/dom/lexbor/lexbor/css/parser.c | 222 +- ext/dom/lexbor/lexbor/css/parser.h | 456 +- ext/dom/lexbor/lexbor/css/property.c | 3171 ++++++++++ ext/dom/lexbor/lexbor/css/property/const.h | 2 +- ext/dom/lexbor/lexbor/css/property/res.h | 2 +- ext/dom/lexbor/lexbor/css/property/state.c | 5343 +++++++++++++++++ ext/dom/lexbor/lexbor/css/property/types.h | 21 + ext/dom/lexbor/lexbor/css/rule.c | 598 ++ ext/dom/lexbor/lexbor/css/rule.h | 32 +- ext/dom/lexbor/lexbor/css/selectors/base.h | 4 +- .../lexbor/css/selectors/pseudo_const.h | 19 +- .../lexbor/lexbor/css/selectors/pseudo_res.h | 98 +- .../lexbor/css/selectors/pseudo_state.c | 130 +- .../lexbor/css/selectors/pseudo_state.h | 4 + .../lexbor/lexbor/css/selectors/selector.c | 79 +- .../lexbor/lexbor/css/selectors/selector.h | 6 + .../lexbor/lexbor/css/selectors/selectors.c | 118 +- ext/dom/lexbor/lexbor/css/selectors/state.c | 18 +- ext/dom/lexbor/lexbor/css/state.c | 627 +- ext/dom/lexbor/lexbor/css/state.h | 27 +- ext/dom/lexbor/lexbor/css/stylesheet.c | 110 + ext/dom/lexbor/lexbor/css/stylesheet.h | 64 +- ext/dom/lexbor/lexbor/css/syntax/anb.c | 13 +- ext/dom/lexbor/lexbor/css/syntax/base.h | 2 +- ext/dom/lexbor/lexbor/css/syntax/parser.c | 1817 +++--- ext/dom/lexbor/lexbor/css/syntax/parser.h | 61 +- ext/dom/lexbor/lexbor/css/syntax/res.h | 10 +- ext/dom/lexbor/lexbor/css/syntax/state.c | 15 +- ext/dom/lexbor/lexbor/css/syntax/state_res.h | 2 +- ext/dom/lexbor/lexbor/css/syntax/syntax.c | 341 +- ext/dom/lexbor/lexbor/css/syntax/syntax.h | 259 +- ext/dom/lexbor/lexbor/css/syntax/token.c | 13 +- ext/dom/lexbor/lexbor/css/syntax/token_res.h | 10 +- ext/dom/lexbor/lexbor/css/syntax/tokenizer.c | 9 +- ext/dom/lexbor/lexbor/css/unit.c | 113 + ext/dom/lexbor/lexbor/css/unit/const.h | 2 +- ext/dom/lexbor/lexbor/css/unit/res.h | 2 +- ext/dom/lexbor/lexbor/css/value.c | 678 +++ ext/dom/lexbor/lexbor/css/value/const.h | 2 +- ext/dom/lexbor/lexbor/css/value/res.h | 2 +- ext/dom/lexbor/lexbor/dom/base.h | 6 +- ext/dom/lexbor/lexbor/dom/exception.c | 370 +- ext/dom/lexbor/lexbor/dom/exception.h | 116 +- ext/dom/lexbor/lexbor/dom/interface.h | 4 +- .../lexbor/lexbor/dom/interfaces/attr_const.h | 33 +- .../lexbor/lexbor/dom/interfaces/attr_res.h | 6 +- .../lexbor/dom/interfaces/character_data.c | 2 +- .../lexbor/dom/interfaces/document_type.c | 105 +- .../lexbor/dom/interfaces/document_type.h | 30 +- .../lexbor/lexbor/dom/interfaces/element.c | 12 + .../lexbor/lexbor/dom/interfaces/element.h | 4 + ext/dom/lexbor/lexbor/dom/interfaces/node.c | 471 ++ ext/dom/lexbor/lexbor/dom/interfaces/node.h | 118 +- .../lexbor/dom/interfaces/shadow_root.c | 2 +- ext/dom/lexbor/lexbor/encoding/base.h | 4 +- ext/dom/lexbor/lexbor/encoding/encode.c | 118 +- ext/dom/lexbor/lexbor/encoding/encoding.c | 116 + ext/dom/lexbor/lexbor/encoding/encoding.h | 71 +- ext/dom/lexbor/lexbor/encoding/multi.c | 2 +- ext/dom/lexbor/lexbor/encoding/multi.h | 160 +- ext/dom/lexbor/lexbor/encoding/range.h | 3 +- ext/dom/lexbor/lexbor/encoding/res.h | 4 +- ext/dom/lexbor/lexbor/encoding/single.h | 3 +- ext/dom/lexbor/lexbor/html/base.h | 4 +- ext/dom/lexbor/lexbor/html/encoding.c | 100 +- ext/dom/lexbor/lexbor/html/encoding.h | 141 +- ext/dom/lexbor/lexbor/html/interface.c | 15 +- ext/dom/lexbor/lexbor/html/interface.h | 3 + ext/dom/lexbor/lexbor/html/interface_res.h | 1758 +++--- .../lexbor/lexbor/html/interfaces/document.c | 17 +- .../lexbor/html/interfaces/option_element.c | 47 + .../lexbor/html/interfaces/option_element.h | 7 + .../lexbor/html/interfaces/search_element.c | 35 + .../lexbor/html/interfaces/search_element.h | 34 + .../lexbor/html/interfaces/select_element.c | 47 +- .../lexbor/html/interfaces/select_element.h | 2 + .../html/interfaces/selectedcontent_element.c | 67 + .../html/interfaces/selectedcontent_element.h | 37 + ext/dom/lexbor/lexbor/html/parser.c | 13 +- ext/dom/lexbor/lexbor/html/style.c | 23 - ext/dom/lexbor/lexbor/html/style.h | 46 - ext/dom/lexbor/lexbor/html/tag.c | 30 + ext/dom/lexbor/lexbor/html/tag.h | 33 +- ext/dom/lexbor/lexbor/html/tag_res.h | 1985 +++--- ext/dom/lexbor/lexbor/html/token.c | 13 +- ext/dom/lexbor/lexbor/html/tokenizer.c | 327 +- ext/dom/lexbor/lexbor/html/tokenizer.h | 50 +- ext/dom/lexbor/lexbor/html/tokenizer/error.c | 76 +- ext/dom/lexbor/lexbor/html/tokenizer/error.h | 106 +- ext/dom/lexbor/lexbor/html/tokenizer/res.h | 16 +- ext/dom/lexbor/lexbor/html/tokenizer/state.c | 106 +- ext/dom/lexbor/lexbor/html/tokenizer/state.h | 36 +- .../lexbor/html/tokenizer/state_comment.c | 19 +- .../lexbor/html/tokenizer/state_doctype.c | 15 +- .../lexbor/html/tokenizer/state_rawtext.c | 16 +- .../lexbor/html/tokenizer/state_rcdata.c | 16 +- .../lexbor/html/tokenizer/state_script.c | 33 +- ext/dom/lexbor/lexbor/html/tree.c | 84 +- ext/dom/lexbor/lexbor/html/tree.h | 24 +- ext/dom/lexbor/lexbor/html/tree/error.c | 68 +- ext/dom/lexbor/lexbor/html/tree/error.h | 18 +- .../lexbor/lexbor/html/tree/insertion_mode.h | 8 - .../tree/insertion_mode/foreign_content.c | 34 +- .../lexbor/html/tree/insertion_mode/in_body.c | 192 +- .../tree/insertion_mode/in_head_noscript.c | 7 + .../html/tree/insertion_mode/in_select.c | 375 -- .../tree/insertion_mode/in_select_in_table.c | 115 - ext/dom/lexbor/lexbor/ns/base.h | 4 +- ext/dom/lexbor/lexbor/ns/const.h | 2 +- ext/dom/lexbor/lexbor/ns/ns.c | 7 +- ext/dom/lexbor/lexbor/ns/res.h | 6 +- .../lexbor/selectors-adapted/selectors.c | 6 +- ext/dom/lexbor/lexbor/selectors/base.h | 4 +- ext/dom/lexbor/lexbor/selectors/selectors.c | 1447 +++-- ext/dom/lexbor/lexbor/selectors/selectors.h | 11 +- ext/dom/lexbor/lexbor/tag/base.h | 4 +- ext/dom/lexbor/lexbor/tag/const.h | 78 +- ext/dom/lexbor/lexbor/tag/res.h | 128 +- ...nd-column-information-for-use-in-PHP.patch | 38 +- ...d-added-nodes-for-options-use-in-PHP.patch | 6 +- ...and-data-structure-to-be-able-to-gen.patch | 23 +- ...ve-unused-upper-case-tag-static-data.patch | 12 +- ...nk-size-of-static-binary-search-tree.patch | 37 +- ...0006-Patch-out-unused-CSS-style-code.patch | 106 +- ext/dom/lexbor/patches/README.md | 5 +- ext/dom/lexbor/patches/update-lexbor.sh | 63 + .../modern/html/parser/Element_innerHTML.phpt | 2 +- 158 files changed, 21143 insertions(+), 5442 deletions(-) create mode 100644 ext/dom/lexbor/lexbor/css/at_rule.c create mode 100644 ext/dom/lexbor/lexbor/css/at_rule/state.c create mode 100644 ext/dom/lexbor/lexbor/css/at_rule/types.h create mode 100644 ext/dom/lexbor/lexbor/css/blank.c create mode 100644 ext/dom/lexbor/lexbor/css/blank.h create mode 100644 ext/dom/lexbor/lexbor/css/declaration.c create mode 100644 ext/dom/lexbor/lexbor/css/property.c create mode 100644 ext/dom/lexbor/lexbor/css/property/state.c create mode 100644 ext/dom/lexbor/lexbor/css/property/types.h create mode 100644 ext/dom/lexbor/lexbor/css/rule.c create mode 100644 ext/dom/lexbor/lexbor/css/stylesheet.c create mode 100644 ext/dom/lexbor/lexbor/css/unit.c create mode 100644 ext/dom/lexbor/lexbor/css/value.c create mode 100644 ext/dom/lexbor/lexbor/html/interfaces/search_element.c create mode 100644 ext/dom/lexbor/lexbor/html/interfaces/search_element.h create mode 100644 ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.c create mode 100644 ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.h delete mode 100644 ext/dom/lexbor/lexbor/html/style.c delete mode 100644 ext/dom/lexbor/lexbor/html/style.h create mode 100644 ext/dom/lexbor/lexbor/html/tag.c delete mode 100644 ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select.c delete mode 100644 ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select_in_table.c create mode 100755 ext/dom/lexbor/patches/update-lexbor.sh diff --git a/ext/dom/config.m4 b/ext/dom/config.m4 index 265dce7d50a2..f5f8a1cae8c4 100644 --- a/ext/dom/config.m4 +++ b/ext/dom/config.m4 @@ -27,15 +27,23 @@ if test "$PHP_DOM" != "no"; then $LEXBOR_DIR/core/shs.c $LEXBOR_DIR/core/str.c $LEXBOR_DIR/core/strtod.c + $LEXBOR_DIR/css/at_rule.c + $LEXBOR_DIR/css/at_rule/state.c + $LEXBOR_DIR/css/blank.c $LEXBOR_DIR/css/css.c + $LEXBOR_DIR/css/declaration.c $LEXBOR_DIR/css/log.c $LEXBOR_DIR/css/parser.c + $LEXBOR_DIR/css/property.c + $LEXBOR_DIR/css/property/state.c + $LEXBOR_DIR/css/rule.c $LEXBOR_DIR/css/selectors/pseudo_state.c $LEXBOR_DIR/css/selectors/pseudo.c $LEXBOR_DIR/css/selectors/selector.c $LEXBOR_DIR/css/selectors/selectors.c $LEXBOR_DIR/css/selectors/state.c $LEXBOR_DIR/css/state.c + $LEXBOR_DIR/css/stylesheet.c $LEXBOR_DIR/css/syntax/anb.c $LEXBOR_DIR/css/syntax/parser.c $LEXBOR_DIR/css/syntax/state.c @@ -43,6 +51,8 @@ if test "$PHP_DOM" != "no"; then $LEXBOR_DIR/css/syntax/token.c $LEXBOR_DIR/css/syntax/tokenizer.c $LEXBOR_DIR/css/syntax/tokenizer/error.c + $LEXBOR_DIR/css/unit.c + $LEXBOR_DIR/css/value.c $LEXBOR_DIR/dom/interface.c $LEXBOR_DIR/dom/interfaces/attr.c $LEXBOR_DIR/dom/interfaces/cdata_section.c @@ -118,7 +128,9 @@ if test "$PHP_DOM" != "no"; then $LEXBOR_DIR/html/interfaces/progress_element.c $LEXBOR_DIR/html/interfaces/quote_element.c $LEXBOR_DIR/html/interfaces/script_element.c + $LEXBOR_DIR/html/interfaces/search_element.c $LEXBOR_DIR/html/interfaces/select_element.c + $LEXBOR_DIR/html/interfaces/selectedcontent_element.c $LEXBOR_DIR/html/interfaces/slot_element.c $LEXBOR_DIR/html/interfaces/source_element.c $LEXBOR_DIR/html/interfaces/span_element.c @@ -139,6 +151,7 @@ if test "$PHP_DOM" != "no"; then $LEXBOR_DIR/html/interfaces/video_element.c $LEXBOR_DIR/html/interfaces/window.c $LEXBOR_DIR/html/parser.c + $LEXBOR_DIR/html/tag.c $LEXBOR_DIR/html/token_attr.c $LEXBOR_DIR/html/token.c $LEXBOR_DIR/html/tokenizer.c @@ -168,8 +181,6 @@ if test "$PHP_DOM" != "no"; then $LEXBOR_DIR/html/tree/insertion_mode/in_head_noscript.c $LEXBOR_DIR/html/tree/insertion_mode/in_head.c $LEXBOR_DIR/html/tree/insertion_mode/in_row.c - $LEXBOR_DIR/html/tree/insertion_mode/in_select_in_table.c - $LEXBOR_DIR/html/tree/insertion_mode/in_select.c $LEXBOR_DIR/html/tree/insertion_mode/in_table_body.c $LEXBOR_DIR/html/tree/insertion_mode/in_table_text.c $LEXBOR_DIR/html/tree/insertion_mode/in_table.c @@ -225,6 +236,8 @@ if test "$PHP_DOM" != "no"; then PHP_ADD_BUILD_DIR([ $ext_builddir/parentnode $ext_builddir/$LEXBOR_DIR/core + $ext_builddir/$LEXBOR_DIR/css/at_rule + $ext_builddir/$LEXBOR_DIR/css/property $ext_builddir/$LEXBOR_DIR/css/selectors $ext_builddir/$LEXBOR_DIR/css/syntax/tokenizer $ext_builddir/$LEXBOR_DIR/css/tokenizer diff --git a/ext/dom/config.w32 b/ext/dom/config.w32 index 9e922d7a3f11..d5e3af578240 100644 --- a/ext/dom/config.w32 +++ b/ext/dom/config.w32 @@ -25,12 +25,14 @@ if (PHP_DOM == "yes") { ADD_SOURCES("ext/dom/lexbor/lexbor/dom/interfaces", "attr.c cdata_section.c character_data.c comment.c document.c document_fragment.c document_type.c element.c node.c processing_instruction.c shadow_root.c text.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/html/tokenizer", "error.c state_comment.c state_doctype.c state_rawtext.c state_rcdata.c state_script.c state.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/html/tree", "active_formatting.c open_elements.c error.c", "dom"); - ADD_SOURCES("ext/dom/lexbor/lexbor/html/tree/insertion_mode", "after_after_body.c after_after_frameset.c after_body.c after_frameset.c after_head.c before_head.c before_html.c foreign_content.c in_body.c in_caption.c in_cell.c in_column_group.c in_frameset.c in_head.c in_head_noscript.c initial.c in_row.c in_select.c in_select_in_table.c in_table_body.c in_table.c in_table_text.c in_template.c text.c", "dom"); - ADD_SOURCES("ext/dom/lexbor/lexbor/html", "encoding.c interface.c parser.c token.c token_attr.c tokenizer.c tree.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/html/tree/insertion_mode", "after_after_body.c after_after_frameset.c after_body.c after_frameset.c after_head.c before_head.c before_html.c foreign_content.c in_body.c in_caption.c in_cell.c in_column_group.c in_frameset.c in_head.c in_head_noscript.c initial.c in_row.c in_table_body.c in_table.c in_table_text.c in_template.c text.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/html", "encoding.c interface.c parser.c tag.c token.c token_attr.c tokenizer.c tree.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/encoding", "decode.c encode.c encoding.c multi.c range.c res.c single.c", "dom"); - ADD_SOURCES("ext/dom/lexbor/lexbor/html/interfaces", "anchor_element.c area_element.c audio_element.c base_element.c body_element.c br_element.c button_element.c canvas_element.c data_element.c data_list_element.c details_element.c dialog_element.c directory_element.c div_element.c d_list_element.c document.c element.c embed_element.c field_set_element.c font_element.c form_element.c frame_element.c frame_set_element.c head_element.c heading_element.c hr_element.c html_element.c iframe_element.c image_element.c input_element.c label_element.c legend_element.c li_element.c link_element.c map_element.c marquee_element.c media_element.c menu_element.c meta_element.c meter_element.c mod_element.c object_element.c o_list_element.c opt_group_element.c option_element.c output_element.c paragraph_element.c param_element.c picture_element.c pre_element.c progress_element.c quote_element.c script_element.c select_element.c slot_element.c source_element.c span_element.c style_element.c table_caption_element.c table_cell_element.c table_col_element.c table_element.c table_row_element.c table_section_element.c template_element.c text_area_element.c time_element.c title_element.c track_element.c u_list_element.c unknown_element.c video_element.c window.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/html/interfaces", "anchor_element.c area_element.c audio_element.c base_element.c body_element.c br_element.c button_element.c canvas_element.c data_element.c data_list_element.c details_element.c dialog_element.c directory_element.c div_element.c d_list_element.c document.c element.c embed_element.c field_set_element.c font_element.c form_element.c frame_element.c frame_set_element.c head_element.c heading_element.c hr_element.c html_element.c iframe_element.c image_element.c input_element.c label_element.c legend_element.c li_element.c link_element.c map_element.c marquee_element.c media_element.c menu_element.c meta_element.c meter_element.c mod_element.c object_element.c o_list_element.c opt_group_element.c option_element.c output_element.c paragraph_element.c param_element.c picture_element.c pre_element.c progress_element.c quote_element.c script_element.c search_element.c select_element.c selectedcontent_element.c slot_element.c source_element.c span_element.c style_element.c table_caption_element.c table_cell_element.c table_col_element.c table_element.c table_row_element.c table_section_element.c template_element.c text_area_element.c time_element.c title_element.c track_element.c u_list_element.c unknown_element.c video_element.c window.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/selectors-adapted", "selectors.c", "dom"); - ADD_SOURCES("ext/dom/lexbor/lexbor/css", "state.c log.c parser.c css.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/css", "at_rule.c blank.c css.c declaration.c log.c parser.c property.c rule.c state.c stylesheet.c unit.c value.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/css/at_rule", "state.c", "dom"); + ADD_SOURCES("ext/dom/lexbor/lexbor/css/property", "state.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/css/selectors", "state.c selectors.c selector.c pseudo_state.c pseudo.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/css/syntax", "state.c parser.c syntax.c anb.c tokenizer.c token.c", "dom"); ADD_SOURCES("ext/dom/lexbor/lexbor/css/syntax/tokenizer", "error.c", "dom"); diff --git a/ext/dom/lexbor/lexbor/core/base.h b/ext/dom/lexbor/lexbor/core/base.h index d3a04880f220..e488dcf7334b 100644 --- a/ext/dom/lexbor/lexbor/core/base.h +++ b/ext/dom/lexbor/lexbor/core/base.h @@ -27,7 +27,7 @@ extern "C" { #include "lexbor/core/lexbor.h" #define LEXBOR_VERSION_MAJOR 2 -#define LEXBOR_VERSION_MINOR 0 +#define LEXBOR_VERSION_MINOR 7 #define LEXBOR_VERSION_PATCH 0 #define LEXBOR_VERSION_STRING LEXBOR_STRINGIZE(LEXBOR_VERSION_MAJOR) "." \ @@ -39,6 +39,10 @@ extern "C" { #define lexbor_max(val1, val2) ((val1) > (val2) ? (val1) : (val2)) #define lexbor_min(val1, val2) ((val1) < (val2) ? (val1) : (val2)) +#define LEXBOR_STR_RES_MAP_CHAR_OTHER 0x00 +#define LEXBOR_STR_RES_MAP_CHAR_A_Z_a_z 0x01 +#define LEXBOR_STR_RES_MAP_CHAR_WHITESPACE 0x02 +#define LEXBOR_STR_RES_SLIP 0xFF /* * Very important!!! diff --git a/ext/dom/lexbor/lexbor/core/def.h b/ext/dom/lexbor/lexbor/core/def.h index 5a48f59e994d..c8b94400a2df 100644 --- a/ext/dom/lexbor/lexbor/core/def.h +++ b/ext/dom/lexbor/lexbor/core/def.h @@ -54,4 +54,6 @@ #define LXB_EXTERN extern LXB_API +#define lxb_size(_size) ((size_t) (_size)) + #endif /* LEXBOR_DEF_H */ diff --git a/ext/dom/lexbor/lexbor/core/diyfp.c b/ext/dom/lexbor/lexbor/core/diyfp.c index 62020bbc645e..7bdbcbbcb08f 100644 --- a/ext/dom/lexbor/lexbor/core/diyfp.c +++ b/ext/dom/lexbor/lexbor/core/diyfp.c @@ -1,16 +1,44 @@ /* - * Copyright (C) Alexander Borisov + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * Based on nxt_diyfp.c from NGINX NJS project + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Copyright (C) Dmitry Volyntsev - * Copyright (C) NGINX, Inc. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov * + * Based on nxt_diyfp.h from NGINX NJS project * An internal diy_fp implementation. * For details, see Loitsch, Florian. "Printing floating-point numbers quickly * and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243. */ + #include "lexbor/core/diyfp.h" diff --git a/ext/dom/lexbor/lexbor/core/diyfp.h b/ext/dom/lexbor/lexbor/core/diyfp.h index 47fedb9da997..86c5336f2e03 100644 --- a/ext/dom/lexbor/lexbor/core/diyfp.h +++ b/ext/dom/lexbor/lexbor/core/diyfp.h @@ -1,11 +1,38 @@ /* - * Copyright (C) Alexander Borisov + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * Based on nxt_diyfp.h from NGINX NJS project + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Copyright (C) Dmitry Volyntsev - * Copyright (C) NGINX, Inc. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov * + * Based on nxt_diyfp.h from NGINX NJS project * An internal diy_fp implementation. * For details, see Loitsch, Florian. "Printing floating-point numbers quickly * and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243. diff --git a/ext/dom/lexbor/lexbor/core/dtoa.c b/ext/dom/lexbor/lexbor/core/dtoa.c index b1a4ee03258d..7da7ce013227 100644 --- a/ext/dom/lexbor/lexbor/core/dtoa.c +++ b/ext/dom/lexbor/lexbor/core/dtoa.c @@ -1,39 +1,36 @@ /* - * Copyright (C) Alexander Borisov - * - * Based on nxt_dtoa.c from NGINX NJS project - * - * Copyright (C) Dmitry Volyntsev - * Copyright (C) NGINX, Inc. - * - * Grisu2 algorithm implementation for printing floating-point numbers based - * upon the work of Milo Yip and Doug Currie. - * - * For algorithm information, see Loitsch, Florian. "Printing - * floating-point numbers quickly and accurately with integers." ACM Sigplan - * Notices 45.6 (2010): 233-243. - * - * Copyright (C) 2015 Doug Currie - * based on dtoa_milo.h - * Copyright (C) 2014 Milo Yip + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov */ #include "lexbor/core/str.h" diff --git a/ext/dom/lexbor/lexbor/core/dtoa.h b/ext/dom/lexbor/lexbor/core/dtoa.h index c60c28803b7b..2d569cfff973 100644 --- a/ext/dom/lexbor/lexbor/core/dtoa.h +++ b/ext/dom/lexbor/lexbor/core/dtoa.h @@ -1,10 +1,36 @@ /* - * Copyright (C) Alexander Borisov + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * Based on nxt_dtoa.h from NGINX NJS project + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Copyright (C) Dmitry Volyntsev - * Copyright (C) Nginx, Inc. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov */ #ifndef LEXBOR_DTOA_H diff --git a/ext/dom/lexbor/lexbor/core/hash.c b/ext/dom/lexbor/lexbor/core/hash.c index 2fdd4caa9d98..c16466effd35 100644 --- a/ext/dom/lexbor/lexbor/core/hash.c +++ b/ext/dom/lexbor/lexbor/core/hash.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -10,9 +10,10 @@ #include "lexbor/core/str.h" -#define LEXBOR_STR_RES_MAP_LOWERCASE -#define LEXBOR_STR_RES_MAP_UPPERCASE -#include "lexbor/core/str_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_uppercase[256]; +#endif /* Insert variable. */ diff --git a/ext/dom/lexbor/lexbor/core/in.c b/ext/dom/lexbor/lexbor/core/in.c index 951e585cbd39..363256b732a4 100644 --- a/ext/dom/lexbor/lexbor/core/in.c +++ b/ext/dom/lexbor/lexbor/core/in.c @@ -1,11 +1,10 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ #include "lexbor/core/in.h" -#include "lexbor/core/str_res.h" lexbor_in_t * diff --git a/ext/dom/lexbor/lexbor/core/shs.c b/ext/dom/lexbor/lexbor/core/shs.c index 679143bf45cc..c2753457d74a 100644 --- a/ext/dom/lexbor/lexbor/core/shs.c +++ b/ext/dom/lexbor/lexbor/core/shs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,10 +7,10 @@ #include "lexbor/core/shs.h" #include "lexbor/core/str.h" -#define LEXBOR_STR_RES_MAP_LOWERCASE -#define LEXBOR_STR_RES_MAP_UPPERCASE -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_uppercase[256]; +#endif #define lexbor_shs_make_id_m(key, size, table_size) \ (((((key[0] * key[size - 1]) * key[0]) + size) % table_size) + 0x01) diff --git a/ext/dom/lexbor/lexbor/core/str.c b/ext/dom/lexbor/lexbor/core/str.c index d11a08614dd4..3d164ebf82dd 100644 --- a/ext/dom/lexbor/lexbor/core/str.c +++ b/ext/dom/lexbor/lexbor/core/str.c @@ -1,14 +1,10 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ #include "lexbor/core/str.h" - -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_MAP_LOWERCASE -#define LEXBOR_STR_RES_MAP_UPPERCASE #include "lexbor/core/str_res.h" @@ -80,6 +76,7 @@ lexbor_str_destroy(lexbor_str_t *str, lexbor_mraw_t *mraw, bool destroy_obj) } if (str->data != NULL) { + lexbor_str_clean(str); str->data = lexbor_mraw_free(mraw, str->data); } @@ -380,6 +377,30 @@ lexbor_str_whitespace_from_end(lexbor_str_t *target) return 0; } +lxb_char_t * +lexbor_str_copy_to(lexbor_str_t *str, const lxb_char_t *buff, size_t length) +{ + lxb_char_t *data_begin; + + data_begin = &str->data[str->length]; + memcpy(data_begin, buff, sizeof(lxb_char_t) * length); + + str->length += length; + + return data_begin; +} + +lxb_char_t * +lexbor_str_copy_to_with_null(lexbor_str_t *str, + const lxb_char_t *buff, size_t length) +{ + lxb_char_t *data_begin = lexbor_str_copy_to(str, buff, length); + + str->data[str->length] = '\0'; + + return data_begin; +} + /* * Data utils * TODO: All functions need optimization. diff --git a/ext/dom/lexbor/lexbor/core/str.h b/ext/dom/lexbor/lexbor/core/str.h index 3bee14537387..8e5f3806fe93 100644 --- a/ext/dom/lexbor/lexbor/core/str.h +++ b/ext/dom/lexbor/lexbor/core/str.h @@ -21,7 +21,6 @@ extern "C" { #define lexbor_str_len(str) lexbor_str_get(str, length) #define lexbor_str(p) {.data = (lxb_char_t *) (p), sizeof(p) - 1} - #define lexbor_str_check_size_arg_m(str, size, mraw, plus_len, return_fail) \ do { \ void *tmp; \ @@ -117,6 +116,12 @@ lexbor_str_whitespace_from_begin(lexbor_str_t *target); LXB_API size_t lexbor_str_whitespace_from_end(lexbor_str_t *target); +LXB_API lxb_char_t * +lexbor_str_copy_to(lexbor_str_t *str, const lxb_char_t *buff, size_t length); + +LXB_API lxb_char_t * +lexbor_str_copy_to_with_null(lexbor_str_t *str, + const lxb_char_t *buff, size_t length); /* Data utils */ /* diff --git a/ext/dom/lexbor/lexbor/core/str_res.h b/ext/dom/lexbor/lexbor/core/str_res.h index cebbda8aa534..be34a0eeb42c 100644 --- a/ext/dom/lexbor/lexbor/core/str_res.h +++ b/ext/dom/lexbor/lexbor/core/str_res.h @@ -1,32 +1,16 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ -#ifndef LEXBOR_STR_RES_H -#define LEXBOR_STR_RES_H -#define LEXBOR_STR_RES_MAP_CHAR_OTHER '\00' -#define LEXBOR_STR_RES_MAP_CHAR_A_Z_a_z '\01' -#define LEXBOR_STR_RES_MAP_CHAR_WHITESPACE '\02' +LXB_API const lxb_char_t +lexbor_str_res_ansi_replacement_character[4] = "\xEF\xBF\xBD"; -#define LEXBOR_STR_RES_SLIP 0xFF - -#endif /* LEXBOR_STR_RES_H */ - -#ifdef LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#ifndef LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER_ENABLED -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER_ENABLED -static const lxb_char_t -lexbor_str_res_ansi_replacement_character[] = "\xEF\xBF\xBD"; -#endif /* LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER_ENABLED */ -#endif /* LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER */ - -#ifdef LEXBOR_STR_RES_MAP_NUM -#ifndef LEXBOR_STR_RES_MAP_NUM_ENABLED -#define LEXBOR_STR_RES_MAP_NUM_ENABLED -static const lxb_char_t lexbor_str_res_map_num[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_num[256] = +{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -57,14 +41,10 @@ static const lxb_char_t lexbor_str_res_map_num[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#endif /* LEXBOR_STR_RES_MAP_NUM_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_NUM */ - -#ifdef LEXBOR_STR_RES_MAP_HEX -#ifndef LEXBOR_STR_RES_MAP_HEX_ENABLED -#define LEXBOR_STR_RES_MAP_HEX_ENABLED -static const lxb_char_t lexbor_str_res_map_hex[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_hex[256] = +{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -95,14 +75,10 @@ static const lxb_char_t lexbor_str_res_map_hex[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#endif /* LEXBOR_STR_RES_MAP_HEX_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_HEX */ - -#ifdef LEXBOR_STR_RES_MAP_LOWERCASE -#ifndef LEXBOR_STR_RES_MAP_LOWERCASE_ENABLED -#define LEXBOR_STR_RES_MAP_LOWERCASE_ENABLED -static const lxb_char_t lexbor_str_res_map_lowercase[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_lowercase[256] = +{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, @@ -133,14 +109,10 @@ static const lxb_char_t lexbor_str_res_map_lowercase[] = { 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -#endif /* LEXBOR_STR_RES_MAP_LOWERCASE_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_LOWERCASE */ - -#ifdef LEXBOR_STR_RES_MAP_UPPERCASE -#ifndef LEXBOR_STR_RES_MAP_UPPERCASE_ENABLED -#define LEXBOR_STR_RES_MAP_UPPERCASE_ENABLED -static const lxb_char_t lexbor_str_res_map_uppercase[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_uppercase[256] = +{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, @@ -171,14 +143,10 @@ static const lxb_char_t lexbor_str_res_map_uppercase[] = { 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -#endif /* LEXBOR_STR_RES_MAP_UPPERCASE_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_UPPERCASE */ - -#ifdef LEXBOR_STR_RES_REPLACEMENT_CHARACTER -#ifndef LEXBOR_STR_RES_REPLACEMENT_CHARACTER_ENABLED -#define LEXBOR_STR_RES_REPLACEMENT_CHARACTER_ENABLED -static const size_t lexbor_str_res_replacement_character[] = { +LXB_API const size_t +lexbor_str_res_replacement_character[160] = +{ 65533, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, @@ -198,14 +166,10 @@ static const size_t lexbor_str_res_replacement_character[] = { 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 382, 376 }; -#endif /* LEXBOR_STR_RES_REPLACEMENT_CHARACTER_ENABLED */ -#endif /* LEXBOR_STR_RES_REPLACEMENT_CHARACTER */ - -#ifdef LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER -#ifndef LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER_ENABLED -#define LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER_ENABLED -static const size_t lexbor_str_res_alphanumeric_character[] = { +LXB_API const size_t +lexbor_str_res_alphanumeric_character[256] = +{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -236,14 +200,10 @@ static const size_t lexbor_str_res_alphanumeric_character[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#endif /* LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER_ENABLED */ -#endif /* LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER */ - -#ifdef LEXBOR_STR_RES_ALPHA_CHARACTER -#ifndef LEXBOR_STR_RES_ALPHA_CHARACTER_ENABLED -#define LEXBOR_STR_RES_ALPHA_CHARACTER_ENABLED -static const size_t lexbor_str_res_alpha_character[] = { +LXB_API const size_t +lexbor_str_res_alpha_character[256] = +{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -274,14 +234,10 @@ static const size_t lexbor_str_res_alpha_character[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#endif /* LEXBOR_STR_RES_ALPHA_CHARACTER_ENABLED */ -#endif /* LEXBOR_STR_RES_ALPHA_CHARACTER */ - -#ifdef LEXBOR_TOKENIZER_CHARS_MAP -#ifndef LEXBOR_TOKENIZER_CHARS_MAP_ENABLED -#define LEXBOR_TOKENIZER_CHARS_MAP_ENABLED -static const unsigned char lexbor_tokenizer_chars_map[] = { +LXB_API const unsigned char +lexbor_tokenizer_chars_map[256] = +{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x02, 0xff, 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -312,35 +268,24 @@ static const unsigned char lexbor_tokenizer_chars_map[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#endif /* LEXBOR_TOKENIZER_CHARS_MAP_ENABLED */ -#endif /* LEXBOR_TOKENIZER_CHARS_MAP */ - -#ifdef LEXBOR_STR_RES_MAP_HEX_TO_CHAR -#ifndef LEXBOR_STR_RES_MAP_HEX_TO_CHAR_ENABLED -#define LEXBOR_STR_RES_MAP_HEX_TO_CHAR_ENABLED -static const lxb_char_t lexbor_str_res_map_hex_to_char[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_hex_to_char[17] = +{ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x00 }; -#endif /* LEXBOR_STR_RES_MAP_HEX_TO_CHAR_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_HEX_TO_CHAR */ -#ifdef LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE -#ifndef LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE_ENABLED -#define LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE_ENABLED -static const lxb_char_t lexbor_str_res_map_hex_to_char_lowercase[] = { +LXB_API const lxb_char_t +lexbor_str_res_map_hex_to_char_lowercase[17] = +{ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x00 }; -#endif /* LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE_ENABLED */ -#endif /* LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE */ - -#ifdef LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE -#ifndef LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_ENABLED -#define LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_ENABLED -static const char * lexbor_str_res_char_to_two_hex_value[257] = { +LXB_API const char * +lexbor_str_res_char_to_two_hex_value[257] = +{ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10", "11", "12", "13", "14", "15", "16", "17", @@ -375,13 +320,10 @@ static const char * lexbor_str_res_char_to_two_hex_value[257] = { "F8", "F9", "FA", "FB", "FC", "FD", "FE", "FF", NULL }; -#endif /* LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_ENABLED */ -#endif /* LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE */ -#ifdef LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE -#ifndef LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE_ENABLED -#define LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE_ENABLED -static const char * lexbor_str_res_char_to_two_hex_value_lowercase[257] = { +LXB_API const char * +lexbor_str_res_char_to_two_hex_value_lowercase[257] = +{ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", @@ -416,5 +358,3 @@ static const char * lexbor_str_res_char_to_two_hex_value_lowercase[257] = { "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff", NULL }; -#endif /* LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE_ENABLED */ -#endif /* LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE */ diff --git a/ext/dom/lexbor/lexbor/core/strtod.c b/ext/dom/lexbor/lexbor/core/strtod.c index 6389fc3156fc..2dad45c109b5 100644 --- a/ext/dom/lexbor/lexbor/core/strtod.c +++ b/ext/dom/lexbor/lexbor/core/strtod.c @@ -1,14 +1,36 @@ /* - * Copyright (C) Alexander Borisov - * - * Based on nxt_strtod.c from NGINX NJS project + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * An internal strtod() implementation based upon V8 src/strtod.cc - * without bignum support. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Copyright 2012 the V8 project authors. All rights reserved. - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov */ #include diff --git a/ext/dom/lexbor/lexbor/core/strtod.h b/ext/dom/lexbor/lexbor/core/strtod.h index 7f15706bc946..0f834bab4868 100644 --- a/ext/dom/lexbor/lexbor/core/strtod.h +++ b/ext/dom/lexbor/lexbor/core/strtod.h @@ -1,10 +1,36 @@ /* - * Copyright (C) Alexander Borisov + * Copyright (C) 2015-2019 NGINX, Inc. + * Copyright (C) 2019-2025 F5, Inc. + * Copyright (C) 2015-2021 Igor Sysoev + * Copyright (C) 2017-2025 Dmitry Volyntsev + * Copyright (C) 2019-2022 Alexander Borisov + * Copyright (C) 2022-2025 Vadim Zhestikov + * All rights reserved. * - * Based on nxt_strtod.h from NGINX NJS project + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Copyright (C) Dmitry Volyntsev - * Copyright (C) Nginx, Inc. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (C) Alexander Borisov */ #ifndef LEXBOR_STRTOD_H diff --git a/ext/dom/lexbor/lexbor/css/at_rule.c b/ext/dom/lexbor/lexbor/css/at_rule.c new file mode 100644 index 000000000000..6c5435d22e06 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/at_rule.c @@ -0,0 +1,449 @@ +/* + * Copyright (C) 2021-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/at_rule.h" +#include "lexbor/css/css.h" +#include "lexbor/css/parser.h" +#include "lexbor/css/stylesheet.h" +#include "lexbor/css/at_rule/state.h" +#include "lexbor/css/at_rule/types.h" +#include "lexbor/css/at_rule/res.h" +#include "lexbor/core/serialize.h" + + +const lxb_css_entry_at_rule_data_t * +lxb_css_at_rule_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_at_rule_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_entry_at_rule_data_t * +lxb_css_at_rule_by_id(uintptr_t id) +{ + return &lxb_css_at_rule_data[id]; +} + +lxb_css_rule_at_t * +lxb_css_at_rule_create(lxb_css_parser_t *parser, + const lxb_char_t *name, size_t length, + const lxb_css_entry_at_rule_data_t **out_entry) +{ + void *prop; + const lxb_css_entry_at_rule_data_t *entry; + lxb_css_at_rule__custom_t *custom; + lxb_css_rule_at_t *at; + + at = lxb_css_rule_at_create(parser->memory); + if (at == NULL) { + return NULL; + } + + entry = lxb_css_at_rule_by_name(name, length); + if (entry == NULL) { + entry = lxb_css_at_rule_by_id(LXB_CSS_AT_RULE__CUSTOM); + + prop = entry->create(parser->memory); + if (prop == NULL) { + goto failed; + } + + custom = prop; + + (void) lexbor_str_init(&custom->name, parser->memory->mraw, length); + if (custom->name.data == NULL) { + goto failed; + } + + memcpy(custom->name.data, name, length); + + custom->name.length = length; + custom->name.data[custom->name.length] = 0x00; + } + else { + prop = entry->create(parser->memory); + if (prop == NULL) { + goto failed; + } + } + + at->type = entry->unique; + at->u.user = prop; + + if (out_entry != NULL) { + *out_entry = entry; + } + + return at; + +failed: + + if (prop != NULL) { + (void) entry->destroy(parser->memory, prop, true); + } + + if (at != NULL) { + (void) lxb_css_rule_at_destroy(at, true); + } + + if (out_entry != NULL) { + *out_entry = NULL; + } + + return NULL; +} + +void * +lxb_css_at_rule_destroy(lxb_css_memory_t *memory, void *value, + lxb_css_at_rule_type_t type, bool self_destroy) +{ + const lxb_css_entry_at_rule_data_t *data; + + data = lxb_css_at_rule_by_id(type); + if (data == NULL) { + return value; + } + + return data->destroy(memory, value, self_destroy); +} + +lxb_status_t +lxb_css_at_rule_convert_to_undef(lxb_css_parser_t *parser, + lxb_css_rule_at_t *at) +{ + lxb_css_at_rule__undef_t *undef; + + undef = lxb_css_at_rule__undef_create(parser->memory); + if (undef == NULL) { + return LXB_STATUS_ERROR_MEMORY_ALLOCATION; + } + + undef->type = at->type; + + (void) lxb_css_at_rule_destroy(parser->memory, at, undef->type, false); + + at->type = LXB_CSS_AT_RULE__UNDEF; + at->u.undef = undef; + + return lxb_css_make_data(parser, &at->u.undef->prelude, + at->prelude_begin, at->prelude_end); +} + +lxb_status_t +lxb_css_at_rule_serialize(const void *style, lxb_css_at_rule_type_t type, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_entry_at_rule_data_t *data; + + data = lxb_css_at_rule_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + return data->serialize(style, cb, ctx); +} + +lxb_status_t +lxb_css_at_rule_serialize_str(const void *style, lxb_css_at_rule_type_t type, + lexbor_mraw_t *mraw, lexbor_str_t *str) +{ + const lxb_css_entry_at_rule_data_t *data; + + data = lxb_css_at_rule_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + return lxb_css_serialize_str_handler(style, str, mraw, data->serialize); +} + +lxb_status_t +lxb_css_at_rule_serialize_name(const void *style, lxb_css_at_rule_type_t type, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_entry_at_rule_data_t *data; + + if (type == LXB_CSS_AT_RULE__UNDEF) { + return lxb_css_at_rule__undef_serialize_name(style, cb, ctx); + } + else if (type == LXB_CSS_AT_RULE__CUSTOM) { + return lxb_css_at_rule__custom_serialize_name(style, cb, ctx); + } + + data = lxb_css_at_rule_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + return cb(data->name, data->length, ctx); +} + +lxb_status_t +lxb_css_at_rule_serialize_name_str(const void *style, lxb_css_at_rule_type_t type, + lexbor_mraw_t *mraw, lexbor_str_t *str) +{ + const lxb_css_entry_at_rule_data_t *data; + + if (type == LXB_CSS_AT_RULE__UNDEF) { + return lxb_css_serialize_str_handler(style, str, mraw, + lxb_css_at_rule__undef_serialize_name); + } + else if (type == LXB_CSS_AT_RULE__CUSTOM) { + return lxb_css_serialize_str_handler(style, str, mraw, + lxb_css_at_rule__custom_serialize_name); + } + + data = lxb_css_at_rule_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + if (str->data == NULL) { + lexbor_str_init(str, mraw, data->length); + if (str->data == NULL) { + return LXB_STATUS_ERROR_MEMORY_ALLOCATION; + } + } + + (void) lexbor_str_append(str, mraw, data->name, data->length); + + return LXB_STATUS_OK; +} + +/* _undef. */ + +void * +lxb_css_at_rule__undef_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_at_rule__undef_t)); +} + +void * +lxb_css_at_rule__undef_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + if (style == NULL) { + return NULL; + } + + if (self_destroy) { + return lexbor_mraw_free(memory->mraw, style); + } + + return style; +} + +lxb_status_t +lxb_css_at_rule__undef_serialize(const void *at, lexbor_serialize_cb_f cb, + void *ctx) +{ + lxb_status_t status; + const lxb_css_entry_at_rule_data_t *data; + const lxb_css_at_rule__undef_t *undef = at; + + static const lxb_char_t wc_str[] = " "; + static const lxb_char_t lb_str[] = "{"; + static const lxb_char_t rb_str[] = "}"; + static const lxb_char_t sm_str[] = ";"; + + data = lxb_css_at_rule_by_id(undef->type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + if (undef->prelude.data != NULL) { + lexbor_serialize_write(cb, wc_str, (sizeof(wc_str) - 1), ctx, status); + lexbor_serialize_write(cb, undef->prelude.data, undef->prelude.length, + ctx, status); + } + + if (undef->block != NULL) { + lexbor_serialize_write(cb, lb_str, (sizeof(lb_str) - 1), ctx, status); + + status = lxb_css_rule_list_serialize(undef->block, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, rb_str, (sizeof(rb_str) - 1), ctx, status); + } + else { + lexbor_serialize_write(cb, sm_str, (sizeof(sm_str) - 1), ctx, status); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_at_rule__undef_serialize_name(const void *at, lexbor_serialize_cb_f cb, + void *ctx) +{ + const lxb_css_entry_at_rule_data_t *data; + const lxb_css_at_rule__undef_t *undef = at; + + data = lxb_css_at_rule_by_id(undef->type); + if (data == NULL) { + return LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + return cb(data->name, data->length, ctx); +} + +/* _custom. */ + +void * +lxb_css_at_rule__custom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_at_rule__custom_t)); +} + +void * +lxb_css_at_rule__custom_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + if (style == NULL) { + return NULL; + } + + if (self_destroy) { + return lexbor_mraw_free(memory->mraw, style); + } + + return style; +} + +lxb_status_t +lxb_css_at_rule__custom_serialize(const void *at, lexbor_serialize_cb_f cb, + void *ctx) +{ + lxb_status_t status; + const lxb_css_at_rule__custom_t *custom = at; + + static const lxb_char_t ws_str[] = " "; + static const lxb_char_t lb_str[] = "{"; + static const lxb_char_t rb_str[] = "}"; + + + if (custom->prelude.data != NULL) { + lexbor_serialize_write(cb, ws_str, (sizeof(ws_str) - 1), ctx, status); + lexbor_serialize_write(cb, custom->prelude.data, custom->prelude.length, + ctx, status); + } + + if (custom->block != NULL) { + lexbor_serialize_write(cb, lb_str, (sizeof(lb_str) - 1), ctx, status); + + status = lxb_css_rule_list_serialize(custom->block, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, rb_str, (sizeof(rb_str) - 1), ctx, status); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_at_rule__custom_serialize_name(const void *at, lexbor_serialize_cb_f cb, + void *ctx) +{ + const lxb_css_at_rule__custom_t *custom = at; + + return cb(custom->name.data, custom->name.length, ctx); +} + +/* Media. */ + +void * +lxb_css_at_rule_media_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_at_rule_media_t)); +} + +void * +lxb_css_at_rule_media_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_at_rule__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_at_rule_media_serialize(const void *style, lexbor_serialize_cb_f cb, + void *ctx) +{ + return LXB_STATUS_OK; +} + +/* Namespace. */ + +void * +lxb_css_at_rule_namespace_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_at_rule_namespace_t)); +} + +void * +lxb_css_at_rule_namespace_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_at_rule__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_at_rule_namespace_serialize(const void *style, lexbor_serialize_cb_f cb, + void *ctx) +{ + return LXB_STATUS_OK; +} + +/* Font-face. */ + +void * +lxb_css_at_rule_font_face_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_at_rule_font_face_t)); +} + +void * +lxb_css_at_rule_font_face_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_at_rule__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_at_rule_font_face_serialize(const void *font_face, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_at_rule_font_face_t *ff = font_face; + + static const lxb_char_t lb_str[] = " {"; + static const lxb_char_t rb_str[] = "}"; + + if (ff->block != NULL) { + lexbor_serialize_write(cb, lb_str, (sizeof(lb_str) - 1), ctx, status); + + status = lxb_css_rule_list_serialize(ff->block, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, rb_str, (sizeof(rb_str) - 1), ctx, status); + } + + return LXB_STATUS_OK; +} diff --git a/ext/dom/lexbor/lexbor/css/at_rule.h b/ext/dom/lexbor/lexbor/css/at_rule.h index a11455c14cd0..cacfa4c8cf2d 100644 --- a/ext/dom/lexbor/lexbor/css/at_rule.h +++ b/ext/dom/lexbor/lexbor/css/at_rule.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -19,19 +19,19 @@ extern "C" { typedef struct { lxb_css_at_rule_type_t type; lexbor_str_t prelude; - lexbor_str_t block; + lxb_css_rule_list_t *block; } lxb_css_at_rule__undef_t; typedef struct { - lexbor_str_t name; - lexbor_str_t prelude; - lexbor_str_t block; + lexbor_str_t name; + lexbor_str_t prelude; + lxb_css_rule_list_t *block; } lxb_css_at_rule__custom_t; typedef struct { - uintptr_t reserved; + lxb_css_rule_list_t *block; } lxb_css_at_rule_media_t; @@ -40,17 +40,31 @@ typedef struct { } lxb_css_at_rule_namespace_t; +typedef struct { + lxb_css_rule_list_t *block; +} +lxb_css_at_rule_font_face_t; -LXB_API const lxb_css_entry_data_t * + +LXB_API const lxb_css_entry_at_rule_data_t * lxb_css_at_rule_by_name(const lxb_char_t *name, size_t length); -LXB_API const lxb_css_entry_data_t * +LXB_API const lxb_css_entry_at_rule_data_t * lxb_css_at_rule_by_id(uintptr_t id); +LXB_API lxb_css_rule_at_t * +lxb_css_at_rule_create(lxb_css_parser_t *parser, + const lxb_char_t *name, size_t length, + const lxb_css_entry_at_rule_data_t **out_entry); + LXB_API void * lxb_css_at_rule_destroy(lxb_css_memory_t *memory, void *value, lxb_css_at_rule_type_t type, bool self_destroy); +LXB_API lxb_status_t +lxb_css_at_rule_convert_to_undef(lxb_css_parser_t *parser, + lxb_css_rule_at_t *at); + LXB_API lxb_status_t lxb_css_at_rule_serialize(const void *style, lxb_css_at_rule_type_t type, lexbor_serialize_cb_f cb, void *ctx); @@ -73,10 +87,6 @@ LXB_API void * lxb_css_at_rule__undef_destroy(lxb_css_memory_t *memory, void *style, bool self_destroy); LXB_API lxb_status_t -lxb_css_at_rule__undef_make(lxb_css_parser_t *parser, - lxb_css_at_rule__undef_t *undef, - const lxb_css_syntax_at_rule_offset_t *at_rule); -LXB_API lxb_status_t lxb_css_at_rule__undef_serialize(const void *style, lexbor_serialize_cb_f cb, void *ctx); LXB_API lxb_status_t @@ -92,10 +102,6 @@ LXB_API void * lxb_css_at_rule__custom_destroy(lxb_css_memory_t *memory, void *style, bool self_destroy); LXB_API lxb_status_t -lxb_css_at_rule__custom_make(lxb_css_parser_t *parser, - lxb_css_at_rule__custom_t *custom, - const lxb_css_syntax_at_rule_offset_t *at_rule); -LXB_API lxb_status_t lxb_css_at_rule__custom_serialize(const void *style, lexbor_serialize_cb_f cb, void *ctx); LXB_API lxb_status_t @@ -126,6 +132,18 @@ LXB_API lxb_status_t lxb_css_at_rule_namespace_serialize(const void *style, lexbor_serialize_cb_f cb, void *ctx); +/* Font-face. */ + +LXB_API void * +lxb_css_at_rule_font_face_create(lxb_css_memory_t *memory); + +LXB_API void * +lxb_css_at_rule_font_face_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy); + +LXB_API lxb_status_t +lxb_css_at_rule_font_face_serialize(const void *style, lexbor_serialize_cb_f cb, + void *ctx); #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/css/at_rule/const.h b/ext/dom/lexbor/lexbor/css/at_rule/const.h index 961f933a2367..29ba3dd95488 100644 --- a/ext/dom/lexbor/lexbor/css/at_rule/const.h +++ b/ext/dom/lexbor/lexbor/css/at_rule/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -21,9 +21,10 @@ enum { LXB_CSS_AT_RULE__UNDEF = 0x0000, LXB_CSS_AT_RULE__CUSTOM = 0x0001, - LXB_CSS_AT_RULE_MEDIA = 0x0002, - LXB_CSS_AT_RULE_NAMESPACE = 0x0003, - LXB_CSS_AT_RULE__LAST_ENTRY = 0x0004 + LXB_CSS_AT_RULE_FONT_FACE = 0x0002, + LXB_CSS_AT_RULE_MEDIA = 0x0003, + LXB_CSS_AT_RULE_NAMESPACE = 0x0004, + LXB_CSS_AT_RULE__LAST_ENTRY = 0x0005 }; typedef uintptr_t lxb_css_at_rule_type_t; diff --git a/ext/dom/lexbor/lexbor/css/at_rule/res.h b/ext/dom/lexbor/lexbor/css/at_rule/res.h index 026a88ae0dd6..6604fb923f40 100644 --- a/ext/dom/lexbor/lexbor/css/at_rule/res.h +++ b/ext/dom/lexbor/lexbor/css/at_rule/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -18,16 +18,19 @@ #include "lexbor/css/at_rule/const.h" -static const lxb_css_entry_data_t lxb_css_at_rule_data[LXB_CSS_AT_RULE__LAST_ENTRY] = +static const lxb_css_entry_at_rule_data_t lxb_css_at_rule_data[LXB_CSS_AT_RULE__LAST_ENTRY] = { - {(lxb_char_t *) "#undef", 6, LXB_CSS_AT_RULE__UNDEF, lxb_css_at_rule_state__undef, + {(lxb_char_t *) "#undef", 6, LXB_CSS_AT_RULE__UNDEF, &lxb_css_at_rule__undef_cb, lxb_css_at_rule__undef_create, lxb_css_at_rule__undef_destroy, lxb_css_at_rule__undef_serialize, (void *) (uintptr_t) LXB_CSS_AT_RULE__UNDEF}, - {(lxb_char_t *) "#сustom", 7, LXB_CSS_AT_RULE__CUSTOM, lxb_css_at_rule_state__custom, + {(lxb_char_t *) "#сustom", 7, LXB_CSS_AT_RULE__CUSTOM, &lxb_css_at_rule__custom_cb, lxb_css_at_rule__custom_create, lxb_css_at_rule__custom_destroy, lxb_css_at_rule__custom_serialize, (void *) (uintptr_t) LXB_CSS_AT_RULE__CUSTOM}, - {(lxb_char_t *) "media", 5, LXB_CSS_AT_RULE_MEDIA, lxb_css_at_rule_state_media, + {(lxb_char_t *) "font-face", 9, LXB_CSS_AT_RULE_FONT_FACE, &lxb_css_at_rule_font_face_cb, + lxb_css_at_rule_font_face_create, lxb_css_at_rule_font_face_destroy, lxb_css_at_rule_font_face_serialize, + NULL}, + {(lxb_char_t *) "media", 5, LXB_CSS_AT_RULE_MEDIA, &lxb_css_at_rule_media_cb, lxb_css_at_rule_media_create, lxb_css_at_rule_media_destroy, lxb_css_at_rule_media_serialize, NULL}, - {(lxb_char_t *) "namespace", 9, LXB_CSS_AT_RULE_NAMESPACE, lxb_css_at_rule_state_namespace, + {(lxb_char_t *) "namespace", 9, LXB_CSS_AT_RULE_NAMESPACE, &lxb_css_at_rule_namespace_cb, lxb_css_at_rule_namespace_create, lxb_css_at_rule_namespace_destroy, lxb_css_at_rule_namespace_serialize, NULL} }; @@ -38,7 +41,7 @@ static const lexbor_shs_entry_t lxb_css_at_rule_shs[6] = {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"media", (void *) &lxb_css_at_rule_data[LXB_CSS_AT_RULE_MEDIA], 5, 0}, - {NULL, NULL, 0, 0}, + {"font-face", (void *) &lxb_css_at_rule_data[LXB_CSS_AT_RULE_FONT_FACE], 9, 0}, {"namespace", (void *) &lxb_css_at_rule_data[LXB_CSS_AT_RULE_NAMESPACE], 9, 0} }; diff --git a/ext/dom/lexbor/lexbor/css/at_rule/state.c b/ext/dom/lexbor/lexbor/css/at_rule/state.c new file mode 100644 index 000000000000..4df2f6085adf --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/at_rule/state.c @@ -0,0 +1,374 @@ +/* + * Copyright (C) 2021-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/css.h" +#include "lexbor/css/at_rule.h" +#include "lexbor/css/parser.h" +#include "lexbor/css/rule.h" +#include "lexbor/css/blank.h" +#include "lexbor/css/at_rule/state.h" + + +/* Undef */ + +bool +lxb_css_at_rule__undef_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_begin = token->offset; + + /* Skip all prelude. */ + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_at_rule__undef_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + + at->prelude_end = token->offset; + + status = lxb_css_make_data(parser, &at->u.undef->prelude, + at->prelude_begin, at->prelude_end); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail_status(parser); + } + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_at_rule__undef_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return lxb_css_state_at_rule_block_begin(parser, token, ctx, out_rule); +} + +bool +lxb_css_at_rule__undef_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + /* For _UNDEF and _CUSTOM, access here is not possible. */ + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_at_rule__undef_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + lxb_css_rule_list_t *block = lxb_css_syntax_returned(parser); + + /* + * Here we do not check for failed because it cannot happen; we do not call + * failed anywhere in _UNDEF and _CUSTOM, we simply skip the tokens. + */ + + at->u.undef->block = block; + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} + +/* Custom */ + +bool +lxb_css_at_rule__custom_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_at_rule__undef_prelude(parser, token, ctx); +} + +lxb_status_t +lxb_css_at_rule__custom_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + + at->prelude_end = token->offset; + + status = lxb_css_make_data(parser, &at->u.custom->prelude, + at->prelude_begin, at->prelude_end); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail_status(parser); + } + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_at_rule__custom_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return lxb_css_state_at_rule_block_begin(parser, token, ctx, out_rule); +} + +bool +lxb_css_at_rule__custom_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + return lxb_css_at_rule__undef_prelude_failed(parser, token, ctx); +} + +lxb_status_t +lxb_css_at_rule__custom_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + lxb_css_rule_list_t *block = lxb_css_syntax_returned(parser); + + /* + * Here we do not check for failed because it cannot happen; we do not call + * failed anywhere in _UNDEF and _CUSTOM, we simply skip the tokens. + */ + + at->u.custom->block = block; + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} + +/* Namespace */ + +bool +lxb_css_at_rule_namespace_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_begin = token->offset; + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_at_rule_namespace_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_end = token->offset; + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_namespace_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + lxb_css_parser_failed_set(parser, true); + + return lxb_css_state_at_rule_block_begin(parser, token, ctx, out_rule); +} + +bool +lxb_css_at_rule_namespace_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + return lxb_css_at_rule__undef_prelude_failed(parser, token, ctx); +} + +lxb_status_t +lxb_css_at_rule_namespace_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + + if (failed) { + status = lxb_css_at_rule_convert_to_undef(parser, at); + if (status != LXB_STATUS_OK) { + return status; + } + + at->u.undef->block = lxb_css_syntax_returned(parser); + } + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} + +/* Media */ + +bool +lxb_css_at_rule_media_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_begin = token->offset; + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_at_rule_media_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_end = token->offset; + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_media_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return lxb_css_state_at_rule_block_begin(parser, token, ctx, out_rule); +} + +bool +lxb_css_at_rule_media_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + return lxb_css_at_rule__undef_prelude_failed(parser, token, ctx); +} + +lxb_status_t +lxb_css_at_rule_media_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + lxb_css_rule_list_t *list = lxb_css_syntax_returned(parser); + + if (list != NULL && !failed) { + at->u.media->block = list; + } + else { + status = lxb_css_at_rule_convert_to_undef(parser, at); + if (status != LXB_STATUS_OK) { + return status; + } + + at->u.undef->block = list; + } + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} + +/* Font-face */ + +bool +lxb_css_at_rule_font_face_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_begin = token->offset; + + if (token->type != LXB_CSS_SYNTAX_TOKEN__END) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_at_rule_font_face_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_end = token->offset; + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_font_face_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return lxb_css_state_at_rule_block_begin(parser, token, ctx, out_rule); +} + +bool +lxb_css_at_rule_font_face_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + return lxb_css_at_rule__undef_prelude_failed(parser, token, ctx); +} + +lxb_status_t +lxb_css_at_rule_font_face_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + lxb_css_rule_list_t *block = lxb_css_syntax_returned(parser); + + if (!failed) { + at->u.font_face->block = block; + } + else { + status = lxb_css_at_rule_convert_to_undef(parser, at); + if (status != LXB_STATUS_OK) { + return status; + } + + at->u.undef->block = block; + } + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} diff --git a/ext/dom/lexbor/lexbor/css/at_rule/state.h b/ext/dom/lexbor/lexbor/css/at_rule/state.h index 65e17e40d0ff..337a23c86714 100644 --- a/ext/dom/lexbor/lexbor/css/at_rule/state.h +++ b/ext/dom/lexbor/lexbor/css/at_rule/state.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -15,18 +15,110 @@ extern "C" { LXB_API bool -lxb_css_at_rule_state__undef(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx); +lxb_css_at_rule__undef_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule__undef_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_at_rule__undef_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); LXB_API bool -lxb_css_at_rule_state__custom(lxb_css_parser_t *parser, +lxb_css_at_rule__undef_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule__undef_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API bool +lxb_css_at_rule__custom_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule__custom_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_at_rule__custom_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +LXB_API bool +lxb_css_at_rule__custom_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule__custom_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API bool +lxb_css_at_rule_namespace_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_namespace_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_namespace_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +LXB_API bool +lxb_css_at_rule_namespace_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_namespace_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API bool +lxb_css_at_rule_media_prelude(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_media_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_media_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); LXB_API bool -lxb_css_at_rule_state_media(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx); +lxb_css_at_rule_media_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_media_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + LXB_API bool -lxb_css_at_rule_state_namespace(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx); +lxb_css_at_rule_font_face_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_font_face_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_at_rule_font_face_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +LXB_API bool +lxb_css_at_rule_font_face_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +LXB_API lxb_status_t +lxb_css_at_rule_font_face_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/css/at_rule/types.h b/ext/dom/lexbor/lexbor/css/at_rule/types.h new file mode 100644 index 000000000000..1079bb632230 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/at_rule/types.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +/* + * Caution! + * This file generated by the script "utils/lexbor/css/names.py"! + * Do not change this file! + */ + + +#ifndef LXB_CSS_AT_RULE_TYPES_H +#define LXB_CSS_AT_RULE_TYPES_H + + +static const lxb_css_syntax_cb_at_rule_t lxb_css_at_rule__undef_cb = { + .prelude = lxb_css_at_rule__undef_prelude, + .prelude_end = lxb_css_at_rule__undef_prelude_end, + .block = lxb_css_at_rule__undef_block, + .cb.failed = lxb_css_at_rule__undef_prelude_failed, + .cb.end = lxb_css_at_rule__undef_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_at_rule__custom_cb = { + .prelude = lxb_css_at_rule__custom_prelude, + .prelude_end = lxb_css_at_rule__custom_prelude_end, + .block = lxb_css_at_rule__custom_block, + .cb.failed = lxb_css_at_rule__custom_prelude_failed, + .cb.end = lxb_css_at_rule__custom_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_at_rule_font_face_cb = { + .prelude = lxb_css_at_rule_font_face_prelude, + .prelude_end = lxb_css_at_rule_font_face_prelude_end, + .block = lxb_css_at_rule_font_face_block, + .cb.failed = lxb_css_at_rule_font_face_prelude_failed, + .cb.end = lxb_css_at_rule_font_face_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_at_rule_media_cb = { + .prelude = lxb_css_at_rule_media_prelude, + .prelude_end = lxb_css_at_rule_media_prelude_end, + .block = lxb_css_at_rule_media_block, + .cb.failed = lxb_css_at_rule_media_prelude_failed, + .cb.end = lxb_css_at_rule_media_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_at_rule_namespace_cb = { + .prelude = lxb_css_at_rule_namespace_prelude, + .prelude_end = lxb_css_at_rule_namespace_prelude_end, + .block = lxb_css_at_rule_namespace_block, + .cb.failed = lxb_css_at_rule_namespace_prelude_failed, + .cb.end = lxb_css_at_rule_namespace_end +}; + + + +#endif /* LXB_CSS_AT_RULE_TYPES_H */ diff --git a/ext/dom/lexbor/lexbor/css/base.h b/ext/dom/lexbor/lexbor/css/base.h index 3d3cdc6a7f28..26712ce7048f 100644 --- a/ext/dom/lexbor/lexbor/css/base.h +++ b/ext/dom/lexbor/lexbor/css/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2025 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -18,7 +18,7 @@ extern "C" { #define LXB_CSS_VERSION_MAJOR 1 -#define LXB_CSS_VERSION_MINOR 3 +#define LXB_CSS_VERSION_MINOR 4 #define LXB_CSS_VERSION_PATCH 0 #define LXB_CSS_VERSION_STRING \ @@ -45,6 +45,8 @@ typedef struct lxb_css_parser_error lxb_css_parser_error_t; typedef struct lxb_css_syntax_tokenizer lxb_css_syntax_tokenizer_t; typedef struct lxb_css_syntax_token lxb_css_syntax_token_t; +/* Callbacks. */ + typedef bool (*lxb_css_parser_state_f)(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx); @@ -82,6 +84,21 @@ typedef struct { } lxb_css_entry_data_t; +typedef struct { + lxb_char_t *name; + size_t length; + uintptr_t unique; + + /* const lxb_css_syntax_cb_at_rule_t */ + const void *cbs; + + lxb_css_style_create_f create; + lxb_css_style_destroy_f destroy; + lxb_css_style_serialize_f serialize; + void *initial; +} +lxb_css_entry_at_rule_data_t; + typedef struct { lxb_char_t *name; size_t length; diff --git a/ext/dom/lexbor/lexbor/css/blank.c b/ext/dom/lexbor/lexbor/css/blank.c new file mode 100644 index 000000000000..80e60f76e198 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/blank.c @@ -0,0 +1,389 @@ +/* + * Copyright (C) 2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/blank.h" +#include "lexbor/css/state.h" +#include "lexbor/css/css.h" +#include "lexbor/css/at_rule/state.h" + + +static bool +lxb_css_blank_list_rules_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +static lxb_status_t +lxb_css_blank_list_rules_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_at_rule_t * +lxb_css_blank_at_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx, + void **out_rule); + +static bool +lxb_css_blank_at_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); + +static lxb_status_t +lxb_css_blank_at_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_block_t * +lxb_css_blank_at_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +static bool +lxb_css_blank_at_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +static lxb_status_t +lxb_css_blank_at_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_blank_qualified_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static bool +lxb_css_blank_qualified_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); + +static lxb_status_t +lxb_css_blank_qualified_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_block_t * +lxb_css_blank_qualified_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static bool +lxb_css_blank_qualified_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +static lxb_status_t +lxb_css_blank_qualified_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); +static bool +lxb_css_blank_block_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +static lxb_status_t +lxb_css_blank_block_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_declarations_t * +lxb_css_blank_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static lxb_css_parser_state_f +lxb_css_blank_declaration_name(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +static bool +lxb_css_blank_declaration_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +static lxb_status_t +lxb_css_blank_declaration_end(lxb_css_parser_t *parser, + void *declarations, void *ctx, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_declaration_offset_t *offset, + bool important, bool failed); + +static lxb_status_t +lxb_css_blank_declarations_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static bool +lxb_css_blank_declarations_bad(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + + +static const lxb_css_syntax_cb_list_rules_t lxb_css_blank_list_rules = { + .at_rule = lxb_css_blank_at_rule_begin, + .qualified_rule = lxb_css_blank_qualified_rule_begin, + .next = lxb_css_blank_list_rules_next, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_blank_list_rules_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_blank_at_rule = { + .prelude = lxb_css_blank_at_rule_prelude, + .prelude_end = lxb_css_blank_at_rule_prelude_end, + .block = lxb_css_blank_at_rule_block_begin, + .cb.failed = lxb_css_blank_at_rule_prelude_failed, + .cb.end = lxb_css_blank_at_rule_end +}; + +static const lxb_css_syntax_cb_qualified_rule_t lxb_css_blank_qualified_rule = { + .prelude = lxb_css_blank_qualified_rule_prelude, + .prelude_end = lxb_css_blank_qualified_rule_prelude_end, + .block = lxb_css_blank_qualified_rule_block_begin, + .cb.failed = lxb_css_blank_qualified_rule_prelude_failed, + .cb.end = lxb_css_blank_qualified_rule_end +}; + +static const lxb_css_syntax_cb_block_t lxb_css_blank_block = { + .at_rule = lxb_css_blank_at_rule_begin, + .declarations = lxb_css_blank_declarations_begin, + .qualified_rule = lxb_css_blank_qualified_rule_begin, + .next = lxb_css_blank_block_next, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_blank_block_end, +}; + +static const lxb_css_syntax_cb_declarations_t lxb_css_blank_declaration = { + .name = lxb_css_blank_declaration_name, + .end = lxb_css_blank_declaration_end, + .cb.failed = lxb_css_blank_declarations_bad, + .cb.end = lxb_css_blank_declarations_end +}; + + +const lxb_css_syntax_cb_list_rules_t * +lxb_css_blank_cb_list_rules(void) +{ + return &lxb_css_blank_list_rules; +} + +const lxb_css_syntax_cb_at_rule_t * +lxb_css_blank_cb_at_rule(void) +{ + return &lxb_css_blank_at_rule; +} + +const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_blank_cb_qualified_rule(void) +{ + return &lxb_css_blank_qualified_rule; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_blank_cb_block(void) +{ + return &lxb_css_blank_block; +} + +const lxb_css_syntax_cb_declarations_t * +lxb_css_blank_cb_declarations(void) +{ + return &lxb_css_blank_declaration; +} + +static bool +lxb_css_blank_list_rules_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_list_rules_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_at_rule_t * +lxb_css_blank_at_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx, + void **out_rule) +{ + return &lxb_css_blank_at_rule; +} + +static bool +lxb_css_blank_at_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_at_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_block_t * +lxb_css_blank_at_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return &lxb_css_blank_block; +} + +static bool +lxb_css_blank_at_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_at_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_blank_qualified_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return &lxb_css_blank_qualified_rule; +} + +static bool +lxb_css_blank_qualified_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_qualified_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_block_t * +lxb_css_blank_qualified_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return &lxb_css_blank_block; +} + +static bool +lxb_css_blank_qualified_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_qualified_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static bool +lxb_css_blank_block_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_block_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_declarations_t * +lxb_css_blank_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return &lxb_css_blank_declaration; +} + +static lxb_css_parser_state_f +lxb_css_blank_declaration_name(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + return lxb_css_blank_declaration_value; +} + +static bool +lxb_css_blank_declaration_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_blank_declaration_end(lxb_css_parser_t *parser, + void *declarations, void *ctx, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_declaration_offset_t *offset, + bool important, bool failed) +{ + return LXB_STATUS_OK; +} + +static lxb_status_t +lxb_css_blank_declarations_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + return LXB_STATUS_OK; +} + +static bool +lxb_css_blank_declarations_bad(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} diff --git a/ext/dom/lexbor/lexbor/css/blank.h b/ext/dom/lexbor/lexbor/css/blank.h new file mode 100644 index 000000000000..05a13bfa1207 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/blank.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#ifndef LXB_CSS_BLANK_H +#define LXB_CSS_BLANK_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lexbor/css/base.h" +#include "lexbor/css/syntax/syntax.h" + + +LXB_API const lxb_css_syntax_cb_list_rules_t * +lxb_css_blank_cb_list_rules(void); + +LXB_API const lxb_css_syntax_cb_at_rule_t * +lxb_css_blank_cb_at_rule(void); + +LXB_API const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_blank_cb_qualified_rule(void); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_blank_cb_block(void); + +LXB_API const lxb_css_syntax_cb_declarations_t * +lxb_css_blank_cb_declarations(void); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LXB_CSS_BLANK_H */ diff --git a/ext/dom/lexbor/lexbor/css/css.c b/ext/dom/lexbor/lexbor/css/css.c index 3b6f0cb0f2f4..68c6c977e834 100644 --- a/ext/dom/lexbor/lexbor/css/css.c +++ b/ext/dom/lexbor/lexbor/css/css.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -155,15 +155,12 @@ lxb_css_memory_ref_dec_destroy(lxb_css_memory_t *memory) lxb_status_t lxb_css_make_data(lxb_css_parser_t *parser, lexbor_str_t *str, - uintptr_t begin, uintptr_t end) + size_t begin, size_t end) { - size_t length, offlen, len; - const lxb_char_t *pos; - const lexbor_str_t *tmp; + size_t length; + const lxb_char_t *p; - tmp = &parser->str; - - offlen = begin - parser->offset; + p = parser->tkz->in_begin; length = end - begin; if (str->data == NULL) { @@ -173,31 +170,9 @@ lxb_css_make_data(lxb_css_parser_t *parser, lexbor_str_t *str, } } - if (tmp->length > offlen) { - len = tmp->length - offlen; - - if (len >= length) { - memcpy(str->data + str->length, tmp->data + offlen, length); - goto done; - } - else { - memcpy(str->data + str->length, tmp->data + offlen, len); - } - - str->length += len; - - pos = parser->pos; - length -= len; - } - else { - pos = parser->pos + (offlen - tmp->length); - } - - memcpy(str->data + str->length, pos, length); - -done: + memcpy(str->data, p + begin, length); - str->length += length; + str->length = length; str->data[str->length] = '\0'; return LXB_STATUS_OK; diff --git a/ext/dom/lexbor/lexbor/css/css.h b/ext/dom/lexbor/lexbor/css/css.h index bb12978e3ee2..4ba7152334ba 100644 --- a/ext/dom/lexbor/lexbor/css/css.h +++ b/ext/dom/lexbor/lexbor/css/css.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -35,7 +35,7 @@ extern "C" { LXB_API lxb_status_t lxb_css_make_data(lxb_css_parser_t *parser, lexbor_str_t *str, - uintptr_t begin, uintptr_t end); + size_t begin, size_t end); LXB_API lxb_char_t * lxb_css_serialize_char_handler(const void *style, lxb_css_style_serialize_f cb, diff --git a/ext/dom/lexbor/lexbor/css/declaration.c b/ext/dom/lexbor/lexbor/css/declaration.c new file mode 100644 index 000000000000..e27571486f1f --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/declaration.c @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2022-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/declaration.h" + + +lxb_css_rule_declaration_t * +lxb_css_declaration_create(lxb_css_parser_t *parser, + const lxb_char_t *name, size_t length, + const lxb_css_entry_data_t **out_entry) +{ + void *prop; + const lxb_css_entry_data_t *entry; + lxb_css_property__custom_t *custom; + lxb_css_rule_declaration_t *declar; + + declar = lxb_css_rule_declaration_create(parser->memory); + if (declar == NULL) { + return NULL; + } + + entry = lxb_css_property_by_name(name, length); + if (entry == NULL) { + entry = lxb_css_property_by_id(LXB_CSS_PROPERTY__CUSTOM); + + prop = entry->create(parser->memory); + if (prop == NULL) { + goto failed; + } + + custom = prop; + + (void) lexbor_str_init(&custom->name, parser->memory->mraw, length); + if (custom->name.data == NULL) { + goto failed; + } + + memcpy(custom->name.data, name, length); + + custom->name.length = length; + custom->name.data[custom->name.length] = 0x00; + } + else { + prop = entry->create(parser->memory); + if (prop == NULL) { + goto failed; + } + } + + declar->type = entry->unique; + declar->u.user = prop; + + if (out_entry != NULL) { + *out_entry = entry; + } + + return declar; + +failed: + + if (prop != NULL) { + (void) entry->destroy(parser->memory, prop, true); + } + + if (declar != NULL) { + (void) lxb_css_rule_declaration_destroy(declar, true); + } + + if (out_entry != NULL) { + *out_entry = NULL; + } + + return NULL; +} + +lxb_css_rule_declaration_list_t * +lxb_css_declaration_list_parse(lxb_css_parser_t *parser, + const lxb_char_t *data, size_t length) +{ + return lxb_css_syntax_parse_declarations(parser, + lxb_css_state_cb_declarations(), + data, length); +} diff --git a/ext/dom/lexbor/lexbor/css/declaration.h b/ext/dom/lexbor/lexbor/css/declaration.h index 1ea414e10bc7..53ab061aaa4c 100644 --- a/ext/dom/lexbor/lexbor/css/declaration.h +++ b/ext/dom/lexbor/lexbor/css/declaration.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Alexander Borisov + * Copyright (C) 2022-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -15,19 +15,14 @@ extern "C" { #include "lexbor/core/mraw.h" -LXB_API lxb_status_t -lxb_css_declaration_list_prepare(lxb_css_parser_t *parser, - lxb_css_memory_t *mem); +LXB_API lxb_css_rule_declaration_t * +lxb_css_declaration_create(lxb_css_parser_t *parser, + const lxb_char_t *name, size_t length, + const lxb_css_entry_data_t **out_entry); -LXB_API lxb_css_rule_declaration_list_t * -lxb_css_declaration_list_process(lxb_css_parser_t *parser, - const lxb_char_t *data, size_t length); - -LXB_API void -lxb_css_declaration_list_finish(lxb_css_parser_t *parser); LXB_API lxb_css_rule_declaration_list_t * -lxb_css_declaration_list_parse(lxb_css_parser_t *parser, lxb_css_memory_t *mem, +lxb_css_declaration_list_parse(lxb_css_parser_t *parser, const lxb_char_t *data, size_t length); diff --git a/ext/dom/lexbor/lexbor/css/log.c b/ext/dom/lexbor/lexbor/css/log.c index 08f6fc4fc5a1..d993e4715c62 100644 --- a/ext/dom/lexbor/lexbor/css/log.c +++ b/ext/dom/lexbor/lexbor/css/log.c @@ -152,7 +152,7 @@ lxb_css_log_format(lxb_css_log_t *log, lxb_css_log_type_t type, return NULL; } - msg = lxb_css_log_push(log, LXB_CSS_LOG_SYNTAX_ERROR, psize); + msg = lxb_css_log_push(log, type, psize); if (msg == NULL) { return NULL; } diff --git a/ext/dom/lexbor/lexbor/css/parser.c b/ext/dom/lexbor/lexbor/css/parser.c index 5ceffed0f970..625143864888 100644 --- a/ext/dom/lexbor/lexbor/css/parser.c +++ b/ext/dom/lexbor/lexbor/css/parser.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -73,7 +73,6 @@ lxb_css_parser_init(lxb_css_parser_t *parser, lxb_css_syntax_tokenizer_t *tkz) parser->rules->context = NULL; /* Temp */ - parser->pos = NULL; parser->str.length = 0; parser->str_size = 4096; @@ -93,13 +92,35 @@ lxb_css_parser_init(lxb_css_parser_t *parser, lxb_css_syntax_tokenizer_t *tkz) parser->types_pos = NULL; parser->types_end = NULL; parser->stage = LXB_CSS_PARSER_CLEAN; - parser->receive_endings = false; parser->status = LXB_STATUS_OK; parser->fake_null = false; + parser->token_end.type = LXB_CSS_SYNTAX_TOKEN__END; return LXB_STATUS_OK; } +lxb_status_t +lxb_css_parser_selectors_init(lxb_css_parser_t *parser) +{ + lxb_status_t status; + + parser->selectors = lxb_css_selectors_create(); + status = lxb_css_selectors_init(parser->selectors); + if (status != LXB_STATUS_OK) { + parser->selectors = lxb_css_selectors_destroy(parser->selectors, true); + } + + return status; +} + +void +lxb_css_parser_selectors_destroy(lxb_css_parser_t *parser) +{ + if (parser->selectors != NULL) { + parser->selectors = lxb_css_selectors_destroy(parser->selectors, true); + } +} + void lxb_css_parser_clean(lxb_css_parser_t *parser) { @@ -111,7 +132,6 @@ lxb_css_parser_clean(lxb_css_parser_t *parser) parser->types_pos = parser->types_begin; parser->stage = LXB_CSS_PARSER_CLEAN; parser->status = LXB_STATUS_OK; - parser->pos = NULL; parser->str.length = 0; parser->fake_null = false; } @@ -331,6 +351,14 @@ lxb_css_parser_unexpected_data_status(lxb_css_parser_t *parser, return LXB_STATUS_ERROR_UNEXPECTED_DATA; } +void * +lxb_css_parser_memory_fail_null(lxb_css_parser_t *parser) +{ + parser->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + parser->loop = false; + return NULL; +} + bool lxb_css_parser_memory_fail(lxb_css_parser_t *parser) { @@ -347,3 +375,189 @@ lxb_css_parser_memory_fail_status(lxb_css_parser_t *parser) return LXB_STATUS_ERROR_MEMORY_ALLOCATION; } + +/* + * No-inline functions for ABI. + */ +lxb_status_t +lxb_css_parser_status_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_status(parser); +} + +lxb_css_memory_t * +lxb_css_parser_memory_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_memory(parser); +} + +void +lxb_css_parser_memory_set_noi(lxb_css_parser_t *parser, lxb_css_memory_t *memory) +{ + lxb_css_parser_memory_set(parser, memory); +} + +lxb_css_selectors_t * +lxb_css_parser_selectors_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_selectors(parser); +} + +void +lxb_css_parser_selectors_set_noi(lxb_css_parser_t *parser, + lxb_css_selectors_t *selectors) +{ + lxb_css_parser_selectors_set(parser, selectors); +} + +bool +lxb_css_parser_is_running_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_is_running(parser); +} + +bool +lxb_css_parser_status_is_unexpected_data_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_status_is_unexpected_data(parser); +} + +void +lxb_css_parser_failed_set_noi(lxb_css_parser_t *parser, bool is) +{ + lxb_css_parser_failed_set(parser, is); +} + +void +lxb_css_parser_failed_set_by_id_noi(lxb_css_parser_t *parser, int idx, bool is) +{ + lxb_css_parser_failed_set_by_id(parser, idx, is); +} + +bool +lxb_css_parser_is_failed_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_is_failed(parser); +} + +void +lxb_css_parser_set_ok_noi(lxb_css_parser_t *parser) +{ + lxb_css_parser_set_ok(parser); +} + +const lxb_char_t * +lxb_css_parser_buffer_noi(lxb_css_parser_t *parser, size_t *length) +{ + return lxb_css_parser_buffer(parser, length); +} + +void +lxb_css_parser_buffer_set_noi(lxb_css_parser_t *parser, + const lxb_char_t *data, size_t length) +{ + lxb_css_parser_buffer_set(parser, data, length); +} + +lxb_css_parser_state_f +lxb_css_parser_state_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_state(parser); +} + +void +lxb_css_parser_state_set_noi(lxb_css_parser_t *parser, lxb_css_parser_state_f state) +{ + lxb_css_parser_state_set(parser, state); +} + +lxb_css_syntax_rule_t * +lxb_css_parser_current_rule_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_current_rule(parser); +} + +size_t +lxb_css_parser_rule_deep_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_rule_deep(parser); +} + +lxb_css_parser_state_t * +lxb_css_parser_states_pop_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_states_pop(parser); +} + +lxb_css_parser_state_t * +lxb_css_parser_states_to_root_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_states_to_root(parser); +} + +bool +lxb_css_parser_states_set_back_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_states_set_back(parser); +} + +void +lxb_css_parser_states_clean_noi(lxb_css_parser_t *parser) +{ + lxb_css_parser_states_clean(parser); +} + +lxb_css_parser_state_t * +lxb_css_parser_states_current_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_states_current(parser); +} + +void +lxb_css_parser_states_set_noi(lxb_css_parser_state_t *states, + lxb_css_parser_state_f state, void *context) +{ + lxb_css_parser_states_set(states, state, context); +} + +void +lxb_css_parser_states_up_noi(lxb_css_parser_t *parser) +{ + lxb_css_parser_states_up(parser); +} + +void +lxb_css_parser_states_down_noi(lxb_css_parser_t *parser) +{ + lxb_css_parser_states_down(parser); +} + +lxb_css_log_t * +lxb_css_parser_log_noi(lxb_css_parser_t *parser) +{ + return lxb_css_parser_log(parser); +} + +const lxb_css_syntax_token_t * +lxb_css_parser_token_end_noi(lxb_css_parser_t *parser, size_t offset) +{ + return lxb_css_parser_token_end(parser, offset); +} + +void +lxb_css_parser_set_context_noi(lxb_css_parser_t *parser, void *ctx) +{ + lxb_css_parser_set_context(parser, ctx); +} + +void +lxb_css_syntax_set_return_noi(lxb_css_parser_t *parser, void *value) +{ + lxb_css_syntax_set_return(parser, value); +} + +void * +lxb_css_syntax_returned_noi(lxb_css_parser_t *parser) +{ + return lxb_css_syntax_returned(parser); +} diff --git a/ext/dom/lexbor/lexbor/css/parser.h b/ext/dom/lexbor/lexbor/css/parser.h index 9a4dfae0b702..d703dcc2f13d 100644 --- a/ext/dom/lexbor/lexbor/css/parser.h +++ b/ext/dom/lexbor/lexbor/css/parser.h @@ -1,6 +1,5 @@ /* - - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -70,7 +69,6 @@ extern "C" { } \ while (false) - #define lxb_css_parser_token_status_wo_ws_m(parser, token) \ do { \ if ((token = lxb_css_syntax_parser_token(parser)) == NULL) { \ @@ -129,49 +127,44 @@ typedef enum { lxb_css_parser_stage_t; struct lxb_css_parser { - lxb_css_parser_state_f block; - void *context; - /* Modules */ - lxb_css_syntax_tokenizer_t *tkz; - lxb_css_selectors_t *selectors; - lxb_css_selectors_t *old_selectors; + lxb_css_syntax_tokenizer_t *tkz; + lxb_css_selectors_t *selectors; /* Memory for all structures. */ - lxb_css_memory_t *memory; - lxb_css_memory_t *old_memory; + lxb_css_memory_t *memory; /* Syntax parse rules. */ - lxb_css_syntax_rule_t *rules_begin; - lxb_css_syntax_rule_t *rules_end; - lxb_css_syntax_rule_t *rules; + lxb_css_syntax_rule_t *rules_begin; + lxb_css_syntax_rule_t *rules_end; + lxb_css_syntax_rule_t *rules; /* States */ - lxb_css_parser_state_t *states_begin; - lxb_css_parser_state_t *states_end; - lxb_css_parser_state_t *states; + lxb_css_parser_state_t *states_begin; + lxb_css_parser_state_t *states_end; + lxb_css_parser_state_t *states; /* Types */ - lxb_css_syntax_token_type_t *types_begin; - lxb_css_syntax_token_type_t *types_end; - lxb_css_syntax_token_type_t *types_pos; + lxb_css_syntax_token_type_t *types_begin; + lxb_css_syntax_token_type_t *types_end; + lxb_css_syntax_token_type_t *types_pos; - const lxb_char_t *pos; - uintptr_t offset; + lxb_css_syntax_token_t token_end; - lexbor_str_t str; - size_t str_size; + lexbor_str_t str; + size_t str_size; - lxb_css_log_t *log; + lxb_css_log_t *log; - lxb_css_parser_stage_t stage; + lxb_css_parser_stage_t stage; - bool loop; - bool fake_null; - bool my_tkz; - bool receive_endings; + lxb_css_syntax_declaration_offset_t offset; - lxb_status_t status; + bool loop; + bool fake_null; + bool my_tkz; + + lxb_status_t status; }; struct lxb_css_parser_state { @@ -185,47 +178,197 @@ struct lxb_css_parser_error { }; +/* + * Create a new CSS parser object. + * + * @return lxb_css_parser_t* if successful, otherwise NULL. + */ LXB_API lxb_css_parser_t * lxb_css_parser_create(void); +/* + * Initialize the CSS parser with a tokenizer. + * + * @param[in] parser Required. The CSS parser object. + * If NULL, the function returns + * LXB_STATUS_ERROR_OBJECT_IS_NULL. + * @param[in] tkz Optional. The tokenizer object. + * If NULL, a new tokenizer will be created and used. + * (In that case the parser manages the tokenizer lifetime.) + * + * @return LXB_STATUS_OK if successful, otherwise an error status value. + */ LXB_API lxb_status_t lxb_css_parser_init(lxb_css_parser_t *parser, lxb_css_syntax_tokenizer_t *tkz); +/* + * Initialize the Selectors module in the parser. + * + * Note: + * Be sure to destroy the Selectors object you created yourself using + * the lxb_css_parser_selectors_destroy() function. + * + * @param[in] parser Required. The CSS parser object. + * + * @return LXB_STATUS_OK if successful, otherwise an error status value. + */ +LXB_API lxb_status_t +lxb_css_parser_selectors_init(lxb_css_parser_t *parser); + +/* + * Destroy the selectors module in the parser. + * + * @param[in] parser Required. The CSS parser object. + */ +LXB_API void +lxb_css_parser_selectors_destroy(lxb_css_parser_t *parser); + +/* + * Clean the parser object. + * + * This resets internal parser state, but keeps allocated memory so the parser + * can be reused. + * + * @param[in] parser Required. The CSS parser object. + */ LXB_API void lxb_css_parser_clean(lxb_css_parser_t *parser); +/* + * Erase the parser object. + * + * This resets internal parser state and releases internal allocations owned by + * the parser so it can be re-initialized. + * + * @param[in] parser Required. The CSS parser object. + */ LXB_API void lxb_css_parser_erase(lxb_css_parser_t *parser); +/* + * Destroy the parser object. + * + * @param[in] parser Optional. The CSS parser object. + * If NULL, the function returns NULL. + * @param[in] self_destroy Optional flag. + * If true, also frees the parser object itself. + * If false, only inner resources are freed and the + * parser object remains valid. + * + * @return parser if self_destroy is false, otherwise NULL. + */ LXB_API lxb_css_parser_t * lxb_css_parser_destroy(lxb_css_parser_t *parser, bool self_destroy); -LXB_API lxb_css_parser_state_t * -lxb_css_parser_states_push(lxb_css_parser_t *parser, - lxb_css_parser_state_f state, - void *context, bool stop); - -LXB_API lxb_css_parser_state_t * -lxb_css_parser_states_next(lxb_css_parser_t *parser, - lxb_css_parser_state_f next, - lxb_css_parser_state_f back, void *ctx, bool root); - -LXB_API lxb_status_t -lxb_css_parser_types_push(lxb_css_parser_t *parser, - lxb_css_syntax_token_type_t type); - +/* + * Stop the parser main loop. + * + * This is a helper for state callbacks that want to immediately stop parsing + * without marking the current rule as failed. + * + * @param[in] parser Required. The CSS parser object. + * + * @return true (convenience return value, useful for state callbacks). + */ LXB_API bool lxb_css_parser_stop(lxb_css_parser_t *parser); +/* + * Fail the parser with a status and stop the main loop. + * + * This is used for hard errors (OOM, overflow, etc.). It sets parser->status + * and stops the parser loop. + * + * @param[in] parser Required. The CSS parser object. + * @param[in] status Required. Status code describing the failure. + * + * @return true (convenience return value, useful for state callbacks). + */ LXB_API bool lxb_css_parser_fail(lxb_css_parser_t *parser, lxb_status_t status); +/* + * Mark the current token as unexpected. + * + * This is a specialized helper for the common "unexpected data" parse error. + * It sets parser->status to LXB_STATUS_ERROR_UNEXPECTED_DATA and marks the + * current rule as failed. + * + * @param[in] parser Required. The CSS parser object. + * + * @return true (convenience return value, useful for state callbacks). + */ LXB_API bool lxb_css_parser_unexpected(lxb_css_parser_t *parser); +/* + * Mark parsing of the current grammar/rule as successful. + * + * Why this function exists: + * - Most callbacks in the CSS parser work as a state machine: each callback + * receives the current token and returns bool to decide what to do next. + * - "Success" is not just a bool. The parser must switch to a special + * lxb_css_state_success state to properly handle trailing whitespace and + * the end-of-input token. + * - If you don't consume all tokens up to LXB_CSS_SYNTAX_TOKEN__END in the + * current rule and call this function, the parser will switch to "failed" + * mode. This is the same as calling the lxb_css_parser_failed() function. + * The exception is the LXB_CSS_SYNTAX_TOKEN_WHITESPACE token. If you are + * sure that only this token remains, the parser will simply exclude it. + * + * What it does: + * - Sets the current rule state to lxb_css_state_success. + * - Does not stop the parser loop by itself. + * + * Typical usage: + * - In css/property/state.c, after you have parsed and consumed the last token + * of a property value, you do: + * return lxb_css_parser_success(parser); + * - That transfers control to lxb_css_state_success, which consumes any + * whitespace and completes on LXB_CSS_SYNTAX_TOKEN__END. + * + * @param[in] parser Required. The CSS parser object. + * + * @return true (convenience return value, useful for state callbacks). + */ LXB_API bool lxb_css_parser_success(lxb_css_parser_t *parser); +/* + * Mark parsing of the current grammar/rule as failed. + * + * Why this function exists: + * - In the state machine, failure is also not "just return false". The parser + * needs to switch to a rule-specific recovery state so it can safely skip + * input until it is allowed to stop (usually until end-of-input or a known + * synchronisation point). + * + * What it does: + * - Sets the current rule state to the rule-specific "failed" handler + * (rule->cbx.cb->failed). + * - Sets rule->failed = true. + * - Does not directly change parser->status. Use lxb_css_parser_fail() or + * lxb_css_parser_unexpected() when you need a concrete status code. + * + * Typical usage: + * - In css/property/state.c, if a token doesn't match the expected grammar, + * you do: + * return lxb_css_parser_failed(parser); + * - That switches the parser into the failed handler. For properties this lets + * the parser consume/skip tokens until it reaches LXB_CSS_SYNTAX_TOKEN__END. + * (See lxb_css_state_failed(): it consumes tokens until end, then calls + * lxb_css_parser_success() to finish.) + * + * Important! + * The user sets the callback to "failed" and must decide what to do in this + * situation. If the user does not consume all tokens before + * LXB_CSS_SYNTAX_TOKEN__END, there will be an infinite loop. + * + * @param[in] parser Required. The CSS parser object. + * + * @return true (convenience return value, useful for state callbacks). + */ + LXB_API bool lxb_css_parser_failed(lxb_css_parser_t *parser); @@ -240,12 +383,64 @@ LXB_API lxb_status_t lxb_css_parser_unexpected_data_status(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token); +LXB_API void * +lxb_css_parser_memory_fail_null(lxb_css_parser_t *parser); + LXB_API bool lxb_css_parser_memory_fail(lxb_css_parser_t *parser); -lxb_status_t +LXB_API lxb_status_t lxb_css_parser_memory_fail_status(lxb_css_parser_t *parser); +/* + * Push a new state to the parser. + * + * @param[in] parser Required. The CSS parser object. + * @param[in] state Required. State callback to execute. + * @param[in] context Optional user pointer associated with this state. + * Stored as-is; the parser doesn't own it. + * @param[in] stop If true, the pushed state is marked as a "stop point". + * This is used by the parser to stop/return control when + * this state is reached. + * + * @return lxb_css_parser_state_t* if successful, otherwise NULL. + */ +LXB_API lxb_css_parser_state_t * +lxb_css_parser_states_push(lxb_css_parser_t *parser, + lxb_css_parser_state_f state, + void *context, bool stop); + +/* + * Go to the next state in the parser. + * + * @param[in] parser Required. The CSS parser object. + * @param[in] next Required. Next state callback. + * @param[in] back Required. State callback to return to. + * @param[in] ctx Optional user pointer for the next state. + * Stored as-is; the parser doesn't own it. + * @param[in] root If true, marks this state as a "root" state. Root states + * are used by helper functions (e.g. to rewind to root). + * + * @return lxb_css_parser_state_t* if successful, otherwise NULL. + */ +LXB_API lxb_css_parser_state_t * +lxb_css_parser_states_next(lxb_css_parser_t *parser, + lxb_css_parser_state_f next, + lxb_css_parser_state_f back, void *ctx, bool root); + +/* + * Push a token type to the parser. + * + * @param[in] parser Required. The CSS parser object. + * @param[in] type Required. Token type to push. + * + * @return LXB_STATUS_OK if successful, otherwise an error status value. + */ +LXB_API lxb_status_t +lxb_css_parser_types_push(lxb_css_parser_t *parser, + lxb_css_syntax_token_type_t type); + + /* * Inline functions */ @@ -350,32 +545,6 @@ lxb_css_parser_state_set(lxb_css_parser_t *parser, lxb_css_parser_state_f state) parser->rules->state = state; } -lxb_inline void -lxb_css_parser_state_block_set(lxb_css_parser_t *parser, - lxb_css_parser_state_f state) -{ - parser->block = state; -} - -lxb_inline void -lxb_css_parser_state_value_set(lxb_css_parser_t *parser, - lxb_css_parser_state_f state) -{ - lxb_css_parser_state_block_set(parser, state); -} - -lxb_inline void * -lxb_css_parser_context(lxb_css_parser_t *parser) -{ - return parser->context; -} - -lxb_inline void -lxb_css_parser_context_set(lxb_css_parser_t *parser, void *context) -{ - parser->context = context; -} - lxb_inline lxb_css_syntax_rule_t * lxb_css_parser_current_rule(lxb_css_parser_t *parser) { @@ -420,13 +589,6 @@ lxb_css_parser_states_set_back(lxb_css_parser_t *parser) return true; } -lxb_inline void -lxb_css_parser_states_change_back(lxb_css_parser_t *parser, - lxb_css_parser_state_f state) -{ - parser->rules->state_back = state; -} - lxb_inline void lxb_css_parser_states_clean(lxb_css_parser_t *parser) { @@ -465,47 +627,127 @@ lxb_css_parser_log(lxb_css_parser_t *parser) return parser->log; } -lxb_inline void -lxb_css_parser_offset_set(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token) +lxb_inline const lxb_css_syntax_token_t * +lxb_css_parser_token_end(lxb_css_parser_t *parser, size_t offset) { - if (parser->pos == NULL) { - if (token == NULL) { - parser->pos = parser->tkz->in_begin; - parser->offset = 0; - } - else { - parser->pos = lxb_css_syntax_token_base(token)->begin - + lxb_css_syntax_token_base(token)->length; - parser->offset = token->offset + lxb_css_syntax_token_base(token)->length; - } - } + parser->token_end.offset = offset; + return &parser->token_end; } -lxb_inline const lxb_css_syntax_list_rules_offset_t * -lxb_css_parser_list_rules_offset(lxb_css_parser_t *parser) +lxb_inline void +lxb_css_parser_set_context(lxb_css_parser_t *parser, void *ctx) { - return &parser->rules->u.list_rules; + parser->rules->context = ctx; } -lxb_inline const lxb_css_syntax_at_rule_offset_t * -lxb_css_parser_at_rule_offset(lxb_css_parser_t *parser) +lxb_inline void +lxb_css_syntax_set_return(lxb_css_parser_t *parser, void *value) { - return &parser->rules->u.at_rule; + parser->rules[-1].returned = value; } -lxb_inline const lxb_css_syntax_qualified_offset_t * -lxb_css_parser_qualified_rule_offset(lxb_css_parser_t *parser) +lxb_inline void * +lxb_css_syntax_returned(lxb_css_parser_t *parser) { - return &parser->rules->u.qualified; + return parser->rules->returned; } -lxb_inline const lxb_css_syntax_declarations_offset_t * -lxb_css_parser_declarations_offset(lxb_css_parser_t *parser) -{ - return &parser->rules->u.declarations; -} +/* + * No-inline functions for ABI. + */ +LXB_API lxb_status_t +lxb_css_parser_status_noi(lxb_css_parser_t *parser); + +LXB_API lxb_css_memory_t * +lxb_css_parser_memory_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_memory_set_noi(lxb_css_parser_t *parser, lxb_css_memory_t *memory); + +LXB_API lxb_css_selectors_t * +lxb_css_parser_selectors_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_selectors_set_noi(lxb_css_parser_t *parser, + lxb_css_selectors_t *selectors); + +LXB_API bool +lxb_css_parser_is_running_noi(lxb_css_parser_t *parser); + +LXB_API bool +lxb_css_parser_status_is_unexpected_data_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_failed_set_noi(lxb_css_parser_t *parser, bool is); + +LXB_API void +lxb_css_parser_failed_set_by_id_noi(lxb_css_parser_t *parser, int idx, bool is); + +LXB_API bool +lxb_css_parser_is_failed_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_set_ok_noi(lxb_css_parser_t *parser); + +LXB_API const lxb_char_t * +lxb_css_parser_buffer_noi(lxb_css_parser_t *parser, size_t *length); + +LXB_API void +lxb_css_parser_buffer_set_noi(lxb_css_parser_t *parser, + const lxb_char_t *data, size_t length); + +LXB_API lxb_css_parser_state_f +lxb_css_parser_state_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_state_set_noi(lxb_css_parser_t *parser, + lxb_css_parser_state_f state); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_parser_current_rule_noi(lxb_css_parser_t *parser); + +LXB_API size_t +lxb_css_parser_rule_deep_noi(lxb_css_parser_t *parser); + +LXB_API lxb_css_parser_state_t * +lxb_css_parser_states_pop_noi(lxb_css_parser_t *parser); + +LXB_API lxb_css_parser_state_t * +lxb_css_parser_states_to_root_noi(lxb_css_parser_t *parser); + +LXB_API bool +lxb_css_parser_states_set_back_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_states_clean_noi(lxb_css_parser_t *parser); + +LXB_API lxb_css_parser_state_t * +lxb_css_parser_states_current_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_states_set_noi(lxb_css_parser_state_t *states, + lxb_css_parser_state_f state, void *context); + +LXB_API void +lxb_css_parser_states_up_noi(lxb_css_parser_t *parser); + +LXB_API void +lxb_css_parser_states_down_noi(lxb_css_parser_t *parser); + +LXB_API lxb_css_log_t * +lxb_css_parser_log_noi(lxb_css_parser_t *parser); + +LXB_API const lxb_css_syntax_token_t * +lxb_css_parser_token_end_noi(lxb_css_parser_t *parser, size_t offset); + +LXB_API void +lxb_css_parser_set_context_noi(lxb_css_parser_t *parser, void *ctx); + +LXB_API void +lxb_css_syntax_set_return_noi(lxb_css_parser_t *parser, void *value); +LXB_API void * +lxb_css_syntax_returned_noi(lxb_css_parser_t *parser); #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/css/property.c b/ext/dom/lexbor/lexbor/css/property.c new file mode 100644 index 000000000000..6e460c3492f8 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/property.c @@ -0,0 +1,3171 @@ +/* + * Copyright (C) 2021-2023 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/css.h" +#include "lexbor/css/property.h" +#include "lexbor/css/parser.h" +#include "lexbor/css/stylesheet.h" +#include "lexbor/css/property/state.h" +#include "lexbor/css/property/res.h" +#include "lexbor/core/serialize.h" +#include "lexbor/core/conv.h" + + +const lxb_css_entry_data_t * +lxb_css_property_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_property_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_entry_data_t * +lxb_css_property_by_id(uintptr_t id) +{ + return &lxb_css_property_data[id]; +} + +const void * +lxb_css_property_initial_by_id(uintptr_t id) +{ + if (id >= LXB_CSS_PROPERTY__LAST_ENTRY) { + return NULL; + } + + return lxb_css_property_data[id].initial; +} + +void * +lxb_css_property_destroy(lxb_css_memory_t *memory, void *style, + lxb_css_property_type_t type, bool self_destroy) +{ + const lxb_css_entry_data_t *data; + + data = lxb_css_property_by_id(type); + if (data == NULL) { + return style; + } + + return data->destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_serialize(const void *style, lxb_css_property_type_t type, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_entry_data_t *data; + + data = lxb_css_property_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + return data->serialize(style, cb, ctx); +} + +lxb_status_t +lxb_css_property_serialize_str(const void *style, lxb_css_property_type_t type, + lexbor_mraw_t *mraw, lexbor_str_t *str) +{ + const lxb_css_entry_data_t *data; + + data = lxb_css_property_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + return lxb_css_serialize_str_handler(style, str, mraw, data->serialize); +} + +lxb_status_t +lxb_css_property_serialize_name(const void *style, lxb_css_property_type_t type, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_entry_data_t *data; + + switch (type) { + case LXB_CSS_PROPERTY__UNDEF: + return lxb_css_property__undef_serialize_name(style, cb, ctx); + + case LXB_CSS_PROPERTY__CUSTOM: + return lxb_css_property__custom_serialize_name(style, cb, ctx); + + default: + break; + } + + data = lxb_css_property_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + return cb(data->name, data->length, ctx); +} + +lxb_status_t +lxb_css_property_serialize_name_str(const void *style, lxb_css_property_type_t type, + lexbor_mraw_t *mraw, lexbor_str_t *str) +{ + const lxb_css_entry_data_t *data; + + switch (type) { + case LXB_CSS_PROPERTY__UNDEF: + return lxb_css_serialize_str_handler(style, str, mraw, + lxb_css_property__undef_serialize_name); + + case LXB_CSS_PROPERTY__CUSTOM: + return lxb_css_serialize_str_handler(style, str, mraw, + lxb_css_property__custom_serialize_name); + + default: + break; + } + + data = lxb_css_property_by_id(type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + if (str->data == NULL) { + lexbor_str_init(str, mraw, data->length); + if (str->data == NULL) { + return LXB_STATUS_ERROR_MEMORY_ALLOCATION; + } + } + + (void) lexbor_str_append(str, mraw, data->name, data->length); + + return LXB_STATUS_OK; +} + +/* _undef. */ + +void * +lxb_css_property__undef_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property__undef_t)); +} + +void * +lxb_css_property__undef_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + if (style == NULL) { + return NULL; + } + + if (self_destroy) { + return lexbor_mraw_free(memory->mraw, style); + } + + return style; +} + +lxb_status_t +lxb_css_property__undef_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__undef_t *undef = style; + + return cb(undef->value.data, undef->value.length, ctx); +} + +lxb_status_t +lxb_css_property__undef_serialize_name(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__undef_t *undef = style; + const lxb_css_entry_data_t *data; + + if (undef->type == LXB_CSS_PROPERTY__UNDEF) { + return LXB_STATUS_OK; + } + + data = lxb_css_property_by_id(undef->type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + return cb(data->name, data->length, ctx); +} + +lxb_status_t +lxb_css_property__undef_serialize_value(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__undef_t *undef = style; + + if (undef->type == LXB_CSS_PROPERTY__UNDEF) { + return cb(undef->value.data, undef->value.length, ctx); + } + + return LXB_STATUS_OK; +} + +/* _custom. */ + +void * +lxb_css_property__custom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property__custom_t)); +} + +void * +lxb_css_property__custom_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + if (style == NULL) { + return NULL; + } + + if (self_destroy) { + return lexbor_mraw_free(memory->mraw, style); + } + + return style; +} + +lxb_status_t +lxb_css_property__custom_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__custom_t *custom = style; + + if (custom->value.data == NULL) { + return LXB_STATUS_OK; + } + + return cb(custom->value.data, custom->value.length, ctx); +} + +lxb_status_t +lxb_css_property__custom_serialize_name(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__custom_t *custom = style; + + return cb(custom->name.data, custom->name.length, ctx); +} + +lxb_status_t +lxb_css_property__custom_serialize_value(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property__custom_t *custom = style; + + if (custom->value.data == NULL) { + return LXB_STATUS_OK; + } + + return cb(custom->value.data, custom->value.length, ctx); +} + +/* Display. */ + +void * +lxb_css_property_display_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_display_t)); +} + +void * +lxb_css_property_display_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_display_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_data_t *data; + const lxb_css_property_display_t *display = property; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + data = lxb_css_value_by_id(display->a); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, data->name, data->length, ctx, status); + + if (display->b == LXB_CSS_PROPERTY__UNDEF) { + return LXB_STATUS_OK; + } + + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + data = lxb_css_value_by_id(display->b); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, data->name, data->length, ctx, status); + + if (display->c == LXB_CSS_PROPERTY__UNDEF) { + return LXB_STATUS_OK; + } + + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + data = lxb_css_value_by_id(display->c); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, data->name, data->length, ctx, status); + + return LXB_STATUS_OK; +} + +/* Order. */ + +void * +lxb_css_property_order_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_order_t)); +} + +void * +lxb_css_property_order_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_order_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_integer_type_sr(style, cb, ctx); +} + +/* Visibility. */ + +void * +lxb_css_property_visibility_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_visibility_t)); +} + +void * +lxb_css_property_visibility_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_visibility_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_visibility_t *vb = style; + + return lxb_css_value_serialize(vb->type, cb, ctx); +} + +/* Width. */ + +void * +lxb_css_property_width_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_width_t)); +} + +void * +lxb_css_property_width_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_width_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_width_t *width = property; + + switch (width->type) { + case LXB_CSS_VALUE__LENGTH: + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_length_sr(&width->u.length, cb, ctx); + + case LXB_CSS_VALUE__PERCENTAGE: + return lxb_css_value_percentage_sr(&width->u.percentage, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(width->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* Height. */ + +void * +lxb_css_property_height_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_height_t)); +} + +void * +lxb_css_property_height_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_height_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(property, cb, ctx); +} + +/* Box-sizing. */ + +void * +lxb_css_property_box_sizing_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_box_sizing_t)); +} + +void * +lxb_css_property_box_sizing_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_box_sizing_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_box_sizing_t *bsize = property; + + return lxb_css_value_serialize(bsize->type, cb, ctx); +} + +/* Min-width. */ + +void * +lxb_css_property_min_width_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_min_width_t)); +} + +void * +lxb_css_property_min_width_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_min_width_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(property, cb, ctx); +} + +/* Min-height. */ + +void * +lxb_css_property_min_height_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_min_height_t)); +} + +void * +lxb_css_property_min_height_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_min_height_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(property, cb, ctx); +} + +/* Max-width. */ + +void * +lxb_css_property_max_width_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_max_width_t)); +} + +void * +lxb_css_property_max_width_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_max_width_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(property, cb, ctx); +} + +/* Max-height. */ + +void * +lxb_css_property_max_height_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_max_height_t)); +} + +void * +lxb_css_property_max_height_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_max_height_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(property, cb, ctx); +} + +/* Margin. */ + +void * +lxb_css_property_margin_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_margin_t)); +} + +void * +lxb_css_property_margin_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_margin_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_margin_t *margin = property; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + /* Top. */ + + status = lxb_css_value_length_percentage_sr(&margin->top, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (margin->right.type == LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_OK; + } + + /* Right. */ + + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + status = lxb_css_value_length_percentage_sr(&margin->right, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (margin->bottom.type == LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_OK; + } + + /* Bottom. */ + + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + status = lxb_css_value_length_percentage_sr(&margin->bottom, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (margin->left.type == LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_OK; + } + + /* Left. */ + + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + return lxb_css_value_length_percentage_sr(&margin->left, cb, ctx); +} + +/* Margin-top. */ + +void * +lxb_css_property_margin_top_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_margin_top_t)); +} + +void * +lxb_css_property_margin_top_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_margin_top_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Margin-right. */ + +void * +lxb_css_property_margin_right_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_margin_right_t)); +} + +void * +lxb_css_property_margin_right_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_margin_right_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Margin-bottom. */ + +void * +lxb_css_property_margin_bottom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_margin_bottom_t)); +} + +void * +lxb_css_property_margin_bottom_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_margin_bottom_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Margin-left. */ + +void * +lxb_css_property_margin_left_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_margin_left_t)); +} + +void * +lxb_css_property_margin_left_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_margin_left_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Padding. */ + +void * +lxb_css_property_padding_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_padding_t)); +} + +void * +lxb_css_property_padding_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_padding_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_margin_serialize(property, cb, ctx); +} + +/* Padding-top. */ + +void * +lxb_css_property_padding_top_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_padding_top_t)); +} + +void * +lxb_css_property_padding_top_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_padding_top_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Padding-right. */ + +void * +lxb_css_property_padding_right_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_padding_right_t)); +} + +void * +lxb_css_property_padding_right_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_padding_right_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Padding-bottom. */ + +void * +lxb_css_property_padding_bottom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_padding_bottom_t)); +} + +void * +lxb_css_property_padding_bottom_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_padding_bottom_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Padding-left. */ + +void * +lxb_css_property_padding_left_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_padding_left_t)); +} + +void * +lxb_css_property_padding_left_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_padding_left_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(property, cb, ctx); +} + +/* Border. */ + +void * +lxb_css_property_border_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_border_t)); +} + +void * +lxb_css_property_border_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_border_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool ws_print; + lxb_status_t status; + const lxb_css_property_border_t *border = property; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + ws_print = false; + + if (border->width.type != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_length_type_sr(&border->width, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (border->style != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(border->style, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (border->color.type != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_value_color_serialize(&border->color, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* Border-top. */ + +void * +lxb_css_property_border_top_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_border_top_t)); +} + +void * +lxb_css_property_border_top_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_border_top_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_border_serialize(property, cb, ctx); +} + +/* Border-right. */ + +void * +lxb_css_property_border_right_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_border_right_t)); +} + +void * +lxb_css_property_border_right_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_border_right_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_border_serialize(property, cb, ctx); +} + +/* Border-bottom. */ + +void * +lxb_css_property_border_bottom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_border_bottom_t)); +} + +void * +lxb_css_property_border_bottom_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_border_bottom_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_border_serialize(property, cb, ctx); +} + +/* Border-left. */ + +void * +lxb_css_property_border_left_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_border_left_t)); +} + +void * +lxb_css_property_border_left_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_border_left_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_border_serialize(property, cb, ctx); +} + +void * +lxb_css_property_border_top_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_border_top_color_t)); +} + +void * +lxb_css_property_border_top_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_border_top_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(style, cb, ctx); +} + +void * +lxb_css_property_border_right_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_border_right_color_t)); +} + +void * +lxb_css_property_border_right_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_border_right_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(style, cb, ctx); +} + +void * +lxb_css_property_border_bottom_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_border_bottom_color_t)); +} + +void * +lxb_css_property_border_bottom_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_border_bottom_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(style, cb, ctx); +} + +void * +lxb_css_property_border_left_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_border_left_color_t)); +} + +void * +lxb_css_property_border_left_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_border_left_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(style, cb, ctx); +} + +void * +lxb_css_property_background_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_background_color_t)); +} + +void * +lxb_css_property_background_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_background_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(style, cb, ctx); +} + +/* Color. */ + +void * +lxb_css_property_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_color_t)); +} + +void * +lxb_css_property_color_destroy(lxb_css_memory_t *memory, + void *property, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, property, self_destroy); +} + +lxb_status_t +lxb_css_property_color_serialize(const void *property, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_color_serialize(property, cb, ctx); +} + +void * +lxb_css_property_opacity_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_opacity_t)); +} + +void * +lxb_css_property_opacity_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_opacity_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_percentage_sr(style, cb, ctx); +} + +void * +lxb_css_property_position_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_position_t)); +} + +void * +lxb_css_property_position_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_position_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_position_t *position = style; + + return lxb_css_value_serialize(position->type, cb, ctx); +} + +void * +lxb_css_property_top_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_top_t)); +} + +void * +lxb_css_property_top_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_top_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(style, cb, ctx); +} + +void * +lxb_css_property_right_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_right_t)); +} + +void * +lxb_css_property_right_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_right_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_bottom_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_bottom_t)); +} + +void * +lxb_css_property_bottom_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_bottom_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_left_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_left_t)); +} + +void * +lxb_css_property_left_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_left_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_inset_block_start_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_inset_block_start_t)); +} + +void * +lxb_css_property_inset_block_start_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_inset_block_start_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_inset_inline_start_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_inset_inline_start_t)); +} + +void * +lxb_css_property_inset_inline_start_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_inset_inline_start_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_inset_block_end_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_inset_block_end_t)); +} + +void * +lxb_css_property_inset_block_end_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_inset_block_end_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +void * +lxb_css_property_inset_inline_end_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_inset_inline_end_t)); +} + +void * +lxb_css_property_inset_inline_end_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_inset_inline_end_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_top_serialize(style, cb, ctx); +} + +/* Text-transform. */ + +LXB_API void * +lxb_css_property_text_transform_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_transform_t)); +} + +LXB_API void * +lxb_css_property_text_transform_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_transform_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool ws_print; + lxb_status_t status; + const lxb_css_property_text_transform_t *tt = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + ws_print = false; + + if (tt->type_case != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(tt->type_case, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (tt->full_width != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(tt->full_width, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (tt->full_size_kana != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_value_serialize(tt->full_size_kana, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* Text-align. */ + +LXB_API void * +lxb_css_property_text_align_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_align_t)); +} + +LXB_API void * +lxb_css_property_text_align_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_align_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_align_t *ta = style; + + return lxb_css_value_serialize(ta->type, cb, ctx); +} + +/* Text-align-all. */ + +LXB_API void * +lxb_css_property_text_align_all_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_align_all_t)); +} + +LXB_API void * +lxb_css_property_text_align_all_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_align_all_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_align_all_t *taa = style; + + return lxb_css_value_serialize(taa->type, cb, ctx); +} + +/* Text-align-last. */ + +LXB_API void * +lxb_css_property_text_align_last_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_align_last_t)); +} + +LXB_API void * +lxb_css_property_text_align_last_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_align_last_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_align_last_t *tal = style; + + return lxb_css_value_serialize(tal->type, cb, ctx); +} + +/* Text-justify. */ + +LXB_API void * +lxb_css_property_text_justify_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_justify_t)); +} + +LXB_API void * +lxb_css_property_text_justify_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_justify_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_justify_t *tj = style; + + return lxb_css_value_serialize(tj->type, cb, ctx); +} + +/* Text-indent. */ + +LXB_API void * +lxb_css_property_text_indent_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_indent_t)); +} + +LXB_API void * +lxb_css_property_text_indent_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_indent_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_text_indent_t *ti = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + if (ti->type == LXB_CSS_VALUE__LENGTH) { + status = lxb_css_value_length_percentage_sr(&ti->length, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + else if (ti->type != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(ti->type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + if (ti->hanging != LXB_CSS_VALUE__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + status = lxb_css_value_serialize(ti->hanging, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + if (ti->each_line != LXB_CSS_VALUE__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + return lxb_css_value_serialize(ti->each_line, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* White-space. */ + +LXB_API void * +lxb_css_property_white_space_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_white_space_t)); +} + +LXB_API void * +lxb_css_property_white_space_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_white_space_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_white_space_t *ws = style; + + return lxb_css_value_serialize(ws->type, cb, ctx); +} + +/* Tab-size. */ + +LXB_API void * +lxb_css_property_tab_size_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_tab_size_t)); +} + +LXB_API void * +lxb_css_property_tab_size_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_tab_size_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_length_sr(style, cb, ctx); +} + +/* Word-break. */ + +LXB_API void * +lxb_css_property_word_break_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_word_break_t)); +} + +LXB_API void * +lxb_css_property_word_break_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_word_break_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_word_break_t *wb = style; + + return lxb_css_value_serialize(wb->type, cb, ctx); +} + +/* Line-break. */ + +LXB_API void * +lxb_css_property_line_break_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_line_break_t)); +} + +LXB_API void * +lxb_css_property_line_break_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_line_break_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_line_break_t *lb = style; + + return lxb_css_value_serialize(lb->type, cb, ctx); +} + +/* Hyphens. */ + +LXB_API void * +lxb_css_property_hyphens_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_hyphens_t)); +} + +LXB_API void * +lxb_css_property_hyphens_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_hyphens_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_hyphens_t *hpns = style; + + return lxb_css_value_serialize(hpns->type, cb, ctx); +} + +/* Overflow-wrap. */ + +LXB_API void * +lxb_css_property_overflow_wrap_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_overflow_wrap_t)); +} + +LXB_API void * +lxb_css_property_overflow_wrap_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_overflow_wrap_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_overflow_wrap_t *ow = style; + + return lxb_css_value_serialize(ow->type, cb, ctx); +} + +/* Word-wrap. */ + +LXB_API void * +lxb_css_property_word_wrap_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_word_wrap_t)); +} + +LXB_API void * +lxb_css_property_word_wrap_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_word_wrap_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_word_wrap_t *ww = style; + + return lxb_css_value_serialize(ww->type, cb, ctx); +} + +/* Word-spacing. */ + +LXB_API void * +lxb_css_property_word_spacing_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_word_spacing_t)); +} + +LXB_API void * +lxb_css_property_word_spacing_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_word_spacing_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_type_sr(style, cb, ctx); +} + +/* Letter-spacing. */ + +LXB_API void * +lxb_css_property_letter_spacing_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_letter_spacing_t)); +} + +LXB_API void * +lxb_css_property_letter_spacing_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_letter_spacing_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_type_sr(style, cb, ctx); +} + +/* Hanging-punctuation. */ + +LXB_API void * +lxb_css_property_hanging_punctuation_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_hanging_punctuation_t)); +} + +LXB_API void * +lxb_css_property_hanging_punctuation_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_hanging_punctuation_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool ws_print; + lxb_status_t status; + const lxb_css_property_hanging_punctuation_t *hp = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + ws_print = false; + + if (hp->type_first != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(hp->type_first, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (hp->force_allow != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(hp->force_allow, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + ws_print = true; + } + + if (hp->last != LXB_CSS_VALUE__UNDEF) { + if (ws_print) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_value_serialize(hp->last, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* Font-family. */ + +void * +lxb_css_property_font_family_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_font_family_t)); +} + +void * +lxb_css_property_font_family_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + lxb_css_property_font_family_t *ff = style; + lxb_css_property_family_name_t *name, *next; + + name = ff->first; + + while (name != NULL) { + next = name->next; + + if (!name->generic) { + (void) lexbor_str_destroy(&name->u.str, memory->mraw, false); + } + + lexbor_mraw_free(memory->mraw, name); + + name = next; + } + + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_font_family_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_font_family_t *ff = style; + const lxb_css_property_family_name_t *name; + + static const lexbor_str_t str_comma = lexbor_str(", "); + + name = ff->first; + + while (name != NULL) { + if (name->generic) { + status = lxb_css_value_serialize(name->u.type, cb, ctx); + } + else { + status = lxb_css_syntax_ident_or_string_serialize(name->u.str.data, + name->u.str.length, + cb, ctx); + } + + if (status != LXB_STATUS_OK) { + return status; + } + + name = name->next; + + if (name != NULL) { + lexbor_serialize_write(cb, str_comma.data, str_comma.length, + ctx, status); + } + } + + return LXB_STATUS_OK; +} + +/* Font-weight. */ + +void * +lxb_css_property_font_weight_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_font_weight_t)); +} + +void * +lxb_css_property_font_weight_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_font_weight_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_type_sr(style, cb, ctx); +} + +/* Font-stretch. */ + +void * +lxb_css_property_font_stretch_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_font_stretch_t)); +} + +void * +lxb_css_property_font_stretch_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_font_stretch_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_percentage_type_sr(style, cb, ctx); +} + +/* Font-style. */ + +void * +lxb_css_property_font_style_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_font_style_t)); +} + +void * +lxb_css_property_font_style_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +lxb_status_t +lxb_css_property_font_style_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_font_style_t *fs = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + status = lxb_css_value_serialize(fs->type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (fs->angle.unit != (lxb_css_unit_angle_t) LXB_CSS_UNIT__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + status = lxb_css_value_angle_sr(&fs->angle, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + return LXB_STATUS_OK; +} + +/* Font-size. */ + +LXB_API void * +lxb_css_property_font_size_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_font_size_t)); +} + +LXB_API void * +lxb_css_property_font_size_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_font_size_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_type_sr(style, cb, ctx); +} + +/* Float-reference. */ + +LXB_API void * +lxb_css_property_float_reference_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_float_reference_t)); +} + +LXB_API void * +lxb_css_property_float_reference_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_float_reference_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_float_reference_t *fr = style; + + return lxb_css_value_serialize(fr->type, cb, ctx); +} + +/* Float. */ + +LXB_API void * +lxb_css_property_float_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_float_t)); +} + +LXB_API void * +lxb_css_property_float_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_float_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_float_t *flt = style; + + static const lexbor_str_t str_o = lexbor_str("("); + static const lexbor_str_t str_cm = lexbor_str(", "); + static const lexbor_str_t str_c = lexbor_str(")"); + + status = lxb_css_value_serialize(flt->type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (flt->length.type != LXB_CSS_VALUE__LENGTH) { + return LXB_STATUS_OK; + } + + lexbor_serialize_write(cb, str_o.data, str_o.length, ctx, status); + + status = lxb_css_value_length_sr(&flt->length.length, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (flt->snap_type == LXB_CSS_VALUE__UNDEF) { + return cb(str_c.data, str_c.length, ctx); + } + + lexbor_serialize_write(cb, str_cm.data, str_cm.length, ctx, status); + + status = lxb_css_value_serialize(flt->snap_type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(str_c.data, str_c.length, ctx); +} + +/* Clear. */ + +LXB_API void * +lxb_css_property_clear_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_clear_t)); +} + +LXB_API void * +lxb_css_property_clear_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_clear_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_clear_t *cls = style; + + return lxb_css_value_serialize(cls->type, cb, ctx); +} + +/* Float-defer. */ + +LXB_API void * +lxb_css_property_float_defer_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_float_defer_t)); +} + +LXB_API void * +lxb_css_property_float_defer_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_float_defer_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_float_defer_t *def = style; + + if (def->type == LXB_CSS_FLOAT_DEFER__INTEGER) { + return lxb_css_value_integer_sr(&def->integer, cb, ctx); + } + + return lxb_css_value_serialize(def->type, cb, ctx); +} + +/* Float-offset. */ + +LXB_API void * +lxb_css_property_float_offset_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_float_offset_t)); +} + +LXB_API void * +lxb_css_property_float_offset_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_float_offset_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(style, cb, ctx); +} + +/* Wrap-flow. */ + +LXB_API void * +lxb_css_property_wrap_flow_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_wrap_flow_t)); +} + +LXB_API void * +lxb_css_property_wrap_flow_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_wrap_flow_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_wrap_flow_t *wf = style; + + return lxb_css_value_serialize(wf->type, cb, ctx); +} + +/* Wrap-through. */ + +LXB_API void * +lxb_css_property_wrap_through_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_wrap_through_t)); +} + +LXB_API void * +lxb_css_property_wrap_through_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_wrap_through_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_wrap_through_t *wt = style; + + return lxb_css_value_serialize(wt->type, cb, ctx); +} + +/* Flex-direction. */ + +LXB_API void * +lxb_css_property_flex_direction_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_direction_t)); +} + +LXB_API void * +lxb_css_property_flex_direction_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_direction_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_flex_direction_t *fd = style; + + return lxb_css_value_serialize(fd->type, cb, ctx); +} + +/* Flex-wrap. */ + +LXB_API void * +lxb_css_property_flex_wrap_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_wrap_t)); +} + +LXB_API void * +lxb_css_property_flex_wrap_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_wrap_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_flex_wrap_t *fw = style; + + return lxb_css_value_serialize(fw->type, cb, ctx); +} + +/* Flex-flow. */ + +LXB_API void * +lxb_css_property_flex_flow_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_flow_t)); +} + +LXB_API void * +lxb_css_property_flex_flow_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_flow_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_flex_flow_t *ff = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + if (ff->type_direction != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(ff->type_direction, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + if (ff->wrap != LXB_CSS_VALUE__UNDEF) { + if (ff->type_direction != LXB_CSS_VALUE__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_value_serialize(ff->wrap, cb, ctx); + } + + return LXB_STATUS_OK; +} + +/* Flex. */ + +LXB_API void * +lxb_css_property_flex_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_flex_t)); +} + +LXB_API void * +lxb_css_property_flex_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_flex_t *flex = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + if (flex->type != LXB_CSS_VALUE__UNDEF) { + return lxb_css_value_serialize(flex->type, cb, ctx); + } + + if (flex->grow.type != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_number_sr(&flex->grow.number, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (flex->shrink.type != LXB_CSS_VALUE__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + status = lxb_css_value_number_sr(&flex->shrink.number, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + } + + if (flex->basis.type == LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_OK; + } + + if (flex->grow.type != LXB_CSS_VALUE__UNDEF) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_property_flex_basis_serialize(&flex->basis, cb, ctx); +} + +/* Flex-grow. */ + +LXB_API void * +lxb_css_property_flex_grow_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_grow_t)); +} + +LXB_API void * +lxb_css_property_flex_grow_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_grow_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_type_sr(style, cb, ctx); +} + +/* Flex-shrink. */ + +LXB_API void * +lxb_css_property_flex_shrink_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_shrink_t)); +} + +LXB_API void * +lxb_css_property_flex_shrink_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_shrink_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_type_sr(style, cb, ctx); +} + +/* Flex-basis. */ + +LXB_API void * +lxb_css_property_flex_basis_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_flex_basis_t)); +} + +LXB_API void * +lxb_css_property_flex_basis_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_flex_basis_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_width_serialize(style, cb, ctx); +} + +/* Justify-content. */ + +LXB_API void * +lxb_css_property_justify_content_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_justify_content_t)); +} + +LXB_API void * +lxb_css_property_justify_content_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_justify_content_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_justify_content_t *jc = style; + + return lxb_css_value_serialize(jc->type, cb, ctx); +} + +/* Align-items. */ + +LXB_API void * +lxb_css_property_align_items_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_align_items_t)); +} + +LXB_API void * +lxb_css_property_align_items_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_align_items_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_align_items_t *ai = style; + + return lxb_css_value_serialize(ai->type, cb, ctx); +} + +/* Align-self. */ + +LXB_API void * +lxb_css_property_align_self_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_align_self_t)); +} + +LXB_API void * +lxb_css_property_align_self_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_align_self_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_align_self_t *as = style; + + return lxb_css_value_serialize(as->type, cb, ctx); +} + +/* Align-content. */ + +LXB_API void * +lxb_css_property_align_content_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_align_content_t)); +} + +LXB_API void * +lxb_css_property_align_content_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_align_content_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_align_content_t *ac = style; + + return lxb_css_value_serialize(ac->type, cb, ctx); +} + +/* Dominant-baseline. */ + +LXB_API void * +lxb_css_property_dominant_baseline_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_dominant_baseline_t)); +} + +LXB_API void * +lxb_css_property_dominant_baseline_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_dominant_baseline_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_dominant_baseline_t *db = style; + + return lxb_css_value_serialize(db->type, cb, ctx); +} + +/* Vertical-align. */ + +LXB_API void * +lxb_css_property_vertical_align_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_vertical_align_t)); +} + +LXB_API void * +lxb_css_property_vertical_align_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_vertical_align_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool is; + lxb_status_t status; + const lxb_css_property_vertical_align_t *va = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + is = false; + + if (va->type != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(va->type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + is = true; + } + + if (va->alignment.type != LXB_CSS_VALUE__UNDEF) { + if (is) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(va->alignment.type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + is = true; + } + + if (va->shift.type != LXB_CSS_VALUE__UNDEF) { + if (is) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_length_percentage_sr(&va->shift, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + return LXB_STATUS_OK; +} + +/* Baseline-source. */ + +LXB_API void * +lxb_css_property_baseline_source_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_baseline_source_t)); +} + +LXB_API void * +lxb_css_property_baseline_source_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_baseline_source_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_baseline_source_t *bs = style; + + return lxb_css_value_serialize(bs->type, cb, ctx); +} + +/* Alignment-baseline. */ + +LXB_API void * +lxb_css_property_alignment_baseline_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_alignment_baseline_t)); +} + +LXB_API void * +lxb_css_property_alignment_baseline_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_alignment_baseline_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_alignment_baseline_t *ab = style; + + return lxb_css_value_serialize(ab->type, cb, ctx); +} + +/* Baseline-shift. */ + +LXB_API void * +lxb_css_property_baseline_shift_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_baseline_shift_t)); +} + +LXB_API void * +lxb_css_property_baseline_shift_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_baseline_shift_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_length_percentage_sr(style, cb, ctx); +} + +/* Line-height. */ + +LXB_API void * +lxb_css_property_line_height_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_line_height_t)); +} + +LXB_API void * +lxb_css_property_line_height_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_line_height_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_number_length_percentage_type_sr(style, cb, ctx); +} + +/* Z-index. */ + +LXB_API void * +lxb_css_property_z_index_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_property_z_index_t)); +} + +LXB_API void * +lxb_css_property_z_index_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_z_index_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_value_integer_type_sr(style, cb, ctx); +} + +/* Direction. */ + +LXB_API void * +lxb_css_property_direction_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_direction_t)); +} + +LXB_API void * +lxb_css_property_direction_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_direction_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_direction_t *dr = style; + + return lxb_css_value_serialize(dr->type, cb, ctx); +} + +/* Unicode-bidi. */ + +LXB_API void * +lxb_css_property_unicode_bidi_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_unicode_bidi_t)); +} + +LXB_API void * +lxb_css_property_unicode_bidi_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_unicode_bidi_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_unicode_bidi_t *ub = style; + + return lxb_css_value_serialize(ub->type, cb, ctx); +} + +/* Writing-mode. */ + +LXB_API void * +lxb_css_property_writing_mode_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_writing_mode_t)); +} + +LXB_API void * +lxb_css_property_writing_mode_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_writing_mode_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_writing_mode_t *wm = style; + + return lxb_css_value_serialize(wm->type, cb, ctx); +} + +/* Text-orientation. */ + +LXB_API void * +lxb_css_property_text_orientation_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_orientation_t)); +} + +LXB_API void * +lxb_css_property_text_orientation_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_orientation_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_orientation_t *to = style; + + return lxb_css_value_serialize(to->type, cb, ctx); +} + +/* Text-combine-upright. */ + +LXB_API void * +lxb_css_property_text_combine_upright_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_combine_upright_t)); +} + +LXB_API void * +lxb_css_property_text_combine_upright_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_combine_upright_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_property_text_combine_upright_t *tcu = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + if (tcu->type == LXB_CSS_TEXT_COMBINE_UPRIGHT_DIGITS) { + status = lxb_css_value_serialize(tcu->type, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (tcu->digits.num != 0) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + + return lxb_css_value_integer_sr(&tcu->digits, cb, ctx); + } + + return LXB_STATUS_OK; + } + + return lxb_css_value_serialize(tcu->type, cb, ctx); +} + +/* Overflow-x. */ + +LXB_API void * +lxb_css_property_overflow_x_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_overflow_x_t)); +} + +LXB_API void * +lxb_css_property_overflow_x_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_overflow_x_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_overflow_x_t *ox = style; + + return lxb_css_value_serialize(ox->type, cb, ctx); +} + +/* Overflow-y. */ + +LXB_API void * +lxb_css_property_overflow_y_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_overflow_y_t)); +} + +LXB_API void * +lxb_css_property_overflow_y_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_overflow_y_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_overflow_y_t *oy = style; + + return lxb_css_value_serialize(oy->type, cb, ctx); +} + +/* Overflow-block. */ + +LXB_API void * +lxb_css_property_overflow_block_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_overflow_block_t)); +} + +LXB_API void * +lxb_css_property_overflow_block_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_overflow_block_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_overflow_block_t *ob = style; + + return lxb_css_value_serialize(ob->type, cb, ctx); +} + +/* Overflow-inline. */ + +LXB_API void * +lxb_css_property_overflow_inline_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_overflow_inline_t)); +} + +LXB_API void * +lxb_css_property_overflow_inline_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_overflow_inline_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_overflow_inline_t *oi = style; + + return lxb_css_value_serialize(oi->type, cb, ctx); +} + +/* Text-overflow. */ + +LXB_API void * +lxb_css_property_text_overflow_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_overflow_t)); +} + +LXB_API void * +lxb_css_property_text_overflow_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_overflow_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_overflow_t *to = style; + + return lxb_css_value_serialize(to->type, cb, ctx); +} + +/* Text-decoration-line. */ + +LXB_API void * +lxb_css_property_text_decoration_line_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_decoration_line_t)); +} + +LXB_API void * +lxb_css_property_text_decoration_line_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_decoration_line_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool itis; + lxb_status_t status; + const lxb_css_property_text_decoration_line_t *tdl = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + itis = false; + + if (tdl->underline != LXB_CSS_VALUE__UNDEF) { + status = lxb_css_value_serialize(tdl->underline, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + itis = true; + } + + if (tdl->overline != LXB_CSS_VALUE__UNDEF) { + if (itis) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(tdl->overline, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + itis = true; + } + + if (tdl->line_through != LXB_CSS_VALUE__UNDEF) { + if (itis) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_value_serialize(tdl->line_through, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + itis = true; + } + + if (tdl->blink != LXB_CSS_VALUE__UNDEF) { + if (itis) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_value_serialize(tdl->blink, cb, ctx); + } + + if (itis) { + return LXB_STATUS_OK; + } + + return lxb_css_value_serialize(tdl->type, cb, ctx); +} + +/* Text-decoration-style. */ + +LXB_API void * +lxb_css_property_text_decoration_style_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_decoration_style_t)); +} + +LXB_API void * +lxb_css_property_text_decoration_style_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_decoration_style_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_property_text_decoration_style_t *tds = style; + + return lxb_css_value_serialize(tds->type, cb, ctx); +} + +/* Text-decoration-color. */ + +LXB_API void * +lxb_css_property_text_decoration_color_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_decoration_color_t)); +} + +LXB_API void * +lxb_css_property_text_decoration_color_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_decoration_color_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_color_serialize(style, cb, ctx); +} + +/* Text-decoration. */ + +LXB_API void * +lxb_css_property_text_decoration_create(lxb_css_memory_t *memory) +{ + return lexbor_mraw_calloc(memory->mraw, + sizeof(lxb_css_property_text_decoration_t)); +} + +LXB_API void * +lxb_css_property_text_decoration_destroy(lxb_css_memory_t *memory, + void *style, bool self_destroy) +{ + return lxb_css_property__undef_destroy(memory, style, self_destroy); +} + +LXB_API lxb_status_t +lxb_css_property_text_decoration_serialize(const void *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + bool itis; + lxb_status_t status; + const lxb_css_property_text_decoration_t *td = style; + + static const lexbor_str_t str_ws = lexbor_str(" "); + + itis = false; + + if (td->line.type != LXB_CSS_VALUE__UNDEF + || td->line.underline != LXB_CSS_VALUE__UNDEF + || td->line.overline != LXB_CSS_VALUE__UNDEF + || td->line.line_through != LXB_CSS_VALUE__UNDEF + || td->line.blink != LXB_CSS_VALUE__UNDEF) + { + status = lxb_css_property_text_decoration_line_serialize(&td->line, + cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + itis = true; + } + + if (td->style.type != LXB_CSS_VALUE__UNDEF) { + if (itis) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + status = lxb_css_property_text_decoration_style_serialize(&td->style, + cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + itis = true; + } + + if (td->color.type != LXB_CSS_VALUE__UNDEF) { + if (itis) { + lexbor_serialize_write(cb, str_ws.data, str_ws.length, ctx, status); + } + + return lxb_css_property_text_decoration_color_serialize(&td->color, + cb, ctx); + } + + return LXB_STATUS_OK; +} diff --git a/ext/dom/lexbor/lexbor/css/property/const.h b/ext/dom/lexbor/lexbor/css/property/const.h index 8ee24481c6a3..4f90bc1c107b 100644 --- a/ext/dom/lexbor/lexbor/css/property/const.h +++ b/ext/dom/lexbor/lexbor/css/property/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/property/res.h b/ext/dom/lexbor/lexbor/css/property/res.h index 35cce1959013..eb5b90304a09 100644 --- a/ext/dom/lexbor/lexbor/css/property/res.h +++ b/ext/dom/lexbor/lexbor/css/property/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/property/state.c b/ext/dom/lexbor/lexbor/css/property/state.c new file mode 100644 index 000000000000..198ef145615d --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/property/state.c @@ -0,0 +1,5343 @@ +/* + * Copyright (C) 2021-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/property.h" +#include "lexbor/css/parser.h" +#include "lexbor/css/rule.h" +#include "lexbor/css/value.h" +#include "lexbor/css/unit.h" +#include "lexbor/css/property/state.h" +#include "lexbor/css/property/res.h" + + +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; +#endif + +#include "lexbor/core/conv.h" + + +#define lxb_css_property_state_check_token(parser, token) \ + if ((token) == NULL) { \ + return lxb_css_parser_memory_fail(parser); \ + } + +#define lxb_css_property_state_get_type(parser, token, type) \ + do { \ + lxb_css_syntax_parser_consume(parser); \ + \ + token = lxb_css_syntax_parser_token_wo_ws(parser); \ + lxb_css_property_state_check_token(parser, token); \ + \ + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { \ + return lxb_css_parser_success(parser); \ + } \ + \ + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, \ + lxb_css_syntax_token_ident(token)->length); \ + } \ + while (false) + +#define LXB_CSS_PROPERTY_STATE_HEX_MASK(n) \ + ((((uint32_t) 1 << (32 - (n))) - 1) << (n)) + + +static bool +lxb_css_property_state_color_rgba_old(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_t *color); +static bool +lxb_css_property_state_color_hsla_old(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_hsla_t *hsl); + +static bool +lxb_css_property_state_length(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_length_t *length) +{ + const lxb_css_data_t *unit; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + unit = lxb_css_unit_absolute_relative_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + length->num = lxb_css_syntax_token_dimension(token)->num.num; + length->is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + length->unit = (lxb_css_unit_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + if (lxb_css_syntax_token_number(token)->num != 0) { + return false; + } + + length->num = lxb_css_syntax_token_number(token)->num; + length->is_float = lxb_css_syntax_token_number(token)->is_float; + length->unit = LXB_CSS_UNIT__UNDEF; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_length_percentage(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_length_percentage_t *lp) +{ + const lxb_css_data_t *unit; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + unit = lxb_css_unit_absolute_relative_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + lp->type = LXB_CSS_VALUE__LENGTH; + lp->u.length.num = lxb_css_syntax_token_dimension(token)->num.num; + lp->u.length.is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + lp->u.length.unit = (lxb_css_unit_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + if (lxb_css_syntax_token_number(token)->num != 0) { + return false; + } + + lp->type = LXB_CSS_VALUE__NUMBER; + lp->u.length.num = lxb_css_syntax_token_number(token)->num; + lp->u.length.is_float = lxb_css_syntax_token_number(token)->is_float; + lp->u.length.unit = LXB_CSS_UNIT__UNDEF; + break; + + case LXB_CSS_SYNTAX_TOKEN_PERCENTAGE: + lp->type = LXB_CSS_VALUE__PERCENTAGE; + lp->u.percentage.num = lxb_css_syntax_token_percentage(token)->num; + lp->u.percentage.is_float = lxb_css_syntax_token_percentage(token)->is_float; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_number_length_percentage(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_number_length_percentage_t *nlp) +{ + const lxb_css_data_t *unit; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + unit = lxb_css_unit_absolute_relative_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + nlp->type = LXB_CSS_VALUE__LENGTH; + nlp->u.length.num = lxb_css_syntax_token_dimension(token)->num.num; + nlp->u.length.is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + nlp->u.length.unit = (lxb_css_unit_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + nlp->type = LXB_CSS_VALUE__NUMBER; + nlp->u.number.num = lxb_css_syntax_token_number(token)->num; + nlp->u.number.is_float = lxb_css_syntax_token_number(token)->is_float; + break; + + case LXB_CSS_SYNTAX_TOKEN_PERCENTAGE: + nlp->type = LXB_CSS_VALUE__PERCENTAGE; + nlp->u.percentage.num = lxb_css_syntax_token_percentage(token)->num; + nlp->u.percentage.is_float = lxb_css_syntax_token_percentage(token)->is_float; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_number_length(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_number_length_t *nl) +{ + const lxb_css_data_t *unit; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + unit = lxb_css_unit_absolute_relative_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + nl->type = LXB_CSS_VALUE__LENGTH; + nl->u.length.num = lxb_css_syntax_token_dimension(token)->num.num; + nl->u.length.is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + nl->u.length.unit = (lxb_css_unit_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + nl->type = LXB_CSS_VALUE__NUMBER; + nl->u.number.num = lxb_css_syntax_token_number(token)->num; + nl->u.number.is_float = lxb_css_syntax_token_number(token)->is_float; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_number(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_number_t *number) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_NUMBER) { + return false; + } + + number->num = lxb_css_syntax_token_number(token)->num; + number->is_float = lxb_css_syntax_token_number(token)->is_float; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_integer(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_integer_t *intg) +{ + long ln; + double num; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_NUMBER) { + return false; + } + + num = lxb_css_syntax_token_number(token)->num; + ln = lexbor_conv_double_to_long(num); + + num = num - (double) ln; + + if (num < 0.0 || num > 0.0) { + return false; + } + + intg->num = ln; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_percentage(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_percentage_t *perc) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_PERCENTAGE) { + return false; + } + + perc->num = lxb_css_syntax_token_percentage(token)->num; + perc->is_float = lxb_css_syntax_token_percentage(token)->is_float; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_number_percentage_none(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_number_percentage_t *np) +{ + double num; + lxb_css_value_type_t type; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_NUMBER) { + np->type = LXB_CSS_VALUE__NUMBER; + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_PERCENTAGE) { + np->type = LXB_CSS_VALUE__PERCENTAGE; + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + if (type != LXB_CSS_VALUE_NONE) { + return false; + } + + np->type = LXB_CSS_VALUE_NONE; + + lxb_css_syntax_parser_consume(parser); + + return true; + } + else { + return false; + } + + num = lxb_css_syntax_token_number(token)->num; + + np->u.number.num = num; + np->u.number.is_float = lxb_css_syntax_token_number(token)->is_float; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_percentage_none(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_percentage_type_t *np) +{ + double num; + lxb_css_value_type_t type; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_PERCENTAGE) { + np->type = LXB_CSS_VALUE__PERCENTAGE; + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + if (type != LXB_CSS_VALUE_NONE) { + return false; + } + + np->type = LXB_CSS_VALUE_NONE; + + lxb_css_syntax_parser_consume(parser); + + return true; + } + else { + return false; + } + + num = lxb_css_syntax_token_number(token)->num; + + np->percentage.num = num; + np->percentage.is_float = lxb_css_syntax_token_number(token)->is_float; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_number_percentage(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_number_percentage_t *np) +{ + double num; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_NUMBER) { + np->type = LXB_CSS_VALUE__NUMBER; + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_PERCENTAGE) { + np->type = LXB_CSS_VALUE__PERCENTAGE; + } + else { + return false; + } + + num = lxb_css_syntax_token_number(token)->num; + + np->u.number.num = num; + np->u.number.is_float = lxb_css_syntax_token_number(token)->is_float; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_angle(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_angle_t *angle) +{ + const lxb_css_data_t *unit; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_DIMENSION) { + return false; + } + + unit = lxb_css_unit_angle_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + angle->num = lxb_css_syntax_token_dimension(token)->num.num; + angle->is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + angle->unit = (lxb_css_unit_angle_t) unit->unique; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +bool +lxb_css_property_state_width_handler(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_width_t *width) +{ + lxb_css_value_type_t type; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_AUTO: + case LXB_CSS_VALUE_MIN_CONTENT: + case LXB_CSS_VALUE_MAX_CONTENT: + width->type = type; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; + } + + return lxb_css_property_state_length_percentage(parser, token, + (lxb_css_value_length_percentage_t *)width); +} + +static bool +lxb_css_property_state_hue(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_hue_t *hue) +{ + const lxb_css_data_t *unit; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + unit = lxb_css_unit_angle_by_name(lxb_css_syntax_token_dimension(token)->str.data, + lxb_css_syntax_token_dimension(token)->str.length); + if (unit == NULL) { + return false; + } + + hue->type = LXB_CSS_VALUE__ANGLE; + hue->u.angle.num = lxb_css_syntax_token_dimension(token)->num.num; + hue->u.angle.is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + hue->u.angle.unit = (lxb_css_unit_angle_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + hue->type = LXB_CSS_VALUE__NUMBER; + hue->u.number.num = lxb_css_syntax_token_number(token)->num; + hue->u.number.is_float = lxb_css_syntax_token_number(token)->is_float; + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +lxb_inline bool +lxb_css_property_state_hue_none(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_hue_t *hue) +{ + lxb_css_value_type_t type; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_property_state_hue(parser, token, hue); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + if (type != LXB_CSS_VALUE_NONE) { + return false; + } + + hue->type = LXB_CSS_VALUE_NONE; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_hex(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_t *color) +{ + size_t length; + uint32_t chex; + lxb_char_t ch; + const lxb_char_t *end, *p; + lxb_css_value_color_hex_rgba_t *rgba; + + length = token->types.hash.length; + + if (length > 8) { + return false; + } + + p = token->types.hash.data; + end = p + length; + + chex = 0; + + while (p < end) { + ch = lexbor_str_res_map_lowercase[lexbor_str_res_map_hex[*p]]; + + if (ch == 0xff) { + return false; + } + + chex = chex << 4 | ch; + + p++; + } + + rgba = &color->u.hex.rgba; + + switch (length) { + case 3: + rgba->r = chex >> 8; + rgba->g = chex >> 4 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(4); + rgba->b = chex & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(4); + rgba->a = 0xff; + + color->u.hex.type = LXB_CSS_PROPERTY_COLOR_HEX_TYPE_3; + break; + + case 4: + rgba->r = chex >> 12; + rgba->g = chex >> 8 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(4); + rgba->b = chex >> 4 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(4); + rgba->a = chex & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(4); + + color->u.hex.type = LXB_CSS_PROPERTY_COLOR_HEX_TYPE_4; + break; + + case 6: + rgba->r = chex >> 16; + rgba->g = chex >> 8 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(8); + rgba->b = chex & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(8); + rgba->a = 0xff; + + color->u.hex.type = LXB_CSS_PROPERTY_COLOR_HEX_TYPE_6; + break; + + case 8: + rgba->r = chex >> 24; + rgba->g = chex >> 16 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(8); + rgba->b = chex >> 8 & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(8); + rgba->a = chex & ~LXB_CSS_PROPERTY_STATE_HEX_MASK(8); + + color->u.hex.type = LXB_CSS_PROPERTY_COLOR_HEX_TYPE_8; + break; + + default: + return false; + } + + color->type = LXB_CSS_COLOR_HEX; + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_rgba(lxb_css_parser_t *parser, + lxb_css_value_color_t *color) +{ + bool res; + lxb_css_color_type_t type; + lxb_css_value_color_rgba_t *rgb; + const lxb_css_syntax_token_t *token; + + rgb = &color->u.rgb; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &rgb->r); + if (res == false) { + return false; + } + + type = rgb->r.type; + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_COMMA) { + /* Deprecated format. */ + + if (type == LXB_CSS_VALUE_NONE) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + rgb->old = true; + + return lxb_css_property_state_color_rgba_old(parser, token, color); + } + + res = lxb_css_property_state_number_percentage_none(parser, token, &rgb->g); + if (res == false) { + return false; + } + + if (type != rgb->g.type) { + if (type == LXB_CSS_VALUE_NONE) { + type = rgb->g.type; + } + else if (rgb->g.type != LXB_CSS_VALUE_NONE) { + return false; + } + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &rgb->b); + if (res == false) { + return false; + } + + if (type != rgb->b.type && type != LXB_CSS_VALUE_NONE + && rgb->b.type != LXB_CSS_VALUE_NONE) + { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_DELIM) { + if (lxb_css_syntax_token_delim(token)->character != '/') { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + return true; + } + else { + return false; + } + + res = lxb_css_property_state_number_percentage_none(parser, token, &rgb->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_rgba_old(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_t *color) +{ + bool res; + lxb_css_value_color_rgba_t *rgb; + + rgb = &color->u.rgb; + + res = lxb_css_property_state_number_percentage(parser, token, &rgb->g); + if (res == false) { + return false; + } + + if (rgb->r.type != rgb->g.type) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage(parser, token, &rgb->b); + if (res == false) { + return false; + } + + if (rgb->r.type != rgb->b.type) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + return true; + } + else if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage(parser, token, &rgb->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_hsla(lxb_css_parser_t *parser, + lxb_css_value_color_t *color) +{ + bool res; + lxb_css_value_color_hsla_t *hsl; + const lxb_css_syntax_token_t *token; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + hsl = &color->u.hsl; + + res = lxb_css_property_state_hue_none(parser, token, &hsl->h); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_COMMA) { + /* Deprecated format. */ + + if (hsl->h.type == LXB_CSS_VALUE_NONE) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + hsl->old = true; + + return lxb_css_property_state_color_hsla_old(parser, token, hsl); + } + + res = lxb_css_property_state_percentage_none(parser, token, &hsl->s); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_percentage_none(parser, token, &hsl->l); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_DELIM) { + if (lxb_css_syntax_token_delim(token)->character != '/') { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + return true; + } + + res = lxb_css_property_state_number_percentage_none(parser, token, &hsl->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_hsla_old(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_hsla_t *hsl) +{ + bool res; + + res = lxb_css_property_state_percentage(parser, token, &hsl->s.percentage); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_percentage(parser, token, &hsl->l.percentage); + if (res == false) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + goto done; + } + else if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage(parser, token, &hsl->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + +done: + + lxb_css_syntax_parser_consume(parser); + + hsl->s.type = LXB_CSS_VALUE__PERCENTAGE; + hsl->l.type = LXB_CSS_VALUE__PERCENTAGE; + + return true; +} + +static bool +lxb_css_property_state_color_lab(lxb_css_parser_t *parser, + lxb_css_value_color_t *color) +{ + bool res; + lxb_css_value_color_lab_t *lab; + const lxb_css_syntax_token_t *token; + + lab = &color->u.lab; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &lab->l); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &lab->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &lab->b); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_DELIM) { + if (lxb_css_syntax_token_delim(token)->character != '/') { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + return true; + } + else { + return false; + } + + res = lxb_css_property_state_number_percentage_none(parser, token, + &lab->alpha); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +static bool +lxb_css_property_state_color_lch(lxb_css_parser_t *parser, + lxb_css_value_color_t *color) +{ + bool res; + lxb_css_value_color_lch_t *lch; + const lxb_css_syntax_token_t *token; + + lch = &color->u.lch; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &lch->l); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number_percentage_none(parser, token, &lch->c); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_hue_none(parser, token, &lch->h); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_DELIM) { + if (lxb_css_syntax_token_delim(token)->character != '/') { + return false; + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + return true; + } + else { + return false; + } + + res = lxb_css_property_state_number_percentage_none(parser, token, &lch->a); + if (res == false) { + return false; + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +/* + * Return: + * true and status always LXB_STATUS_OK — token consumed, ok. + * false and status != LXB_STATUS_OK — token consumed, not ok. + * false and status == LXB_STATUS_OK — token not consumed, not ok. + */ +static bool +lxb_css_property_state_color_handler(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_value_color_t *color, + lxb_status_t *status) +{ + bool res; + lxb_css_value_type_t type; + + *status = LXB_STATUS_OK; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_HASH: + color->type = LXB_CSS_VALUE_HEX; + + return lxb_css_property_state_color_hex(parser, token, color); + + case LXB_CSS_SYNTAX_TOKEN_FUNCTION: + type = lxb_css_value_by_name(lxb_css_syntax_token_function(token)->data, + lxb_css_syntax_token_function(token)->length); + color->type = type; + + switch (type) { + /* */ + case LXB_CSS_VALUE_RGB: + case LXB_CSS_VALUE_RGBA: + res = lxb_css_property_state_color_rgba(parser, color); + break; + + case LXB_CSS_VALUE_HSL: + case LXB_CSS_VALUE_HSLA: + case LXB_CSS_VALUE_HWB: + res = lxb_css_property_state_color_hsla(parser, color); + break; + + case LXB_CSS_VALUE_LAB: + case LXB_CSS_VALUE_OKLAB: + res = lxb_css_property_state_color_lab(parser, color); + break; + + case LXB_CSS_VALUE_LCH: + case LXB_CSS_VALUE_OKLCH: + res = lxb_css_property_state_color_lch(parser, color); + break; + + case LXB_CSS_VALUE_COLOR: + default: + *status = LXB_STATUS_OK; + return false; + } + + if (!res) { + *status = LXB_STATUS_ERROR_UNEXPECTED_DATA; + } + + return res; + + case LXB_CSS_SYNTAX_TOKEN_IDENT: + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* */ + case LXB_CSS_VALUE_CURRENTCOLOR: + /* */ + case LXB_CSS_VALUE_CANVAS: + case LXB_CSS_VALUE_CANVASTEXT: + case LXB_CSS_VALUE_LINKTEXT: + case LXB_CSS_VALUE_VISITEDTEXT: + case LXB_CSS_VALUE_ACTIVETEXT: + case LXB_CSS_VALUE_BUTTONFACE: + case LXB_CSS_VALUE_BUTTONTEXT: + case LXB_CSS_VALUE_BUTTONBORDER: + case LXB_CSS_VALUE_FIELD: + case LXB_CSS_VALUE_FIELDTEXT: + case LXB_CSS_VALUE_HIGHLIGHT: + case LXB_CSS_VALUE_HIGHLIGHTTEXT: + case LXB_CSS_VALUE_SELECTEDITEM: + case LXB_CSS_VALUE_SELECTEDITEMTEXT: + case LXB_CSS_VALUE_MARK: + case LXB_CSS_VALUE_MARKTEXT: + case LXB_CSS_VALUE_GRAYTEXT: + case LXB_CSS_VALUE_ACCENTCOLOR: + case LXB_CSS_VALUE_ACCENTCOLORTEXT: + /* */ + case LXB_CSS_VALUE_TRANSPARENT: + /* */ + case LXB_CSS_VALUE_ALICEBLUE: + case LXB_CSS_VALUE_ANTIQUEWHITE: + case LXB_CSS_VALUE_AQUA: + case LXB_CSS_VALUE_AQUAMARINE: + case LXB_CSS_VALUE_AZURE: + case LXB_CSS_VALUE_BEIGE: + case LXB_CSS_VALUE_BISQUE: + case LXB_CSS_VALUE_BLACK: + case LXB_CSS_VALUE_BLANCHEDALMOND: + case LXB_CSS_VALUE_BLUE: + case LXB_CSS_VALUE_BLUEVIOLET: + case LXB_CSS_VALUE_BROWN: + case LXB_CSS_VALUE_BURLYWOOD: + case LXB_CSS_VALUE_CADETBLUE: + case LXB_CSS_VALUE_CHARTREUSE: + case LXB_CSS_VALUE_CHOCOLATE: + case LXB_CSS_VALUE_CORAL: + case LXB_CSS_VALUE_CORNFLOWERBLUE: + case LXB_CSS_VALUE_CORNSILK: + case LXB_CSS_VALUE_CRIMSON: + case LXB_CSS_VALUE_CYAN: + case LXB_CSS_VALUE_DARKBLUE: + case LXB_CSS_VALUE_DARKCYAN: + case LXB_CSS_VALUE_DARKGOLDENROD: + case LXB_CSS_VALUE_DARKGRAY: + case LXB_CSS_VALUE_DARKGREEN: + case LXB_CSS_VALUE_DARKGREY: + case LXB_CSS_VALUE_DARKKHAKI: + case LXB_CSS_VALUE_DARKMAGENTA: + case LXB_CSS_VALUE_DARKOLIVEGREEN: + case LXB_CSS_VALUE_DARKORANGE: + case LXB_CSS_VALUE_DARKORCHID: + case LXB_CSS_VALUE_DARKRED: + case LXB_CSS_VALUE_DARKSALMON: + case LXB_CSS_VALUE_DARKSEAGREEN: + case LXB_CSS_VALUE_DARKSLATEBLUE: + case LXB_CSS_VALUE_DARKSLATEGRAY: + case LXB_CSS_VALUE_DARKSLATEGREY: + case LXB_CSS_VALUE_DARKTURQUOISE: + case LXB_CSS_VALUE_DARKVIOLET: + case LXB_CSS_VALUE_DEEPPINK: + case LXB_CSS_VALUE_DEEPSKYBLUE: + case LXB_CSS_VALUE_DIMGRAY: + case LXB_CSS_VALUE_DIMGREY: + case LXB_CSS_VALUE_DODGERBLUE: + case LXB_CSS_VALUE_FIREBRICK: + case LXB_CSS_VALUE_FLORALWHITE: + case LXB_CSS_VALUE_FORESTGREEN: + case LXB_CSS_VALUE_FUCHSIA: + case LXB_CSS_VALUE_GAINSBORO: + case LXB_CSS_VALUE_GHOSTWHITE: + case LXB_CSS_VALUE_GOLD: + case LXB_CSS_VALUE_GOLDENROD: + case LXB_CSS_VALUE_GRAY: + case LXB_CSS_VALUE_GREEN: + case LXB_CSS_VALUE_GREENYELLOW: + case LXB_CSS_VALUE_GREY: + case LXB_CSS_VALUE_HONEYDEW: + case LXB_CSS_VALUE_HOTPINK: + case LXB_CSS_VALUE_INDIANRED: + case LXB_CSS_VALUE_INDIGO: + case LXB_CSS_VALUE_IVORY: + case LXB_CSS_VALUE_KHAKI: + case LXB_CSS_VALUE_LAVENDER: + case LXB_CSS_VALUE_LAVENDERBLUSH: + case LXB_CSS_VALUE_LAWNGREEN: + case LXB_CSS_VALUE_LEMONCHIFFON: + case LXB_CSS_VALUE_LIGHTBLUE: + case LXB_CSS_VALUE_LIGHTCORAL: + case LXB_CSS_VALUE_LIGHTCYAN: + case LXB_CSS_VALUE_LIGHTGOLDENRODYELLOW: + case LXB_CSS_VALUE_LIGHTGRAY: + case LXB_CSS_VALUE_LIGHTGREEN: + case LXB_CSS_VALUE_LIGHTGREY: + case LXB_CSS_VALUE_LIGHTPINK: + case LXB_CSS_VALUE_LIGHTSALMON: + case LXB_CSS_VALUE_LIGHTSEAGREEN: + case LXB_CSS_VALUE_LIGHTSKYBLUE: + case LXB_CSS_VALUE_LIGHTSLATEGRAY: + case LXB_CSS_VALUE_LIGHTSLATEGREY: + case LXB_CSS_VALUE_LIGHTSTEELBLUE: + case LXB_CSS_VALUE_LIGHTYELLOW: + case LXB_CSS_VALUE_LIME: + case LXB_CSS_VALUE_LIMEGREEN: + case LXB_CSS_VALUE_LINEN: + case LXB_CSS_VALUE_MAGENTA: + case LXB_CSS_VALUE_MAROON: + case LXB_CSS_VALUE_MEDIUMAQUAMARINE: + case LXB_CSS_VALUE_MEDIUMBLUE: + case LXB_CSS_VALUE_MEDIUMORCHID: + case LXB_CSS_VALUE_MEDIUMPURPLE: + case LXB_CSS_VALUE_MEDIUMSEAGREEN: + case LXB_CSS_VALUE_MEDIUMSLATEBLUE: + case LXB_CSS_VALUE_MEDIUMSPRINGGREEN: + case LXB_CSS_VALUE_MEDIUMTURQUOISE: + case LXB_CSS_VALUE_MEDIUMVIOLETRED: + case LXB_CSS_VALUE_MIDNIGHTBLUE: + case LXB_CSS_VALUE_MINTCREAM: + case LXB_CSS_VALUE_MISTYROSE: + case LXB_CSS_VALUE_MOCCASIN: + case LXB_CSS_VALUE_NAVAJOWHITE: + case LXB_CSS_VALUE_NAVY: + case LXB_CSS_VALUE_OLDLACE: + case LXB_CSS_VALUE_OLIVE: + case LXB_CSS_VALUE_OLIVEDRAB: + case LXB_CSS_VALUE_ORANGE: + case LXB_CSS_VALUE_ORANGERED: + case LXB_CSS_VALUE_ORCHID: + case LXB_CSS_VALUE_PALEGOLDENROD: + case LXB_CSS_VALUE_PALEGREEN: + case LXB_CSS_VALUE_PALETURQUOISE: + case LXB_CSS_VALUE_PALEVIOLETRED: + case LXB_CSS_VALUE_PAPAYAWHIP: + case LXB_CSS_VALUE_PEACHPUFF: + case LXB_CSS_VALUE_PERU: + case LXB_CSS_VALUE_PINK: + case LXB_CSS_VALUE_PLUM: + case LXB_CSS_VALUE_POWDERBLUE: + case LXB_CSS_VALUE_PURPLE: + case LXB_CSS_VALUE_REBECCAPURPLE: + case LXB_CSS_VALUE_RED: + case LXB_CSS_VALUE_ROSYBROWN: + case LXB_CSS_VALUE_ROYALBLUE: + case LXB_CSS_VALUE_SADDLEBROWN: + case LXB_CSS_VALUE_SALMON: + case LXB_CSS_VALUE_SANDYBROWN: + case LXB_CSS_VALUE_SEAGREEN: + case LXB_CSS_VALUE_SEASHELL: + case LXB_CSS_VALUE_SIENNA: + case LXB_CSS_VALUE_SILVER: + case LXB_CSS_VALUE_SKYBLUE: + case LXB_CSS_VALUE_SLATEBLUE: + case LXB_CSS_VALUE_SLATEGRAY: + case LXB_CSS_VALUE_SLATEGREY: + case LXB_CSS_VALUE_SNOW: + case LXB_CSS_VALUE_SPRINGGREEN: + case LXB_CSS_VALUE_STEELBLUE: + case LXB_CSS_VALUE_TAN: + case LXB_CSS_VALUE_TEAL: + case LXB_CSS_VALUE_THISTLE: + case LXB_CSS_VALUE_TOMATO: + case LXB_CSS_VALUE_TURQUOISE: + case LXB_CSS_VALUE_VIOLET: + case LXB_CSS_VALUE_WHEAT: + case LXB_CSS_VALUE_WHITE: + case LXB_CSS_VALUE_WHITESMOKE: + case LXB_CSS_VALUE_YELLOW: + case LXB_CSS_VALUE_YELLOWGREEN: + color->type = type; + break; + + default: + return false; + } + + break; + + default: + return false; + } + + lxb_css_syntax_parser_consume(parser); + + return true; +} + +bool +lxb_css_property_state__undef(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_parser_failed(parser); +} + +bool +lxb_css_property_state__custom(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_status_t status; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property__custom_t *custom = declar->u.custom; + + (void) lexbor_str_init(&custom->value, parser->memory->mraw, 0); + if (custom->value.data == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + status = lxb_css_syntax_token_serialize_str(token, &custom->value, + parser->memory->mraw); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail(parser); + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_display(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_property_display_t *display; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + display = declar->u.display; + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_BLOCK: + case LXB_CSS_DISPLAY_INLINE: + case LXB_CSS_DISPLAY_RUN_IN: + display->a = type; + goto inside_listitem; + + /* */ + case LXB_CSS_DISPLAY_FLOW: + case LXB_CSS_DISPLAY_FLOW_ROOT: + display->a = type; + goto outside_listitem; + + case LXB_CSS_DISPLAY_TABLE: + case LXB_CSS_DISPLAY_FLEX: + case LXB_CSS_DISPLAY_GRID: + case LXB_CSS_DISPLAY_RUBY: + display->a = type; + goto outside; + + /* */ + case LXB_CSS_DISPLAY_LIST_ITEM: + display->a = type; + goto listitem_only; + + /* */ + case LXB_CSS_DISPLAY_TABLE_ROW_GROUP: + case LXB_CSS_DISPLAY_TABLE_HEADER_GROUP: + case LXB_CSS_DISPLAY_TABLE_FOOTER_GROUP: + case LXB_CSS_DISPLAY_TABLE_ROW: + case LXB_CSS_DISPLAY_TABLE_CELL: + case LXB_CSS_DISPLAY_TABLE_COLUMN_GROUP: + case LXB_CSS_DISPLAY_TABLE_COLUMN: + case LXB_CSS_DISPLAY_TABLE_CAPTION: + case LXB_CSS_DISPLAY_RUBY_BASE: + case LXB_CSS_DISPLAY_RUBY_TEXT: + case LXB_CSS_DISPLAY_RUBY_BASE_CONTAINER: + case LXB_CSS_DISPLAY_RUBY_TEXT_CONTAINER: + /* */ + case LXB_CSS_DISPLAY_CONTENTS: + case LXB_CSS_DISPLAY_NONE: + /* */ + case LXB_CSS_DISPLAY_INLINE_BLOCK: + case LXB_CSS_DISPLAY_INLINE_TABLE: + case LXB_CSS_DISPLAY_INLINE_FLEX: + case LXB_CSS_DISPLAY_INLINE_GRID: + display->a = type; + goto done; + + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + display->a = type; + goto done; + + default: + return lxb_css_parser_failed(parser); + } + +inside_listitem: + + lxb_css_property_state_get_type(parser, token, type); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_FLOW: + case LXB_CSS_DISPLAY_FLOW_ROOT: + display->b = type; + break; + + case LXB_CSS_DISPLAY_TABLE: + case LXB_CSS_DISPLAY_FLEX: + case LXB_CSS_DISPLAY_GRID: + case LXB_CSS_DISPLAY_RUBY: + display->b = type; + goto done; + + case LXB_CSS_DISPLAY_LIST_ITEM: + display->b = type; + goto flow_only; + + default: + return lxb_css_parser_failed(parser); + } + +listitem: + + lxb_css_property_state_get_type(parser, token, type); + + if (type == LXB_CSS_DISPLAY_LIST_ITEM) { + display->c = type; + goto done; + } + + return lxb_css_parser_failed(parser); + +outside: + + lxb_css_property_state_get_type(parser, token, type); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_BLOCK: + case LXB_CSS_DISPLAY_INLINE: + case LXB_CSS_DISPLAY_RUN_IN: + if (display->b == LXB_CSS_PROPERTY__UNDEF) { + display->b = type; + } + else { + display->c = type; + } + + goto done; + + default: + return lxb_css_parser_failed(parser); + } + +outside_listitem: + + lxb_css_property_state_get_type(parser, token, type); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_BLOCK: + case LXB_CSS_DISPLAY_INLINE: + case LXB_CSS_DISPLAY_RUN_IN: + display->b = type; + goto listitem; + + case LXB_CSS_DISPLAY_LIST_ITEM: + display->b = type; + goto outside; + + default: + return lxb_css_parser_failed(parser); + } + +listitem_only: + + lxb_css_property_state_get_type(parser, token, type); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_BLOCK: + case LXB_CSS_DISPLAY_INLINE: + case LXB_CSS_DISPLAY_RUN_IN: + display->b = type; + break; + + /* */ + case LXB_CSS_DISPLAY_FLOW: + case LXB_CSS_DISPLAY_FLOW_ROOT: + display->b = type; + goto outside; + + default: + return lxb_css_parser_failed(parser); + } + +flow_only: + + lxb_css_property_state_get_type(parser, token, type); + + switch (type) { + /* */ + case LXB_CSS_DISPLAY_FLOW: + case LXB_CSS_DISPLAY_FLOW_ROOT: + display->c = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + +done: + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_order(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_integer(parser, token, + &declar->u.order->integer); + if (res) { + declar->u.order->type = LXB_CSS_ORDER__INTEGER; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + declar->u.order->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_visibility(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_VISIBILITY_VISIBLE: + case LXB_CSS_VISIBILITY_HIDDEN: + case LXB_CSS_VISIBILITY_COLLAPSE: + declar->u.visibility->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_width(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + case LXB_CSS_VALUE_AUTO: + case LXB_CSS_VALUE_MIN_CONTENT: + case LXB_CSS_VALUE_MAX_CONTENT: + declar->u.width->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + } + + if (!lxb_css_property_state_length_percentage(parser, token, + declar->u.user)) + { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_height(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_width(parser, token, ctx); +} + +bool +lxb_css_property_state_box_sizing(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + case LXB_CSS_VALUE_CONTENT_BOX: + case LXB_CSS_VALUE_BORDER_BOX: + declar->u.box_sizing->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_min_width(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_width(parser, token, ctx); +} + +bool +lxb_css_property_state_min_height(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_width(parser, token, ctx); +} + +bool +lxb_css_property_state_max_width(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + case LXB_CSS_VALUE_NONE: + case LXB_CSS_VALUE_MIN_CONTENT: + case LXB_CSS_VALUE_MAX_CONTENT: + declar->u.width->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + } + + if (!lxb_css_property_state_length_percentage(parser, token, + declar->u.user)) + { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_max_height(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_max_width(parser, token, ctx); +} + +static bool +lxb_css_property_state_mp(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_rule_declaration_t *declar, bool with_auto) +{ + unsigned int state; + lxb_css_value_type_t type; + lxb_css_property_margin_top_t *top; + + state = 1; + +next: + + switch (state) { + case 1: + top = &declar->u.margin->top; + break; + + case 2: + top = &declar->u.margin->right; + break; + + case 3: + top = &declar->u.margin->bottom; + break; + + case 4: + top = &declar->u.margin->left; + break; + + default: + return lxb_css_parser_failed(parser); + } + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + top->type = type; + break; + + case LXB_CSS_VALUE_AUTO: + if (with_auto) { + top->type = type; + break; + } + + /* Fall through. */ + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + } + else if (!lxb_css_property_state_length_percentage(parser, token, + (lxb_css_value_length_percentage_t *) top)) + { + return lxb_css_parser_failed(parser); + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN__END) { + return lxb_css_parser_success(parser); + } + + state++; + + goto next; +} + +static bool +lxb_css_property_state_mp_top(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_rule_declaration_t *declar, bool with_auto) +{ + lxb_css_value_type_t type; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + declar->u.margin_top->type = type; + break; + + case LXB_CSS_VALUE_AUTO: + if (with_auto) { + declar->u.margin_top->type = type; + break; + } + + /* Fall through. */ + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + } + + if (!lxb_css_property_state_length_percentage(parser, token, + declar->u.user)) + { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_margin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp(parser, token, ctx, true); +} + +bool +lxb_css_property_state_margin_top(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, true); +} + +bool +lxb_css_property_state_margin_right(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, true); +} + +bool +lxb_css_property_state_margin_bottom(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, true); +} + +bool +lxb_css_property_state_margin_left(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, true); +} + +bool +lxb_css_property_state_padding(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp(parser, token, ctx, false); +} + +bool +lxb_css_property_state_padding_top(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, false); +} + +bool +lxb_css_property_state_padding_right(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, false); +} + +bool +lxb_css_property_state_padding_bottom(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, false); +} + +bool +lxb_css_property_state_padding_left(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, false); +} + +static bool +lxb_css_property_state_line_width_style_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_border_t *border) +{ + lxb_status_t status; + lxb_css_value_type_t type; + const lxb_css_data_t *unit; + lxb_css_value_length_t *length; + lxb_css_syntax_token_string_t *str; + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_DIMENSION: + if (border->width.type != LXB_CSS_VALUE__UNDEF) { + return false; + } + + str = &lxb_css_syntax_token_dimension(token)->str; + + unit = lxb_css_unit_absolute_relative_by_name(str->data, + str->length); + if (unit == NULL) { + return false; + } + + length = &border->width.length; + + border->width.type = LXB_CSS_VALUE__LENGTH; + length->num = lxb_css_syntax_token_dimension(token)->num.num; + length->is_float = lxb_css_syntax_token_dimension(token)->num.is_float; + length->unit = (lxb_css_unit_t) unit->unique; + break; + + case LXB_CSS_SYNTAX_TOKEN_NUMBER: + if (border->width.type != LXB_CSS_VALUE__UNDEF) { + return false; + } + + length = &border->width.length; + + border->width.type = LXB_CSS_VALUE__NUMBER; + length->num = lxb_css_syntax_token_number(token)->num; + length->is_float = lxb_css_syntax_token_number(token)->is_float; + break; + + case LXB_CSS_SYNTAX_TOKEN_IDENT: + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_THIN: + case LXB_CSS_VALUE_MEDIUM: + case LXB_CSS_VALUE_THICK: + if (border->width.type != LXB_CSS_VALUE__UNDEF) { + return false; + } + + border->width.type = type; + break; + + case LXB_CSS_VALUE_NONE: + case LXB_CSS_VALUE_HIDDEN: + case LXB_CSS_VALUE_DOTTED: + case LXB_CSS_VALUE_DASHED: + case LXB_CSS_VALUE_SOLID: + case LXB_CSS_VALUE_DOUBLE: + case LXB_CSS_VALUE_GROOVE: + case LXB_CSS_VALUE_RIDGE: + case LXB_CSS_VALUE_INSET: + case LXB_CSS_VALUE_OUTSET: + if (border->style != LXB_CSS_VALUE__UNDEF) { + return false; + } + + border->style = type; + break; + + default: + goto color; + } + + break; + + default: + goto color; + } + + lxb_css_syntax_parser_consume(parser); + + return true; + +color: + + if (border->color.type != LXB_CSS_VALUE__UNDEF) { + return false; + } + + return lxb_css_property_state_color_handler(parser, token, &border->color, + &status); +} + +bool +lxb_css_property_state_border(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + declar->u.border->style = type; + + lxb_css_syntax_parser_consume(parser); + return lxb_css_parser_success(parser); + + default: + break; + } + } + + res = lxb_css_property_state_line_width_style_color(parser, token, + declar->u.border); + if (!res) { + return lxb_css_parser_failed(parser); + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN__END) { + return lxb_css_parser_success(parser); + } + + res = lxb_css_property_state_line_width_style_color(parser, token, + declar->u.border); + if (!res) { + return lxb_css_parser_failed(parser); + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN__END) { + return lxb_css_parser_success(parser); + } + + res = lxb_css_property_state_line_width_style_color(parser, token, + declar->u.border); + if (!res) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_border_top(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_border(parser, token, ctx); +} + +bool +lxb_css_property_state_border_right(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_border(parser, token, ctx); +} + +bool +lxb_css_property_state_border_bottom(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_border(parser, token, ctx); +} + +bool +lxb_css_property_state_border_left(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_border(parser, token, ctx); +} + +bool +lxb_css_property_state_border_top_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_border_right_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_border_bottom_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_border_left_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_background_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_status_t status; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + declar->u.color->type = type; + + lxb_css_syntax_parser_consume(parser); + return lxb_css_parser_success(parser); + + default: + break; + } + } + + res = lxb_css_property_state_color_handler(parser, token, + (lxb_css_value_color_t *) declar->u.color, + &status); + if (!res) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_opacity(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_opacity_t *opacity = declar->u.opacity; + + res = lxb_css_property_state_number_percentage(parser, token, + (lxb_css_value_number_percentage_t *) opacity); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + opacity->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_position(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_POSITION_STATIC: + case LXB_CSS_POSITION_RELATIVE: + case LXB_CSS_POSITION_ABSOLUTE: + case LXB_CSS_POSITION_STICKY: + case LXB_CSS_POSITION_FIXED: + declar->u.position->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_top(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_mp_top(parser, token, ctx, true); +} + +bool +lxb_css_property_state_right(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_bottom(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_left(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_inset_block_start(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_inset_inline_start(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_inset_block_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_inset_inline_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_top(parser, token, ctx); +} + +bool +lxb_css_property_state_text_transform(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_text_transform_t *tt; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + tt = declar->u.text_transform; + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_TRANSFORM_NONE: + tt->type_case = type; + break; + + case LXB_CSS_TEXT_TRANSFORM_CAPITALIZE: + case LXB_CSS_TEXT_TRANSFORM_UPPERCASE: + case LXB_CSS_TEXT_TRANSFORM_LOWERCASE: + tt->type_case = type; + goto next; + + case LXB_CSS_TEXT_TRANSFORM_FULL_WIDTH: + tt->full_width = type; + goto next; + + case LXB_CSS_TEXT_TRANSFORM_FULL_SIZE_KANA: + tt->full_size_kana = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + +next: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + + switch (type) { + case LXB_CSS_TEXT_TRANSFORM_CAPITALIZE: + case LXB_CSS_TEXT_TRANSFORM_UPPERCASE: + case LXB_CSS_TEXT_TRANSFORM_LOWERCASE: + if (tt->type_case != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + tt->type_case = type; + goto next; + + case LXB_CSS_TEXT_TRANSFORM_FULL_WIDTH: + if (tt->full_width != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + tt->full_width = type; + goto next; + + case LXB_CSS_TEXT_TRANSFORM_FULL_SIZE_KANA: + if (tt->full_size_kana != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + tt->full_size_kana = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } +} + +bool +lxb_css_property_state_text_align(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_ALIGN_START: + case LXB_CSS_TEXT_ALIGN_END: + case LXB_CSS_TEXT_ALIGN_LEFT: + case LXB_CSS_TEXT_ALIGN_RIGHT: + case LXB_CSS_TEXT_ALIGN_CENTER: + case LXB_CSS_TEXT_ALIGN_JUSTIFY: + case LXB_CSS_TEXT_ALIGN_MATCH_PARENT: + case LXB_CSS_TEXT_ALIGN_JUSTIFY_ALL: + declar->u.text_align->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_align_all(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_ALIGN_ALL_START: + case LXB_CSS_TEXT_ALIGN_ALL_END: + case LXB_CSS_TEXT_ALIGN_ALL_LEFT: + case LXB_CSS_TEXT_ALIGN_ALL_RIGHT: + case LXB_CSS_TEXT_ALIGN_ALL_CENTER: + case LXB_CSS_TEXT_ALIGN_ALL_JUSTIFY: + case LXB_CSS_TEXT_ALIGN_ALL_MATCH_PARENT: + declar->u.text_align_all->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_align_last(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_ALIGN_LAST_AUTO: + case LXB_CSS_TEXT_ALIGN_LAST_START: + case LXB_CSS_TEXT_ALIGN_LAST_END: + case LXB_CSS_TEXT_ALIGN_LAST_LEFT: + case LXB_CSS_TEXT_ALIGN_LAST_RIGHT: + case LXB_CSS_TEXT_ALIGN_LAST_CENTER: + case LXB_CSS_TEXT_ALIGN_LAST_JUSTIFY: + case LXB_CSS_TEXT_ALIGN_LAST_MATCH_PARENT: + declar->u.text_align_last->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_justify(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_JUSTIFY_AUTO: + case LXB_CSS_TEXT_JUSTIFY_NONE: + case LXB_CSS_TEXT_JUSTIFY_INTER_WORD: + case LXB_CSS_TEXT_JUSTIFY_INTER_CHARACTER: + declar->u.text_justify->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_indent(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_text_indent_t *text_indent; + + text_indent = declar->u.text_indent; + + res = lxb_css_property_state_length_percentage(parser, token, + &text_indent->length); + if (res) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + text_indent->type = LXB_CSS_VALUE__LENGTH; + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + if (!res) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + if (res) { + return lxb_css_parser_failed(parser); + } + + text_indent->type = type; + break; + + /* Local. */ + case LXB_CSS_TEXT_INDENT_HANGING: + text_indent->hanging = type; + goto next; + + case LXB_CSS_TEXT_INDENT_EACH_LINE: + text_indent->each_line = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + +next: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_length_percentage(parser, token, + &text_indent->length); + if (res) { + if (text_indent->type != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + text_indent->type = LXB_CSS_VALUE__LENGTH; + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + if (text_indent->type == LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + + switch (type) { + case LXB_CSS_TEXT_INDENT_HANGING: + if (text_indent->hanging != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + text_indent->hanging = type; + goto next; + + case LXB_CSS_TEXT_INDENT_EACH_LINE: + if (text_indent->each_line != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + text_indent->each_line = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } +} + +bool +lxb_css_property_state_white_space(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WHITE_SPACE_NORMAL: + case LXB_CSS_WHITE_SPACE_PRE: + case LXB_CSS_WHITE_SPACE_NOWRAP: + case LXB_CSS_WHITE_SPACE_PRE_WRAP: + case LXB_CSS_WHITE_SPACE_BREAK_SPACES: + case LXB_CSS_WHITE_SPACE_PRE_LINE: + declar->u.white_space->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_tab_size(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_number_length(parser, token, + (lxb_css_value_number_length_t *) declar->u.tab_size); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + declar->u.tab_size->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_word_break(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WORD_BREAK_NORMAL: + case LXB_CSS_WORD_BREAK_KEEP_ALL: + case LXB_CSS_WORD_BREAK_BREAK_ALL: + case LXB_CSS_WORD_BREAK_BREAK_WORD: + declar->u.word_break->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_line_break(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_LINE_BREAK_AUTO: + case LXB_CSS_LINE_BREAK_LOOSE: + case LXB_CSS_LINE_BREAK_NORMAL: + case LXB_CSS_LINE_BREAK_STRICT: + case LXB_CSS_LINE_BREAK_ANYWHERE: + declar->u.line_break->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_hyphens(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_HYPHENS_NONE: + case LXB_CSS_HYPHENS_MANUAL: + case LXB_CSS_HYPHENS_AUTO: + declar->u.hyphens->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_overflow_wrap(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_OVERFLOW_WRAP_NORMAL: + case LXB_CSS_OVERFLOW_WRAP_BREAK_WORD: + case LXB_CSS_OVERFLOW_WRAP_ANYWHERE: + declar->u.overflow_wrap->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_word_wrap(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_overflow_wrap(parser, token, ctx); +} + +bool +lxb_css_property_state_word_spacing(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_length(parser, token, + &declar->u.word_spacing->length); + if (res) { + declar->u.word_spacing->type = LXB_CSS_VALUE__LENGTH; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WORD_SPACING_NORMAL: + declar->u.word_spacing->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_letter_spacing(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_word_spacing(parser, token, ctx); +} + +bool +lxb_css_property_state_hanging_punctuation(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_hanging_punctuation_t *hp; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + hp = declar->u.hanging_punctuation; + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_HANGING_PUNCTUATION_NONE: + hp->type_first = type; + break; + + case LXB_CSS_HANGING_PUNCTUATION_FIRST: + hp->type_first = type; + goto next; + + case LXB_CSS_HANGING_PUNCTUATION_FORCE_END: + case LXB_CSS_HANGING_PUNCTUATION_ALLOW_END: + hp->force_allow = type; + goto next; + + case LXB_CSS_HANGING_PUNCTUATION_LAST: + hp->last = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + +next: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + + switch (type) { + case LXB_CSS_HANGING_PUNCTUATION_FIRST: + if (hp->type_first != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + hp->type_first = type; + goto next; + + case LXB_CSS_HANGING_PUNCTUATION_FORCE_END: + case LXB_CSS_HANGING_PUNCTUATION_ALLOW_END: + if (hp->force_allow != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + hp->force_allow = type; + goto next; + + case LXB_CSS_HANGING_PUNCTUATION_LAST: + if (hp->last != LXB_CSS_VALUE__UNDEF) { + return lxb_css_parser_failed(parser); + } + + hp->last = type; + goto next; + + default: + return lxb_css_parser_failed(parser); + } +} + +bool +lxb_css_property_state_font_family(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + size_t length; + const lxb_char_t *data; + lexbor_str_t *str; + lexbor_mraw_t *mraw; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_font_family_t *ff; + lxb_css_property_family_name_t *name; + + mraw = parser->memory->mraw; + ff = declar->u.font_family; + + while (token != NULL) { + name = lexbor_mraw_alloc(mraw, sizeof(lxb_css_property_family_name_t)); + if (name == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + if (token->type == LXB_CSS_SYNTAX_TOKEN_IDENT) { + data = lxb_css_syntax_token_ident(token)->data; + length = lxb_css_syntax_token_ident(token)->length; + + type = lxb_css_value_by_name(data, length); + if (type != LXB_CSS_VALUE__UNDEF) { + name->generic = true; + name->u.type = type; + + goto next; + } + } + else if (token->type == LXB_CSS_SYNTAX_TOKEN_STRING) { + data = lxb_css_syntax_token_string(token)->data; + length = lxb_css_syntax_token_string(token)->length; + } + else { + return lxb_css_parser_failed(parser); + } + + name->generic = false; + + str = &name->u.str; + + (void) lexbor_str_init(str, mraw, length); + if (name->u.str.data == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + memcpy(str->data, data, length); + + str->data[length] = '\0'; + str->length = length; + + next: + + if (ff->first == NULL) { + ff->first = name; + } + else { + ff->last->next = name; + } + + name->next = NULL; + name->prev = ff->last; + ff->last = name; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + if (token->type == LXB_CSS_SYNTAX_TOKEN__END) { + return lxb_css_parser_success(parser); + } + + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + } + + lxb_css_property_state_check_token(parser, token); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_font_weight(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx)\ +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_font_weight_t *fw = declar->u.font_weight; + + res = lxb_css_property_state_number(parser, token, &fw->number); + + if (res) { + if (fw->number.num < 1 || fw->number.num > 1000) { + return lxb_css_parser_failed(parser); + } + + fw->type = LXB_CSS_FONT_WEIGHT__NUMBER; + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FONT_WEIGHT_NORMAL: + case LXB_CSS_FONT_WEIGHT_BOLD: + case LXB_CSS_FONT_WEIGHT_BOLDER: + case LXB_CSS_FONT_WEIGHT_LIGHTER: + fw->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_font_stretch(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_font_stretch_t *fs = declar->u.font_stretch; + + res = lxb_css_property_state_percentage(parser, token, &fs->percentage); + + if (res) { + if (fs->percentage.num < 0) { + return lxb_css_parser_failed(parser); + } + + fs->type = LXB_CSS_FONT_STRETCH__PERCENTAGE; + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FONT_STRETCH_NORMAL: + case LXB_CSS_FONT_STRETCH_ULTRA_CONDENSED: + case LXB_CSS_FONT_STRETCH_EXTRA_CONDENSED: + case LXB_CSS_FONT_STRETCH_CONDENSED: + case LXB_CSS_FONT_STRETCH_SEMI_CONDENSED: + case LXB_CSS_FONT_STRETCH_SEMI_EXPANDED: + case LXB_CSS_FONT_STRETCH_EXPANDED: + case LXB_CSS_FONT_STRETCH_EXTRA_EXPANDED: + case LXB_CSS_FONT_STRETCH_ULTRA_EXPANDED: + fs->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_font_style(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_font_style_t *fs = declar->u.font_style; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FONT_STYLE_NORMAL: + case LXB_CSS_FONT_STYLE_ITALIC: + fs->type = type; + break; + + case LXB_CSS_FONT_STYLE_OBLIQUE: + fs->type = type; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_angle(parser, token, &fs->angle); + + if (res) { + if (fs->angle.num < -90 || fs->angle.num > 90) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); + } + else { + fs->angle.unit = (lxb_css_unit_angle_t) LXB_CSS_UNIT__UNDEF; + } + + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_font_size(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_font_size_t *fs = declar->u.font_size; + + res = lxb_css_property_state_length_percentage(parser, token, &fs->length); + + if (res) { + if (fs->length.u.length.num < 0) { + return lxb_css_parser_failed(parser); + } + + fs->type = LXB_CSS_FONT_SIZE__LENGTH; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FONT_SIZE_XX_SMALL: + case LXB_CSS_FONT_SIZE_X_SMALL: + case LXB_CSS_FONT_SIZE_SMALL: + case LXB_CSS_FONT_SIZE_MEDIUM: + case LXB_CSS_FONT_SIZE_LARGE: + case LXB_CSS_FONT_SIZE_X_LARGE: + case LXB_CSS_FONT_SIZE_XX_LARGE: + case LXB_CSS_FONT_SIZE_XXX_LARGE: + case LXB_CSS_FONT_SIZE_MATH: + case LXB_CSS_FONT_SIZE_LARGER: + case LXB_CSS_FONT_SIZE_SMALLER: + fs->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_float_reference(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLOAT_REFERENCE_INLINE: + case LXB_CSS_FLOAT_REFERENCE_COLUMN: + case LXB_CSS_FLOAT_REFERENCE_REGION: + case LXB_CSS_FLOAT_REFERENCE_PAGE: + declar->u.float_reference->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_float(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_float_t *fp = declar->u.floatp; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + if (token->type == LXB_CSS_SYNTAX_TOKEN_FUNCTION) { + goto snap; + } + + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLOAT_BLOCK_START: + case LXB_CSS_FLOAT_BLOCK_END: + case LXB_CSS_FLOAT_INLINE_START: + case LXB_CSS_FLOAT_INLINE_END: + case LXB_CSS_FLOAT_SNAP_BLOCK: + case LXB_CSS_FLOAT_SNAP_INLINE: + case LXB_CSS_FLOAT_LEFT: + case LXB_CSS_FLOAT_RIGHT: + case LXB_CSS_FLOAT_TOP: + case LXB_CSS_FLOAT_BOTTOM: + case LXB_CSS_FLOAT_NONE: + fp->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + +snap: + + type = lxb_css_value_by_name(lxb_css_syntax_token_function(token)->data, + lxb_css_syntax_token_function(token)->length); + + if (type != LXB_CSS_FLOAT_SNAP_BLOCK + && type != LXB_CSS_FLOAT_SNAP_INLINE) + { + return lxb_css_parser_failed(parser); + } + + fp->type = type; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_length(parser, token, &fp->length.length); + if (!res) { + return lxb_css_parser_failed(parser); + } + + fp->length.type = LXB_CSS_VALUE__LENGTH; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_COMMA) { + if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + fp->snap_type = LXB_CSS_VALUE__UNDEF; + + lxb_css_syntax_parser_consume(parser); + return lxb_css_parser_success(parser); + } + + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_FLOAT_START: + case LXB_CSS_FLOAT_END: + if (fp->type != LXB_CSS_FLOAT_SNAP_BLOCK) { + return lxb_css_parser_failed(parser); + } + + fp->snap_type = type; + break; + + case LXB_CSS_FLOAT_LEFT: + case LXB_CSS_FLOAT_RIGHT: + if (fp->type != LXB_CSS_FLOAT_SNAP_INLINE) { + return lxb_css_parser_failed(parser); + } + + fp->snap_type = type; + break; + + case LXB_CSS_FLOAT_NEAR: + fp->snap_type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) { + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + } + + return lxb_css_parser_failed(parser); +} + +bool +lxb_css_property_state_clear(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_CLEAR_INLINE_START: + case LXB_CSS_CLEAR_INLINE_END: + case LXB_CSS_CLEAR_BLOCK_START: + case LXB_CSS_CLEAR_BLOCK_END: + case LXB_CSS_CLEAR_LEFT: + case LXB_CSS_CLEAR_RIGHT: + case LXB_CSS_CLEAR_TOP: + case LXB_CSS_CLEAR_BOTTOM: + case LXB_CSS_CLEAR_NONE: + declar->u.clear->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_float_defer(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_float_defer_t *fd = declar->u.float_defer; + + res = lxb_css_property_state_integer(parser, token, &fd->integer); + if (res) { + fd->type = LXB_CSS_FLOAT_DEFER__INTEGER; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLOAT_DEFER_LAST: + case LXB_CSS_FLOAT_DEFER_NONE: + fd->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_float_offset(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_float_offset_t *fo = declar->u.float_offset; + + res = lxb_css_property_state_length_percentage(parser, token, + (lxb_css_value_length_percentage_t *) fo); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + fo->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_wrap_flow(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WRAP_FLOW_AUTO: + case LXB_CSS_WRAP_FLOW_BOTH: + case LXB_CSS_WRAP_FLOW_START: + case LXB_CSS_WRAP_FLOW_END: + case LXB_CSS_WRAP_FLOW_MINIMUM: + case LXB_CSS_WRAP_FLOW_MAXIMUM: + case LXB_CSS_WRAP_FLOW_CLEAR: + declar->u.wrap_flow->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_wrap_through(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WRAP_THROUGH_WRAP: + case LXB_CSS_WRAP_THROUGH_NONE: + declar->u.wrap_through->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_direction(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLEX_DIRECTION_ROW: + case LXB_CSS_FLEX_DIRECTION_ROW_REVERSE: + case LXB_CSS_FLEX_DIRECTION_COLUMN: + case LXB_CSS_FLEX_DIRECTION_COLUMN_REVERSE: + declar->u.flex_direction->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_wrap(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLEX_WRAP_NOWRAP: + case LXB_CSS_FLEX_WRAP_WRAP: + case LXB_CSS_FLEX_WRAP_WRAP_REVERSE: + declar->u.flex_wrap->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_flow(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_flex_flow_t *ff = declar->u.flex_flow; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLEX_DIRECTION_ROW: + case LXB_CSS_FLEX_DIRECTION_ROW_REVERSE: + case LXB_CSS_FLEX_DIRECTION_COLUMN: + case LXB_CSS_FLEX_DIRECTION_COLUMN_REVERSE: + ff->type_direction = type; + goto direction; + + case LXB_CSS_FLEX_WRAP_NOWRAP: + case LXB_CSS_FLEX_WRAP_WRAP: + case LXB_CSS_FLEX_WRAP_WRAP_REVERSE: + ff->wrap = type; + goto wrap; + + default: + return lxb_css_parser_failed(parser); + } + +direction: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_FLEX_WRAP_NOWRAP: + case LXB_CSS_FLEX_WRAP_WRAP: + case LXB_CSS_FLEX_WRAP_WRAP_REVERSE: + ff->wrap = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + goto done; + +wrap: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_success(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_FLEX_DIRECTION_ROW: + case LXB_CSS_FLEX_DIRECTION_ROW_REVERSE: + case LXB_CSS_FLEX_DIRECTION_COLUMN: + case LXB_CSS_FLEX_DIRECTION_COLUMN_REVERSE: + ff->type_direction = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + +done: + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +lxb_inline bool +lxb_css_property_state_flex_grow_shrink(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_flex_t *flex) +{ + bool res; + + res = lxb_css_property_state_number(parser, token, &flex->grow.number); + if (!res) { + return false; + } + + flex->grow.type = LXB_CSS_FLEX_GROW__NUMBER; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_number(parser, token, &flex->shrink.number); + if (res) { + flex->shrink.type = LXB_CSS_FLEX_SHRINK__NUMBER; + } + + return true; +} + +lxb_inline bool +lxb_css_property_state_flex_grow_basis(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_flex_t *flex) +{ + bool res; + lxb_css_value_type_t type; + + res = lxb_css_property_state_width_handler(parser, token, + (lxb_css_property_flex_basis_t *) &flex->basis); + if (res) { + return true; + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return false; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + + if (type == LXB_CSS_FLEX_BASIS_CONTENT) { + flex->basis.type = type; + + lxb_css_syntax_parser_consume(parser); + return true; + } + + return false; +} + +bool +lxb_css_property_state_flex(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_flex_t *flex = declar->u.flex; + + res = lxb_css_property_state_flex_grow_shrink(parser, token, flex); + + if (res) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_flex_grow_basis(parser, token, flex); + + if (!res && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + flex->basis.type = LXB_CSS_VALUE__NUMBER; + flex->basis.u.length.num = flex->grow.number.num; + flex->basis.u.length.unit = LXB_CSS_UNIT__UNDEF; + flex->basis.u.length.is_float = flex->grow.number.is_float; + + flex->grow.type = LXB_CSS_VALUE__UNDEF; + + if (flex->shrink.type != LXB_CSS_VALUE__UNDEF) { + flex->grow = flex->shrink; + flex->shrink.type = LXB_CSS_VALUE__UNDEF; + + goto try_shrink_last; + } + + res = lxb_css_property_state_flex_grow_shrink(parser, token, flex); + if (!res) { + return lxb_css_parser_failed(parser); + } + } + + return lxb_css_parser_success(parser); + } + else { + res = lxb_css_property_state_flex_grow_basis(parser, token, flex); + + if (res) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + (void) lxb_css_property_state_flex_grow_shrink(parser, token, flex); + + return lxb_css_parser_success(parser); + } + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_FLEX_NONE: + flex->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); + +try_shrink_last: + + res = lxb_css_property_state_number(parser, token, &flex->shrink.number); + if (res) { + flex->shrink.type = LXB_CSS_FLEX_SHRINK__NUMBER; + } + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_grow(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_flex_grow_t *fg = declar->u.flex_grow; + + res = lxb_css_property_state_number(parser, token, &fg->number); + if (res) { + if (fg->number.num < 0) { + return lxb_css_parser_failed(parser); + } + + fg->type = LXB_CSS_FLEX_GROW__NUMBER; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + fg->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_shrink(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_flex_grow_t *fs = declar->u.flex_shrink; + + res = lxb_css_property_state_number(parser, token, &fs->number); + if (res) { + if (fs->number.num < 0) { + return lxb_css_parser_failed(parser); + } + + fs->type = LXB_CSS_FLEX_SHRINK__NUMBER; + + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + fs->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_flex_basis(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_flex_basis_t *fb = declar->u.flex_basis; + + res = lxb_css_property_state_width_handler(parser, token, + (lxb_css_property_width_t *) fb); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + case LXB_CSS_FLEX_BASIS_CONTENT: + fb->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_justify_content(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_JUSTIFY_CONTENT_FLEX_START: + case LXB_CSS_JUSTIFY_CONTENT_FLEX_END: + case LXB_CSS_JUSTIFY_CONTENT_CENTER: + case LXB_CSS_JUSTIFY_CONTENT_SPACE_BETWEEN: + case LXB_CSS_JUSTIFY_CONTENT_SPACE_AROUND: + declar->u.justify_content->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_align_items(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_ALIGN_ITEMS_FLEX_START: + case LXB_CSS_ALIGN_ITEMS_FLEX_END: + case LXB_CSS_ALIGN_ITEMS_CENTER: + case LXB_CSS_ALIGN_ITEMS_BASELINE: + case LXB_CSS_ALIGN_ITEMS_STRETCH: + declar->u.align_items->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_align_self(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_ALIGN_SELF_AUTO: + case LXB_CSS_ALIGN_SELF_FLEX_START: + case LXB_CSS_ALIGN_SELF_FLEX_END: + case LXB_CSS_ALIGN_SELF_CENTER: + case LXB_CSS_ALIGN_SELF_BASELINE: + case LXB_CSS_ALIGN_SELF_STRETCH: + declar->u.align_self->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_align_content(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_ALIGN_CONTENT_FLEX_START: + case LXB_CSS_ALIGN_CONTENT_FLEX_END: + case LXB_CSS_ALIGN_CONTENT_CENTER: + case LXB_CSS_ALIGN_CONTENT_SPACE_BETWEEN: + case LXB_CSS_ALIGN_CONTENT_SPACE_AROUND: + case LXB_CSS_ALIGN_CONTENT_STRETCH: + declar->u.align_content->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_dominant_baseline(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_DOMINANT_BASELINE_AUTO: + case LXB_CSS_DOMINANT_BASELINE_TEXT_BOTTOM: + case LXB_CSS_DOMINANT_BASELINE_ALPHABETIC: + case LXB_CSS_DOMINANT_BASELINE_IDEOGRAPHIC: + case LXB_CSS_DOMINANT_BASELINE_MIDDLE: + case LXB_CSS_DOMINANT_BASELINE_CENTRAL: + case LXB_CSS_DOMINANT_BASELINE_MATHEMATICAL: + case LXB_CSS_DOMINANT_BASELINE_HANGING: + case LXB_CSS_DOMINANT_BASELINE_TEXT_TOP: + declar->u.dominant_baseline->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_alignment_baseline_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_alignment_baseline_t *ab) +{ + lxb_css_value_type_t type; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return false; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_ALIGNMENT_BASELINE_BASELINE: + case LXB_CSS_ALIGNMENT_BASELINE_TEXT_BOTTOM: + case LXB_CSS_ALIGNMENT_BASELINE_ALPHABETIC: + case LXB_CSS_ALIGNMENT_BASELINE_IDEOGRAPHIC: + case LXB_CSS_ALIGNMENT_BASELINE_MIDDLE: + case LXB_CSS_ALIGNMENT_BASELINE_CENTRAL: + case LXB_CSS_ALIGNMENT_BASELINE_MATHEMATICAL: + case LXB_CSS_ALIGNMENT_BASELINE_TEXT_TOP: + ab->type = type; + + lxb_css_syntax_parser_consume(parser); + return true; + + default: + return false; + } +} + +bool +lxb_css_property_state_baseline_shift_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_baseline_shift_t *bs) +{ + bool res; + lxb_css_value_type_t type; + + res = lxb_css_property_state_length_percentage(parser, token, bs); + + if (res) { + return true; + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return false; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_BASELINE_SHIFT_SUB: + case LXB_CSS_BASELINE_SHIFT_SUPER: + case LXB_CSS_BASELINE_SHIFT_TOP: + case LXB_CSS_BASELINE_SHIFT_CENTER: + case LXB_CSS_BASELINE_SHIFT_BOTTOM: + bs->type = type; + + lxb_css_syntax_parser_consume(parser); + return true; + + default: + return false; + } +} + +bool +lxb_css_property_state_vertical_align(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + uint8_t maps; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_vertical_align_t *va = declar->u.vertical_align; + + maps = 0; + +again: + + res = lxb_css_property_state_alignment_baseline_h(parser, token, + &va->alignment); + if (res) { + if (maps & 1 << 1) { + return lxb_css_parser_failed(parser); + } + + maps |= 1 << 1; + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_baseline_shift_h(parser, token, + &va->shift); + if (res) { + if (maps & 1 << 2) { + return lxb_css_parser_failed(parser); + } + + maps |= 1 << 2; + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + } + else { + res = lxb_css_property_state_baseline_shift_h(parser, token, + &va->shift); + if (res) { + if (maps & 1 << 2) { + return lxb_css_parser_failed(parser); + } + + maps |= 1 << 2; + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_alignment_baseline_h(parser, token, + &va->alignment); + if (res) { + if (maps & 1 << 1) { + return lxb_css_parser_failed(parser); + } + + maps |= 1 << 1; + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + } + } + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + if (maps != 0) { + return lxb_css_parser_success(parser); + } + + return lxb_css_parser_failed(parser); + } + + if (maps & 1 << 3) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_VERTICAL_ALIGN_FIRST: + case LXB_CSS_VERTICAL_ALIGN_LAST: + va->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + maps = 1 << 3; + + goto again; +} + +bool +lxb_css_property_state_baseline_source(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_BASELINE_SOURCE_AUTO: + case LXB_CSS_BASELINE_SOURCE_FIRST: + case LXB_CSS_BASELINE_SOURCE_LAST: + declar->u.baseline_source->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_alignment_baseline(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_ALIGNMENT_BASELINE_BASELINE: + case LXB_CSS_ALIGNMENT_BASELINE_TEXT_BOTTOM: + case LXB_CSS_ALIGNMENT_BASELINE_ALPHABETIC: + case LXB_CSS_ALIGNMENT_BASELINE_IDEOGRAPHIC: + case LXB_CSS_ALIGNMENT_BASELINE_MIDDLE: + case LXB_CSS_ALIGNMENT_BASELINE_CENTRAL: + case LXB_CSS_ALIGNMENT_BASELINE_MATHEMATICAL: + case LXB_CSS_ALIGNMENT_BASELINE_TEXT_TOP: + declar->u.alignment_baseline->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_baseline_shift(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_length_percentage(parser, token, + declar->u.baseline_shift); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_BASELINE_SHIFT_SUB: + case LXB_CSS_BASELINE_SHIFT_SUPER: + case LXB_CSS_BASELINE_SHIFT_TOP: + case LXB_CSS_BASELINE_SHIFT_CENTER: + case LXB_CSS_BASELINE_SHIFT_BOTTOM: + declar->u.baseline_shift->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_line_height(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_number_length_percentage(parser, token, + declar->u.line_height); + if (res) { + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_LINE_HEIGHT_NORMAL: + declar->u.line_height->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_z_index(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + res = lxb_css_property_state_integer(parser, token, + &declar->u.z_index->integer); + if (res) { + declar->u.z_index->type = LXB_CSS_VALUE__INTEGER; + return lxb_css_parser_success(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_Z_INDEX_AUTO: + declar->u.line_height->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_direction(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_DIRECTION_LTR: + case LXB_CSS_DIRECTION_RTL: + declar->u.direction->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_unicode_bidi(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_UNICODE_BIDI_NORMAL: + case LXB_CSS_UNICODE_BIDI_EMBED: + case LXB_CSS_UNICODE_BIDI_ISOLATE: + case LXB_CSS_UNICODE_BIDI_BIDI_OVERRIDE: + case LXB_CSS_UNICODE_BIDI_ISOLATE_OVERRIDE: + case LXB_CSS_UNICODE_BIDI_PLAINTEXT: + declar->u.unicode_bidi->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_writing_mode(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_WRITING_MODE_HORIZONTAL_TB: + case LXB_CSS_WRITING_MODE_VERTICAL_RL: + case LXB_CSS_WRITING_MODE_VERTICAL_LR: + case LXB_CSS_WRITING_MODE_SIDEWAYS_RL: + case LXB_CSS_WRITING_MODE_SIDEWAYS_LR: + declar->u.writing_mode->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_orientation(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_ORIENTATION_MIXED: + case LXB_CSS_TEXT_ORIENTATION_UPRIGHT: + case LXB_CSS_TEXT_ORIENTATION_SIDEWAYS: + declar->u.text_orientation->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_combine_upright(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_text_combine_upright_t *tcu = declar->u.text_combine_upright; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_COMBINE_UPRIGHT_NONE: + case LXB_CSS_TEXT_COMBINE_UPRIGHT_ALL: + tcu->type = type; + break; + + case LXB_CSS_TEXT_COMBINE_UPRIGHT_DIGITS: + tcu->type = type; + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + res = lxb_css_property_state_integer(parser, token, + &tcu->digits); + if (res) { + if (tcu->digits.num != 2 && tcu->digits.num != 4) { + return lxb_css_parser_failed(parser); + } + } + + return lxb_css_parser_success(parser); + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_overflow_x(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_OVERFLOW_X_VISIBLE: + case LXB_CSS_OVERFLOW_X_HIDDEN: + case LXB_CSS_OVERFLOW_X_CLIP: + case LXB_CSS_OVERFLOW_X_SCROLL: + case LXB_CSS_OVERFLOW_X_AUTO: + declar->u.overflow_x->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_overflow_y(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_overflow_x(parser, token, ctx); +} + +bool +lxb_css_property_state_overflow_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_overflow_x(parser, token, ctx); +} + +bool +lxb_css_property_state_overflow_inline(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_overflow_x(parser, token, ctx); +} + +bool +lxb_css_property_state_text_overflow(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_OVERFLOW_CLIP: + case LXB_CSS_TEXT_OVERFLOW_ELLIPSIS: + declar->u.text_overflow->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +lxb_status_t +lxb_css_property_state_text_decoration_line_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_text_decoration_line_t *tdl) +{ + lxb_css_value_type_t type; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return LXB_STATUS_NEXT; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_TEXT_DECORATION_LINE_NONE: + tdl->type = type; + + lxb_css_syntax_parser_consume(parser); + return LXB_STATUS_OK; + + default: + goto first; + } + +next: + + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token_wo_ws(parser); + if (token == NULL) { + return LXB_STATUS_ERROR_MEMORY_ALLOCATION; + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return LXB_STATUS_OK; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + +first: + + switch (type) { + case LXB_CSS_TEXT_DECORATION_LINE_UNDERLINE: + if (tdl->underline != LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_STOP; + } + + tdl->underline = type; + goto next; + + case LXB_CSS_TEXT_DECORATION_LINE_OVERLINE: + if (tdl->overline != LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_STOP; + } + + tdl->overline = type; + goto next; + + case LXB_CSS_TEXT_DECORATION_LINE_LINE_THROUGH: + if (tdl->line_through != LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_STOP; + } + + tdl->line_through = type; + goto next; + + case LXB_CSS_TEXT_DECORATION_LINE_BLINK: + if (tdl->blink != LXB_CSS_VALUE__UNDEF) { + return LXB_STATUS_STOP; + } + + tdl->blink = type; + goto next; + + default: + if (tdl->underline != LXB_CSS_VALUE__UNDEF + || tdl->overline != LXB_CSS_VALUE__UNDEF + || tdl->line_through != LXB_CSS_VALUE__UNDEF + || tdl->blink != LXB_CSS_VALUE__UNDEF) + { + return LXB_STATUS_OK; + } + + return LXB_STATUS_NEXT; + } +} + +bool +lxb_css_property_state_text_decoration_line(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_status_t status; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_text_decoration_line_t *tdl = declar->u.text_decoration_line; + + status = lxb_css_property_state_text_decoration_line_h(parser, token, tdl); + + if (status == LXB_STATUS_OK) { + return lxb_css_parser_success(parser); + } + else if (status == LXB_STATUS_STOP) { + return lxb_css_parser_failed(parser); + } + else if (status != LXB_STATUS_NEXT) { + return lxb_css_parser_memory_fail(parser); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + tdl->type = type; + + lxb_css_syntax_parser_consume(parser); + return lxb_css_parser_success(parser); + + default: + return lxb_css_parser_failed(parser); + } +} + +bool +lxb_css_property_state_text_decoration_style_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_property_text_decoration_style_t *tds) +{ + lxb_css_value_type_t type; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return false; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + case LXB_CSS_TEXT_DECORATION_STYLE_SOLID: + case LXB_CSS_TEXT_DECORATION_STYLE_DOUBLE: + case LXB_CSS_TEXT_DECORATION_STYLE_DOTTED: + case LXB_CSS_TEXT_DECORATION_STYLE_DASHED: + case LXB_CSS_TEXT_DECORATION_STYLE_WAVY: + tds->type = type; + + lxb_css_syntax_parser_consume(parser); + return true; + + default: + return false; + } +} + +bool +lxb_css_property_state_text_decoration_style(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + return lxb_css_parser_failed(parser); + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + /* Local. */ + case LXB_CSS_TEXT_DECORATION_STYLE_SOLID: + case LXB_CSS_TEXT_DECORATION_STYLE_DOUBLE: + case LXB_CSS_TEXT_DECORATION_STYLE_DOTTED: + case LXB_CSS_TEXT_DECORATION_STYLE_DASHED: + case LXB_CSS_TEXT_DECORATION_STYLE_WAVY: + declar->u.text_decoration_style->type = type; + break; + + default: + return lxb_css_parser_failed(parser); + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_parser_success(parser); +} + +bool +lxb_css_property_state_text_decoration_color(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_property_state_color(parser, token, ctx); +} + +bool +lxb_css_property_state_text_decoration(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + bool res, line, style, color; + lxb_status_t status; + lxb_css_value_type_t type; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_property_text_decoration_t *td = declar->u.text_decoration; + + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT) { + goto lsc; + } + + type = lxb_css_value_by_name(lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length); + switch (type) { + /* Global. */ + case LXB_CSS_VALUE_INITIAL: + case LXB_CSS_VALUE_INHERIT: + case LXB_CSS_VALUE_UNSET: + case LXB_CSS_VALUE_REVERT: + td->line.type = type; + + lxb_css_syntax_parser_consume(parser); + return lxb_css_parser_success(parser); + + default: + break; + } + +lsc: + + line = false; + style = false; + color = false; + + for (size_t i = 0; i < 3; i++) { + if (!line) { + status = lxb_css_property_state_text_decoration_line_h(parser, token, + &td->line); + if (status == LXB_STATUS_OK) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + line = true; + } + else if (status == LXB_STATUS_STOP) { + return lxb_css_parser_failed(parser); + } + else if (status != LXB_STATUS_NEXT) { + return lxb_css_parser_memory_fail(parser); + } + } + + if (!style) { + res = lxb_css_property_state_text_decoration_style_h(parser, token, + &td->style); + if (res) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + style = true; + } + } + + if (!color) { + res = lxb_css_property_state_color_handler(parser, token, + (lxb_css_value_color_t *) &td->color, + &status); + if (res) { + token = lxb_css_syntax_parser_token_wo_ws(parser); + lxb_css_property_state_check_token(parser, token); + + color = true; + } + else { + if (status != LXB_STATUS_OK) { + return lxb_css_parser_failed(parser); + } + } + } + } + + if (!line && !style && !color) { + return lxb_css_parser_failed(parser); + } + + return lxb_css_parser_success(parser); +} diff --git a/ext/dom/lexbor/lexbor/css/property/types.h b/ext/dom/lexbor/lexbor/css/property/types.h new file mode 100644 index 000000000000..3a23f125a698 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/property/types.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2025 Alexander Borisov + * + * Author: Alexander Borisov + */ + +/* + * Caution! + * This file generated by the script "utils/lexbor/css/names.py"! + * Do not change this file! + */ + + +#ifndef LXB_CSS_PROPERTY_TYPES_H +#define LXB_CSS_PROPERTY_TYPES_H + + + + + +#endif /* LXB_CSS_PROPERTY_TYPES_H */ diff --git a/ext/dom/lexbor/lexbor/css/rule.c b/ext/dom/lexbor/lexbor/css/rule.c new file mode 100644 index 000000000000..5ee938730ea8 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/rule.c @@ -0,0 +1,598 @@ +/* + * Copyright (C) 2021-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/rule.h" +#include "lexbor/css/parser.h" +#include "lexbor/core/serialize.h" +#include "lexbor/css/stylesheet.h" +#include "lexbor/css/selectors/selectors.h" + + +void * +lxb_css_rule_destroy(lxb_css_rule_t *rule, bool self_destroy) +{ + switch (rule->type) { + case LXB_CSS_RULE_LIST: + return lxb_css_rule_list_destroy(lxb_css_rule_list(rule), + self_destroy); + case LXB_CSS_RULE_AT_RULE: + return lxb_css_rule_at_destroy(lxb_css_rule_at(rule), + self_destroy); + case LXB_CSS_RULE_STYLE: + return lxb_css_rule_style_destroy(lxb_css_rule_style(rule), + self_destroy); + case LXB_CSS_RULE_BAD_STYLE: + return lxb_css_rule_bad_style_destroy(lxb_css_rule_bad_style(rule), + self_destroy); + case LXB_CSS_RULE_DECLARATION: + return lxb_css_rule_declaration_destroy(lxb_css_rule_declaration(rule), + self_destroy); + case LXB_CSS_RULE_DECLARATION_LIST: + return lxb_css_rule_declaration_list_destroy(lxb_css_rule_declaration_list(rule), + self_destroy); + case LXB_CSS_RULE_STYLESHEET: + case LXB_CSS_RULE_UNDEF: + return NULL; + } + + return NULL; +} + +lxb_status_t +lxb_css_rule_serialize(const lxb_css_rule_t *rule, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (rule->type) { + case LXB_CSS_RULE_LIST: + return lxb_css_rule_list_serialize(lxb_css_rule_list(rule), cb, ctx); + + case LXB_CSS_RULE_AT_RULE: + return lxb_css_rule_at_serialize(lxb_css_rule_at(rule), cb, ctx); + + case LXB_CSS_RULE_STYLE: + return lxb_css_rule_style_serialize(lxb_css_rule_style(rule), + cb, ctx); + case LXB_CSS_RULE_BAD_STYLE: + return lxb_css_rule_bad_style_serialize(lxb_css_rule_bad_style(rule), + cb, ctx); + case LXB_CSS_RULE_DECLARATION: + return lxb_css_rule_declaration_serialize(lxb_css_rule_declaration(rule), + cb, ctx); + case LXB_CSS_RULE_DECLARATION_LIST: + return lxb_css_rule_declaration_list_serialize(lxb_css_rule_declaration_list(rule), + cb, ctx); + case LXB_CSS_RULE_STYLESHEET: + case LXB_CSS_RULE_UNDEF: + break; + } + + return LXB_STATUS_ERROR_WRONG_ARGS; +} + +lxb_status_t +lxb_css_rule_serialize_chain(const lxb_css_rule_t *rule, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + + static const lxb_char_t ws_str[] = "\n"; + + status = lxb_css_rule_serialize(rule, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + rule = rule->next; + + while (rule != NULL) { + lexbor_serialize_write(cb, ws_str, (sizeof(ws_str) - 1), ctx, status); + + status = lxb_css_rule_serialize(rule, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + rule = rule->next; + } + + return LXB_STATUS_OK; +} + +lxb_css_rule_list_t * +lxb_css_rule_list_destroy(lxb_css_rule_list_t *list, bool self_destroy) +{ + lxb_css_rule_t *rule, *next, *parent; + lxb_css_rule_t *child_rule; + lxb_css_memory_t *memory; + lxb_css_rule_at_t *at; + lxb_css_rule_style_t *style; + lxb_css_rule_bad_style_t *bad; + lxb_css_rule_list_t *sub_list; + lxb_css_rule_declaration_list_t *declr_list; + + if (list == NULL) { + return NULL; + } + + rule = list->first; + memory = lxb_css_rule(list)->memory; + + while (rule != NULL) { + child_rule = NULL; + + switch (rule->type) { + case LXB_CSS_RULE_LIST: + sub_list = lxb_css_rule_list(rule); + + if (sub_list->first != NULL) { + child_rule = sub_list->first; + + sub_list->first = NULL; + sub_list->last = NULL; + } + break; + + case LXB_CSS_RULE_STYLE: + style = lxb_css_rule_style(rule); + + if (style->child != NULL) { + child_rule = lxb_css_rule(style->child); + style->child = NULL; + } + break; + + case LXB_CSS_RULE_BAD_STYLE: + bad = lxb_css_rule_bad_style(rule); + + if (bad->child != NULL) { + child_rule = lxb_css_rule(bad->child); + bad->child = NULL; + } + break; + + case LXB_CSS_RULE_AT_RULE: + at = lxb_css_rule_at(rule); + + if (at->type == LXB_CSS_AT_RULE_MEDIA) { + if (at->u.media != NULL && at->u.media->block != NULL) { + child_rule = lxb_css_rule(at->u.media->block); + at->u.media->block = NULL; + } + } + else if (at->type == LXB_CSS_AT_RULE__UNDEF) { + if (at->u.undef != NULL && at->u.undef->block != NULL) { + child_rule = lxb_css_rule(at->u.undef->block); + at->u.undef->block = NULL; + } + } + else if (at->type == LXB_CSS_AT_RULE__CUSTOM) { + if (at->u.custom != NULL && at->u.custom->block != NULL) { + child_rule = lxb_css_rule(at->u.custom->block); + at->u.custom->block = NULL; + } + } + else if (at->type == LXB_CSS_AT_RULE_FONT_FACE) { + if (at->u.font_face != NULL && at->u.font_face->block != NULL) { + child_rule = lxb_css_rule(at->u.font_face->block); + at->u.font_face->block = NULL; + } + } + break; + + case LXB_CSS_RULE_DECLARATION_LIST: + declr_list = lxb_css_rule_declaration_list(rule); + + if (declr_list->first != NULL) { + child_rule = declr_list->first; + + declr_list->first = NULL; + declr_list->last = NULL; + } + break; + + default: + break; + } + + if (child_rule != NULL) { + rule = child_rule; + continue; + } + + next = rule->next; + parent = rule->parent; + + (void) lxb_css_rule_destroy(rule, true); + + if (next != NULL) { + rule = next; + } + else { + if (parent == lxb_css_rule(list)) { + break; + } + + rule = parent; + } + } + + if (self_destroy) { + return lexbor_mraw_free(memory->tree, list); + } + + list->first = NULL; + list->last = NULL; + + return list; +} + +lxb_status_t +lxb_css_rule_list_serialize(const lxb_css_rule_list_t *list, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + lxb_css_rule_t *rule; + + static const lxb_char_t nl_str[] = "\n"; + + rule = list->first; + + if (rule == NULL) { + return LXB_STATUS_OK; + } + + status = lxb_css_rule_serialize(rule, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + rule = rule->next; + + while (rule != NULL) { + lexbor_serialize_write(cb, nl_str, (sizeof(nl_str) - 1), ctx, status); + + status = lxb_css_rule_serialize(rule, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + rule = rule->next; + } + + return LXB_STATUS_OK; +} + +lxb_css_rule_at_t * +lxb_css_rule_at_destroy(lxb_css_rule_at_t *at, bool self_destroy) +{ + lxb_css_memory_t *memory = lxb_css_rule(at)->memory; + + switch (at->type) { + case LXB_CSS_AT_RULE__UNDEF: + (void) lxb_css_at_rule__undef_destroy(memory, at->u.undef, true); + break; + + case LXB_CSS_AT_RULE_MEDIA: + (void) lxb_css_at_rule_media_destroy(memory, at->u.media, true); + break; + + case LXB_CSS_AT_RULE_NAMESPACE: + (void) lxb_css_at_rule_namespace_destroy(memory, at->u.ns, true); + break; + + case LXB_CSS_AT_RULE__LAST_ENTRY: + break; + } + + if (self_destroy) { + return lexbor_mraw_free(memory->tree, at); + } + + return at; +} + +lxb_status_t +lxb_css_rule_at_serialize(const lxb_css_rule_at_t *at, lexbor_serialize_cb_f cb, + void *ctx) +{ + lxb_status_t status; + const lxb_css_at_rule__undef_t *undef; + const lxb_css_at_rule__custom_t *custom; + const lxb_css_entry_at_rule_data_t *data, *undata; + + static const lxb_char_t at_str[] = "@"; + + data = lxb_css_at_rule_by_id(at->type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, at_str, (sizeof(at_str) - 1), ctx, status); + + if (at->type == LXB_CSS_AT_RULE__UNDEF) { + undef = at->u.undef; + + undata = lxb_css_at_rule_by_id(undef->type); + if (undata == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, undata->name, undata->length, ctx, status); + } + else if (at->type == LXB_CSS_AT_RULE__CUSTOM) { + custom = at->u.custom; + + lexbor_serialize_write(cb, custom->name.data, + custom->name.length, ctx, status); + } + else { + lexbor_serialize_write(cb, data->name, data->length, ctx, status); + } + + return data->serialize(at->u.user, cb, ctx); +} + +lxb_status_t +lxb_css_rule_at_serialize_name(const lxb_css_rule_at_t *at, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_at_rule_serialize_name(at->u.user, at->type, cb, ctx); +} + +lxb_css_rule_style_t * +lxb_css_rule_style_destroy(lxb_css_rule_style_t *style, bool self_destroy) +{ + lxb_css_memory_t *memory = lxb_css_rule(style)->memory; + + lxb_css_selector_list_destroy(style->selector); + (void) lxb_css_rule_declaration_list_destroy(style->declarations, true); + (void) lxb_css_rule_list_destroy(style->child, true); + + style->selector = NULL; + style->declarations = NULL; + style->child = NULL; + + if (self_destroy) { + return lexbor_mraw_free(memory->tree, style); + } + + return style; +} + +lxb_status_t +lxb_css_rule_style_serialize(const lxb_css_rule_style_t *style, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + + static const lxb_char_t lc_str[] = " {"; + static const lxb_char_t rc_str[] = "}"; + static const lxb_char_t cm_str[] = "; "; + + status = lxb_css_selector_serialize_list_chain(style->selector, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (style->declarations != NULL) { + lexbor_serialize_write(cb, lc_str, (sizeof(lc_str) - 1), ctx, status); + + status = lxb_css_rule_declaration_list_serialize(style->declarations, + cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (style->child == NULL) { + lexbor_serialize_write(cb, rc_str, (sizeof(rc_str) - 1), + ctx, status); + } + } + + if (style->child != NULL && style->child->first != NULL) { + lexbor_serialize_write(cb, cm_str, (sizeof(cm_str) - 1), ctx, status); + + status = lxb_css_rule_list_serialize(style->child, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + } + + if (style->declarations != NULL) { + lexbor_serialize_write(cb, rc_str, (sizeof(rc_str) - 1), ctx, status); + } + + return LXB_STATUS_OK; +} + +lxb_css_rule_bad_style_t * +lxb_css_rule_bad_style_destroy(lxb_css_rule_bad_style_t *bad, bool self_destroy) +{ + lxb_css_memory_t *memory = lxb_css_rule(bad)->memory; + + (void) lexbor_str_destroy(&bad->selectors, memory->mraw, false); + bad->declarations = lxb_css_rule_declaration_list_destroy(bad->declarations, + true); + bad->child = lxb_css_rule_list_destroy(bad->child, true); + + if (self_destroy) { + return lexbor_mraw_free(memory->tree, bad); + } + + return bad; +} + +lxb_status_t +lxb_css_rule_bad_style_serialize(const lxb_css_rule_bad_style_t *bad, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + + static const lxb_char_t lc_str[] = "{"; + static const lxb_char_t rc_str[] = "}"; + + if (bad->selectors.data != NULL) { + lexbor_serialize_write(cb, bad->selectors.data, bad->selectors.length, + ctx, status); + } + + if (bad->declarations != NULL) { + lexbor_serialize_write(cb, lc_str, (sizeof(lc_str) - 1), ctx, status); + + status = lxb_css_rule_declaration_list_serialize(bad->declarations, + cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(rc_str, (sizeof(rc_str) - 1), ctx); + } + + return LXB_STATUS_OK; +} + +lxb_css_rule_declaration_list_t * +lxb_css_rule_declaration_list_destroy(lxb_css_rule_declaration_list_t *list, + bool self_destroy) +{ + lxb_css_rule_t *declr, *next; + + if (list == NULL) { + return NULL; + } + + declr = list->first; + + while (declr != NULL) { + next = declr->next; + (void) lxb_css_rule_destroy(declr, true); + declr = next; + } + + if (self_destroy) { + return lexbor_mraw_free(lxb_css_rule(list)->memory->tree, list); + } + + list->first = NULL; + list->last = NULL; + + return list; +} + +lxb_status_t +lxb_css_rule_declaration_list_serialize(const lxb_css_rule_declaration_list_t *list, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_rule_t *declr; + + static const lxb_char_t sm_str[] = "; "; + + declr = list->first; + + if (declr == NULL) { + return LXB_STATUS_OK; + } + + status = lxb_css_rule_serialize(declr, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + declr = declr->next; + + while (declr != NULL) { + lexbor_serialize_write(cb, sm_str, (sizeof(sm_str) - 1), ctx, status); + + status = lxb_css_rule_serialize(declr, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + declr = declr->next; + } + + return LXB_STATUS_OK; +} + +lxb_css_rule_declaration_t * +lxb_css_rule_declaration_destroy(lxb_css_rule_declaration_t *declr, + bool self_destroy) +{ + lxb_css_memory_t *memory = lxb_css_rule(declr)->memory; + + if (declr->u.user != NULL) { + declr->u.user = lxb_css_property_destroy(memory, declr->u.user, + declr->type, true); + } + + if (self_destroy) { + return lexbor_mraw_free(memory->tree, declr); + } + + return declr; +} + +lxb_status_t +lxb_css_rule_declaration_serialize(const lxb_css_rule_declaration_t *declaration, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + const lxb_css_entry_data_t *data, *undata; + const lxb_css_property__undef_t *undef; + const lxb_css_property__custom_t *custom; + + static const lxb_char_t cl_str[] = ": "; + static const lxb_char_t imp_str[] = " !important"; + + data = lxb_css_property_by_id(declaration->type); + if (data == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + if (declaration->type == LXB_CSS_PROPERTY__UNDEF) { + undef = declaration->u.undef; + + if (undef->type > LXB_CSS_PROPERTY__CUSTOM) { + undata = lxb_css_property_by_id(undef->type); + if (undata == NULL) { + return LXB_STATUS_ERROR_NOT_EXISTS; + } + + lexbor_serialize_write(cb, undata->name, undata->length, ctx, status); + lexbor_serialize_write(cb, cl_str, (sizeof(cl_str) - 1), ctx, status); + } + } + else if (declaration->type == LXB_CSS_PROPERTY__CUSTOM) { + custom = declaration->u.custom; + + lexbor_serialize_write(cb, custom->name.data, custom->name.length, + ctx, status); + lexbor_serialize_write(cb, cl_str, (sizeof(cl_str) - 1), ctx, status); + } + else { + lexbor_serialize_write(cb, data->name, data->length, ctx, status); + lexbor_serialize_write(cb, cl_str, (sizeof(cl_str) - 1), ctx, status); + } + + status = data->serialize(declaration->u.user, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (declaration->important && declaration->type != LXB_CSS_PROPERTY__UNDEF) { + lexbor_serialize_write(cb, imp_str, (sizeof(imp_str) - 1), ctx, status); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_rule_declaration_serialize_name(const lxb_css_rule_declaration_t *declr, + lexbor_serialize_cb_f cb, void *ctx) +{ + return lxb_css_property_serialize_name(declr->u.user, declr->type, cb, ctx); +} diff --git a/ext/dom/lexbor/lexbor/css/rule.h b/ext/dom/lexbor/lexbor/css/rule.h index bd191f9b6519..d192a0161ccd 100644 --- a/ext/dom/lexbor/lexbor/css/rule.h +++ b/ext/dom/lexbor/lexbor/css/rule.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -46,9 +46,6 @@ struct lxb_css_rule { lxb_css_rule_t *prev; lxb_css_rule_t *parent; - const lxb_char_t *begin; - const lxb_char_t *end; - lxb_css_memory_t *memory; size_t ref_count; }; @@ -68,10 +65,15 @@ struct lxb_css_rule_at { union { lxb_css_at_rule__undef_t *undef; lxb_css_at_rule__custom_t *custom; + lxb_css_at_rule_font_face_t *font_face; lxb_css_at_rule_media_t *media; lxb_css_at_rule_namespace_t *ns; void *user; } u; + + size_t name_begin; + size_t prelude_begin; + size_t prelude_end; }; struct lxb_css_rule_style { @@ -79,6 +81,10 @@ struct lxb_css_rule_style { lxb_css_selector_list_t *selector; lxb_css_rule_declaration_list_t *declarations; + lxb_css_rule_list_t *child; + + size_t prelude_begin; + size_t prelude_end; }; struct lxb_css_rule_bad_style { @@ -86,6 +92,10 @@ struct lxb_css_rule_bad_style { lexbor_str_t selectors; lxb_css_rule_declaration_list_t *declarations; + lxb_css_rule_list_t *child; + + size_t prelude_begin; + size_t prelude_end; }; struct lxb_css_rule_declaration_list { @@ -97,6 +107,16 @@ struct lxb_css_rule_declaration_list { size_t count; }; +typedef struct { + size_t name_begin; + size_t name_end; + size_t value_begin; + size_t value_end; + size_t important_begin; + size_t important_end; +} +lxb_css_rule_declaration_offset_t; + struct lxb_css_rule_declaration { lxb_css_rule_t rule; uintptr_t type; @@ -204,7 +224,9 @@ struct lxb_css_rule_declaration { void *user; } u; - bool important; + lxb_css_rule_declaration_offset_t offset; + + bool important; }; diff --git a/ext/dom/lexbor/lexbor/css/selectors/base.h b/ext/dom/lexbor/lexbor/css/selectors/base.h index 279c1e5f68c3..3151f74b04ee 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/base.h +++ b/ext/dom/lexbor/lexbor/css/selectors/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Alexander Borisov + * Copyright (C) 2021-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -16,7 +16,7 @@ extern "C" { #define LXB_CSS_SELECTORS_VERSION_MAJOR 1 -#define LXB_CSS_SELECTORS_VERSION_MINOR 1 +#define LXB_CSS_SELECTORS_VERSION_MINOR 3 #define LXB_CSS_SELECTORS_VERSION_PATCH 0 #define LXB_CSS_SELECTORS_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/css/selectors/pseudo_const.h b/ext/dom/lexbor/lexbor/css/selectors/pseudo_const.h index 2b19f1888147..9fa5bb2177c7 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/pseudo_const.h +++ b/ext/dom/lexbor/lexbor/css/selectors/pseudo_const.h @@ -69,15 +69,16 @@ typedef enum { LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS = 0x0003, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS = 0x0004, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG = 0x0005, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT = 0x0006, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD = 0x0007, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL = 0x0008, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD = 0x0009, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL = 0x000a, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE = 0x000b, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE = 0x000c, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE = 0x000d, - LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION__LAST_ENTRY = 0x000e + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LEXBOR_CONTAINS = 0x0006, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT = 0x0007, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD = 0x0008, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL = 0x0009, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD = 0x000a, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL = 0x000b, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE = 0x000c, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE = 0x000d, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE = 0x000e, + LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION__LAST_ENTRY = 0x000f } lxb_css_selector_pseudo_class_function_id_t; diff --git a/ext/dom/lexbor/lexbor/css/selectors/pseudo_res.h b/ext/dom/lexbor/lexbor/css/selectors/pseudo_res.h index 5ae6e048064c..108257406069 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/pseudo_res.h +++ b/ext/dom/lexbor/lexbor/css/selectors/pseudo_res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -68,60 +68,64 @@ static const lxb_css_selectors_pseudo_data_func_t lxb_css_selectors_pseudo_data_ { {(lxb_char_t *) "#undef", 6, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION__UNDEF, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function__undef, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function__undef, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "current", 7, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_current, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_current, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, true}, {(lxb_char_t *) "dir", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_dir, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_dir, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "has", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS, false, LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT, - {.state = lxb_css_selectors_state_pseudo_class_function_has, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving_relative}, true, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_has, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_forgiving_relative}, true, true}, {(lxb_char_t *) "is", 2, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_is, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, true, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_is, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_forgiving}, true, true}, {(lxb_char_t *) "lang", 4, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_lang, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_lang, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, + {(lxb_char_t *) "lexbor-contains", 15, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LEXBOR_CONTAINS, + false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, + {.value = lxb_css_selectors_state_pseudo_class_function_lexbor_contains, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "not", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_not, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_not, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, true}, {(lxb_char_t *) "nth-child", 9, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_child, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_child, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, true}, {(lxb_char_t *) "nth-col", 7, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_col, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_col, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "nth-last-child", 14, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_last_child, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_last_child, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, true}, {(lxb_char_t *) "nth-last-col", 12, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_last_col, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_last_col, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "nth-last-of-type", 16, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_last_of_type, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_last_of_type, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "nth-of-type", 11, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_nth_of_type, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}, + {.value = lxb_css_selectors_state_pseudo_class_function_nth_of_type, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false}, {(lxb_char_t *) "where", 5, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_class_function_where, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, true, true} + {.value = lxb_css_selectors_state_pseudo_class_function_where, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_forgiving}, true, true} }; static const lxb_css_selectors_pseudo_data_t lxb_css_selectors_pseudo_data_pseudo_element[LXB_CSS_SELECTOR_PSEUDO_ELEMENT__LAST_ENTRY] = @@ -145,8 +149,8 @@ static const lxb_css_selectors_pseudo_data_func_t lxb_css_selectors_pseudo_data_ { {(lxb_char_t *) "#undef", 6, LXB_CSS_SELECTOR_PSEUDO_ELEMENT_FUNCTION__UNDEF, false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE, - {.state = lxb_css_selectors_state_pseudo_element_function__undef, .block = NULL, - .failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false} + {.value = lxb_css_selectors_state_pseudo_element_function__undef, + .cb.failed = lxb_css_state_failed, .cb.end = lxb_css_selectors_state_function_end}, false, false} }; static const lexbor_shs_entry_t lxb_css_selectors_pseudo_class_shs[79] = @@ -232,46 +236,50 @@ static const lexbor_shs_entry_t lxb_css_selectors_pseudo_class_shs[79] = {NULL, NULL, 0, 0} }; -static const lexbor_shs_entry_t lxb_css_selectors_pseudo_class_function_shs[39] = +static const lexbor_shs_entry_t lxb_css_selectors_pseudo_class_function_shs[43] = { - {NULL, NULL, 38, 0}, + {NULL, NULL, 42, 0}, + {"nth-last-of-type", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE], 16, 0}, {NULL, NULL, 0, 0}, - {"current", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT], 7, 0}, {NULL, NULL, 0, 0}, - {"dir", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR], 3, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, + {"not", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT], 3, 0}, {NULL, NULL, 0, 0}, - {"is", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS], 2, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"nth-child", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD], 9, 0}, {NULL, NULL, 0, 0}, + {"has", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS], 3, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"nth-last-child", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD], 14, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, + {"nth-col", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL], 7, 0}, {NULL, NULL, 0, 0}, - {"where", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE], 5, 0}, + {"lexbor-contains", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LEXBOR_CONTAINS], 15, 0}, + {NULL, NULL, 0, 0}, + {"is", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS], 2, 0}, + {"nth-last-col", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL], 12, 0}, + {"current", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT], 7, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"nth-col", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL], 7, 0}, {"lang", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG], 4, 0}, - {"has", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS], 3, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"nth-last-col", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL], 12, 0}, - {"nth-of-type", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE], 11, 0}, + {"nth-child", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD], 9, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"not", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT], 3, 0}, - {"nth-last-of-type", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE], 16, 0}, + {NULL, NULL, 0, 0}, + {"nth-last-child", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD], 14, 0}, + {"nth-of-type", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE], 11, 0}, + {NULL, NULL, 0, 0}, + {"dir", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR], 3, 0}, + {"where", (void *) &lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE], 5, 0}, {NULL, NULL, 0, 0} }; diff --git a/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.c b/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.c index f40b089d1300..263ca52f35e4 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.c +++ b/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -27,10 +27,9 @@ lxb_css_selectors_state_pseudo_of_back(lxb_css_parser_t *parser, static const lxb_css_syntax_cb_components_t lxb_css_selectors_comp = { - .state = lxb_css_selectors_state_complex_list, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_state_pseudo_of_end + .prelude = lxb_css_selectors_state_complex_list, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_state_pseudo_of_end }; @@ -182,6 +181,117 @@ lxb_css_selectors_state_pseudo_element_function__undef(lxb_css_parser_t *parser, return true; } +bool +lxb_css_selectors_state_pseudo_class_function_lexbor_contains(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_selectors_t *selectors; + lxb_css_selector_t *selector; + lxb_css_selector_contains_t *contains; + lexbor_str_t *str; + const lxb_char_t *data; + size_t length; + + selectors = parser->selectors; + selector = selectors->list_last->last; + +again: + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_STRING: + data = token->types.string.data; + length = token->types.string.length; + break; + + case LXB_CSS_SYNTAX_TOKEN_IDENT: + data = token->types.ident.data; + length = token->types.ident.length; + break; + + case LXB_CSS_SYNTAX_TOKEN_WHITESPACE: + lxb_css_syntax_parser_consume(parser); + lxb_css_parser_token_status_m(parser, token); + goto again; + + default: + lxb_css_parser_unexpected_data(parser, token); + return lxb_css_parser_failed(parser); + } + + contains = lexbor_mraw_alloc(parser->memory->mraw, + sizeof(lxb_css_selector_contains_t)); + if (contains == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + contains->insensitive = false; + str = &contains->str; + + str->data = lexbor_mraw_alloc(parser->memory->mraw, + sizeof(lexbor_str_t)); + if (str->data == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + memcpy(str->data, data, length + 1); + + str->length = length; + str->data[length] = '\0'; + + selector->u.pseudo.data = contains; + +again_end: + + lxb_css_syntax_parser_consume(parser); + lxb_css_parser_token_status_m(parser, token); + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN__END: + break; + + case LXB_CSS_SYNTAX_TOKEN_WHITESPACE: + goto again_end; + + case LXB_CSS_SYNTAX_TOKEN_IDENT: + data = token->types.ident.data; + length = token->types.ident.length; + + if (length == 1 && (*data == 'i' || *data == 'I')) { + contains->insensitive = true; + + lxb_css_syntax_parser_consume(parser); + lxb_css_parser_token_status_m(parser, token); + + if (token->type == LXB_CSS_SYNTAX_TOKEN_WHITESPACE) { + lxb_css_syntax_parser_consume(parser); + lxb_css_parser_token_status_m(parser, token); + } + + if (token->type != LXB_CSS_SYNTAX_TOKEN__END) { + goto failed; + } + + break; + } + /* Fall through. */ + + default: + goto failed; + } + + parser->selectors->list = NULL; + + return lxb_css_parser_success(parser); + +failed: + + lexbor_mraw_free(parser->memory->mraw, contains->str.data); + lexbor_mraw_free(parser->memory->mraw, contains); + + lxb_css_parser_unexpected_data(parser, token); + return lxb_css_parser_failed(parser); +} + static bool lxb_css_selectors_state_pseudo_anb(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, @@ -268,10 +378,14 @@ lxb_css_selectors_state_pseudo_of_begin(lxb_css_parser_t *parser, return lxb_css_parser_memory_fail(parser); } - rule = lxb_css_syntax_parser_components_push(parser, token, + rule = lxb_css_syntax_parser_components_push(parser, + &lxb_css_selectors_comp, lxb_css_selectors_state_pseudo_of_back, - &lxb_css_selectors_comp, list, - LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); + list, LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); +// rule = lxb_css_syntax_parser_components_push(parser, token, +// lxb_css_selectors_state_pseudo_of_back, +// &lxb_css_selectors_comp, list, +// LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); if (rule == NULL) { lexbor_mraw_free(parser->memory->mraw, list->last->u.pseudo.data); diff --git a/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.h b/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.h index 5c5a31f94585..652e455f1f13 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.h +++ b/ext/dom/lexbor/lexbor/css/selectors/pseudo_state.h @@ -77,6 +77,10 @@ LXB_API bool lxb_css_selectors_state_pseudo_element_function__undef(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx); +LXB_API bool +lxb_css_selectors_state_pseudo_class_function_lexbor_contains(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/css/selectors/selector.c b/ext/dom/lexbor/lexbor/css/selectors/selector.c index e8bf96ba88cf..160d19fa45a2 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/selector.c +++ b/ext/dom/lexbor/lexbor/css/selectors/selector.c @@ -638,11 +638,45 @@ lxb_css_selector_serialize_class(lxb_css_selector_t *selector, return LXB_STATUS_OK; } +static lxb_status_t +lxb_css_selector_serialize_escape_write(lxb_char_t *p, lxb_char_t *end, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_char_t *begin; + lxb_status_t status; + + begin = p; + + lxb_css_selector_serialize_write("\"", 1); + + while (p < end) { + if (*p == '"') { + if (begin < p) { + lxb_css_selector_serialize_write(begin, p - begin); + } + + lxb_css_selector_serialize_write("\\000022", 7); + + begin = p + 1; + } + + p++; + } + + if (begin < p) { + lxb_css_selector_serialize_write(begin, p - begin); + } + + lxb_css_selector_serialize_write("\"", 1); + + return LXB_STATUS_OK; +} + static lxb_status_t lxb_css_selector_serialize_attribute(lxb_css_selector_t *selector, lexbor_serialize_cb_f cb, void *ctx) { - lxb_char_t *p, *begin, *end; + lxb_char_t *p, *end; lxb_status_t status; lxb_css_selector_attribute_t *attr; @@ -686,30 +720,11 @@ lxb_css_selector_serialize_attribute(lxb_css_selector_t *selector, p = attr->value.data; end = attr->value.data + attr->value.length; - begin = p; - - lxb_css_selector_serialize_write("\"", 1); - - while (p < end) { - if (*p == '"') { - if (begin < p) { - lxb_css_selector_serialize_write(begin, p - begin); - } - - lxb_css_selector_serialize_write("\\000022", 7); - - begin = p + 1; - } - - p++; - } - - if (begin < p) { - lxb_css_selector_serialize_write(begin, p - begin); + status = lxb_css_selector_serialize_escape_write(p, end, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; } - lxb_css_selector_serialize_write("\"", 1); - if (attr->modifier != LXB_CSS_SELECTOR_MODIFIER_UNSET) { switch (attr->modifier) { case LXB_CSS_SELECTOR_MODIFIER_I: @@ -740,7 +755,9 @@ lxb_css_selector_serialize_pseudo_class_function(lxb_css_selector_t *selector, lexbor_serialize_cb_f cb, void *ctx) { lxb_status_t status; + lxb_char_t *p, *end; lxb_css_selector_pseudo_t *pseudo; + lxb_css_selector_contains_t *contains; const lxb_css_selectors_pseudo_data_func_t *pfunc; pseudo = &selector->u.pseudo; @@ -789,6 +806,22 @@ lxb_css_selector_serialize_pseudo_class_function(lxb_css_selector_t *selector, cb, ctx); break; + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LEXBOR_CONTAINS: + contains = pseudo->data; + p = contains->str.data; + end = p + contains->str.length; + + status = lxb_css_selector_serialize_escape_write(p, end, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (contains->insensitive) { + lxb_css_selector_serialize_write(" i", 2); + } + + break; + default: status = LXB_STATUS_OK; break; diff --git a/ext/dom/lexbor/lexbor/css/selectors/selector.h b/ext/dom/lexbor/lexbor/css/selectors/selector.h index 52dbabc7ba5c..1862c868c8ce 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/selector.h +++ b/ext/dom/lexbor/lexbor/css/selectors/selector.h @@ -80,6 +80,12 @@ typedef struct { } lxb_css_selector_anb_of_t; +typedef struct { + lexbor_str_t str; + bool insensitive; +} +lxb_css_selector_contains_t; + struct lxb_css_selector { lxb_css_selector_type_t type; lxb_css_selector_combinator_t combinator; diff --git a/ext/dom/lexbor/lexbor/css/selectors/selectors.c b/ext/dom/lexbor/lexbor/css/selectors/selectors.c index 52537873ef08..77586f4a65c6 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/selectors.c +++ b/ext/dom/lexbor/lexbor/css/selectors/selectors.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -20,59 +20,51 @@ lxb_css_selectors_components_end(lxb_css_parser_t *parser, static const lxb_css_syntax_cb_components_t lxb_css_selectors_complex_list_cb = { - .state = lxb_css_selectors_state_complex_list, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_complex_list, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_compound_list_cb = { - .state = lxb_css_selectors_state_compound_list, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_compound_list, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_simple_list_cb = { - .state = lxb_css_selectors_state_simple_list, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_simple_list, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_relative_list_cb = { - .state = lxb_css_selectors_state_relative_list, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_relative_list, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_complex_cb = { - .state = lxb_css_selectors_state_complex, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_complex, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_compound_cb = { - .state = lxb_css_selectors_state_compound, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_compound, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_simple_cb = { - .state = lxb_css_selectors_state_simple, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_simple, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; static const lxb_css_syntax_cb_components_t lxb_css_selectors_relative_cb = { - .state = lxb_css_selectors_state_relative, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_selectors_components_end + .prelude = lxb_css_selectors_state_relative, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_selectors_components_end }; @@ -170,9 +162,7 @@ lxb_css_selectors_parse_relative_list(lxb_css_parser_t *parser, } static lxb_status_t -lxb_css_selectors_parse_prepare(lxb_css_parser_t *parser, - lxb_css_memory_t *memory, - lxb_css_selectors_t *selectors) +lxb_css_selectors_parse_prepare(lxb_css_parser_t *parser) { if (parser->stage != LXB_CSS_PARSER_CLEAN) { if (parser->stage == LXB_CSS_PARSER_RUN) { @@ -185,12 +175,6 @@ lxb_css_selectors_parse_prepare(lxb_css_parser_t *parser, parser->tkz->with_comment = false; parser->stage = LXB_CSS_PARSER_RUN; - parser->old_memory = parser->memory; - parser->old_selectors = parser->selectors; - - parser->memory = memory; - parser->selectors = selectors; - return LXB_STATUS_OK; } @@ -203,8 +187,7 @@ lxb_css_selectors_parse_process(lxb_css_parser_t *parser, lxb_css_parser_buffer_set(parser, data, length); - rule = lxb_css_syntax_parser_components_push(parser, NULL, NULL, - components, NULL, + rule = lxb_css_syntax_parser_components_push(parser, components, NULL, NULL, LXB_CSS_SYNTAX_TOKEN_UNDEF); if (rule == NULL) { return NULL; @@ -222,9 +205,6 @@ static void lxb_css_selectors_parse_finish(lxb_css_parser_t *parser) { parser->stage = LXB_CSS_PARSER_END; - - parser->memory = parser->old_memory; - parser->selectors = parser->old_selectors; } static lxb_css_selector_list_t * @@ -232,41 +212,45 @@ lxb_css_selectors_parse_list(lxb_css_parser_t *parser, const lxb_css_syntax_cb_components_t *components, const lxb_char_t *data, size_t length) { - lxb_css_memory_t *memory; - lxb_css_selectors_t *selectors; + bool my_mem, my_selectors; lxb_css_selector_list_t *list; - memory = parser->memory; - selectors = parser->selectors; + my_mem = false; + my_selectors = false; - if (selectors == NULL) { - selectors = lxb_css_selectors_create(); - parser->status = lxb_css_selectors_init(selectors); + if (parser->selectors == NULL) { + parser->selectors = lxb_css_selectors_create(); + parser->status = lxb_css_selectors_init(parser->selectors); if (parser->status != LXB_STATUS_OK) { - (void) lxb_css_selectors_destroy(selectors, true); + (void) lxb_css_selectors_destroy(parser->selectors, true); return NULL; } + + my_selectors = true; } else { - lxb_css_selectors_clean(selectors); + lxb_css_selectors_clean(parser->selectors); } - if (memory == NULL) { - memory = lxb_css_memory_create(); - parser->status = lxb_css_memory_init(memory, 256); + if (parser->memory == NULL) { + parser->memory = lxb_css_memory_create(); + parser->status = lxb_css_memory_init(parser->memory, 256); if (parser->status != LXB_STATUS_OK) { - if (selectors != parser->selectors) { - (void) lxb_css_selectors_destroy(selectors, true); + if (my_selectors) { + parser->selectors = lxb_css_selectors_destroy(parser->selectors, + true); } - (void) lxb_css_memory_destroy(memory, true); + (void) lxb_css_memory_destroy(parser->memory, true); return NULL; } + + my_mem = true; } - parser->status = lxb_css_selectors_parse_prepare(parser, memory, selectors); + parser->status = lxb_css_selectors_parse_prepare(parser); if (parser->status != LXB_STATUS_OK) { list = NULL; goto end; @@ -278,12 +262,12 @@ lxb_css_selectors_parse_list(lxb_css_parser_t *parser, end: - if (list == NULL && memory != parser->memory) { - (void) lxb_css_memory_destroy(memory, true); + if (list == NULL && my_mem) { + parser->memory = lxb_css_memory_destroy(parser->memory, true); } - if (selectors != parser->selectors) { - (void) lxb_css_selectors_destroy(selectors, true); + if (my_selectors) { + parser->selectors = lxb_css_selectors_destroy(parser->selectors, true); } return list; diff --git a/ext/dom/lexbor/lexbor/css/selectors/state.c b/ext/dom/lexbor/lexbor/css/selectors/state.c index 873e7d31cfda..1f0a391ac29a 100644 --- a/ext/dom/lexbor/lexbor/css/selectors/state.c +++ b/ext/dom/lexbor/lexbor/css/selectors/state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -1557,8 +1557,8 @@ lxb_css_selectors_state_pseudo_class_function(lxb_css_parser_t *parser, selectors->comb_default = func->combinator; selectors->parent = selector; - rule = lxb_css_syntax_parser_function_push(parser, token, success, - &func->cb, selectors->list_last); + rule = lxb_css_syntax_consume_function(parser, token, &func->cb, + success, selectors->list_last); if (rule == NULL) { goto failed; } @@ -1663,8 +1663,8 @@ lxb_css_selectors_state_pseudo_element_function(lxb_css_parser_t *parser, selectors->comb_default = func->combinator; selectors->parent = selector; - rule = lxb_css_syntax_parser_function_push(parser, token, success, - &func->cb, selectors->list_last); + rule = lxb_css_syntax_consume_function(parser, token, &func->cb, + success, selectors->list_last); if (rule == NULL) { (void) lxb_css_parser_memory_fail(parser); return parser->status; @@ -1711,7 +1711,7 @@ lxb_css_selectors_state_function_end(lxb_css_parser_t *parser, lxb_css_selectors_t *selectors = parser->selectors; if (token->type == LXB_CSS_SYNTAX_TOKEN__EOF) { - (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_ERROR, + (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_SYNTAX_ERROR, "%s. End Of File in pseudo function", lxb_css_selectors_module_name); } @@ -1737,7 +1737,7 @@ lxb_css_selectors_state_function_end(lxb_css_parser_t *parser, return LXB_STATUS_OK; } - (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_ERROR, + (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_SYNTAX_ERROR, "%s. Pseudo function can't be empty: %S()", lxb_css_selectors_module_name, &selector->name); @@ -1783,7 +1783,7 @@ lxb_css_selectors_state_forgiving_cb(lxb_css_parser_t *parser, lxb_css_parser_set_ok(parser); if (token->type == LXB_CSS_SYNTAX_TOKEN__EOF) { - (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_ERROR, + (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_SYNTAX_ERROR, "%s. End Of File in pseudo function", lxb_css_selectors_module_name); } @@ -1814,7 +1814,7 @@ lxb_css_selectors_state_forgiving_cb(lxb_css_parser_t *parser, return LXB_STATUS_OK; } - (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_ERROR, + (void) lxb_css_log_format(parser->log, LXB_CSS_LOG_SYNTAX_ERROR, "%s. Pseudo function can't be empty: %S()", lxb_css_selectors_module_name, &selector->name); diff --git a/ext/dom/lexbor/lexbor/css/state.c b/ext/dom/lexbor/lexbor/css/state.c index 15a9614948f2..dda5310a9676 100644 --- a/ext/dom/lexbor/lexbor/css/state.c +++ b/ext/dom/lexbor/lexbor/css/state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -9,6 +9,143 @@ #include "lexbor/css/at_rule/state.h" +static bool +lxb_css_state_list_rules_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +static lxb_status_t +lxb_css_state_list_rules_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_at_rule_t * +lxb_css_state_at_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx, + void **out_rule); + +static bool +lxb_css_state_at_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); + +static lxb_status_t +lxb_css_state_at_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); +static bool +lxb_css_state_at_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +static lxb_status_t +lxb_css_state_at_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_state_qualified_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static bool +lxb_css_state_qualified_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); + +static lxb_status_t +lxb_css_state_qualified_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_block_t * +lxb_css_state_qualified_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static bool +lxb_css_state_qualified_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx); +static lxb_status_t +lxb_css_state_qualified_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); +static bool +lxb_css_state_block_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +static lxb_status_t +lxb_css_state_block_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static const lxb_css_syntax_cb_declarations_t * +lxb_css_state_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static lxb_css_parser_state_f +lxb_css_state_declaration_name(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +static lxb_status_t +lxb_css_state_declaration_end(lxb_css_parser_t *parser, + void *declarations, void *ctx, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_declaration_offset_t *offset, + bool important, bool failed); + +static lxb_status_t +lxb_css_state_declarations_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed); + +static bool +lxb_css_state_declarations_bad(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + + +static const lxb_css_syntax_cb_list_rules_t lxb_css_state_list_rules = { + .at_rule = lxb_css_state_at_rule_begin, + .qualified_rule = lxb_css_state_qualified_rule_begin, + .next = lxb_css_state_list_rules_next, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_state_list_rules_end +}; + +static const lxb_css_syntax_cb_at_rule_t lxb_css_state_at_rule = { + .prelude = lxb_css_state_at_rule_prelude, + .prelude_end = lxb_css_state_at_rule_prelude_end, + .block = lxb_css_state_at_rule_block_begin, + .cb.failed = lxb_css_state_at_rule_prelude_failed, + .cb.end = lxb_css_state_at_rule_end +}; + +static const lxb_css_syntax_cb_qualified_rule_t lxb_css_state_qualified_rule = { + .prelude = lxb_css_state_qualified_rule_prelude, + .prelude_end = lxb_css_state_qualified_rule_prelude_end, + .block = lxb_css_state_qualified_rule_block_begin, + .cb.failed = lxb_css_state_qualified_rule_prelude_failed, + .cb.end = lxb_css_state_qualified_rule_end +}; + +static const lxb_css_syntax_cb_block_t lxb_css_state_block = { + .at_rule = lxb_css_state_at_rule_begin, + .declarations = lxb_css_state_declarations_begin, + .qualified_rule = lxb_css_state_qualified_rule_begin, + .next = lxb_css_state_block_next, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_state_block_end, +}; + +static const lxb_css_syntax_cb_declarations_t lxb_css_state_declaration = { + .name = lxb_css_state_declaration_name, + .end = lxb_css_state_declaration_end, + .cb.failed = lxb_css_state_declarations_bad, + .cb.end = lxb_css_state_declarations_end +}; + + bool lxb_css_state_success(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx) @@ -49,3 +186,491 @@ lxb_css_state_stop(lxb_css_parser_t *parser, { return lxb_css_parser_stop(parser); } + +bool +lxb_css_state_blank(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + return lxb_css_parser_success(parser); +} + +const lxb_css_syntax_cb_list_rules_t * +lxb_css_state_cb_list_rules(void) +{ + return &lxb_css_state_list_rules; +} + +const lxb_css_syntax_cb_at_rule_t * +lxb_css_state_cb_at_rule(void) +{ + return &lxb_css_state_at_rule; +} + +const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_state_cb_qualified_rule(void) +{ + return &lxb_css_state_qualified_rule; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_state_cb_block(void) +{ + return &lxb_css_state_block; +} + +const lxb_css_syntax_cb_declarations_t * +lxb_css_state_cb_declarations(void) +{ + return &lxb_css_state_declaration; +} + +static bool +lxb_css_state_list_rules_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + void *returned = lxb_css_syntax_returned(parser); + lxb_css_rule_list_t *list = ctx; + + if (returned != NULL) { + lxb_css_rule_list_append(list, returned); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_state_list_rules_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_list_t *list = ctx; + + lxb_css_syntax_set_return(parser, list); + + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_at_rule_t * +lxb_css_state_at_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx, + void **out_rule) +{ + lxb_css_rule_at_t *at; + const lxb_css_entry_at_rule_data_t *entry; + + at = lxb_css_at_rule_create(parser, lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length, + &entry); + if (at == NULL) { + return lxb_css_parser_memory_fail_null(parser); + } + + *out_rule = at; + + return entry->cbs; +} + +static bool +lxb_css_state_at_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_rule_at_t *at = ctx; + + at->prelude_begin = token->offset; + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_state_at_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_status_t status; + lxb_css_rule_at_t *at = ctx; + lxb_css_at_rule__custom_t *custom; + + at->prelude_end = token->offset; + + custom = at->u.custom; + + status = lxb_css_make_data(parser, &custom->prelude, at->prelude_begin, + at->prelude_end); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail_status(parser); + } + + return LXB_STATUS_OK; +} + +const lxb_css_syntax_cb_block_t * +lxb_css_state_at_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + lxb_css_rule_list_t *list; + + list = lxb_css_rule_list_create(parser->memory); + if (list == NULL) { + return lxb_css_parser_memory_fail_null(parser); + } + + *out_rule = list; + + return &lxb_css_state_block; +} + +static bool +lxb_css_state_at_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_state_at_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_at_t *at = ctx; + lxb_css_rule_list_t *block = lxb_css_syntax_returned(parser); + + at->u.custom->block = block; + + lxb_css_syntax_set_return(parser, at); + + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_state_qualified_rule_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + lxb_css_rule_style_t *style; + + style = lxb_css_rule_style_create(parser->memory); + if (style == NULL) { + return lxb_css_parser_memory_fail_null(parser); + } + + *out_rule = style; + + return &lxb_css_state_qualified_rule; +} + +static bool +lxb_css_state_qualified_rule_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + lxb_css_rule_style_t *style = ctx; + + lxb_css_selectors_clean(parser->selectors); + lxb_css_parser_state_set(parser, lxb_css_selectors_state_complex_list); + + style->prelude_begin = token->offset; + + return false; +} + +static lxb_status_t +lxb_css_state_qualified_rule_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + size_t begin; + lxb_status_t status; + lxb_css_rule_style_t *style = ctx; + lxb_css_rule_bad_style_t *bad; + + if (!failed) { + style->selector = parser->selectors->list; + style->prelude_end = token->offset; + + return LXB_STATUS_OK; + } + + begin = style->prelude_begin; + + (void) lxb_css_rule_style_destroy(style, true); + + bad = lxb_css_rule_bad_style_create(parser->memory); + if (bad == NULL) { + return lxb_css_parser_memory_fail_status(parser); + } + + bad->prelude_begin = begin; + bad->prelude_end = token->offset; + + status = lxb_css_make_data(parser, &bad->selectors, bad->prelude_begin, + bad->prelude_end); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail_status(parser); + } + + lxb_css_parser_set_context(parser, bad); + + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_block_t * +lxb_css_state_qualified_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + lxb_css_rule_list_t *list; + + list = lxb_css_rule_list_create(parser->memory); + if (list == NULL) { + return lxb_css_parser_memory_fail_null(parser); + } + + *out_rule = list; + + return &lxb_css_state_block; +} + +static bool +lxb_css_state_qualified_rule_prelude_failed(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx) +{ + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_state_qualified_rule_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_t *declrs; + lxb_css_rule_list_t *list; + lxb_css_rule_style_t *style; + lxb_css_rule_bad_style_t *bad; + + list = lxb_css_syntax_returned(parser); + + if (!failed) { + style = ctx; + + if (list != NULL && list->first != NULL + && list->first->type == LXB_CSS_RULE_DECLARATION_LIST) + { + declrs = list->first; + style->declarations = lxb_css_rule_declaration_list(declrs); + + declrs->parent = lxb_css_rule(style); + + if (list->first == list->last) { + list->last = NULL; + } + + if (declrs->next != NULL) { + declrs->next->prev = NULL; + } + + list->first = declrs->next; + declrs->next = NULL; + } + + style->child = list; + + lxb_css_syntax_set_return(parser, style); + } + else { + bad = ctx; + + if (list != NULL && list->first != NULL + && list->first->type == LXB_CSS_RULE_DECLARATION_LIST) + { + declrs = list->first; + bad->declarations = lxb_css_rule_declaration_list(declrs); + + declrs->parent = lxb_css_rule(bad); + + if (list->first == list->last) { + list->last = NULL; + } + + if (declrs->next != NULL) { + declrs->next->prev = NULL; + } + + list->first = declrs->next; + declrs->next = NULL; + } + + bad->child = list; + + lxb_css_syntax_set_return(parser, bad); + } + + return LXB_STATUS_OK; +} + +static bool +lxb_css_state_block_next(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + /* rule can be either a declaration list or an at rule. */ + + lxb_css_rule_t *rule = lxb_css_syntax_returned(parser); + lxb_css_rule_list_t *list = ctx; + + lxb_css_rule_list_append(list, rule); + + return lxb_css_parser_success(parser); +} + +static lxb_status_t +lxb_css_state_block_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_list_t *list = ctx; + + lxb_css_syntax_set_return(parser, list); + + return LXB_STATUS_OK; +} + +static const lxb_css_syntax_cb_declarations_t * +lxb_css_state_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + lxb_css_rule_declaration_list_t *list; + + list = lxb_css_rule_declaration_list_create(parser->memory); + if (list == NULL) { + return lxb_css_parser_memory_fail_null(parser); + } + + *out_rule = list; + + return &lxb_css_state_declaration; +} + +static lxb_css_parser_state_f +lxb_css_state_declaration_name(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule) +{ + const lxb_css_entry_data_t *entry; + lxb_css_rule_declaration_t *declar; + + declar = lxb_css_declaration_create(parser, + lxb_css_syntax_token_ident(token)->data, + lxb_css_syntax_token_ident(token)->length, + &entry); + if (declar == NULL) { + (void) lxb_css_parser_memory_fail_null(parser); + return NULL; + } + + /* We present an original position. */ + + declar->offset.name_begin = token->offset; + declar->offset.name_end = token->offset + + lxb_css_syntax_token_base(token)->length; + *out_rule = declar; + + return entry->state; +} + +static lxb_status_t +lxb_css_state_declaration_end(lxb_css_parser_t *parser, + void *declarations, void *ctx, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_declaration_offset_t *offset, + bool important, bool failed) +{ + lxb_status_t status; + lxb_css_property__undef_t *undef; + lxb_css_rule_declaration_t *declar = ctx; + lxb_css_rule_declaration_list_t *list = declarations; + + declar->offset.value_begin = offset->value_begin; + declar->offset.value_end = offset->value_end; + declar->offset.important_begin = offset->important_begin; + declar->offset.important_end = offset->important_end; + declar->important = important; + + if (failed) { + lxb_css_rule_declaration_destroy(declar, false); + + undef = lxb_css_property__undef_create(parser->memory); + if (undef == NULL) { + return lxb_css_parser_memory_fail_status(parser); + } + + undef->type = declar->type; + + status = lxb_css_make_data(parser, &undef->value, + declar->offset.value_begin, + declar->offset.value_end); + if (status != LXB_STATUS_OK) { + return lxb_css_parser_memory_fail_status(parser); + } + + declar->u.undef = undef; + declar->type = LXB_CSS_PROPERTY__UNDEF; + } + + lxb_css_rule_declaration_list_append(list, lxb_css_rule(declar)); + + return LXB_STATUS_OK; +} + +static lxb_status_t +lxb_css_state_declarations_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, bool failed) +{ + lxb_css_rule_declaration_list_t *list = ctx; + + lxb_css_syntax_set_return(parser, list); + + return LXB_STATUS_OK; +} + +static bool +lxb_css_state_declarations_bad(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx) +{ + lxb_css_rule_declaration_t *declar; + + if (ctx == NULL) { + declar = lxb_css_rule_declaration_create(parser->memory); + if (declar == NULL) { + return lxb_css_parser_memory_fail(parser); + } + + lxb_css_parser_current_rule(parser)->context = declar; + declar->type = LXB_CSS_PROPERTY__UNDEF; + } + + while (token != NULL && token->type != LXB_CSS_SYNTAX_TOKEN__END) { + lxb_css_syntax_parser_consume(parser); + token = lxb_css_syntax_parser_token(parser); + } + + return lxb_css_parser_success(parser); +} diff --git a/ext/dom/lexbor/lexbor/css/state.h b/ext/dom/lexbor/lexbor/css/state.h index 0a2abd803634..6ecd50343928 100644 --- a/ext/dom/lexbor/lexbor/css/state.h +++ b/ext/dom/lexbor/lexbor/css/state.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,6 +12,7 @@ extern "C" { #endif #include "lexbor/css/base.h" +#include "lexbor/css/syntax/syntax.h" LXB_API bool @@ -26,6 +27,30 @@ LXB_API bool lxb_css_state_stop(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx); +LXB_API bool +lxb_css_state_blank(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, void *ctx); + +LXB_API const lxb_css_syntax_cb_list_rules_t * +lxb_css_state_cb_list_rules(void); + +LXB_API const lxb_css_syntax_cb_at_rule_t * +lxb_css_state_cb_at_rule(void); + +LXB_API const lxb_css_syntax_cb_qualified_rule_t * +lxb_css_state_cb_qualified_rule(void); + +LXB_API const lxb_css_syntax_cb_block_t * +lxb_css_state_cb_block(void); + +LXB_API const lxb_css_syntax_cb_declarations_t * +lxb_css_state_cb_declarations(void); + +const lxb_css_syntax_cb_block_t * +lxb_css_state_at_rule_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/css/stylesheet.c b/ext/dom/lexbor/lexbor/css/stylesheet.c new file mode 100644 index 000000000000..f03f145721c4 --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/stylesheet.c @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2021-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/css.h" +#include "lexbor/css/stylesheet.h" +#include "lexbor/css/parser.h" +#include "lexbor/css/at_rule.h" +#include "lexbor/css/property.h" +#include "lexbor/css/rule.h" +#include "lexbor/css/state.h" +#include "lexbor/css/selectors/selectors.h" +#include "lexbor/css/selectors/state.h" + + +lxb_css_stylesheet_t * +lxb_css_stylesheet_create(lxb_css_memory_t *memory) +{ + lxb_status_t status; + lxb_css_stylesheet_t *stylesheet; + + if (memory == NULL) { + memory = lxb_css_memory_create(); + status = lxb_css_memory_init(memory, 1024); + + if (status != LXB_STATUS_OK) { + (void) lxb_css_memory_destroy(memory, true); + return NULL; + } + } + else { + (void) lxb_css_memory_ref_inc(memory); + } + + stylesheet = lexbor_mraw_calloc(memory->mraw, sizeof(lxb_css_stylesheet_t)); + if (stylesheet == NULL) { + return NULL; + } + + stylesheet->memory = memory; + + return stylesheet; +} + +lxb_css_stylesheet_t * +lxb_css_stylesheet_destroy(lxb_css_stylesheet_t *sst, bool destroy_memory) +{ + if (sst == NULL) { + return NULL; + } + + if (destroy_memory) { + (void) lxb_css_memory_ref_dec_destroy(sst->memory); + return NULL; + } + + if (sst->root != NULL) { + (void) lxb_css_rule_destroy(sst->root, true); + } + + (void) lexbor_mraw_free(sst->memory->mraw, sst); + + return NULL; +} + +lxb_status_t +lxb_css_stylesheet_parse(lxb_css_stylesheet_t *sst, lxb_css_parser_t *parser, + const lxb_char_t *data, size_t length) +{ + lxb_status_t status; + lxb_css_rule_list_t *list; + lxb_css_selectors_t selectors; + + if (sst == NULL || parser == NULL) { + return LXB_STATUS_ERROR_WRONG_ARGS; + } + + if (parser->selectors == NULL) { + status = lxb_css_selectors_init(&selectors); + if (status != LXB_STATUS_OK) { + return status; + } + + parser->selectors = &selectors; + } + else { + lxb_css_selectors_clean(parser->selectors); + } + + parser->memory = sst->memory; + + list = lxb_css_syntax_parse_list_rules(parser, + lxb_css_state_cb_list_rules(), + data, length); + + if (parser->selectors == &selectors) { + parser->selectors = lxb_css_selectors_destroy(&selectors, false); + } + + if (list == NULL) { + sst->root = NULL; + return parser->status; + } + + sst->root = &list->rule; + + return LXB_STATUS_OK; +} diff --git a/ext/dom/lexbor/lexbor/css/stylesheet.h b/ext/dom/lexbor/lexbor/css/stylesheet.h index 5f3e37d82e45..9d52f9897cc5 100644 --- a/ext/dom/lexbor/lexbor/css/stylesheet.h +++ b/ext/dom/lexbor/lexbor/css/stylesheet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -25,26 +25,62 @@ struct lxb_css_stylesheet { void *element; /* lxb_html_style_element_t * */ }; +/* + * Create a new CSS stylesheet object. + * + * This function creates a stylesheet object which holds the parsed CSS rules. + * + * @param[in] memory Optional. A memory pool to use for allocations. + * If NULL, a new internal memory pool is created/managed + * by the stylesheet. + * + * @return A new lxb_css_stylesheet_t * or NULL on failure. + */ LXB_API lxb_css_stylesheet_t * lxb_css_stylesheet_create(lxb_css_memory_t *memory); +/* + * Destroy a CSS stylesheet object. + * + * @param[in] sst Optional. The stylesheet object to destroy. + * If NULL, the function returns NULL. + * @param[in] destroy_memory If true, the memory pool attached to + * the stylesheet is also destroyed. + * + * @return Always NULL. + */ LXB_API lxb_css_stylesheet_t * lxb_css_stylesheet_destroy(lxb_css_stylesheet_t *sst, bool destroy_memory); -LXB_API lxb_css_stylesheet_t * -lxb_css_stylesheet_parse(lxb_css_parser_t *parser, - const lxb_char_t *data, size_t length); - +/* + * Parse CSS content into the stylesheet. + * + * This function takes CSS text and builds the rule tree in the stylesheet. + * + * The function returns an error only in extremely unforeseen circumstances, + * such as the inability to allocate memory for objects. Any broken CSS will + * not cause an error. + * + * Selectors note: + * If the provided parser does not have an initialized selectors module, one + * will be created temporarily for this call. For better performance when + * parsing multiple stylesheets, initialize the selectors module in + * the parser once: + * + * lxb_css_parser_t *parser = lxb_css_parser_create(); + * lxb_css_parser_init(parser, NULL); + * lxb_css_parser_selectors_init(parser); + * + * @param[in] sst Required. The target stylesheet. + * @param[in] parser Required. An initialized CSS parser. + * @param[in] data Optional. The CSS text data. + * @param[in] length Required. Length of the data in bytes. + * + * @return LXB_STATUS_OK on success, or an error code on failure. + */ LXB_API lxb_status_t -lxb_css_stylesheet_prepare(lxb_css_parser_t *parser, lxb_css_memory_t *memory, - lxb_css_selectors_t *selectors); - -LXB_API lxb_css_stylesheet_t * -lxb_css_stylesheet_process(lxb_css_parser_t *parser, - const lxb_char_t *data, size_t length); - -LXB_API void -lxb_css_stylesheet_finish(lxb_css_parser_t *parser); +lxb_css_stylesheet_parse(lxb_css_stylesheet_t *sst, lxb_css_parser_t *parser, + const lxb_char_t *data, size_t length); #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/css/syntax/anb.c b/ext/dom/lexbor/lexbor/css/syntax/anb.c index ffd1751cdabf..d3f7c7bfe0a6 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/anb.c +++ b/ext/dom/lexbor/lexbor/css/syntax/anb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -38,10 +38,9 @@ lxb_css_syntax_anb_state_ident_data(lxb_css_parser_t *parser, static const lxb_css_syntax_cb_pipe_t lxb_css_syntax_anb_pipe = { - .state = lxb_css_syntax_anb_state, - .block = NULL, - .failed = lxb_css_state_failed, - .end = lxb_css_syntax_anb_end + .prelude = lxb_css_syntax_anb_state, + .cb.failed = lxb_css_state_failed, + .cb.end = lxb_css_syntax_anb_end }; @@ -66,8 +65,8 @@ lxb_css_syntax_anb_parse(lxb_css_parser_t *parser, lxb_css_parser_buffer_set(parser, data, length); - rule = lxb_css_syntax_parser_pipe_push(parser, NULL, - &lxb_css_syntax_anb_pipe, &anb, + rule = lxb_css_syntax_parser_pipe_push(parser, &lxb_css_syntax_anb_pipe, + NULL, &anb, LXB_CSS_SYNTAX_TOKEN_UNDEF); if (rule == NULL) { return anb; diff --git a/ext/dom/lexbor/lexbor/css/syntax/base.h b/ext/dom/lexbor/lexbor/css/syntax/base.h index 3dc981ba3da2..627fce4c7fa5 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/base.h +++ b/ext/dom/lexbor/lexbor/css/syntax/base.h @@ -17,7 +17,7 @@ extern "C" { #define LXB_CSS_SYNTAX_VERSION_MAJOR 1 -#define LXB_CSS_SYNTAX_VERSION_MINOR 3 +#define LXB_CSS_SYNTAX_VERSION_MINOR 4 #define LXB_CSS_SYNTAX_VERSION_PATCH 0 #define LXB_CSS_SYNTAX_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/css/syntax/parser.c b/ext/dom/lexbor/lexbor/css/syntax/parser.c index 5a3c7abf24f8..7e7e973f75d6 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/parser.c +++ b/ext/dom/lexbor/lexbor/css/syntax/parser.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2025 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -11,14 +11,11 @@ #include "lexbor/css/at_rule/state.h" -static const lxb_css_syntax_token_t lxb_css_syntax_token_terminated = -{ - .types.terminated = {.begin = NULL, .length = 0, .user_id = 0}, - .type = LXB_CSS_SYNTAX_TOKEN__END, - .offset = 0, - .cloned = false -}; +static const lexbor_str_t lxb_css_err_rc = lexbor_str("Unexpected token in " + "qualified rule: RC_BRACKET"); +static lxb_css_syntax_rule_t * +lxb_css_syntax_parser_stack_pop(lxb_css_parser_t *parser); static const lxb_css_syntax_token_t * lxb_css_syntax_parser_list_rules(lxb_css_parser_t *parser, @@ -35,28 +32,105 @@ lxb_css_syntax_parser_list_rules_qualified(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); -static bool +static const lxb_css_syntax_token_t * lxb_css_syntax_parser_list_rules_back(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx); + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + lxb_css_parser_state_f back_state, + lxb_css_syntax_begin_at_rule_f cb, + bool nested); static const lxb_css_syntax_token_t * lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_prelude_end_consule_token(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_back_to_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + static const lxb_css_syntax_token_t * lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule); +lxb_css_syntax_parser_qualified_rule_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_qualified_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_qualified_back_to_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + lxb_css_parser_state_f back_state, + lxb_css_syntax_begin_block_f cb); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_at(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_qualified(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_validate(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); -static bool -lxb_css_syntax_parser_declarations_back(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * lxb_css_syntax_parser_declarations_name(lxb_css_parser_t *parser, @@ -69,40 +143,77 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_next(lxb_css_parser_t *parser, +lxb_css_syntax_parser_declarations_drop(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_drop(lxb_css_parser_t *parser, +lxb_css_syntax_parser_declarations_next(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declaration_back_to_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declaration_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declaration_end_handler(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + bool skip_token); + static const lxb_css_syntax_token_t * lxb_css_syntax_parser_declarations_end(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_end_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + bool skip_token); + static const lxb_css_syntax_token_t * lxb_css_syntax_parser_components(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_components_back_to_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + static const lxb_css_syntax_token_t * lxb_css_syntax_parser_function(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_block(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule); +lxb_css_syntax_parser_function_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); static const lxb_css_syntax_token_t * lxb_css_syntax_parser_pipe(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_pipe_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_end_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + lxb_inline const lxb_css_syntax_token_t * lxb_css_syntax_parser_failed(lxb_css_parser_t *parser, lxb_status_t status) @@ -111,6 +222,31 @@ lxb_css_syntax_parser_failed(lxb_css_parser_t *parser, lxb_status_t status) return NULL; } +lxb_inline const lxb_css_syntax_token_t * +lxb_css_syntax_token_parser_do_phase_again(lxb_css_parser_t *parser) +{ + parser->fake_null = true; + return NULL; +} + +lxb_inline const lxb_css_syntax_token_t * +lxb_css_syntax_parser_call_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token) +{ + lxb_css_syntax_rule_t *rules; + + (void) lxb_css_syntax_parser_stack_pop(parser); + + rules = parser->rules; + + if (parser->rules <= parser->rules_begin) { + rules->state = lxb_css_state_stop; + return token; + } + + return rules->back(parser, token, rules); +} + lxb_status_t lxb_css_syntax_parser_run(lxb_css_parser_t *parser) @@ -177,369 +313,259 @@ lxb_css_syntax_parser_consume(lxb_css_parser_t *parser) lxb_css_syntax_rule_t * lxb_css_syntax_parser_list_rules_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_list_rules_t *cb_rules, - void *ctx, bool top_level, - lxb_css_syntax_token_type_t stop) + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - - parser->rules->state = lxb_css_state_success; + + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_list_rules; - rule->state = cb_rules->cb.state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_list_rules; - rule->cbx.list_rules = cb_rules; - rule->context = ctx; - rule->block_end = stop; - rule->top_level = top_level; - - if (token != NULL) { - rule->u.list_rules.begin = token->offset; - } - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_list_rules, + .state = lxb_css_state_blank, + .back = lxb_css_syntax_parser_list_rules_back, + .cbx.list_rules = cb_rules, + .context = ctx, + .block_end = stop + }; return rule; } lxb_css_syntax_rule_t * lxb_css_syntax_parser_at_rule_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_at_rule_t *at_rule, - void *ctx, lxb_css_syntax_token_type_t stop) + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop, + bool nested) { - lxb_status_t status; - lxb_css_syntax_at_rule_offset_t *at; lxb_css_syntax_rule_t *rule; - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - parser->rules->state = lxb_css_state_success; + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_at_rule; - rule->state = at_rule->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_at_rule; - rule->cbx.at_rule = at_rule; - rule->context = ctx; - rule->block_end = stop; - - if (token != NULL) { - at = &rule->u.at_rule; - - at->name = token->offset; - at->prelude = token->offset + lxb_css_syntax_token_base(token)->length; - } - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_at_rule, + .state = at_rule->prelude, + .back = lxb_css_syntax_parser_at_back_to_prelude, + .cbx.at_rule = at_rule, + .context = ctx, + .block_end = stop, + .nested = nested + }; return rule; } lxb_css_syntax_rule_t * lxb_css_syntax_parser_qualified_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_qualified_rule_t *qualified, - void *ctx, lxb_css_syntax_token_type_t stop) + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop, + bool nested) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - parser->rules->state = lxb_css_state_success; + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_qualified_rule; - rule->state = qualified->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_qualified_rule; - rule->cbx.qualified_rule = qualified; - rule->context = ctx; - rule->block_end = stop; - - if (token != NULL) { - rule->u.qualified.prelude = token->offset; - } - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_qualified_rule, + .state = qualified->prelude, + .back = lxb_css_syntax_parser_qualified_back_to_prelude, + .cbx.qualified_rule = qualified, + .context = ctx, + .block_end = stop, + .nested = nested + }; return rule; } lxb_css_syntax_rule_t * -lxb_css_syntax_parser_declarations_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_declarations_t *declarations, - void *ctx, lxb_css_syntax_token_type_t stop) +lxb_css_syntax_parser_block_push(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_block_t *block, + lxb_css_parser_state_f back, void *ctx) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - parser->rules->state = lxb_css_state_success; + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_declarations; - rule->state = declarations->cb.state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_declarations; - rule->cbx.declarations = declarations; - rule->context = ctx; - rule->block_end = stop; - - if (token != NULL) { - rule->u.declarations.begin = token->offset; - } - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_block, + .state = lxb_css_state_blank, + .back = lxb_css_syntax_parser_block_back, + .cbx.block = block, + .context = ctx + }; return rule; } lxb_css_syntax_rule_t * -lxb_css_syntax_parser_components_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_components_t *comp, - void *ctx, lxb_css_syntax_token_type_t stop) +lxb_css_syntax_parser_declarations_push(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_declarations_t *declr, + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop, + bool name_validate, bool nested) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; + lxb_css_syntax_state_f phase; - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - parser->rules->state = lxb_css_state_success; + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_components; - rule->state = comp->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_components; - rule->cbx.components = comp; - rule->context = ctx; - rule->block_end = stop; + phase = (!name_validate) ? lxb_css_syntax_parser_declarations_begin + : lxb_css_syntax_parser_declarations_validate; - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = phase, + .state = lxb_css_state_blank, + .back = lxb_css_syntax_parser_declaration_back_to_value, + .cbx.declarations = declr, + .context = ctx, + .block_end = stop, + .nested = nested + }; return rule; } lxb_css_syntax_rule_t * -lxb_css_syntax_parser_function_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_function_t *func, - void *ctx) +lxb_css_syntax_parser_components_push(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_components_t *comp, + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - if (token == NULL || token->type != LXB_CSS_SYNTAX_TOKEN_FUNCTION) { - parser->status = LXB_STATUS_ERROR_WRONG_ARGS; - return NULL; - } - - if (parser->rules > parser->rules_begin) { - rule = parser->rules; - - if (rule->deep != 0 - && parser->types_pos[-1] == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) - { - rule->deep--; - parser->types_pos--; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; } } - parser->rules->state = lxb_css_state_success; - - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; - } + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_function; - rule->state = func->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_function; - rule->cbx.func = func; - rule->context = ctx; - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_components, + .state = comp->prelude, + .back = lxb_css_syntax_parser_components_back_to_value, + .cbx.components = comp, + .context = ctx, + .block_end = stop + }; return rule; } lxb_css_syntax_rule_t * -lxb_css_syntax_parser_block_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_block_t *block, - void *ctx) +lxb_css_syntax_parser_function_push(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_function_t *func, + lxb_css_parser_state_f back, void *ctx) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - lxb_css_syntax_token_type_t block_end; - - if (token == NULL) { - parser->status = LXB_STATUS_ERROR_WRONG_ARGS; - return NULL; - } - - switch (token->type) { - case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: - block_end = LXB_CSS_SYNTAX_TOKEN_RS_BRACKET; - break; - - case LXB_CSS_SYNTAX_TOKEN_FUNCTION: - case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: - block_end = LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS; - break; - - case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: - block_end = LXB_CSS_SYNTAX_TOKEN_RC_BRACKET; - break; - default: - parser->status = LXB_STATUS_ERROR_WRONG_ARGS; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { return NULL; - } - - if (parser->rules > parser->rules_begin) { - rule = parser->rules; - - if (rule->deep != 0 && parser->types_pos[-1] == block_end) { - rule->deep--; - parser->types_pos--; } } - parser->rules->state = lxb_css_state_success; - - lxb_css_parser_offset_set(parser, token); - - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; - } + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_block; - rule->state = block->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_block; - rule->cbx.block = block; - rule->context = ctx; - rule->block_end = block_end; - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_function, + .state = func->value, + .back = lxb_css_syntax_parser_function_back, + .cbx.func = func, + .context = ctx + }; return rule; } lxb_css_syntax_rule_t * lxb_css_syntax_parser_pipe_push(lxb_css_parser_t *parser, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_pipe_t *pipe, - void *ctx, lxb_css_syntax_token_type_t stop) + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop) { - lxb_status_t status; lxb_css_syntax_rule_t *rule; - status = lxb_css_syntax_stack_expand(parser, 1); - if (status != LXB_STATUS_OK) { - parser->status = status; - return NULL; + if ((parser->rules + 1) >= parser->rules_end) { + parser->status = lxb_css_syntax_stack_expand(parser, 1); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } } - parser->rules->state = lxb_css_state_success; + parser->rules->back_state = back; rule = ++parser->rules; - memset(rule, 0x00, sizeof(lxb_css_syntax_rule_t)); - - rule->phase = lxb_css_syntax_parser_pipe; - rule->state = pipe->state; - rule->state_back = state_back; - rule->back = lxb_css_syntax_parser_pipe; - rule->cbx.pipe = pipe; - rule->context = ctx; - rule->block_end = stop; - - parser->context = NULL; + *rule = (lxb_css_syntax_rule_t) { + .phase = lxb_css_syntax_parser_pipe, + .state = pipe->prelude, + .back = lxb_css_syntax_parser_pipe_back, + .cbx.pipe = pipe, + .context = ctx, + .block_end = stop + }; return rule; } -lxb_css_syntax_rule_t * +static lxb_css_syntax_rule_t * lxb_css_syntax_parser_stack_pop(lxb_css_parser_t *parser) { return parser->rules--; @@ -554,12 +580,16 @@ lxb_css_syntax_parser_list_rules(lxb_css_parser_t *parser, return token; } + rule->skip_consume = true; + begin: rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; switch (token->type) { case LXB_CSS_SYNTAX_TOKEN_WHITESPACE: + case LXB_CSS_SYNTAX_TOKEN_CDC: + case LXB_CSS_SYNTAX_TOKEN_CDO: lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -577,22 +607,6 @@ lxb_css_syntax_parser_list_rules(lxb_css_parser_t *parser, case LXB_CSS_SYNTAX_TOKEN__EOF: goto done; - case LXB_CSS_SYNTAX_TOKEN_CDC: - case LXB_CSS_SYNTAX_TOKEN_CDO: - if (rule->top_level) { - lxb_css_syntax_token_consume(parser->tkz); - - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { - return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); - } - - goto begin; - } - - /* fall through */ - default: if (rule->block_end == token->type && rule->deep == 0) { goto done; @@ -607,79 +621,136 @@ lxb_css_syntax_parser_list_rules(lxb_css_parser_t *parser, done: rule->phase = lxb_css_syntax_parser_end; - rule->skip_consume = true; - rule->u.list_rules.end = token->offset; - - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, 0); } +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ static const lxb_css_syntax_token_t * lxb_css_syntax_parser_list_rules_at(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule) { - if (rule->state != lxb_css_state_success) { - return token; - } + const lxb_css_syntax_cb_list_rules_t *list_rules = rule->cbx.list_rules; - rule = lxb_css_syntax_parser_at_rule_push(parser, token, - lxb_css_syntax_parser_list_rules_back, - rule->cbx.list_rules->at_rule, - rule->context, rule->block_end); - if (rule == NULL) { - return NULL; - } - - parser->fake_null = true; - - return NULL; + return lxb_css_syntax_parser_at_begin(parser, token, rule, list_rules->next, + list_rules->at_rule, false); } +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ static const lxb_css_syntax_token_t * lxb_css_syntax_parser_list_rules_qualified(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule) { - if (rule->state != lxb_css_state_success) { - return token; - } + void *qualified_ctx; + lxb_css_syntax_rule_t *qualified; + lxb_css_syntax_begin_qualified_rule_f cb; + const lxb_css_syntax_cb_list_rules_t *list_rules; + const lxb_css_syntax_cb_qualified_rule_t *cb_qualified; - rule = lxb_css_syntax_parser_qualified_push(parser, token, - lxb_css_syntax_parser_list_rules_back, - rule->cbx.list_rules->qualified_rule, - rule->context, rule->block_end); - if (rule == NULL) { - return NULL; + qualified_ctx = NULL; + list_rules = rule->cbx.list_rules; + cb = list_rules->qualified_rule; + + rule->skip_consume = false; + + cb_qualified = cb(parser, token, rule->context, &qualified_ctx); + if (cb_qualified == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); } - parser->fake_null = true; + qualified = lxb_css_syntax_parser_qualified_push(parser, cb_qualified, + list_rules->next, + qualified_ctx, + rule->block_end, + false); + if (qualified == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); + } - return NULL; + return lxb_css_syntax_token_parser_do_phase_again(parser); } -static bool +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * lxb_css_syntax_parser_list_rules_back(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx) + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { - lxb_css_syntax_rule_t *rule; + rule->phase = lxb_css_syntax_parser_list_rules; + rule->state = rule->back_state; + rule->skip_consume = true; - if (token->type == LXB_CSS_SYNTAX_TOKEN__END) { - return lxb_css_parser_success(parser); + return token; +} + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + lxb_css_parser_state_f back_state, + lxb_css_syntax_begin_at_rule_f cb, + bool nested) +{ + void *at_rule_ctx; + lxb_css_syntax_rule_t *at_rule; + const lxb_css_syntax_cb_at_rule_t *cb_at_rule; + + at_rule_ctx = NULL; + rule->skip_consume = false; + + cb_at_rule = cb(parser, token, rule->context, &at_rule_ctx); + if (cb_at_rule == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); } - rule = parser->rules; - rule->state = rule->cbx.list_rules->next; + at_rule = lxb_css_syntax_parser_at_rule_push(parser, cb_at_rule, + back_state, at_rule_ctx, + rule->block_end, nested); + if (at_rule == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); + } + + lxb_css_syntax_token_consume(parser->tkz); + + token = lxb_css_syntax_token(parser->tkz); + if (token == NULL) { + return lxb_css_syntax_parser_failed(parser, parser->tkz->status); + } - return false; + if (token->type == LXB_CSS_SYNTAX_TOKEN_WHITESPACE) { + lxb_css_syntax_token_consume(parser->tkz); + } + + return lxb_css_syntax_token_parser_do_phase_again(parser); } +/* + * First call for this code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + * Rule -- lxb_css_syntax_rule_t with at_rule callbacks. + */ static const lxb_css_syntax_token_t * lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule) { lxb_status_t status; + const lxb_css_log_message_t *msg; if (rule->offset > token->offset) { return token; @@ -688,7 +759,7 @@ lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; + rule->phase = lxb_css_syntax_parser_at_prelude_end; goto done; } @@ -706,25 +777,11 @@ lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: if (rule->deep == 0) { - rule->phase = lxb_css_syntax_parser_start_block; - - rule->u.at_rule.prelude_end = token->offset; - rule->u.at_rule.block = token->offset - + lxb_css_syntax_token_base(token)->length; - + rule->phase = lxb_css_syntax_parser_at_block; + rule->back = lxb_css_syntax_parser_end_back; rule->skip_consume = true; - parser->block = rule->cbx.cb->block; - - lxb_css_syntax_token_consume(parser->tkz); - - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { - return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); - } - - token = &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } status = lxb_css_parser_types_push(parser, @@ -732,13 +789,25 @@ lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, break; case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: - if (rule->deep != 0 && parser->types_pos[-1] == token->type) { - if (rule->deep == 1) { - goto done; + if (rule->deep != 0) { + if (parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; + } + } + else { + msg = lxb_css_log_format(parser->log, + LXB_CSS_LOG_SYNTAX_ERROR, + "%S", &lxb_css_err_rc); + if (msg == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); } - parser->types_pos--; - rule->deep--; + if (rule->nested) { + rule->phase = lxb_css_syntax_parser_at_prelude_end; + goto done; + } } return token; @@ -754,12 +823,14 @@ lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, case LXB_CSS_SYNTAX_TOKEN_SEMICOLON: if (rule->deep == 0) { + rule->phase = lxb_css_syntax_parser_at_prelude_end_consule_token; goto done; } return token; case LXB_CSS_SYNTAX_TOKEN__EOF: + rule->phase = lxb_css_syntax_parser_at_prelude_end; goto done; default: @@ -776,17 +847,91 @@ lxb_css_syntax_parser_at_rule(lxb_css_parser_t *parser, done: - rule->phase = lxb_css_syntax_parser_end; rule->skip_consume = true; - if (rule->u.at_rule.prelude_end != 0) { - rule->u.at_rule.block_end = token->offset; + return lxb_css_parser_token_end(parser, token->offset); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + lxb_status_t status; + const lxb_css_syntax_cb_at_rule_t *at_rule = rule->cbx.at_rule; + + status = at_rule->prelude_end(parser, token, rule->context, rule->failed); + if (status != LXB_STATUS_OK) { + return lxb_css_syntax_parser_failed(parser, status); } - else { - rule->u.at_rule.prelude_end = token->offset; + + return lxb_css_syntax_parser_block_begin(parser, token, rule, + at_rule->prelude, at_rule->block); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + lxb_status_t status; + const lxb_css_syntax_cb_at_rule_t *at_rule = rule->cbx.at_rule; + + rule->phase = lxb_css_syntax_parser_end; + rule->state = lxb_css_state_success; + + status = at_rule->prelude_end(parser, token, rule->context, rule->failed); + if (status != LXB_STATUS_OK) { + return lxb_css_syntax_parser_failed(parser, status); } - return &lxb_css_syntax_token_terminated; + return lxb_css_syntax_token_parser_do_phase_again(parser); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_prelude_end_consule_token(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + lxb_status_t status; + const lxb_css_syntax_cb_at_rule_t *at_rule = rule->cbx.at_rule; + + rule->phase = lxb_css_syntax_parser_end_consume_token; + + status = at_rule->prelude_end(parser, token, rule->context, rule->failed); + if (status != LXB_STATUS_OK) { + return lxb_css_syntax_parser_failed(parser, status); + } + + return lxb_css_syntax_token_parser_do_phase_again(parser); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_at_back_to_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + rule->phase = lxb_css_syntax_parser_at_rule; + rule->state = rule->back_state; + rule->skip_consume = false; + + return token; } static const lxb_css_syntax_token_t * @@ -795,8 +940,7 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, lxb_css_syntax_rule_t *rule) { lxb_status_t status; - - /* It is necessary to avoid re-entry of the token into the phase. */ + const lxb_css_log_message_t *msg; if (rule->offset > token->offset) { return token; @@ -805,7 +949,6 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; goto done; } @@ -823,25 +966,11 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: if (rule->deep == 0) { - rule->phase = lxb_css_syntax_parser_start_block; - - rule->u.qualified.prelude_end = token->offset; - rule->u.qualified.block = token->offset - + lxb_css_syntax_token_base(token)->length; - + rule->phase = lxb_css_syntax_parser_qualified_rule_block; + rule->back = lxb_css_syntax_parser_end_back; rule->skip_consume = true; - parser->block = rule->cbx.cb->block; - - lxb_css_syntax_token_consume(parser->tkz); - - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { - return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); - } - - token = &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } status = lxb_css_parser_types_push(parser, @@ -849,13 +978,24 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, break; case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: - if (rule->deep != 0 && parser->types_pos[-1] == token->type) { - if (rule->deep == 1) { - goto done; + if (rule->deep != 0) { + if (parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; + } + } + else { + msg = lxb_css_log_format(parser->log, + LXB_CSS_LOG_SYNTAX_ERROR, + "%S", &lxb_css_err_rc); + if (msg == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); } - parser->types_pos--; - rule->deep--; + if (rule->nested) { + goto done; + } } return token; @@ -868,7 +1008,7 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, } return token; - + case LXB_CSS_SYNTAX_TOKEN__EOF: goto done; @@ -886,23 +1026,113 @@ lxb_css_syntax_parser_qualified_rule(lxb_css_parser_t *parser, done: - rule->phase = lxb_css_syntax_parser_end; + rule->phase = lxb_css_syntax_parser_qualified_prelude_end; rule->skip_consume = true; - if (rule->u.qualified.block != 0) { - rule->u.qualified.block_end = token->offset; + return lxb_css_parser_token_end(parser, token->offset); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_qualified_rule_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + const lxb_css_syntax_cb_qualified_rule_t *qualified_rule; + + qualified_rule = rule->cbx.qualified_rule; + + parser->status = qualified_rule->prelude_end(parser, token, + rule->context, rule->failed); + if (parser->status != LXB_STATUS_OK) { + return NULL; } - else { - rule->u.qualified.prelude_end = token->offset; + + return lxb_css_syntax_parser_block_begin(parser, token, rule, + qualified_rule->prelude, + qualified_rule->block); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_qualified_prelude_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + const lxb_css_syntax_cb_qualified_rule_t *qualified_rule; + + qualified_rule = rule->cbx.qualified_rule; + + parser->status = qualified_rule->prelude_end(parser, token, + rule->context, rule->failed); + if (parser->status != LXB_STATUS_OK) { + return NULL; + } + + rule->phase = lxb_css_syntax_parser_end; + rule->state = lxb_css_state_success; + + return lxb_css_syntax_token_parser_do_phase_again(parser); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_qualified_back_to_prelude(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + rule->phase = lxb_css_syntax_parser_qualified_rule; + rule->state = rule->back_state; + rule->skip_consume = false; + + return token; +} + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + lxb_css_parser_state_f back_state, + lxb_css_syntax_begin_block_f cb) +{ + void *block_ctx; + lxb_css_syntax_rule_t *block; + const lxb_css_syntax_cb_block_t *cb_block; + + block_ctx = NULL; + rule->skip_consume = false; + + cb_block = cb(parser, token, rule->context, &block_ctx); + if (cb_block == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); + } + + block = lxb_css_syntax_parser_block_push(parser, cb_block, back_state, + block_ctx); + if (block == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); } - return &lxb_css_syntax_token_terminated; + lxb_css_syntax_token_consume(parser->tkz); + + return lxb_css_syntax_token_parser_do_phase_again(parser); } static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule) +lxb_css_syntax_parser_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { if (rule->offset > token->offset) { return token; @@ -912,11 +1142,6 @@ lxb_css_syntax_parser_declarations(lxb_css_parser_t *parser, rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; - if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; - goto done; - } - switch (token->type) { case LXB_CSS_SYNTAX_TOKEN_SEMICOLON: case LXB_CSS_SYNTAX_TOKEN_WHITESPACE: @@ -930,93 +1155,221 @@ lxb_css_syntax_parser_declarations(lxb_css_parser_t *parser, goto begin; - case LXB_CSS_SYNTAX_TOKEN_IDENT: - rule->u.declarations.name_begin = token->offset; - - if (lxb_css_syntax_tokenizer_lookup_colon(parser->tkz)) { - rule->phase = lxb_css_syntax_parser_declarations_name; - parser->block = rule->cbx.cb->block; + case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: + if (rule->deep == 0) { + rule->phase = lxb_css_syntax_parser_end_consume_token; + break; + } - return token; + if (parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; } - rule->state = rule->cbx.cb->failed; - rule->phase = lxb_css_syntax_parser_declarations_drop; - rule->failed = true; + return token; + case LXB_CSS_SYNTAX_TOKEN__EOF: + rule->phase = lxb_css_syntax_parser_end; break; case LXB_CSS_SYNTAX_TOKEN_AT_KEYWORD: - rule->u.declarations.name_begin = 0; - - rule = lxb_css_syntax_parser_at_rule_push(parser, token, - lxb_css_syntax_parser_declarations_back, - rule->cbx.declarations->at_rule, rule->context, - rule->block_end); - if (rule != NULL) { - parser->fake_null = true; - } + rule->phase = lxb_css_syntax_parser_block_at; + break; - return NULL; + case LXB_CSS_SYNTAX_TOKEN_IDENT: + if (lxb_css_syntax_tokenizer_lookup_colon(parser->tkz)) { + rule->phase = lxb_css_syntax_parser_block_declarations; + break; + } - case LXB_CSS_SYNTAX_TOKEN__EOF: - goto done; + /* Fall Through. */ default: - rule->state = rule->cbx.cb->failed; - rule->phase = lxb_css_syntax_parser_declarations_drop; - rule->failed = true; - - rule->u.declarations.name_begin = token->offset; + rule->phase = lxb_css_syntax_parser_block_qualified; break; } - parser->fake_null = true; + rule->skip_consume = true; - return NULL; + return lxb_css_parser_token_end(parser, 0); +} -done: +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_at(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + const lxb_css_syntax_cb_block_t *block = rule->cbx.block; - rule->phase = lxb_css_syntax_parser_end; - rule->state = lxb_css_state_success; - rule->skip_consume = true; + return lxb_css_syntax_parser_at_begin(parser, token, rule, + block->next, block->at_rule, true); +} - rule->u.declarations.name_begin = 0; - rule->u.declarations.end = token->offset; +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + void *declr_ctx; + lxb_css_syntax_rule_t *declr_rule; + lxb_css_syntax_begin_declarations_f cb; + const lxb_css_syntax_cb_block_t *block; + const lxb_css_syntax_cb_declarations_t *cb_declr; - parser->fake_null = true; + declr_ctx = NULL; + block = rule->cbx.block; + cb = block->declarations; - return NULL; + rule->skip_consume = false; + + cb_declr = cb(parser, token, rule->context, &declr_ctx); + if (cb_declr == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); + } + + declr_rule = lxb_css_syntax_parser_declarations_push(parser, cb_declr, + block->next, declr_ctx, + LXB_CSS_SYNTAX_TOKEN_RC_BRACKET, + false, true); + if (declr_rule == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); + } + + return lxb_css_syntax_token_parser_do_phase_again(parser); } -static bool -lxb_css_syntax_parser_declarations_back(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, void *ctx) +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_block_qualified(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { - lxb_css_syntax_rule_t *rules = parser->rules; + void *qualified_ctx; + lxb_css_syntax_rule_t *qualified; + const lxb_css_syntax_cb_block_t *block; + lxb_css_syntax_begin_qualified_rule_f cb; + const lxb_css_syntax_cb_qualified_rule_t *cb_qualified; - rules->state = rules->cbx.declarations->cb.state; + qualified_ctx = NULL; + block = rule->cbx.block; + cb = block->qualified_rule; + + rule->skip_consume = false; - return rules->state(parser, token, ctx); + cb_qualified = cb(parser, token, rule->context, &qualified_ctx); + if (cb_qualified == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); + } + + qualified = lxb_css_syntax_parser_qualified_push(parser, cb_qualified, + block->next, qualified_ctx, + LXB_CSS_SYNTAX_TOKEN_SEMICOLON, + true); + if (qualified == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_MEMORY_ALLOCATION); + } + + return lxb_css_syntax_token_parser_do_phase_again(parser); } +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_name(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule) +lxb_css_syntax_parser_block_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { - if (rule->offset > token->offset) { - return token; + rule->phase = lxb_css_syntax_parser_block; + rule->state = rule->back_state; + rule->skip_consume = true; + + return token; +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_validate(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_IDENT + || !lxb_css_syntax_tokenizer_lookup_colon(parser->tkz)) + { + rule->phase = lxb_css_syntax_parser_declarations_drop; + rule->state = rule->cbx.cb->failed; + rule->begin = token->offset; + rule->context_old = rule->context; + rule->context = NULL; + rule->failed = true; + + parser->offset.value_end = 0; + + return lxb_css_syntax_token_parser_do_phase_again(parser); } - if (rule->state != lxb_css_state_success) { - rule->skip_consume = true; + return lxb_css_syntax_parser_declarations_begin(parser, token, rule); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_begin(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + void *declr_ctx; + lxb_css_syntax_declaration_name_f cb; - return &lxb_css_syntax_token_terminated; + declr_ctx = NULL; + cb = rule->cbx.declarations->name; + + rule->state = cb(parser, token, rule->context, &declr_ctx); + if (rule->state == NULL) { + return lxb_css_syntax_parser_failed(parser, + LXB_STATUS_ERROR_UNEXPECTED_DATA); } + rule->phase = lxb_css_syntax_parser_declarations_name; + rule->context_old = rule->context; + rule->context = declr_ctx; rule->skip_consume = false; + lxb_css_syntax_token_consume(parser->tkz); + + return lxb_css_syntax_token_parser_do_phase_again(parser); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_name(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ /* 1. */ if (token->type == LXB_CSS_SYNTAX_TOKEN_WHITESPACE) { @@ -1049,8 +1402,6 @@ lxb_css_syntax_parser_declarations_name(lxb_css_parser_t *parser, return NULL; } - rule->u.declarations.name_end = token->offset; - lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -1069,12 +1420,12 @@ lxb_css_syntax_parser_declarations_name(lxb_css_parser_t *parser, } } - rule->u.declarations.value_begin = token->offset; + rule->begin = token->offset; + parser->offset.value_end = 0; /* 4. */ rule->phase = lxb_css_syntax_parser_declarations_value; - rule->state = parser->block; return lxb_css_syntax_parser_declarations_value(parser, token, rule); } @@ -1085,7 +1436,7 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, lxb_css_syntax_rule_t *rule) { bool imp; - uintptr_t before_important; + size_t offset; lxb_status_t status; if (rule->offset > token->offset) { @@ -1097,7 +1448,6 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; goto done; } @@ -1115,7 +1465,7 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, return token; } - before_important = token->offset; + parser->offset.value_end = token->offset; lxb_css_syntax_token_consume(parser->tkz); @@ -1128,7 +1478,7 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, if (token->type == LXB_CSS_SYNTAX_TOKEN_DELIM) { rule->important = true; - rule->u.declarations.before_important = before_important; + parser->offset.important_begin = token->offset; lxb_css_syntax_token_consume(parser->tkz); @@ -1138,6 +1488,10 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, if (token == NULL) { return lxb_css_syntax_parser_failed(parser, parser->tkz->status); } + + parser->offset.important_end = token->offset + + lxb_css_syntax_token_base(token)->length; + lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -1155,6 +1509,10 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, } } } + else { + parser->offset.important_begin = 0; + parser->offset.important_end = 0; + } goto again; @@ -1162,17 +1520,20 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, if (rule->deep == 0) { rule->phase = lxb_css_syntax_parser_declarations_next; - rule->u.declarations.value_end = token->offset; + offset = token->offset; - lxb_css_syntax_token_consume(parser->tkz); + parser->offset.value_begin = rule->begin; + parser->offset.end = offset; - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { - return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); + if (parser->offset.value_end == 0) { + parser->offset.value_end = offset; + parser->offset.important_begin = 0; + parser->offset.important_end = 0; } - return &lxb_css_syntax_token_terminated; + lxb_css_syntax_token_consume(parser->tkz); + + return lxb_css_parser_token_end(parser, offset); } return token; @@ -1190,9 +1551,11 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, return token; } - rule->u.declarations.before_important = token->offset; rule->important = true; + parser->offset.value_end = token->offset; + parser->offset.important_begin = token->offset; + lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -1200,6 +1563,9 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, return lxb_css_syntax_parser_failed(parser, parser->tkz->status); } + parser->offset.important_end = token->offset + + lxb_css_syntax_token_base(token)->length; + lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -1262,177 +1628,304 @@ lxb_css_syntax_parser_declarations_value(lxb_css_parser_t *parser, done: - rule->phase = lxb_css_syntax_parser_declarations_end; - rule->skip_consume = true; + parser->offset.value_begin = rule->begin; + parser->offset.end = token->offset; + + if (parser->offset.value_end == 0) { + parser->offset.value_end = token->offset; + parser->offset.important_begin = 0; + parser->offset.important_end = 0; + } - rule->u.declarations.value_end = token->offset; - rule->u.declarations.end = token->offset; + rule->phase = lxb_css_syntax_parser_declaration_end; + rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_next(lxb_css_parser_t *parser, +lxb_css_syntax_parser_declarations_drop(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule) { + size_t offset; lxb_status_t status; - lxb_css_syntax_declarations_offset_t *decl; - if (rule->state != lxb_css_state_success) { - rule->skip_consume = true; + if (rule->offset > token->offset) { + return token; + } - return &lxb_css_syntax_token_terminated; + rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; + + if (rule->block_end == token->type && rule->deep == 0) { + goto done; + } + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_SEMICOLON: + if (rule->deep == 0) { + rule->phase = lxb_css_syntax_parser_declarations_next; + + offset = token->offset; + + parser->offset.value_begin = rule->begin; + parser->offset.end = offset; + + if (parser->offset.value_end == 0) { + parser->offset.value_end = offset; + parser->offset.important_begin = 0; + parser->offset.important_end = 0; + } + + lxb_css_syntax_token_consume(parser->tkz); + + return lxb_css_parser_token_end(parser, offset); + } + + return token; + + case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: + status = lxb_css_parser_types_push(parser, + LXB_CSS_SYNTAX_TOKEN_RS_BRACKET); + break; + + case LXB_CSS_SYNTAX_TOKEN_FUNCTION: + case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: + status = lxb_css_parser_types_push(parser, + LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); + break; + + case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: + status = lxb_css_parser_types_push(parser, + LXB_CSS_SYNTAX_TOKEN_RC_BRACKET); + break; + + case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: + if (rule->deep == 0) { + if (rule->nested) { + goto done; + } + } + else if (parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; + } + + return token; + + case LXB_CSS_SYNTAX_TOKEN_RS_BRACKET: + case LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS: + if (rule->deep != 0 && parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; + } + + return token; + + case LXB_CSS_SYNTAX_TOKEN__EOF: + goto done; + + default: + return token; } - status = rule->cbx.declarations->declaration_end(parser, rule->context, - rule->important, - rule->failed); if (status != LXB_STATUS_OK) { return lxb_css_syntax_parser_failed(parser, status); } - rule->phase = lxb_css_syntax_parser_declarations; - rule->state = rule->cbx.cb->state; + rule->deep++; - rule->skip_consume = false; - rule->important = false; - rule->failed = false; + return token; + +done: + + parser->offset.value_begin = rule->begin; + parser->offset.end = token->offset; - decl = &rule->u.declarations; + if (parser->offset.value_end == 0) { + parser->offset.value_end = token->offset; + parser->offset.important_begin = 0; + parser->offset.important_end = 0; + } - decl->name_begin = 0; - decl->name_end = 0; - decl->value_begin = 0; - decl->before_important = 0; - decl->value_end = 0; + rule->phase = lxb_css_syntax_parser_declaration_end; + rule->skip_consume = true; - return lxb_css_syntax_parser_declarations(parser, token, rule); + return lxb_css_parser_token_end(parser, token->offset); } +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_drop(lxb_css_parser_t *parser, +lxb_css_syntax_parser_declarations_next(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule) { + void *out_rule; lxb_status_t status; + lxb_css_syntax_declaration_name_f name; - /* It is necessary to avoid re-entry of the token into the phase. */ + if (rule->state != lxb_css_state_success) { + rule->skip_consume = true; - if (rule->offset > token->offset) { - return token; + return lxb_css_parser_token_end(parser, token->offset); } - rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; - - if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; - goto done; + status = rule->cbx.declarations->end(parser, rule->context_old, + rule->context, token, &parser->offset, + rule->important, rule->failed); + if (status != LXB_STATUS_OK) { + return lxb_css_syntax_parser_failed(parser, status); } - switch (token->type) { - case LXB_CSS_SYNTAX_TOKEN_SEMICOLON: - if (rule->deep == 0) { - rule->phase = lxb_css_syntax_parser_declarations_next; +begin: + + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_SEMICOLON: + case LXB_CSS_SYNTAX_TOKEN_WHITESPACE: + lxb_css_syntax_token_consume(parser->tkz); + + token = lxb_css_syntax_token(parser->tkz); + if (token == NULL) { + return lxb_css_syntax_parser_failed(parser, + parser->tkz->status); + } + + goto begin; - rule->u.declarations.name_end = token->offset; + case LXB_CSS_SYNTAX_TOKEN__EOF: + rule->phase = lxb_css_syntax_parser_declarations_end; + break; - lxb_css_syntax_token_consume(parser->tkz); + case LXB_CSS_SYNTAX_TOKEN_IDENT: + if (lxb_css_syntax_tokenizer_lookup_colon(parser->tkz)) { + out_rule = NULL; + name = rule->cbx.declarations->name; + rule->skip_consume = true; - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { + rule->state = name(parser, token, rule->context, &out_rule); + if (rule->state == NULL) { return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); + LXB_STATUS_ERROR_UNEXPECTED_DATA); } - rule->skip_consume = true; - - return &lxb_css_syntax_token_terminated; - } + rule->context = out_rule; - return token; + lxb_css_syntax_token_consume(parser->tkz); - case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_RS_BRACKET); - break; + rule->phase = lxb_css_syntax_parser_declarations_name; + rule->context = out_rule; - case LXB_CSS_SYNTAX_TOKEN_FUNCTION: - case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); - break; + break; + } - case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_RC_BRACKET); - break; + /* Fall through. */ - case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: - case LXB_CSS_SYNTAX_TOKEN_RS_BRACKET: - case LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS: - if (rule->deep != 0 && parser->types_pos[-1] == token->type) { - parser->types_pos--; - rule->deep--; + default: + if (rule->nested) { + rule->phase = lxb_css_syntax_parser_declarations_end; } + else { + rule->phase = lxb_css_syntax_parser_declarations_drop; + rule->state = rule->cbx.cb->failed; + rule->begin = token->offset; + rule->context = NULL; + rule->failed = true; - return token; - - case LXB_CSS_SYNTAX_TOKEN__EOF: - goto done; + parser->offset.value_end = 0; - default: - return token; - } + return lxb_css_syntax_token_parser_do_phase_again(parser); + } - if (status != LXB_STATUS_OK) { - return lxb_css_syntax_parser_failed(parser, status); + break; } - rule->deep++; - - return token; + rule->skip_consume = false; + rule->important = false; + rule->failed = false; -done: + return lxb_css_syntax_token_parser_do_phase_again(parser); +} - rule->phase = lxb_css_syntax_parser_declarations_end; - rule->skip_consume = true; +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declaration_back_to_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + rule->phase = lxb_css_syntax_parser_declarations_value; + rule->state = rule->back_state; + rule->skip_consume = false; - rule->u.declarations.name_end = token->offset; - rule->u.declarations.end = token->offset; + return token; +} - return &lxb_css_syntax_token_terminated; +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declaration_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + return lxb_css_syntax_parser_declaration_end_handler(parser, token, + rule, false); } static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_declarations_end(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule) +lxb_css_syntax_parser_declaration_end_handler(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + bool skip_token) { lxb_status_t status; - lxb_css_syntax_rule_t *rules; if (rule->state != lxb_css_state_success) { rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } - status = rule->cbx.declarations->declaration_end(parser, rule->context, - rule->important, - rule->failed); + status = rule->cbx.declarations->end(parser, rule->context_old, + rule->context, token, &parser->offset, + rule->important, rule->failed); if (status != LXB_STATUS_OK) { return lxb_css_syntax_parser_failed(parser, status); } + return lxb_css_syntax_parser_declarations_end_h(parser, token, + rule, skip_token); +} + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_end(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + return lxb_css_syntax_parser_declarations_end_h(parser, token, + rule, false); +} + +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_declarations_end_h(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule, + bool skip_token) +{ + lxb_status_t status; + /* This code will be called exclusively from the lxb_css_parser_run(...). */ + rule->context = rule->context_old; + status = rule->cbx.cb->end(parser, token, rule->context, false); if (status != LXB_STATUS_OK) { return lxb_css_syntax_parser_failed(parser, status); } - if (!rule->skip_ending) { + if (skip_token) { lxb_css_syntax_token_consume(parser->tkz); token = lxb_css_syntax_token(parser->tkz); @@ -1442,18 +1935,7 @@ lxb_css_syntax_parser_declarations_end(lxb_css_parser_t *parser, } } - (void) lxb_css_syntax_parser_stack_pop(parser); - - rules = parser->rules; - - if (parser->rules <= parser->rules_begin) { - rules->state = lxb_css_state_stop; - return token; - } - - rules->phase = rules->back; - - return rules->phase(parser, token, rules); + return lxb_css_syntax_parser_call_back(parser, token); } static const lxb_css_syntax_token_t * @@ -1470,7 +1952,6 @@ lxb_css_syntax_parser_components(lxb_css_parser_t *parser, rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; if (rule->block_end == token->type && rule->deep == 0) { - rule->skip_ending = true; goto done; } @@ -1521,7 +2002,23 @@ lxb_css_syntax_parser_components(lxb_css_parser_t *parser, rule->phase = lxb_css_syntax_parser_end; rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_components_back_to_value(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + rule->phase = lxb_css_syntax_parser_components; + rule->state = rule->back_state; + rule->skip_consume = false; + + return token; } static const lxb_css_syntax_token_t * @@ -1555,16 +2052,16 @@ lxb_css_syntax_parser_function(lxb_css_parser_t *parser, break; case LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS: - if (rule->deep != 0) { - if (parser->types_pos[-1] == token->type) { - parser->types_pos--; - rule->deep--; - } - } - else { + if (rule->deep == 0) { + rule->phase = lxb_css_syntax_parser_end_consume_token; goto done; } + if (parser->types_pos[-1] == token->type) { + parser->types_pos--; + rule->deep--; + } + return token; case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: @@ -1577,6 +2074,7 @@ lxb_css_syntax_parser_function(lxb_css_parser_t *parser, return token; case LXB_CSS_SYNTAX_TOKEN__EOF: + rule->phase = lxb_css_syntax_parser_end; goto done; default: @@ -1593,77 +2091,25 @@ lxb_css_syntax_parser_function(lxb_css_parser_t *parser, done: - rule->phase = lxb_css_syntax_parser_end; rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ static const lxb_css_syntax_token_t * -lxb_css_syntax_parser_block(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule) +lxb_css_syntax_parser_function_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { - lxb_status_t status; - - if (rule->offset > token->offset) { - return token; - } - - rule->offset = token->offset + lxb_css_syntax_token_base(token)->length; - - if (rule->block_end == token->type && rule->deep == 0) { - goto done; - } - - switch (token->type) { - case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_RS_BRACKET); - break; - - case LXB_CSS_SYNTAX_TOKEN_FUNCTION: - case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS); - break; - - case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: - status = lxb_css_parser_types_push(parser, - LXB_CSS_SYNTAX_TOKEN_RC_BRACKET); - break; - - case LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS: - case LXB_CSS_SYNTAX_TOKEN_RS_BRACKET: - case LXB_CSS_SYNTAX_TOKEN_RC_BRACKET: - if (rule->deep != 0 && parser->types_pos[-1] == token->type) { - parser->types_pos--; - rule->deep--; - } - - return token; - - case LXB_CSS_SYNTAX_TOKEN__EOF: - goto done; - - default: - return token; - } - - if (status != LXB_STATUS_OK) { - return lxb_css_syntax_parser_failed(parser, status); - } - - rule->deep++; + rule->phase = lxb_css_syntax_parser_function; + rule->state = rule->back_state; + rule->skip_consume = false; return token; - -done: - - rule->phase = lxb_css_syntax_parser_end; - rule->skip_consume = true; - - return &lxb_css_syntax_token_terminated; } static const lxb_css_syntax_token_t * @@ -1677,31 +2123,41 @@ lxb_css_syntax_parser_pipe(lxb_css_parser_t *parser, rule->phase = lxb_css_syntax_parser_end; rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + return lxb_css_parser_token_end(parser, token->offset); } return token; } -const lxb_css_syntax_token_t * -lxb_css_syntax_parser_start_block(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule) +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_pipe_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) { - if (rule->state != lxb_css_state_success) { - rule->skip_consume = true; - - return &lxb_css_syntax_token_terminated; - } - - /* This code will be called exclusively from the lxb_css_parser_run(...). */ - + rule->phase = lxb_css_syntax_parser_pipe; + rule->state = rule->back_state; rule->skip_consume = false; - rule->phase = rule->back; - rule->state = parser->block; + return token; +} + +/* + * This code will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ +static const lxb_css_syntax_token_t * +lxb_css_syntax_parser_end_back(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + rule->phase = lxb_css_syntax_parser_end; + rule->state = lxb_css_state_blank; - return rule->back(parser, token, rule); + return token; } const lxb_css_syntax_token_t * @@ -1710,13 +2166,12 @@ lxb_css_syntax_parser_end(lxb_css_parser_t *parser, lxb_css_syntax_rule_t *rule) { lxb_status_t status; - lxb_css_syntax_rule_t *rules; lxb_css_syntax_cb_base_t *base; - if (rule->state != lxb_css_state_success) { - rule->skip_consume = true; + rule->skip_consume = true; - return &lxb_css_syntax_token_terminated; + if (rule->state != lxb_css_state_success) { + return lxb_css_parser_token_end(parser, token->offset); } /* This code will be called exclusively from the lxb_css_parser_run(...). */ @@ -1728,27 +2183,43 @@ lxb_css_syntax_parser_end(lxb_css_parser_t *parser, return lxb_css_syntax_parser_failed(parser, status); } - if (!rule->skip_ending) { - lxb_css_syntax_token_consume(parser->tkz); + rule->skip_consume = false; - token = lxb_css_syntax_token(parser->tkz); - if (token == NULL) { - return lxb_css_syntax_parser_failed(parser, - parser->tkz->status); - } + return lxb_css_syntax_parser_call_back(parser, token); +} + +const lxb_css_syntax_token_t * +lxb_css_syntax_parser_end_consume_token(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule) +{ + lxb_status_t status; + lxb_css_syntax_cb_base_t *base; + + rule->skip_consume = true; + + if (rule->state != lxb_css_state_success) { + return lxb_css_parser_token_end(parser, token->offset); } - (void) lxb_css_syntax_parser_stack_pop(parser); + /* This code will be called exclusively from the lxb_css_parser_run(...). */ - rules = parser->rules; + base = rule->cbx.user; - if (parser->rules <= parser->rules_begin) { - rules->state = lxb_css_state_stop; - return token; + status = base->end(parser, token, rule->context, rule->failed); + if (status != LXB_STATUS_OK) { + return lxb_css_syntax_parser_failed(parser, status); } - rules->phase = rules->back; - rules->state = rule->state_back; + rule->skip_consume = false; + + lxb_css_syntax_token_consume(parser->tkz); + + token = lxb_css_syntax_token(parser->tkz); + if (token == NULL) { + return lxb_css_syntax_parser_failed(parser, + parser->tkz->status); + } - return rules->phase(parser, token, rules); + return lxb_css_syntax_parser_call_back(parser, token); } diff --git a/ext/dom/lexbor/lexbor/css/syntax/parser.h b/ext/dom/lexbor/lexbor/css/syntax/parser.h index f41d62f1ff87..2e7aff644509 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/parser.h +++ b/ext/dom/lexbor/lexbor/css/syntax/parser.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2025 Alexander Borisov + * Copyright (C) 2020-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -30,70 +30,63 @@ lxb_css_syntax_parser_consume(lxb_css_parser_t *parser); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_list_rules_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_list_rules_t *list_rules, - void *ctx, bool top_level, - lxb_css_syntax_token_type_t stop); + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_at_rule_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_at_rule_t *at_rule, - void *ctx, lxb_css_syntax_token_type_t stop); + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop, + bool nested); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_qualified_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_qualified_rule_t *qualified, - void *ctx, lxb_css_syntax_token_type_t stop); + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop, + bool nested); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_parser_block_push(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_block_t *block, + lxb_css_parser_state_f back, void *ctx); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_declarations_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_declarations_t *declarations, - void *ctx, lxb_css_syntax_token_type_t stop); + const lxb_css_syntax_cb_declarations_t *declr, + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop, + bool name_validate, bool nested); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_components_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_components_t *comp, + lxb_css_parser_state_f back, void *ctx, lxb_css_syntax_token_type_t stop); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_function_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_function_t *func, - void *ctx); - -LXB_API lxb_css_syntax_rule_t * -lxb_css_syntax_parser_block_push(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_parser_state_f state_back, - const lxb_css_syntax_cb_block_t *block, - void *ctx); + lxb_css_parser_state_f back, void *ctx); LXB_API lxb_css_syntax_rule_t * lxb_css_syntax_parser_pipe_push(lxb_css_parser_t *parser, - lxb_css_parser_state_f state_back, const lxb_css_syntax_cb_pipe_t *pipe, - void *ctx, lxb_css_syntax_token_type_t stop); - -LXB_API const lxb_css_syntax_token_t * -lxb_css_syntax_parser_start_block(lxb_css_parser_t *parser, - const lxb_css_syntax_token_t *token, - lxb_css_syntax_rule_t *rule); + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop); LXB_API const lxb_css_syntax_token_t * lxb_css_syntax_parser_end(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); +LXB_API const lxb_css_syntax_token_t * +lxb_css_syntax_parser_end_consume_token(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_rule_t *rule); + #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/css/syntax/res.h b/ext/dom/lexbor/lexbor/css/syntax/res.h index cd33446f81d5..7fa2f8ba705f 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/res.h +++ b/ext/dom/lexbor/lexbor/css/syntax/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,12 +7,9 @@ #ifndef LEXBOR_CSS_SYNTAX_RES_H #define LEXBOR_CSS_SYNTAX_RES_H -#ifdef LXB_CSS_SYNTAX_RES_NAME_MAP -#ifndef LXB_CSS_SYNTAX_RES_NAME_MAP_ENABLED -#define LXB_CSS_SYNTAX_RES_NAME_MAP_ENABLED #define LXB_CSS_SYNTAX_RES_NAME_START 0x01 -static const lxb_char_t lxb_css_syntax_res_name_map[256] = +LXB_API const lxb_char_t lxb_css_syntax_res_name_map[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -42,7 +39,4 @@ static const lxb_char_t lxb_css_syntax_res_name_map[256] = 0x01, 0x01, 0x01, 0x01, 0x01 }; -#endif /* LXB_CSS_SYNTAX_RES_NAME_MAP_ENABLED */ -#endif /* LXB_CSS_SYNTAX_RES_NAME_MAP */ - #endif /* LEXBOR_CSS_SYNTAX_RES_H */ diff --git a/ext/dom/lexbor/lexbor/css/syntax/state.c b/ext/dom/lexbor/lexbor/css/syntax/state.c index 99cd30c1868f..a93731e11235 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/state.c +++ b/ext/dom/lexbor/lexbor/css/syntax/state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -14,12 +14,11 @@ #include "lexbor/css/syntax/syntax.h" #include "lexbor/css/syntax/tokenizer/error.h" -#define LXB_CSS_SYNTAX_RES_NAME_MAP #include "lexbor/css/syntax/res.h" -#define LEXBOR_STR_RES_MAP_HEX -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; +#endif #define LXB_CSS_SYNTAX_ERROR_CODEPOINT 0x1FFFFF @@ -1101,7 +1100,9 @@ lxb_css_syntax_state_consume_numeric(lxb_css_syntax_tokenizer_t *tkz, /* U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9) */ do { - e_digit = (*data - 0x30) + e_digit * 0x0A; + if (e_digit < INT_MAX / 10) { + e_digit = (*data - 0x30) + e_digit * 0x0A; + } data += 1; @@ -1523,7 +1524,7 @@ lxb_css_syntax_state_url(lxb_css_syntax_tokenizer_t *tkz, lxb_css_syntax_tokenizer_error_add(tkz->parse_errors, data, LXB_CSS_SYNTAX_TOKENIZER_ERROR_EOINUR); - return lxb_css_syntax_state_string_set(tkz, token, data); + goto done; default: if (*data >= 0x80) { diff --git a/ext/dom/lexbor/lexbor/css/syntax/state_res.h b/ext/dom/lexbor/lexbor/css/syntax/state_res.h index 2f6e2899fdc0..e98909a5bff4 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/state_res.h +++ b/ext/dom/lexbor/lexbor/css/syntax/state_res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/syntax/syntax.c b/ext/dom/lexbor/lexbor/css/syntax/syntax.c index b148d8a043c1..f8a1e944df23 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/syntax.c +++ b/ext/dom/lexbor/lexbor/css/syntax/syntax.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -9,58 +9,315 @@ #include "lexbor/core/str.h" -#define LEXBOR_STR_RES_MAP_HEX -#define LEXBOR_STR_RES_MAP_HEX_TO_CHAR_LOWERCASE -#define LEXBOR_STR_RES_CHAR_TO_TWO_HEX_VALUE_LOWERCASE -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex_to_char_lowercase[17]; + LXB_EXTERN const char *lexbor_str_res_char_to_two_hex_value_lowercase[257]; + LXB_EXTERN const lxb_char_t lxb_css_syntax_res_name_map[256]; +#endif -#define LXB_CSS_SYNTAX_RES_NAME_MAP -#include "lexbor/css/syntax/res.h" +static const lexbor_str_t lxb_css_syntax_str_ws = lexbor_str(" "); -static const lexbor_str_t lxb_str_ws = lexbor_str(" "); - - -lxb_status_t +lxb_css_rule_list_t * lxb_css_syntax_parse_list_rules(lxb_css_parser_t *parser, const lxb_css_syntax_cb_list_rules_t *cb, - const lxb_char_t *data, size_t length, - void *ctx, bool top_level) + const lxb_char_t *data, size_t length) { - lxb_status_t status; + lxb_css_rule_list_t *list; lxb_css_syntax_rule_t *rule; if (lxb_css_parser_is_running(parser)) { parser->status = LXB_STATUS_ERROR_WRONG_STAGE; - return parser->status; + return NULL; } lxb_css_parser_clean(parser); - lxb_css_parser_buffer_set(parser, data, length); - rule = lxb_css_syntax_parser_list_rules_push(parser, NULL, NULL, cb, - ctx, top_level, + list = lxb_css_rule_list_create(parser->memory); + if (list == NULL) { + parser->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + goto failed; + } + + rule = lxb_css_syntax_parser_list_rules_push(parser, cb, NULL, list, LXB_CSS_SYNTAX_TOKEN_UNDEF); if (rule == NULL) { - status = parser->status; - goto end; + goto failed; + } + + parser->tkz->with_comment = false; + parser->stage = LXB_CSS_PARSER_RUN; + + parser->status = lxb_css_syntax_parser_run(parser); + if (parser->status != LXB_STATUS_OK) { + goto failed; + } + + parser->stage = LXB_CSS_PARSER_END; + + return list; + +failed: + + if (list != NULL) { + lxb_css_rule_list_destroy(list, true); + } + + parser->stage = LXB_CSS_PARSER_END; + + return NULL; +} + +lxb_css_rule_declaration_list_t * +lxb_css_syntax_parse_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_declarations_t *cb, + const lxb_char_t *data, size_t length) +{ + lxb_css_rule_declaration_list_t *list; + lxb_css_syntax_rule_t *rule; + + if (lxb_css_parser_is_running(parser)) { + parser->status = LXB_STATUS_ERROR_WRONG_STAGE; + return NULL; + } + + lxb_css_parser_clean(parser); + lxb_css_parser_buffer_set(parser, data, length); + + list = lxb_css_rule_declaration_list_create(parser->memory); + if (list == NULL) { + parser->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + goto failed; + } + + rule = lxb_css_syntax_parser_declarations_push(parser, cb, NULL, list, + LXB_CSS_SYNTAX_TOKEN_UNDEF, + true, false); + if (rule == NULL) { + goto failed; } parser->tkz->with_comment = false; parser->stage = LXB_CSS_PARSER_RUN; - status = lxb_css_syntax_parser_run(parser); - if (status != LXB_STATUS_OK) { - /* Destroy StyleSheet. */ + parser->status = lxb_css_syntax_parser_run(parser); + if (parser->status != LXB_STATUS_OK) { + goto failed; } -end: + parser->stage = LXB_CSS_PARSER_END; + + return list; + +failed: + + if (list != NULL) { + lxb_css_rule_declaration_list_destroy(list, true); + } parser->stage = LXB_CSS_PARSER_END; - return status; + return NULL; +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_list_rules(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_list_rules_t *list_rules, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop) +{ + return lxb_css_syntax_parser_list_rules_push(parser, list_rules, back, + ctx, stop); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_at_rule(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_at_rule_t *at_rule, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_AT_KEYWORD) { + return NULL; + } + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0 + && parser->types_pos[-1] == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) + { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_syntax_parser_at_rule_push(parser, at_rule, back, ctx, + stop, false); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_qualified_rule(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_qualified_rule_t *qualified, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop) +{ + lxb_css_syntax_token_type_t type; + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0) { + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RS_BRACKET; + break; + + case LXB_CSS_SYNTAX_TOKEN_FUNCTION: + case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: + type = LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS; + break; + + case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RC_BRACKET; + break; + + default: + type = LXB_CSS_SYNTAX_TOKEN_UNDEF; + break; + } + + + if (parser->types_pos[-1] == type) { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + } + + return lxb_css_syntax_parser_qualified_push(parser, qualified, back, + ctx, stop, false); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_block_t *block, + lxb_css_parser_state_f back, void *ctx) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_LC_BRACKET) { + return NULL; + } + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0 + && parser->types_pos[-1] == LXB_CSS_SYNTAX_TOKEN_RC_BRACKET) + { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_syntax_parser_block_push(parser, block, back, ctx); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_declarations_t *declr, + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop) +{ + lxb_css_syntax_token_type_t type; + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0) { + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RS_BRACKET; + break; + + case LXB_CSS_SYNTAX_TOKEN_FUNCTION: + case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: + type = LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS; + break; + + case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RC_BRACKET; + break; + + default: + type = LXB_CSS_SYNTAX_TOKEN_UNDEF; + break; + } + + + if (parser->types_pos[-1] == type) { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + } + + return lxb_css_syntax_parser_declarations_push(parser, declr, back, + ctx, stop, true, false); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_components(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_components_t *comp, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop) +{ + lxb_css_syntax_token_type_t type; + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0) { + switch (token->type) { + case LXB_CSS_SYNTAX_TOKEN_LS_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RS_BRACKET; + break; + + case LXB_CSS_SYNTAX_TOKEN_FUNCTION: + case LXB_CSS_SYNTAX_TOKEN_L_PARENTHESIS: + type = LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS; + break; + + case LXB_CSS_SYNTAX_TOKEN_LC_BRACKET: + type = LXB_CSS_SYNTAX_TOKEN_RC_BRACKET; + break; + + default: + type = LXB_CSS_SYNTAX_TOKEN_UNDEF; + break; + } + + + if (parser->types_pos[-1] == type) { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + } + + return lxb_css_syntax_parser_components_push(parser, comp, back, ctx, stop); +} + +lxb_css_syntax_rule_t * +lxb_css_syntax_consume_function(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_function_t *func, + lxb_css_parser_state_f back, void *ctx) +{ + if (token->type != LXB_CSS_SYNTAX_TOKEN_FUNCTION) { + return NULL; + } + + if (parser->rules > parser->rules_begin && parser->rules->deep != 0 + && parser->types_pos[-1] == LXB_CSS_SYNTAX_TOKEN_R_PARENTHESIS) + { + parser->types_pos -= 1; + parser->rules->deep -= 1; + } + + lxb_css_syntax_parser_consume(parser); + + return lxb_css_syntax_parser_function_push(parser, func, back, ctx); } lxb_status_t @@ -69,22 +326,20 @@ lxb_css_syntax_stack_expand(lxb_css_parser_t *parser, size_t count) size_t length, cur_len, size; lxb_css_syntax_rule_t *p; - if ((parser->rules + count) >= parser->rules_end) { - cur_len = parser->rules - parser->rules_begin; + cur_len = parser->rules - parser->rules_begin; - length = cur_len + count + 1024; - size = length * sizeof(lxb_css_syntax_rule_t); + length = cur_len + count + 1024; + size = length * sizeof(lxb_css_syntax_rule_t); - p = lexbor_realloc(parser->rules_begin, size); - if (p == NULL) { - return LXB_STATUS_ERROR_MEMORY_ALLOCATION; - } - - parser->rules_begin = p; - parser->rules_end = p + length; - parser->rules = p + cur_len; + p = lexbor_realloc(parser->rules_begin, size); + if (p == NULL) { + return LXB_STATUS_ERROR_MEMORY_ALLOCATION; } + parser->rules_begin = p; + parser->rules_end = p + length; + parser->rules = p + cur_len; + return LXB_STATUS_OK; } @@ -166,8 +421,9 @@ lxb_css_syntax_ident_serialize(const lxb_char_t *data, size_t length, data = ++p; if (p < end && lexbor_str_res_map_hex[*p] != 0xff) { - lexbor_serialize_write(cb, lxb_str_ws.data, - lxb_str_ws.length, ctx, status); + lexbor_serialize_write(cb, lxb_css_syntax_str_ws.data, + lxb_css_syntax_str_ws.length, + ctx, status); } continue; @@ -231,8 +487,9 @@ lxb_css_syntax_string_serialize(const lxb_char_t *data, size_t length, p++; if (p < end && lexbor_str_res_map_hex[*p] != 0xff) { - lexbor_serialize_write(cb, lxb_str_ws.data, - lxb_str_ws.length, ctx, status); + lexbor_serialize_write(cb, lxb_css_syntax_str_ws.data, + lxb_css_syntax_str_ws.length, + ctx, status); } data = p; diff --git a/ext/dom/lexbor/lexbor/css/syntax/syntax.h b/ext/dom/lexbor/lexbor/css/syntax/syntax.h index 91ed9088f29a..08e9c5c8618d 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/syntax.h +++ b/ext/dom/lexbor/lexbor/css/syntax/syntax.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Alexander Borisov + * Copyright (C) 2022-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,6 +12,7 @@ extern "C" { #endif #include "lexbor/css/syntax/tokenizer.h" +#include "lexbor/css/syntax/tokenizer.h" typedef struct lxb_css_syntax_rule lxb_css_syntax_rule_t; @@ -21,124 +22,211 @@ typedef const lxb_css_syntax_token_t * const lxb_css_syntax_token_t *token, lxb_css_syntax_rule_t *rule); -typedef lxb_status_t -(*lxb_css_syntax_declaration_end_f)(lxb_css_parser_t *parser, void *ctx, - bool important, bool failed); + +typedef struct lxb_css_syntax_cb_base lxb_css_syntax_cb_base_t; +typedef struct lxb_css_syntax_cb_list_rules lxb_css_syntax_cb_list_rules_t; +typedef struct lxb_css_syntax_cb_at_rule lxb_css_syntax_cb_at_rule_t; +typedef struct lxb_css_syntax_cb_qualified_rule lxb_css_syntax_cb_qualified_rule_t; +typedef struct lxb_css_syntax_cb_block lxb_css_syntax_cb_block_t; +typedef struct lxb_css_syntax_cb_declarations lxb_css_syntax_cb_declarations_t; +typedef struct lxb_css_syntax_cb_function lxb_css_syntax_cb_function_t; +typedef struct lxb_css_syntax_cb_components lxb_css_syntax_cb_components_t; +typedef struct lxb_css_syntax_cb_pipe lxb_css_syntax_cb_pipe_t; + +typedef struct lxb_css_syntax_declaration_offset lxb_css_syntax_declaration_offset_t; typedef lxb_status_t (*lxb_css_syntax_cb_done_f)(lxb_css_parser_t *parser, const lxb_css_syntax_token_t *token, void *ctx, bool failed); -typedef struct { - uintptr_t begin; - uintptr_t end; -} -lxb_css_syntax_list_rules_offset_t; - -typedef struct { - uintptr_t name; - uintptr_t prelude; - uintptr_t prelude_end; - uintptr_t block; - uintptr_t block_end; -} -lxb_css_syntax_at_rule_offset_t; - -typedef struct { - uintptr_t prelude; - uintptr_t prelude_end; - uintptr_t block; - uintptr_t block_end; -} -lxb_css_syntax_qualified_offset_t; - -typedef struct { - uintptr_t begin; - uintptr_t end; - uintptr_t name_begin; - uintptr_t name_end; - uintptr_t value_begin; - uintptr_t before_important; - uintptr_t value_end; -} -lxb_css_syntax_declarations_offset_t; - -typedef struct { - lxb_css_parser_state_f state; - lxb_css_parser_state_f block; +typedef const lxb_css_syntax_cb_at_rule_t * +(*lxb_css_syntax_begin_at_rule_f)(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +typedef const lxb_css_syntax_cb_qualified_rule_t * +(*lxb_css_syntax_begin_qualified_rule_f)(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +typedef const lxb_css_syntax_cb_block_t * +(*lxb_css_syntax_begin_block_f)(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); + +typedef const lxb_css_syntax_cb_declarations_t * +(*lxb_css_syntax_begin_declarations_f)(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +typedef lxb_css_parser_state_f +(*lxb_css_syntax_declaration_name_f)(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + void *ctx, void **out_rule); +typedef lxb_status_t +(*lxb_css_syntax_declaration_end_f)(lxb_css_parser_t *parser, + void *declaration, void *ctx, + const lxb_css_syntax_token_t *token, + lxb_css_syntax_declaration_offset_t *offset, + bool important, bool failed); + +struct lxb_css_syntax_cb_base { lxb_css_parser_state_f failed; lxb_css_syntax_cb_done_f end; -} -lxb_css_syntax_cb_base_t; +}; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_pipe_t; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_block_t; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_function_t; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_components_t; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_at_rule_t; -typedef lxb_css_syntax_cb_base_t lxb_css_syntax_cb_qualified_rule_t; +struct lxb_css_syntax_cb_list_rules { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f next; + lxb_css_syntax_begin_at_rule_f at_rule; + lxb_css_syntax_begin_qualified_rule_f qualified_rule; +}; + +struct lxb_css_syntax_cb_at_rule { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f prelude; + lxb_css_syntax_cb_done_f prelude_end; + lxb_css_syntax_begin_block_f block; +}; + +struct lxb_css_syntax_cb_qualified_rule { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f prelude; + lxb_css_syntax_cb_done_f prelude_end; + lxb_css_syntax_begin_block_f block; +}; + +struct lxb_css_syntax_cb_block { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f next; + lxb_css_syntax_begin_at_rule_f at_rule; + lxb_css_syntax_begin_declarations_f declarations; + lxb_css_syntax_begin_qualified_rule_f qualified_rule; +}; -typedef struct { +struct lxb_css_syntax_cb_declarations { lxb_css_syntax_cb_base_t cb; - lxb_css_syntax_declaration_end_f declaration_end; - const lxb_css_syntax_cb_at_rule_t *at_rule; -} -lxb_css_syntax_cb_declarations_t; - -typedef struct { - lxb_css_syntax_cb_base_t cb; - lxb_css_parser_state_f next; - const lxb_css_syntax_cb_at_rule_t *at_rule; - const lxb_css_syntax_cb_qualified_rule_t *qualified_rule; -} -lxb_css_syntax_cb_list_rules_t; + lxb_css_syntax_declaration_name_f name; + lxb_css_syntax_declaration_end_f end; +}; + +struct lxb_css_syntax_cb_function { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f value; +}; + +struct lxb_css_syntax_cb_components { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f prelude; +}; + +struct lxb_css_syntax_cb_pipe { + lxb_css_syntax_cb_base_t cb; + lxb_css_parser_state_f prelude; +}; + +struct lxb_css_syntax_declaration_offset { + size_t value_begin; + size_t value_end; + size_t important_begin; + size_t important_end; + size_t end; +}; struct lxb_css_syntax_rule { lxb_css_syntax_state_f phase; lxb_css_parser_state_f state; - lxb_css_parser_state_f state_back; + + /* + * This callback will be called before rule->state is called. + * Exclusively from the lxb_css_parser_run(...). + */ lxb_css_syntax_state_f back; + lxb_css_parser_state_f back_state; + void *context; + void *context_old; + void *returned; union { const lxb_css_syntax_cb_base_t *cb; const lxb_css_syntax_cb_list_rules_t *list_rules; const lxb_css_syntax_cb_at_rule_t *at_rule; const lxb_css_syntax_cb_qualified_rule_t *qualified_rule; - const lxb_css_syntax_cb_declarations_t *declarations; const lxb_css_syntax_cb_components_t *components; + const lxb_css_syntax_cb_declarations_t *declarations; const lxb_css_syntax_cb_function_t *func; const lxb_css_syntax_cb_block_t *block; const lxb_css_syntax_cb_pipe_t *pipe; void *user; } cbx; - void *context; - - uintptr_t offset; - size_t deep; - lxb_css_syntax_token_type_t block_end; - bool skip_ending; - bool skip_consume; - bool important; - bool failed; - bool top_level; - - union { - lxb_css_syntax_list_rules_offset_t list_rules; - lxb_css_syntax_at_rule_offset_t at_rule; - lxb_css_syntax_qualified_offset_t qualified; - lxb_css_syntax_declarations_offset_t declarations; - void *user; - } u; + size_t offset; + size_t deep; + size_t begin; + lxb_css_syntax_token_type_t block_end; + bool nested; + bool skip_consume; + bool important; + bool failed; }; -LXB_API lxb_status_t +LXB_API lxb_css_rule_list_t * lxb_css_syntax_parse_list_rules(lxb_css_parser_t *parser, const lxb_css_syntax_cb_list_rules_t *cb, - const lxb_char_t *data, size_t length, - void *ctx, bool top_level); + const lxb_char_t *data, size_t length); + +LXB_API lxb_css_rule_declaration_list_t * +lxb_css_syntax_parse_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_declarations_t *cb, + const lxb_char_t *data, size_t length); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_list_rules(lxb_css_parser_t *parser, + const lxb_css_syntax_cb_list_rules_t *list_rules, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_at_rule(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_at_rule_t *at_rule, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_qualified_rule(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_qualified_rule_t *qualified, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_block(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_block_t *block, + lxb_css_parser_state_f back, void *ctx); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_declarations(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_declarations_t *declr, + lxb_css_parser_state_f back, void *ctx, + lxb_css_syntax_token_type_t stop); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_components(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_components_t *comp, + lxb_css_parser_state_f back, + void *ctx, lxb_css_syntax_token_type_t stop); + +LXB_API lxb_css_syntax_rule_t * +lxb_css_syntax_consume_function(lxb_css_parser_t *parser, + const lxb_css_syntax_token_t *token, + const lxb_css_syntax_cb_function_t *func, + lxb_css_parser_state_f back, void *ctx); + LXB_API lxb_status_t lxb_css_syntax_stack_expand(lxb_css_parser_t *parser, size_t count); @@ -159,6 +247,7 @@ LXB_API lxb_status_t lxb_css_syntax_ident_or_string_serialize(const lxb_char_t *data, size_t length, lexbor_serialize_cb_f cb, void *ctx); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/ext/dom/lexbor/lexbor/css/syntax/token.c b/ext/dom/lexbor/lexbor/css/syntax/token.c index be1cc7809c43..ff53c4531e8b 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/token.c +++ b/ext/dom/lexbor/lexbor/css/syntax/token.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,15 +12,12 @@ #include "lexbor/css/parser.h" #include "lexbor/css/syntax/token.h" #include "lexbor/css/syntax/state.h" -#include "lexbor/css/syntax/state_res.h" - -#define LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP #include "lexbor/css/syntax/token_res.h" -#define LEXBOR_STR_RES_MAP_HEX -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; +#endif lxb_css_syntax_token_t * lxb_css_syntax_tokenizer_token(lxb_css_syntax_tokenizer_t *tkz); diff --git a/ext/dom/lexbor/lexbor/css/syntax/token_res.h b/ext/dom/lexbor/lexbor/css/syntax/token_res.h index 7a8e1c4d2594..d5ee29cf3b22 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/token_res.h +++ b/ext/dom/lexbor/lexbor/css/syntax/token_res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,10 +7,6 @@ #ifndef LEXBOR_CSS_SYNTAX_TOKEN_RES_H #define LEXBOR_CSS_SYNTAX_TOKEN_RES_H - -#ifdef LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP -#ifndef LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP_ENABLED -#define LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP_ENABLED static const lexbor_shs_entry_t lxb_css_syntax_token_res_name_shs_map[136] = { {NULL, NULL, 135, 0}, {NULL, NULL, 0, 0}, @@ -83,8 +79,4 @@ static const lexbor_shs_entry_t lxb_css_syntax_token_res_name_shs_map[136] = {NULL, NULL, 0, 0}, {"semicolon", (void *) LXB_CSS_SYNTAX_TOKEN_SEMICOLON, 9, 0} }; -#endif /* LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP_ENABLED */ -#endif /* LXB_CSS_SYNTAX_TOKEN_RES_NAME_SHS_MAP */ - - #endif /* LEXBOR_CSS_SYNTAX_TOKEN_RES_H */ diff --git a/ext/dom/lexbor/lexbor/css/syntax/tokenizer.c b/ext/dom/lexbor/lexbor/css/syntax/tokenizer.c index 9eecac657546..a44b2c7194a6 100644 --- a/ext/dom/lexbor/lexbor/css/syntax/tokenizer.c +++ b/ext/dom/lexbor/lexbor/css/syntax/tokenizer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,9 +12,10 @@ #include "lexbor/core/array.h" -#define LEXBOR_STR_RES_MAP_LOWERCASE -#include "lexbor/core/str_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; +#endif static const lxb_char_t lxb_css_syntax_tokenizer_important[] = "important"; @@ -297,7 +298,7 @@ lxb_css_syntax_tokenizer_lookup_important_ch(lxb_css_syntax_tokenizer_t *tkz, { static const size_t length = sizeof(lxb_css_syntax_tokenizer_important) - 1; - if (!(end - p >= length + if (!(lxb_size(end - p) >= length && lexbor_str_data_ncasecmp(p, lxb_css_syntax_tokenizer_important, length))) { diff --git a/ext/dom/lexbor/lexbor/css/unit.c b/ext/dom/lexbor/lexbor/css/unit.c new file mode 100644 index 000000000000..f3cc9c8ef28e --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/unit.c @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2021 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/css.h" +#include "lexbor/css/unit/res.h" + + +const lxb_css_data_t * +lxb_css_unit_absolute_relative_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_absolute_relative_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_absolute_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_absolute_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_relative_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_relative_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_angle_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_angle_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_frequency_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_frequency_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_resolution_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_resolution_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_duration_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_unit_duration_shs, + name, length); + if (entry == NULL) { + return NULL; + } + + return entry->value; +} + +const lxb_css_data_t * +lxb_css_unit_by_id(lxb_css_type_t id) +{ + return &lxb_css_unit_data[id]; +} diff --git a/ext/dom/lexbor/lexbor/css/unit/const.h b/ext/dom/lexbor/lexbor/css/unit/const.h index 9b7ba1c311b1..9f5e515834e8 100644 --- a/ext/dom/lexbor/lexbor/css/unit/const.h +++ b/ext/dom/lexbor/lexbor/css/unit/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/unit/res.h b/ext/dom/lexbor/lexbor/css/unit/res.h index 4cca189b6f45..ac24503d1a6f 100644 --- a/ext/dom/lexbor/lexbor/css/unit/res.h +++ b/ext/dom/lexbor/lexbor/css/unit/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/value.c b/ext/dom/lexbor/lexbor/css/value.c new file mode 100644 index 000000000000..23e2472d625c --- /dev/null +++ b/ext/dom/lexbor/lexbor/css/value.c @@ -0,0 +1,678 @@ +/* + * Copyright (C) 2022-2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/css/css.h" +#include "lexbor/css/value/res.h" + +#include "lexbor/core/serialize.h" +#include "lexbor/core/conv.h" + + +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex_to_char_lowercase[17]; + LXB_EXTERN const char *lexbor_str_res_char_to_two_hex_value_lowercase[257]; +#endif + +static const lexbor_str_t lxb_css_value_str_ws = lexbor_str(" "); +static const lexbor_str_t lxb_str_comma = lexbor_str(", "); +static const lexbor_str_t lxb_str_alpha = lexbor_str(" / "); +static const lexbor_str_t lxb_str_rp = lexbor_str(")"); + + +const lxb_css_data_t * +lxb_css_value_by_id(uintptr_t id) +{ + if (id < LXB_CSS_VALUE__LAST_ENTRY) { + return &lxb_css_value_data[id]; + } + + return NULL; +} + +lxb_css_value_type_t +lxb_css_value_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + entry = lexbor_shs_entry_get_lower_static(lxb_css_value_shs, name, length); + if (entry == NULL) { + return LXB_CSS_VALUE__UNDEF; + } + + return (lxb_css_value_type_t) (uintptr_t) entry->value; +} + +lxb_status_t +lxb_css_value_serialize(lxb_css_value_type_t type, + lexbor_serialize_cb_f cb, void *ctx) +{ + const lxb_css_data_t *data; + + if (type >= LXB_CSS_VALUE__LAST_ENTRY) { + return LXB_STATUS_ERROR_WRONG_ARGS; + } + + data = &lxb_css_value_data[type]; + + return cb(data->name, data->length, ctx); +} + +lxb_status_t +lxb_css_value_percentage_sr(const lxb_css_value_percentage_t *percent, + lexbor_serialize_cb_f cb, void *ctx) +{ + size_t length; + lxb_char_t buf[128]; + lxb_status_t status; + + static const lexbor_str_t str_per = lexbor_str("%"); + + /* FIXME: If length != sizeof(buf)? */ + length = lexbor_conv_float_to_data(percent->num, buf, sizeof(buf)); + + lexbor_serialize_write(cb, buf, length, ctx, status); + lexbor_serialize_write(cb, str_per.data, str_per.length, ctx, status); + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_length_sr(const lxb_css_value_length_t *len, + lexbor_serialize_cb_f cb, void *ctx) +{ + size_t length; + lxb_char_t buf[128]; + lxb_status_t status; + const lxb_css_data_t *unit; + + /* FIXME: If length != sizeof(buf)? */ + length = lexbor_conv_float_to_data(len->num, buf, sizeof(buf)); + + lexbor_serialize_write(cb, buf, length, ctx, status); + + if (len->unit == LXB_CSS_UNIT__UNDEF) { + return LXB_STATUS_OK; + } + + unit = lxb_css_unit_by_id(len->unit); + if (unit == NULL) { + return LXB_STATUS_OK; + } + + lexbor_serialize_write(cb, unit->name, unit->length, ctx, status); + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_number_sr(const lxb_css_value_number_t *number, + lexbor_serialize_cb_f cb, void *ctx) +{ + size_t length; + lxb_char_t buf[128]; + lxb_status_t status; + + /* FIXME: If length != sizeof(buf)? */ + length = lexbor_conv_float_to_data(number->num, buf, sizeof(buf)); + + lexbor_serialize_write(cb, buf, length, ctx, status); + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_integer_sr(const lxb_css_value_integer_t *integer, + lexbor_serialize_cb_f cb, void *ctx) +{ + size_t length; + lxb_char_t buf[128]; + lxb_status_t status; + + /* FIXME: If length != sizeof(buf)? */ + length = lexbor_conv_long_to_data(integer->num, buf, sizeof(buf)); + + lexbor_serialize_write(cb, buf, length, ctx, status); + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_length_percentage_sr(const lxb_css_value_length_percentage_t *lp, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (lp->type) { + case LXB_CSS_VALUE__LENGTH: + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_length_sr(&lp->u.length, cb, ctx); + + case LXB_CSS_VALUE__PERCENTAGE: + return lxb_css_value_percentage_sr(&lp->u.percentage, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(lp->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_number_length_sr(const lxb_css_value_number_length_t *nl, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (nl->type) { + case LXB_CSS_VALUE__LENGTH: + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_length_sr(&nl->u.length, cb, ctx); + + default: + return lxb_css_value_serialize(nl->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_number_percentage_sr(const lxb_css_value_number_percentage_t *np, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (np->type) { + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_number_sr(&np->u.number, cb, ctx); + + case LXB_CSS_VALUE__PERCENTAGE: + return lxb_css_value_percentage_sr(&np->u.percentage, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(np->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_length_type_sr(const lxb_css_value_length_type_t *lt, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (lt->type) { + case LXB_CSS_VALUE__LENGTH: + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_length_sr(<->length, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(lt->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_percentage_type_sr(const lxb_css_value_percentage_type_t *pt, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (pt->type) { + case LXB_CSS_VALUE__PERCENTAGE: + return lxb_css_value_percentage_sr(&pt->percentage, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(pt->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_number_type_sr(const lxb_css_value_number_type_t *num, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (num->type) { + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_number_sr(&num->number, cb, ctx); + + default: + return lxb_css_value_serialize(num->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_integer_type_sr(const lxb_css_value_integer_type_t *num, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (num->type) { + case LXB_CSS_VALUE__INTEGER: + return lxb_css_value_integer_sr(&num->integer, cb, ctx); + + default: + return lxb_css_value_serialize(num->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_length_percentage_type_sr(const lxb_css_value_length_percentage_type_t *lpt, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (lpt->type) { + case LXB_CSS_VALUE__LENGTH: + return lxb_css_value_length_percentage_sr(&lpt->length, cb, ctx); + + default: + return lxb_css_value_serialize(lpt->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_number_length_percentage_type_sr(const lxb_css_value_number_length_percentage_t *nlp, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (nlp->type) { + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_number_sr(&nlp->u.number, cb, ctx); + + case LXB_CSS_VALUE__LENGTH: + return lxb_css_value_length_sr(&nlp->u.length, cb, ctx); + + case LXB_CSS_VALUE__PERCENTAGE: + return lxb_css_value_percentage_sr(&nlp->u.percentage, cb, ctx); + + default: + return lxb_css_value_serialize(nlp->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +lxb_status_t +lxb_css_value_angle_sr(const lxb_css_value_angle_t *angle, + lexbor_serialize_cb_f cb, void *ctx) +{ + size_t length; + lxb_char_t buf[128]; + lxb_status_t status; + const lxb_css_data_t *data; + + /* FIXME: If length != sizeof(buf)? */ + length = lexbor_conv_float_to_data(angle->num, buf, sizeof(buf)); + + lexbor_serialize_write(cb, buf, length, ctx, status); + + data = lxb_css_unit_by_id(angle->unit); + + return cb(data->name, data->length, ctx); +} + +lxb_status_t +lxb_css_value_hue_sr(const lxb_css_value_hue_t *hue, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (hue->type) { + case LXB_CSS_VALUE__NUMBER: + return lxb_css_value_number_sr(&hue->u.number, cb, ctx); + + case LXB_CSS_VALUE__ANGLE: + return lxb_css_value_angle_sr(&hue->u.angle, cb, ctx); + + case LXB_CSS_VALUE__UNDEF: + /* FIXME: ???? */ + break; + + default: + return lxb_css_value_serialize(hue->type, cb, ctx); + } + + return LXB_STATUS_OK; +} + +static lxb_status_t +lxb_css_value_color_hex_sr(const lxb_css_value_color_hex_t *hex, + lexbor_serialize_cb_f cb, void *ctx) +{ + lxb_status_t status; + static const lexbor_str_t str_hash = lexbor_str("#"); + const lxb_css_value_color_hex_rgba_t *rgba = &hex->rgba; + + const lxb_char_t *hmo = lexbor_str_res_map_hex_to_char_lowercase; + const char **hmt = lexbor_str_res_char_to_two_hex_value_lowercase; + + lexbor_serialize_write(cb, str_hash.data, str_hash.length, ctx, status); + + switch (hex->type) { + case LXB_CSS_PROPERTY_COLOR_HEX_TYPE_3: + case LXB_CSS_PROPERTY_COLOR_HEX_TYPE_4: + lexbor_serialize_write(cb, &hmo[rgba->r], 1, ctx, status); + lexbor_serialize_write(cb, &hmo[rgba->g], 1, ctx, status); + lexbor_serialize_write(cb, &hmo[rgba->b], 1, ctx, status); + + if (hex->type == LXB_CSS_PROPERTY_COLOR_HEX_TYPE_4) { + lexbor_serialize_write(cb, &hmo[rgba->a], 1, ctx, status); + } + + break; + + case LXB_CSS_PROPERTY_COLOR_HEX_TYPE_6: + case LXB_CSS_PROPERTY_COLOR_HEX_TYPE_8: + lexbor_serialize_write(cb, hmt[rgba->r], 2, ctx, status); + lexbor_serialize_write(cb, hmt[rgba->g], 2, ctx, status); + lexbor_serialize_write(cb, hmt[rgba->b], 2, ctx, status); + + if (hex->type == LXB_CSS_PROPERTY_COLOR_HEX_TYPE_8) { + lexbor_serialize_write(cb, hmt[rgba->a], 2, ctx, status); + } + + break; + + default: + break; + } + + return LXB_STATUS_OK; +} + +static lxb_status_t +lxb_css_value_color_rgb_sr(const lxb_css_value_color_rgba_t *rgb, + lexbor_serialize_cb_f cb, void *ctx, + lxb_css_value_type_t type) +{ + lxb_status_t status; + const lexbor_str_t *sep; + static const lexbor_str_t str_rgb = lexbor_str("rgb("); + static const lexbor_str_t str_rgba = lexbor_str("rgba("); + + if (type == LXB_CSS_COLOR_RGB) { + lexbor_serialize_write(cb, str_rgb.data, str_rgb.length, ctx, status); + } + else { + lexbor_serialize_write(cb, str_rgba.data, str_rgba.length, ctx, status); + } + + sep = (rgb->old) ? &lxb_str_comma : &lxb_css_value_str_ws; + + status = lxb_css_value_number_percentage_sr(&rgb->r, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&rgb->g, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&rgb->b, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (rgb->a.type == LXB_CSS_VALUE__UNDEF) { + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); + } + + sep = (rgb->old) ? &lxb_str_comma : &lxb_str_alpha; + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&rgb->a, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); +} + +static lxb_status_t +lxb_css_value_color_hsl_sr(const lxb_css_value_color_hsla_t *hsl, + lexbor_serialize_cb_f cb, void *ctx, + lxb_css_value_type_t type) +{ + lxb_status_t status; + const lexbor_str_t *sep; + static const lexbor_str_t str_hsl = lexbor_str("hsl("); + static const lexbor_str_t str_hsla = lexbor_str("hsla("); + static const lexbor_str_t str_hwb = lexbor_str("hwb("); + + switch (type) { + case LXB_CSS_COLOR_HSL: + status = cb(str_hsl.data, str_hsl.length, ctx); + break; + + case LXB_CSS_COLOR_HSLA: + status = cb(str_hsla.data, str_hsla.length, ctx); + break; + + case LXB_CSS_COLOR_HWB: + status = cb(str_hwb.data, str_hwb.length, ctx); + break; + + default: + return LXB_STATUS_ERROR_WRONG_ARGS; + } + + if (status != LXB_STATUS_OK) { + return status; + } + + sep = (hsl->old) ? &lxb_str_comma : &lxb_css_value_str_ws; + + status = lxb_css_value_hue_sr(&hsl->h, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_percentage_type_sr(&hsl->s, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_percentage_type_sr(&hsl->l, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (hsl->a.type == LXB_CSS_VALUE__UNDEF) { + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); + } + + sep = (hsl->old) ? &lxb_str_comma : &lxb_str_alpha; + + lexbor_serialize_write(cb, sep->data, sep->length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&hsl->a, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); +} + +static lxb_status_t +lxb_css_value_color_lab_sr(const lxb_css_value_color_lab_t *lab, + lexbor_serialize_cb_f cb, void *ctx, + lxb_css_value_type_t type) +{ + lxb_status_t status; + static const lexbor_str_t str_lab = lexbor_str("lab("); + static const lexbor_str_t str_oklab = lexbor_str("oklab("); + + switch (type) { + case LXB_CSS_COLOR_LAB: + status = cb(str_lab.data, str_lab.length, ctx); + break; + + case LXB_CSS_COLOR_OKLAB: + status = cb(str_oklab.data, str_oklab.length, ctx); + break; + + default: + return LXB_STATUS_ERROR_WRONG_ARGS; + } + + if (status != LXB_STATUS_OK) { + return status; + } + + status = lxb_css_value_number_percentage_sr(&lab->l, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, lxb_css_value_str_ws.data, + lxb_css_value_str_ws.length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&lab->a, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, lxb_css_value_str_ws.data, + lxb_css_value_str_ws.length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&lab->b, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (lab->alpha.type == LXB_CSS_VALUE__UNDEF) { + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); + } + + lexbor_serialize_write(cb, lxb_str_alpha.data, lxb_str_alpha.length, + ctx, status); + + status = lxb_css_value_number_percentage_sr(&lab->alpha, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); +} + +static lxb_status_t +lxb_css_value_color_lch_sr(const lxb_css_value_color_lch_t *lch, + lexbor_serialize_cb_f cb, void *ctx, + lxb_css_value_type_t type) +{ + lxb_status_t status; + static const lexbor_str_t str_lch = lexbor_str("lch("); + static const lexbor_str_t str_oklch = lexbor_str("oklch("); + + switch (type) { + case LXB_CSS_COLOR_LCH: + status = cb(str_lch.data, str_lch.length, ctx); + break; + + case LXB_CSS_COLOR_OKLCH: + status = cb(str_oklch.data, str_oklch.length, ctx); + break; + + default: + return LXB_STATUS_ERROR_WRONG_ARGS; + } + + if (status != LXB_STATUS_OK) { + return status; + } + + status = lxb_css_value_number_percentage_sr(&lch->l, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, lxb_css_value_str_ws.data, + lxb_css_value_str_ws.length, ctx, status); + + status = lxb_css_value_number_percentage_sr(&lch->c, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + lexbor_serialize_write(cb, lxb_css_value_str_ws.data, + lxb_css_value_str_ws.length, ctx, status); + + status = lxb_css_value_hue_sr(&lch->h, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + if (lch->a.type == LXB_CSS_VALUE__UNDEF) { + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); + } + + lexbor_serialize_write(cb, lxb_str_alpha.data, lxb_str_alpha.length, + ctx, status); + + status = lxb_css_value_number_percentage_sr(&lch->a, cb, ctx); + if (status != LXB_STATUS_OK) { + return status; + } + + return cb(lxb_str_rp.data, lxb_str_rp.length, ctx); +} + +lxb_status_t +lxb_css_value_color_serialize(const lxb_css_value_color_t *color, + lexbor_serialize_cb_f cb, void *ctx) +{ + switch (color->type) { + case LXB_CSS_COLOR_HEX: + return lxb_css_value_color_hex_sr(&color->u.hex, cb, ctx); + + case LXB_CSS_COLOR_RGB: + case LXB_CSS_COLOR_RGBA: + return lxb_css_value_color_rgb_sr(&color->u.rgb, cb, ctx, + color->type); + + case LXB_CSS_COLOR_HSL: + case LXB_CSS_COLOR_HSLA: + case LXB_CSS_COLOR_HWB: + return lxb_css_value_color_hsl_sr(&color->u.hsl, cb, ctx, + color->type); + + case LXB_CSS_COLOR_LAB: + case LXB_CSS_COLOR_OKLAB: + return lxb_css_value_color_lab_sr(&color->u.lab, cb, ctx, + color->type); + + case LXB_CSS_COLOR_LCH: + case LXB_CSS_COLOR_OKLCH: + return lxb_css_value_color_lch_sr(&color->u.lch, cb, ctx, + color->type); + + case LXB_CSS_VALUE__UNDEF: + break; + + default: + return lxb_css_value_serialize(color->type, cb, ctx); + } + + return LXB_STATUS_OK; +} diff --git a/ext/dom/lexbor/lexbor/css/value/const.h b/ext/dom/lexbor/lexbor/css/value/const.h index c9b5241e1d73..a7bd64c60349 100644 --- a/ext/dom/lexbor/lexbor/css/value/const.h +++ b/ext/dom/lexbor/lexbor/css/value/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/css/value/res.h b/ext/dom/lexbor/lexbor/css/value/res.h index 79b3c6b0322f..180dc95f10e9 100644 --- a/ext/dom/lexbor/lexbor/css/value/res.h +++ b/ext/dom/lexbor/lexbor/css/value/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/dom/base.h b/ext/dom/lexbor/lexbor/dom/base.h index 167e43d7691c..3894aa13ca6c 100644 --- a/ext/dom/lexbor/lexbor/dom/base.h +++ b/ext/dom/lexbor/lexbor/dom/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -15,8 +15,8 @@ extern "C" { #include "lexbor/core/base.h" -#define LXB_DOM_VERSION_MAJOR 1 -#define LXB_DOM_VERSION_MINOR 8 +#define LXB_DOM_VERSION_MAJOR 2 +#define LXB_DOM_VERSION_MINOR 0 #define LXB_DOM_VERSION_PATCH 0 #define LXB_DOM_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/dom/exception.c b/ext/dom/lexbor/lexbor/dom/exception.c index 44fcf65d6b4e..5433ce42aac6 100644 --- a/ext/dom/lexbor/lexbor/dom/exception.c +++ b/ext/dom/lexbor/lexbor/dom/exception.c @@ -1,18 +1,372 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ #include "lexbor/dom/exception.h" +#include "lexbor/dom/interfaces/document.h" -/* - * No inline functions for ABI. - */ -void * -lxb_dom_exception_code_ref_set_noi(lxb_dom_exception_code_t *var, - lxb_dom_exception_code_t code) +typedef struct { + lexbor_str_t name; + lexbor_str_t message; +} +lxb_dom_exception_data_t; + + +static const lxb_dom_exception_data_t lxb_dom_exception_data[LXB_DOM_EXCEPTION__LAST_ENTRY] = +{ + { + lexbor_str("Error"), + lexbor_str("") + }, + { + lexbor_str("IndexSizeError"), + lexbor_str("Deprecated. Use RangeError instead.") + }, + { + lexbor_str("DOMStringSizeError"), + lexbor_str("") + }, + { + lexbor_str("HierarchyRequestError"), + lexbor_str("The operation would yield an incorrect node tree.") + }, + { + lexbor_str("WrongDocumentError"), + lexbor_str("The object is in the wrong document.") + }, + { + lexbor_str("InvalidCharacterError"), + lexbor_str("The string contains invalid characters.") + }, + { + lexbor_str("NoDataAllowedError"), + lexbor_str("") + }, + { + lexbor_str("NoModificationAllowedError"), + lexbor_str("The object can not be modified.") + }, + { + lexbor_str("NotFoundError"), + lexbor_str("The object can not be found here.") + }, + { + lexbor_str("NotSupportedError"), + lexbor_str("The operation is not supported.") + }, + { + lexbor_str("InUseAttributeError"), + lexbor_str("The attribute is in use by another element.") + }, + { + lexbor_str("InvalidStateError"), + lexbor_str("The object is in an invalid state.") + }, + { + lexbor_str("SyntaxError"), + lexbor_str("The string did not match the expected pattern.") + }, + { + lexbor_str("InvalidModificationError"), + lexbor_str("The object can not be modified in this way.") + }, + { + lexbor_str("NamespaceError"), + lexbor_str("The operation is not allowed by Namespaces in XML.") + }, + { + lexbor_str("InvalidAccessError"), + lexbor_str("Deprecated. Use TypeError for invalid arguments, " + "\"NotSupportedError\" DOMException for unsupported operations, " + "and \"NotAllowedError\" DOMException for denied requests instead.") + }, + { + lexbor_str("ValidationError"), + lexbor_str("") + }, + { + lexbor_str("TypeMismatchError"), + lexbor_str("Deprecated. Use TypeError instead.") + }, + { + lexbor_str("SecurityError"), + lexbor_str("The operation is insecure.") + }, + { + lexbor_str("NetworkError"), + lexbor_str("A network error occurred.") + }, + { + lexbor_str("AbortError"), + lexbor_str("The operation was aborted.") + }, + { + lexbor_str("URLMismatchError"), + lexbor_str("Deprecated.") + }, + { + lexbor_str("QuotaExceededError"), + lexbor_str("Deprecated. Use the QuotaExceededError DOMException-derived " + "interface instead.") + }, + { + lexbor_str("TimeoutError"), + lexbor_str("The operation timed out.") + }, + { + lexbor_str("InvalidNodeTypeError"), + lexbor_str("The supplied node is incorrect or has an incorrect ancestor " + "for this operation.") + }, + { + lexbor_str("DataCloneError"), + lexbor_str("The object can not be cloned.") + }, + { + lexbor_str("EncodingError"), + lexbor_str("The encoding operation (either encoded or decoding) failed.") + }, + { + lexbor_str("NotReadableError"), + lexbor_str("The I/O read operation failed.") + }, + { + lexbor_str("UnknownError"), + lexbor_str("The operation failed for an unknown transient reason " + "(e.g. out of memory).") + }, + { + lexbor_str("ConstraintError"), + lexbor_str("A mutation operation in a transaction failed because a " + "constraint was not satisfied.") + }, + { + lexbor_str("DataError"), + lexbor_str("Provided data is inadequate.") + }, + { + lexbor_str("TransactionInactiveError"), + lexbor_str("A request was placed against a transaction which is currently" + " not active, or which is finished.") + }, + { + lexbor_str("ReadOnlyError"), + lexbor_str("The mutating operation was attempted in a \"readonly\" transaction.") + }, + { + lexbor_str("VersionError"), + lexbor_str("An attempt was made to open a database using a lower version" + " than the existing version.") + }, + { + lexbor_str("OperationError"), + lexbor_str("The operation failed for an operation-specific reason.") + }, + { + lexbor_str("NotAllowedError"), + lexbor_str("The request is not allowed by the user agent or the platform" + " in the current context, possibly because the user denied permission.") + }, + { + lexbor_str("OptOutError"), + lexbor_str("The user opted out of the process.") + } +}; + + +lxb_dom_exception_t * +lxb_dom_exception_create(lxb_dom_document_t *document, + const lxb_char_t *message, size_t message_length, + const lxb_char_t *name, size_t name_length) +{ + lexbor_str_t *str; + const lxb_dom_exception_data_t *data; + lxb_dom_exception_t *exception; + + exception = lexbor_mraw_alloc(document->mraw, sizeof(lxb_dom_exception_t)); + if (exception == NULL) { + return NULL; + } + + exception->document = document; + + if (name != NULL && name_length > 0) { + exception->code = lxb_dom_exception_code_by_name(name, name_length); + } + else { + exception->code = LXB_DOM_EXCEPTION_ERR; + } + + /* Message. */ + + if (message == NULL || message_length == 0) { + data = &lxb_dom_exception_data[exception->code]; + exception->message = *((lexbor_str_t *) &data->message); + } + else { + str = &exception->message; + str->data = lexbor_mraw_alloc(document->mraw, message_length + 1); + if (str->data == NULL) { + goto failed; + } + + memcpy(str->data, message, message_length); + + str->data[message_length] = '\0'; + str->length = message_length; + } + + /* Name. */ + + if (exception->code != LXB_DOM_EXCEPTION_ERR + || name == NULL || name_length == 0) + { + data = &lxb_dom_exception_data[exception->code]; + exception->name = *((lexbor_str_t *) &data->name); + } + else { + str = &exception->name; + str->data = lexbor_mraw_alloc(document->mraw, name_length + 1); + if (str->data == NULL) { + if (exception->message.length != 0) { + lexbor_mraw_free(document->mraw, exception->message.data); + } + + goto failed; + } + + memcpy(str->data, name, name_length); + + str->data[name_length] = '\0'; + str->length = name_length; + } + + return exception; + +failed: + + lexbor_mraw_free(document->mraw, exception); + + return NULL; +} + +lxb_dom_exception_t * +lxb_dom_exception_create_by_code(lxb_dom_document_t *document, + const lxb_char_t *message, size_t length, + lxb_dom_exception_code_t code) { - return lxb_dom_exception_code_ref_set(var, code); + lexbor_str_t *str; + const lxb_dom_exception_data_t *data; + lxb_dom_exception_t *exception; + + if (code <= LXB_DOM_EXCEPTION_OK || code >= LXB_DOM_EXCEPTION__LAST_ENTRY) { + return NULL; + } + + exception = lexbor_mraw_alloc(document->mraw, sizeof(lxb_dom_exception_t)); + if (exception == NULL) { + return NULL; + } + + exception->document = document; + exception->code = code; + + data = &lxb_dom_exception_data[code]; + + /* Message. */ + + if (message == NULL || length == 0) { + exception->message = *((lexbor_str_t *) &data->message); + } + else { + str = &exception->message; + str->data = lexbor_mraw_alloc(document->mraw, length + 1); + if (str->data == NULL) { + goto failed; + } + + memcpy(str->data, message, length); + + str->data[length] = '\0'; + str->length = length; + } + + /* Name. */ + + exception->name = *((lexbor_str_t *) &data->name); + + return exception; + +failed: + + lexbor_mraw_free(document->mraw, exception); + + return NULL; +} + +lxb_dom_exception_t * +lxb_dom_exception_destroy(lxb_dom_exception_t *exception) +{ + const lxb_dom_exception_data_t *data; + lxb_dom_document_t *document = exception->document; + + data = &lxb_dom_exception_data[exception->code]; + + if (exception->message.data != NULL + && exception->message.data != data->message.data) + { + lexbor_mraw_free(document->mraw, exception->message.data); + } + + if (exception->name.data != NULL + && exception->name.data != data->name.data) + { + lexbor_mraw_free(document->mraw, exception->name.data); + } + + lexbor_mraw_free(document->mraw, exception); + + return NULL; +} + +const lexbor_str_t * +lxb_dom_exception_message_by_code(lxb_dom_exception_code_t code) +{ + if (code <= LXB_DOM_EXCEPTION_OK || code >= LXB_DOM_EXCEPTION__LAST_ENTRY) { + return NULL; + } + + return &lxb_dom_exception_data[code].message; +} + +const lexbor_str_t * +lxb_dom_exception_name_by_code(lxb_dom_exception_code_t code) +{ + if (code <= LXB_DOM_EXCEPTION_OK || code >= LXB_DOM_EXCEPTION__LAST_ENTRY) { + return NULL; + } + + return &lxb_dom_exception_data[code].name; +} + +lxb_dom_exception_code_t +lxb_dom_exception_code_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_str_t *str; + lxb_dom_exception_code_t code; + + for (code = 0; code < LXB_DOM_EXCEPTION__LAST_ENTRY; code++) { + str = &lxb_dom_exception_data[code].name; + + if (length == str->length + && lexbor_str_data_ncasecmp(str->data, name, length)) + { + return code; + } + } + + return LXB_DOM_EXCEPTION_ERR; } diff --git a/ext/dom/lexbor/lexbor/dom/exception.h b/ext/dom/lexbor/lexbor/dom/exception.h index 47a7cfee040c..b306ed1443a3 100644 --- a/ext/dom/lexbor/lexbor/dom/exception.h +++ b/ext/dom/lexbor/lexbor/dom/exception.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,58 +12,84 @@ extern "C" { #endif #include "lexbor/core/base.h" +#include "lexbor/core/str.h" +#include "lexbor/dom/interface.h" typedef enum { - LXB_DOM_INDEX_SIZE_ERR = 0x00, - LXB_DOM_DOMSTRING_SIZE_ERR, - LXB_DOM_HIERARCHY_REQUEST_ERR, - LXB_DOM_WRONG_DOCUMENT_ERR, - LXB_DOM_INVALID_CHARACTER_ERR, - LXB_DOM_NO_DATA_ALLOWED_ERR, - LXB_DOM_NO_MODIFICATION_ALLOWED_ERR, - LXB_DOM_NOT_FOUND_ERR, - LXB_DOM_NOT_SUPPORTED_ERR, - LXB_DOM_INUSE_ATTRIBUTE_ERR, - LXB_DOM_INVALID_STATE_ERR, - LXB_DOM_SYNTAX_ERR, - LXB_DOM_INVALID_MODIFICATION_ERR, - LXB_DOM_NAMESPACE_ERR, - LXB_DOM_INVALID_ACCESS_ERR, - LXB_DOM_VALIDATION_ERR, - LXB_DOM_TYPE_MISMATCH_ERR, - LXB_DOM_SECURITY_ERR, - LXB_DOM_NETWORK_ERR, - LXB_DOM_ABORT_ERR, - LXB_DOM_URL_MISMATCH_ERR, - LXB_DOM_QUOTA_EXCEEDED_ERR, - LXB_DOM_TIMEOUT_ERR, - LXB_DOM_INVALID_NODE_TYPE_ERR, - LXB_DOM_DATA_CLONE_ERR + LXB_DOM_EXCEPTION_OK = -1, + LXB_DOM_EXCEPTION_ERR = 0, + LXB_DOM_EXCEPTION_INDEX_SIZE_ERR = 1, /* Deprecated. */ + LXB_DOM_EXCEPTION_DOMSTRING_SIZE_ERR, + LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR, + LXB_DOM_EXCEPTION_WRONG_DOCUMENT_ERR, + LXB_DOM_EXCEPTION_INVALID_CHARACTER_ERR, + LXB_DOM_EXCEPTION_NO_DATA_ALLOWED_ERR, + LXB_DOM_EXCEPTION_NO_MODIFICATION_ALLOWED_ERR, + LXB_DOM_EXCEPTION_NOT_FOUND_ERR, + LXB_DOM_EXCEPTION_NOT_SUPPORTED_ERR, + LXB_DOM_EXCEPTION_INUSE_ATTRIBUTE_ERR, + LXB_DOM_EXCEPTION_INVALID_STATE_ERR, + LXB_DOM_EXCEPTION_SYNTAX_ERR, + LXB_DOM_EXCEPTION_INVALID_MODIFICATION_ERR, + LXB_DOM_EXCEPTION_NAMESPACE_ERR, + LXB_DOM_EXCEPTION_INVALID_ACCESS_ERR, /* Deprecated. */ + LXB_DOM_EXCEPTION_VALIDATION_ERR, + LXB_DOM_EXCEPTION_TYPE_MISMATCH_ERR, /* Deprecated. */ + LXB_DOM_EXCEPTION_SECURITY_ERR, + LXB_DOM_EXCEPTION_NETWORK_ERR, + LXB_DOM_EXCEPTION_ABORT_ERR, + LXB_DOM_EXCEPTION_URL_MISMATCH_ERR, /* Deprecated. */ + LXB_DOM_EXCEPTION_QUOTA_EXCEEDED_ERR, /* Deprecated. */ + LXB_DOM_EXCEPTION_TIMEOUT_ERR, + LXB_DOM_EXCEPTION_INVALID_NODE_TYPE_ERR, + LXB_DOM_EXCEPTION_DATA_CLONE_ERR, + LXB_DOM_EXCEPTION_ENCODING_ERR, + LXB_DOM_EXCEPTION_NOT_READABLE_ERR, + LXB_DOM_EXCEPTION_UNKNOWN_ERR, + LXB_DOM_EXCEPTION_CONSTRAINT_ERR, + LXB_DOM_EXCEPTION_DATA_ERR, + LXB_DOM_EXCEPTION_TRANSACTION_INACTIVE_ERR, + LXB_DOM_EXCEPTION_READ_ONLY_ERR, + LXB_DOM_EXCEPTION_VERSION_ERR, + LXB_DOM_EXCEPTION_OPERATION_ERR, + LXB_DOM_EXCEPTION_NOT_ALLOWED_ERR, + LXB_DOM_EXCEPTION_OPT_OUT_ERR, + LXB_DOM_EXCEPTION__LAST_ENTRY } lxb_dom_exception_code_t; - -/* - * Inline functions - */ -lxb_inline void * -lxb_dom_exception_code_ref_set(lxb_dom_exception_code_t *var, - lxb_dom_exception_code_t code) -{ - if (var != NULL) { - *var = code; - } - - return NULL; +typedef struct { + lexbor_str_t name; + lexbor_str_t message; + lxb_dom_exception_code_t code; + lxb_dom_document_t *document; } +lxb_dom_exception_t; -/* - * No inline functions for ABI. - */ -LXB_API void * -lxb_dom_exception_code_ref_set_noi(lxb_dom_exception_code_t *var, - lxb_dom_exception_code_t code); + +LXB_API lxb_dom_exception_t * +lxb_dom_exception_create(lxb_dom_document_t *document, + const lxb_char_t *message, size_t message_length, + const lxb_char_t *name, size_t name_length); + +LXB_API lxb_dom_exception_t * +lxb_dom_exception_create_by_code(lxb_dom_document_t *document, + const lxb_char_t *message, size_t length, + lxb_dom_exception_code_t code); + +LXB_API lxb_dom_exception_t * +lxb_dom_exception_destroy(lxb_dom_exception_t *exception); + + +LXB_API const lexbor_str_t * +lxb_dom_exception_message_by_code(lxb_dom_exception_code_t code); + +LXB_API const lexbor_str_t * +lxb_dom_exception_name_by_code(lxb_dom_exception_code_t code); + +LXB_API lxb_dom_exception_code_t +lxb_dom_exception_code_by_name(const lxb_char_t *name, size_t length); #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/dom/interface.h b/ext/dom/lexbor/lexbor/dom/interface.h index 3eb4b133e9cd..30753e0b43ab 100644 --- a/ext/dom/lexbor/lexbor/dom/interface.h +++ b/ext/dom/lexbor/lexbor/dom/interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -16,8 +16,6 @@ extern "C" { #include "lexbor/tag/const.h" #include "lexbor/ns/const.h" -#include "lexbor/dom/exception.h" - #define lxb_dom_interface_cdata_section(obj) ((lxb_dom_cdata_section_t *) (obj)) #define lxb_dom_interface_character_data(obj) ((lxb_dom_character_data_t *) (obj)) diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/attr_const.h b/ext/dom/lexbor/lexbor/dom/interfaces/attr_const.h index 756ad5548e45..28afac5e0bdd 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/attr_const.h +++ b/ext/dom/lexbor/lexbor/dom/interfaces/attr_const.h @@ -39,22 +39,23 @@ typedef enum { LXB_DOM_ATTR_ID = 0x0012, LXB_DOM_ATTR_IS = 0x0013, LXB_DOM_ATTR_MAXLENGTH = 0x0014, - LXB_DOM_ATTR_PLACEHOLDER = 0x0015, - LXB_DOM_ATTR_POOL = 0x0016, - LXB_DOM_ATTR_PUBLIC = 0x0017, - LXB_DOM_ATTR_READONLY = 0x0018, - LXB_DOM_ATTR_REQUIRED = 0x0019, - LXB_DOM_ATTR_SCHEME = 0x001a, - LXB_DOM_ATTR_SELECTED = 0x001b, - LXB_DOM_ATTR_SIZE = 0x001c, - LXB_DOM_ATTR_SLOT = 0x001d, - LXB_DOM_ATTR_SRC = 0x001e, - LXB_DOM_ATTR_STYLE = 0x001f, - LXB_DOM_ATTR_SYSTEM = 0x0020, - LXB_DOM_ATTR_TITLE = 0x0021, - LXB_DOM_ATTR_TYPE = 0x0022, - LXB_DOM_ATTR_WIDTH = 0x0023, - LXB_DOM_ATTR__LAST_ENTRY = 0x0024 + LXB_DOM_ATTR_MULTIPLE = 0x0015, + LXB_DOM_ATTR_PLACEHOLDER = 0x0016, + LXB_DOM_ATTR_POOL = 0x0017, + LXB_DOM_ATTR_PUBLIC = 0x0018, + LXB_DOM_ATTR_READONLY = 0x0019, + LXB_DOM_ATTR_REQUIRED = 0x001a, + LXB_DOM_ATTR_SCHEME = 0x001b, + LXB_DOM_ATTR_SELECTED = 0x001c, + LXB_DOM_ATTR_SIZE = 0x001d, + LXB_DOM_ATTR_SLOT = 0x001e, + LXB_DOM_ATTR_SRC = 0x001f, + LXB_DOM_ATTR_STYLE = 0x0020, + LXB_DOM_ATTR_SYSTEM = 0x0021, + LXB_DOM_ATTR_TITLE = 0x0022, + LXB_DOM_ATTR_TYPE = 0x0023, + LXB_DOM_ATTR_WIDTH = 0x0024, + LXB_DOM_ATTR__LAST_ENTRY = 0x0025 } lxb_dom_attr_id_enum_t; diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/attr_res.h b/ext/dom/lexbor/lexbor/dom/interfaces/attr_res.h index 85aa2c5061fc..0796043cafd7 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/attr_res.h +++ b/ext/dom/lexbor/lexbor/dom/interfaces/attr_res.h @@ -63,6 +63,8 @@ static const lxb_dom_attr_data_t lxb_dom_attr_res_data_default[LXB_DOM_ATTR__LAS LXB_DOM_ATTR_IS, 1, true}, {{.u.short_str = "maxlength", .length = 9, .next = NULL}, LXB_DOM_ATTR_MAXLENGTH, 1, true}, + {{.u.short_str = "multiple", .length = 8, .next = NULL}, + LXB_DOM_ATTR_MULTIPLE, 1, true}, {{.u.short_str = "placeholder", .length = 11, .next = NULL}, LXB_DOM_ATTR_PLACEHOLDER, 1, true}, {{.u.short_str = "pool", .length = 4, .next = NULL}, @@ -127,7 +129,7 @@ static const lexbor_shs_entry_t lxb_dom_attr_res_shs_data[40] = {"is", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_IS], 2, 0}, {"type", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_TYPE], 4, 0}, {"title", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_TITLE], 5, 0}, - {NULL, NULL, 0, 0}, + {"multiple", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_MULTIPLE], 8, 0}, {"for", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_FOR], 3, 0}, {"face", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_FACE], 4, 22}, {"alt", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_ALT], 3, 23}, @@ -135,7 +137,7 @@ static const lexbor_shs_entry_t lxb_dom_attr_res_shs_data[40] = {"charset", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_CHARSET], 7, 26}, {"maxlength", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_MAXLENGTH], 9, 0}, {NULL, NULL, 0, 0}, - {"checked", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_CHECKED], 7, 0}, + {"checked", (void *) &lxb_dom_attr_res_data_default[LXB_DOM_ATTR_CHECKED], 7, 30}, {NULL, NULL, 0, 0} }; diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/character_data.c b/ext/dom/lexbor/lexbor/dom/interfaces/character_data.c index bbca1865b39d..12c7dfdd0d6c 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/character_data.c +++ b/ext/dom/lexbor/lexbor/dom/interfaces/character_data.c @@ -22,7 +22,7 @@ lxb_dom_character_data_interface_create(lxb_dom_document_t *document) lxb_dom_node_t *node = lxb_dom_interface_node(element); node->owner_document = lxb_dom_document_owner(document); - node->type = LXB_DOM_NODE_TYPE_UNDEF; + node->type = LXB_DOM_NODE_TYPE_CHARACTER_DATA; return element; } diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/document_type.c b/ext/dom/lexbor/lexbor/dom/interfaces/document_type.c index 8c7465f4d62b..46889162717f 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/document_type.c +++ b/ext/dom/lexbor/lexbor/dom/interfaces/document_type.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -12,6 +12,10 @@ LXB_API lxb_dom_attr_data_t * lxb_dom_attr_qualified_name_append(lexbor_hash_t *hash, const lxb_char_t *name, size_t length); +LXB_API lxb_dom_attr_data_t * +lxb_dom_attr_local_name_append(lexbor_hash_t *hash, + const lxb_char_t *name, size_t length); + lxb_dom_document_type_t * lxb_dom_document_type_interface_create(lxb_dom_document_t *document) @@ -29,6 +33,8 @@ lxb_dom_document_type_interface_create(lxb_dom_document_t *document) node->owner_document = lxb_dom_document_owner(document); node->type = LXB_DOM_NODE_TYPE_DOCUMENT_TYPE; + element->name = LXB_DOM_ATTR_HTML; + return element; } @@ -105,6 +111,103 @@ lxb_dom_document_type_interface_destroy(lxb_dom_document_type_t *document_type) return NULL; } +lxb_dom_document_type_t * +lxb_dom_document_type_create(lxb_dom_document_t *document, + const lxb_char_t *name, size_t name_len, + const lxb_char_t *pub, size_t pub_len, + const lxb_char_t *sys, size_t sys_len, + lxb_dom_exception_code_t *code) +{ + lxb_dom_attr_data_t *data; + lxb_dom_document_type_t *doctype; + + if (!lxb_dom_document_type_valid_name(name, name_len)) { + if (code != NULL) { + *code = LXB_DOM_EXCEPTION_INVALID_CHARACTER_ERR; + } + + return NULL; + } + + doctype = lxb_dom_document_type_interface_create(document); + if (doctype == NULL) { + goto failed; + } + + data = lxb_dom_attr_local_name_append(document->attrs, name, name_len); + if (data == NULL) { + goto failed; + } + + doctype->name = data->attr_id; + + if (pub != NULL && pub_len != 0) { + doctype->public_id.data = lxb_dom_document_create_text(document, + pub_len + 1); + if (doctype->public_id.data == NULL) { + goto failed; + } + + (void) lexbor_str_copy_to_with_null(&doctype->public_id, pub, pub_len); + } + + if (sys != NULL && sys_len != 0) { + doctype->system_id.data = lxb_dom_document_create_text(document, + sys_len + 1); + if (doctype->system_id.data == NULL) { + goto failed; + } + + (void) lexbor_str_copy_to_with_null(&doctype->system_id, sys, sys_len); + } + + if (code != NULL) { + *code = LXB_DOM_EXCEPTION_OK; + } + + return doctype; + +failed: + + if (doctype != NULL && doctype->public_id.data != NULL) { + lxb_dom_document_destroy_text(document, doctype->public_id.data); + } + + if (code != NULL) { + *code = LXB_DOM_EXCEPTION_ERR; + } + + return NULL; +} + +bool +lxb_dom_document_type_valid_name(const lxb_char_t *name, size_t length) +{ + lxb_char_t c; + const lxb_char_t *end; + + if (name == NULL || length == 0) { + return false; + } + + end = name + length; + + while (name < end) { + c = *name++; + /* + * U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE, + * or U+0000 NULL, or U+003E (>) + */ + if (c == 0x09 || c == 0x0A || c == 0x0C || c == 0x0D || c == 0x20 + || c == 0x00 || c == 0x3E) + { + return false; + } + } + + return true; +} + /* * No inline functions for ABI. */ diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/document_type.h b/ext/dom/lexbor/lexbor/dom/interfaces/document_type.h index 366aaba409ac..c7a1960af668 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/document_type.h +++ b/ext/dom/lexbor/lexbor/dom/interfaces/document_type.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -37,6 +37,34 @@ lxb_dom_document_type_interface_clone(lxb_dom_document_t *document, LXB_API lxb_dom_document_type_t * lxb_dom_document_type_interface_destroy(lxb_dom_document_type_t *document_type); +/* + * Create DocumentType by specification. + * + * https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype + * + * @param[in] lxb_dom_document_t *. Not NULL. + * @param[in] const lxb_char_t *. Name. May be NULL, but then the return value + * will be NULL and an exception code will be recorded. + * @param[in] size_t. Length of name. May be 0, but then the return value + * will be NULL and an exception code will be recorded. + * @param[in] const lxb_char_t *. PublicID. Can be NULL. + * @param[in] size_t. Length of PublicID. Can be 0. + * @param[in] const lxb_char_t *. SystemID. Can be NULL. + * @param[in] size_t. Length of SystemID. Can be 0. + * @param[out] lxb_dom_exception_code_t. Can be NULL. If the variable is passed, + * the code will definitely be assigned. LXB_DOM_EXCEPTION_OK + * if successful. + * + * @return lxb_dom_document_type_t * if successful, otherwise NULL. + */ +LXB_API lxb_dom_document_type_t * +lxb_dom_document_type_create(lxb_dom_document_t *document, + const lxb_char_t *name, size_t name_len, + const lxb_char_t *pub, size_t pub_len, + const lxb_char_t *sys, size_t sys_len, + lxb_dom_exception_code_t *code); +LXB_API bool +lxb_dom_document_type_valid_name(const lxb_char_t *ame, size_t name_len); /* * Inline functions diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/element.c b/ext/dom/lexbor/lexbor/dom/interfaces/element.c index 09d9736e5d8c..90d707d078bb 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/element.c +++ b/ext/dom/lexbor/lexbor/dom/interfaces/element.c @@ -581,6 +581,18 @@ lxb_dom_element_is_set(lxb_dom_element_t *element, return LXB_STATUS_OK; } +lxb_dom_element_t * +lxb_dom_element_by_id(lxb_dom_element_t *root, + const lxb_char_t *qualified_name, size_t len) +{ + lxb_dom_node_t *node; + + node = lxb_dom_node_by_id(lxb_dom_interface_node(root), + qualified_name, len); + + return lxb_dom_interface_element(node); +} + lxb_status_t lxb_dom_elements_by_tag_name(lxb_dom_element_t *root, lxb_dom_collection_t *collection, diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/element.h b/ext/dom/lexbor/lexbor/dom/interfaces/element.h index dd661d439cce..50d814fd3765 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/element.h +++ b/ext/dom/lexbor/lexbor/dom/interfaces/element.h @@ -135,6 +135,10 @@ LXB_API lxb_status_t lxb_dom_element_is_set(lxb_dom_element_t *element, const lxb_char_t *is, size_t is_len); +LXB_API lxb_dom_element_t * +lxb_dom_element_by_id(lxb_dom_element_t *root, + const lxb_char_t *qualified_name, size_t len); + LXB_API lxb_status_t lxb_dom_elements_by_tag_name(lxb_dom_element_t *root, lxb_dom_collection_t *collection, diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/node.c b/ext/dom/lexbor/lexbor/dom/interfaces/node.c index a588ed388e48..f2bbaa391e39 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/node.c +++ b/ext/dom/lexbor/lexbor/dom/interfaces/node.c @@ -10,6 +10,7 @@ #include "lexbor/dom/interfaces/document_type.h" #include "lexbor/dom/interfaces/element.h" #include "lexbor/dom/interfaces/processing_instruction.h" +#include "lexbor/dom/interfaces/shadow_root.h" typedef struct lxb_dom_node_cb_ctx lxb_dom_node_cb_ctx_t; @@ -29,6 +30,13 @@ struct lxb_dom_node_cb_ctx { size_t value_length; }; +typedef struct { + lxb_dom_node_t *node; + const lxb_char_t *value; + size_t length; +} +lxb_dom_node_id_cb_ctx_t; + LXB_API lxb_dom_attr_data_t * lxb_dom_attr_local_name_append(lexbor_hash_t *hash, @@ -44,6 +52,9 @@ lxb_ns_append(lexbor_hash_t *hash, const lxb_char_t *link, size_t length); static lexbor_action_t lxb_dom_node_by_tag_name_cb(lxb_dom_node_t *node, void *ctx); +static lexbor_action_t +lxb_dom_node_by_id_cb(lxb_dom_node_t *node, void *ctx); + static lexbor_action_t lxb_dom_node_by_tag_name_cb_all(lxb_dom_node_t *node, void *ctx); @@ -443,6 +454,373 @@ lxb_dom_node_insert_after(lxb_dom_node_t *to, lxb_dom_node_t *node) } } +lxb_dom_exception_code_t +lxb_dom_node_pre_insert_validity(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child) +{ + size_t count; + lxb_dom_node_t *tmp; + + /* + * If parent is not a Document, DocumentFragment, or Element node, then + * throw a "HierarchyRequestError" DOMException. + */ + if (parent == NULL) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + switch (parent->type) { + case LXB_DOM_NODE_TYPE_ELEMENT: + case LXB_DOM_NODE_TYPE_DOCUMENT: + case LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT: + break; + + default: + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + if (lxb_dom_node_host_including_inclusive_ancestor(node, parent)) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + /* + * If child is non-null and its parent is not parent, + * then throw a "NotFoundError" DOMException. + */ + if (child != NULL && parent != child->parent) { + return LXB_DOM_EXCEPTION_NOT_FOUND_ERR; + } + + /* + * If node is not a DocumentFragment, DocumentType, Element, + * or CharacterData node, then throw a "HierarchyRequestError" DOMException. + */ + if (node == NULL) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + switch (parent->type) { + case LXB_DOM_NODE_TYPE_ELEMENT: + case LXB_DOM_NODE_TYPE_DOCUMENT: + case LXB_DOM_NODE_TYPE_DOCUMENT_TYPE: + case LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT: + case LXB_DOM_NODE_TYPE_CHARACTER_DATA: + case LXB_DOM_NODE_TYPE_TEXT: + break; + + default: + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + /* + * If either node is a Text node and parent is a document, or node is + * a doctype and parent is not a document, then throw + * a "HierarchyRequestError" DOMException. + */ + if ((node->type == LXB_DOM_NODE_TYPE_TEXT + && parent->type == LXB_DOM_NODE_TYPE_DOCUMENT) + || (node->type == LXB_DOM_NODE_TYPE_DOCUMENT_TYPE + && parent->type != LXB_DOM_NODE_TYPE_DOCUMENT)) + { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + if (parent->type != LXB_DOM_NODE_TYPE_DOCUMENT) { + return LXB_DOM_EXCEPTION_OK; + } + + switch (node->type) { + case LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT: + tmp = node->first_child; + + if (tmp == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + + count = 0; + + do { + if (tmp->type == LXB_DOM_NODE_TYPE_TEXT) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + else if (tmp->type == LXB_DOM_NODE_TYPE_ELEMENT) { + count += 1; + + if (count > 1) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + } + + tmp = tmp->next; + } + while (tmp != NULL); + + if (count != 1) { + return LXB_DOM_EXCEPTION_OK; + } + + /* Fall Through. */ + + case LXB_DOM_NODE_TYPE_ELEMENT: + tmp = parent->first_child; + + while (tmp != NULL) { + if (tmp->type == LXB_DOM_NODE_TYPE_ELEMENT) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + tmp = tmp->next; + } + + if (child == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + + if (child->type == LXB_DOM_NODE_TYPE_DOCUMENT_TYPE) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + tmp = child->next; + + while (tmp != NULL) { + if (tmp->type == LXB_DOM_NODE_TYPE_DOCUMENT_TYPE) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + tmp = tmp->next; + } + + break; + + case LXB_DOM_NODE_TYPE_DOCUMENT_TYPE: + tmp = parent->first_child; + + while (tmp != NULL) { + if (tmp->type == LXB_DOM_NODE_TYPE_DOCUMENT_TYPE) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + else if (tmp->type == LXB_DOM_NODE_TYPE_ELEMENT + && child == NULL) + { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + tmp = tmp->next; + } + + if (child == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + + tmp = child->prev; + + while (tmp != NULL) { + if (tmp->type == LXB_DOM_NODE_TYPE_ELEMENT) { + return LXB_DOM_EXCEPTION_HIERARCHY_REQUEST_ERR; + } + + tmp = tmp->prev; + } + + break; + + default: + break; + } + + return LXB_DOM_EXCEPTION_OK; +} + +lxb_dom_exception_code_t +lxb_dom_node_pre_insert(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child) +{ + lxb_dom_exception_code_t ex_code; + + ex_code = lxb_dom_node_pre_insert_validity(parent, node, child); + if (ex_code != LXB_DOM_EXCEPTION_OK) { + return ex_code; + } + + if (child == node) { + child = node->next; + } + + return lxb_dom_node_insert(parent, node, child, false); +} + +lxb_inline lxb_dom_exception_code_t +lxb_dom_node_insert_node(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child, bool suppress_observers) +{ + lxb_dom_exception_code_t code; + + code = lxb_dom_node_adopt(node); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + + if (child == NULL) { + lxb_dom_node_insert_child(parent, node); + } + else { + lxb_dom_node_insert_before(child, node); + } + + return LXB_DOM_EXCEPTION_OK; +} + +lxb_dom_exception_code_t +lxb_dom_node_insert(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child, bool suppress_observers) +{ + lxb_dom_node_t *tmp, *next; + lxb_dom_exception_code_t code; + + if (node->type == LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT) { + if (node->first_child == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + } + + /* TODO: live range. */ + + if (node->type != LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT) { + return lxb_dom_node_insert_node(parent, node, child, + suppress_observers); + } + + tmp = node->first_child; + + while (tmp != NULL) { + next = tmp->next; + + code = lxb_dom_node_insert_node(parent, tmp, child, + suppress_observers); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + + tmp = next; + } + + /* TODO: Shadow and queue a tree mutation record. */ + + return LXB_DOM_EXCEPTION_OK; +} + +lxb_dom_exception_code_t +lxb_dom_node_insert_before_spec(lxb_dom_node_t *dst, lxb_dom_node_t *node, + lxb_dom_node_t *child) +{ + return lxb_dom_node_pre_insert(dst, node, child); +} + +lxb_dom_exception_code_t +lxb_dom_node_append_child(lxb_dom_node_t *parent, lxb_dom_node_t *node) +{ + return lxb_dom_node_pre_insert(parent, node, NULL); +} + +lxb_dom_exception_code_t +lxb_dom_node_remove_child(lxb_dom_node_t *parent, lxb_dom_node_t *child) +{ + if (parent != child->parent) { + return LXB_DOM_EXCEPTION_NOT_FOUND_ERR; + } + + return lxb_dom_node_remove_spec(child, false); +} + +lxb_dom_exception_code_t +lxb_dom_node_replace_child(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child) +{ + lxb_dom_node_t *tmp, *next; + lxb_dom_node_t *before; + lxb_dom_exception_code_t code; + + code = lxb_dom_node_pre_insert_validity(parent, node, child); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + + before = child->prev; + if (before == NULL) { + before = child->next; + } + + if (child->parent != NULL) { + code = lxb_dom_node_remove_spec(child, true); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + } + + if (node->type != LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT) { + return lxb_dom_node_insert_node(parent, node, before, true); + } + + tmp = node->first_child; + + while (tmp != NULL) { + next = tmp->next; + + code = lxb_dom_node_insert_node(parent, tmp, before, true); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + + tmp = next; + } + + return LXB_DOM_EXCEPTION_OK; +} + +lxb_dom_exception_code_t +lxb_dom_node_replace_all_spec(lxb_dom_node_t *parent, lxb_dom_node_t *node) +{ + lxb_dom_node_t *child, *next; + lxb_dom_exception_code_t code; + + child = parent->first_child; + + while (child != NULL) { + next = child->next; + + code = lxb_dom_node_remove_spec(child, true); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + + child = next; + } + + return lxb_dom_node_append_child(parent, node); +} + +lxb_dom_exception_code_t +lxb_dom_node_remove_spec(lxb_dom_node_t *node, bool suppress_observers) +{ + if (node->parent == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + + /* TODO: 3. Run the live range pre-remove steps, given node. */ + + /* + * TODO: For each NodeIterator object iterator whose root’s node document + * is node’s node document, run the NodeIterator pre-remove steps given + * node and iterator. + */ + + lxb_dom_node_remove(node); + + /* TODO: finish everything else. */ + + return LXB_DOM_EXCEPTION_OK; +} + void lxb_dom_node_remove_wo_events(lxb_dom_node_t *node) { @@ -617,6 +995,52 @@ lxb_dom_node_prepare_by(lxb_dom_document_t *document, return LXB_STATUS_OK; } +lxb_dom_node_t * +lxb_dom_node_by_id(lxb_dom_node_t *root, + const lxb_char_t *qualified_name, size_t len) +{ + lxb_dom_node_id_cb_ctx_t ctx; + + ctx.node = NULL; + ctx.value = qualified_name; + ctx.length = len; + + lxb_dom_node_simple_walk(root, lxb_dom_node_by_id_cb, &ctx); + + return ctx.node; +} + +static lexbor_action_t +lxb_dom_node_by_id_cb(lxb_dom_node_t *node, void *ctx) +{ + lxb_dom_node_id_cb_ctx_t *context; + const lxb_dom_attr_t *attr_id; + + if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) { + return LEXBOR_ACTION_OK; + } + + context = ctx; + attr_id = lxb_dom_interface_element(node)->attr_id; + + if (attr_id == NULL + || attr_id->value == NULL + || attr_id->value->length != context->length) + { + return LEXBOR_ACTION_OK; + } + + const lxb_char_t *data = attr_id->value->data; + size_t length = attr_id->value->length; + + if (lexbor_str_data_ncmp(context->value, data, length)) { + context->node = node; + return LEXBOR_ACTION_STOP; + } + + return LEXBOR_ACTION_OK; +} + lxb_status_t lxb_dom_node_by_tag_name(lxb_dom_node_t *root, lxb_dom_collection_t *collection, @@ -1278,6 +1702,47 @@ lxb_dom_node_is_empty(const lxb_dom_node_t *root) return true; } +bool +lxb_dom_node_host_including_inclusive_ancestor(const lxb_dom_node_t *node, + const lxb_dom_node_t *parent) +{ + const lxb_dom_shadow_root_t *root; + + while (parent != NULL) { + if (parent == node) { + return true; + } + + if (parent->type == LXB_DOM_NODE_TYPE_SHADOW_ROOT) { + root = lxb_dom_interface_shadow_root(parent); + parent = &root->host->node; + + continue; + } + + parent = parent->parent; + } + + return false; +} + +lxb_dom_exception_code_t +lxb_dom_node_adopt(lxb_dom_node_t *node) +{ + lxb_dom_exception_code_t code; + + if (node->parent != NULL) { + code = lxb_dom_node_remove_spec(node, false); + if (code != LXB_DOM_EXCEPTION_OK) { + return code; + } + } + + /* TODO: If document is not oldDocument steps. */ + + return LXB_DOM_EXCEPTION_OK; +} + lxb_tag_id_t lxb_dom_node_tag_id_noi(lxb_dom_node_t *node) { @@ -1313,3 +1778,9 @@ lxb_dom_node_last_child_noi(lxb_dom_node_t *node) { return lxb_dom_node_last_child(node); } + +lxb_dom_node_type_t +lxb_dom_node_type_noi(lxb_dom_node_t *node) +{ + return lxb_dom_node_type(node); +} diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/node.h b/ext/dom/lexbor/lexbor/dom/interfaces/node.h index b5d2c5069f0d..b95373c51952 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/node.h +++ b/ext/dom/lexbor/lexbor/dom/interfaces/node.h @@ -13,6 +13,7 @@ extern "C" { #include "lexbor/dom/interface.h" #include "lexbor/dom/collection.h" +#include "lexbor/dom/exception.h" #include "lexbor/dom/interfaces/event_target.h" @@ -59,7 +60,9 @@ typedef enum { LXB_DOM_NODE_TYPE_DOCUMENT_TYPE = 0x0A, LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT = 0x0B, LXB_DOM_NODE_TYPE_NOTATION = 0x0C, // historical - LXB_DOM_NODE_TYPE_LAST_ENTRY = 0x0D + LXB_DOM_NODE_TYPE_CHARACTER_DATA, + LXB_DOM_NODE_TYPE_SHADOW_ROOT, + LXB_DOM_NODE_TYPE_LAST_ENTRY } lxb_dom_node_type_t; @@ -135,12 +138,106 @@ lxb_dom_node_insert_after_wo_events(lxb_dom_node_t *to, lxb_dom_node_t *node); LXB_API void lxb_dom_node_insert_after(lxb_dom_node_t *to, lxb_dom_node_t *node); +LXB_API lxb_dom_exception_code_t +lxb_dom_node_pre_insert_validity(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child); + +LXB_API lxb_dom_exception_code_t +lxb_dom_node_pre_insert(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child); + +LXB_API lxb_dom_exception_code_t +lxb_dom_node_insert(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child, bool suppress_observers); + +/* + * Add a node as a child. + * + * Function according to specification. Node.appendChild(node). + * + * The function not only adds a node as a child, but also validates + * the possibility of adding it. + * For example, the lxb_dom_node_insert_child() function does not perform + * any validation. + * + * @param[in] lxb_dom_node_t *. Where to add. Not NULL. + * @param[in] lxb_dom_node_t *. Who to add. Not NULL. + * + * @return LXB_DOM_EXCEPTION_OK if successful, otherwise an error exception code. + */ +LXB_API lxb_dom_exception_code_t +lxb_dom_node_append_child(lxb_dom_node_t *parent, lxb_dom_node_t *node); + +/* + * Insert before child. + * + * Function according to specification. Node.insertBefore(node, child). + * + * The function not only insert a node as a child, but also validates + * the possibility of adding it. + * For example, the lxb_dom_node_insert_before() function does not perform + * any validation. + * + * @param[in] lxb_dom_node_t *. Where to add. Not NULL. + * @param[in] lxb_dom_node_t *. Who to add. Not NULL. + * @param[in] lxb_dom_node_t *. The child before need to insert. Not NULL. + * + * @return LXB_DOM_EXCEPTION_OK if successful, otherwise an error exception code. + */ +LXB_API lxb_dom_exception_code_t +lxb_dom_node_insert_before_spec(lxb_dom_node_t *dst, lxb_dom_node_t *node, + lxb_dom_node_t *child); + +LXB_API lxb_dom_exception_code_t +lxb_dom_node_remove_spec(lxb_dom_node_t *node, bool suppress_observers); + LXB_API void lxb_dom_node_remove_wo_events(lxb_dom_node_t *node); LXB_API void lxb_dom_node_remove(lxb_dom_node_t *node); +/* + * Removing a node. + * + * Function according to specification. Node.removeChild(node). + * + * The function not only removing a node, but also validates the possibility + * of adding it. + * For example, the lxb_dom_node_remove() function does not perform + * any validation. + * + * @param[in] lxb_dom_node_t *. Where remove. Not NULL. + * @param[in] lxb_dom_node_t *. Who remove. Not NULL. + * + * @return LXB_DOM_EXCEPTION_OK if successful, otherwise an error exception code. + */ +LXB_API lxb_dom_exception_code_t +lxb_dom_node_remove_child(lxb_dom_node_t *parent, lxb_dom_node_t *child); + +/* + * The function replaces the child with a node. + * + * Function according to specification. Node.replaceChild(node, child). + * + * The function not only replace a node, but also validates the possibility + * of adding it. + * For example, the lxb_dom_node_replace_all() function does not perform + * any validation. + * + * @param[in] lxb_dom_node_t *. Where replace. Not NULL. + * @param[in] lxb_dom_node_t *. Who replace. Not NULL. + * @param[in] lxb_dom_node_t *. Replaceable child. Not NULL. + * + * @return LXB_DOM_EXCEPTION_OK if successful, otherwise an error exception code. + */ +LXB_API lxb_dom_exception_code_t +lxb_dom_node_replace_child(lxb_dom_node_t *parent, lxb_dom_node_t *node, + lxb_dom_node_t *child); + +LXB_API lxb_dom_exception_code_t +lxb_dom_node_replace_all_spec(lxb_dom_node_t *parent, lxb_dom_node_t *node); + LXB_API lxb_status_t lxb_dom_node_replace_all(lxb_dom_node_t *parent, lxb_dom_node_t *node); @@ -148,6 +245,10 @@ LXB_API void lxb_dom_node_simple_walk(lxb_dom_node_t *root, lxb_dom_node_simple_walker_f walker_cb, void *ctx); +LXB_API lxb_dom_node_t * +lxb_dom_node_by_id(lxb_dom_node_t *root, + const lxb_char_t *qualified_name, size_t len); + LXB_API lxb_status_t lxb_dom_node_by_tag_name(lxb_dom_node_t *root, lxb_dom_collection_t *collection, const lxb_char_t *qualified_name, size_t len); @@ -193,6 +294,12 @@ lxb_dom_node_text_content_set(lxb_dom_node_t *node, LXB_API bool lxb_dom_node_is_empty(const lxb_dom_node_t *root); +LXB_API bool +lxb_dom_node_host_including_inclusive_ancestor(const lxb_dom_node_t *node, + const lxb_dom_node_t *parent); + +LXB_API lxb_dom_exception_code_t +lxb_dom_node_adopt(lxb_dom_node_t *node); /* * Inline functions @@ -233,6 +340,12 @@ lxb_dom_node_last_child(lxb_dom_node_t *node) return node->last_child; } +lxb_inline lxb_dom_node_type_t +lxb_dom_node_type(lxb_dom_node_t *node) +{ + return node->type; +} + /* * No inline functions for ABI. */ @@ -254,6 +367,9 @@ lxb_dom_node_first_child_noi(lxb_dom_node_t *node); LXB_API lxb_dom_node_t * lxb_dom_node_last_child_noi(lxb_dom_node_t *node); +LXB_API lxb_dom_node_type_t +lxb_dom_node_type_noi(lxb_dom_node_t *node); + #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/dom/interfaces/shadow_root.c b/ext/dom/lexbor/lexbor/dom/interfaces/shadow_root.c index a7145bcec0d8..e2c332d58b28 100644 --- a/ext/dom/lexbor/lexbor/dom/interfaces/shadow_root.c +++ b/ext/dom/lexbor/lexbor/dom/interfaces/shadow_root.c @@ -22,7 +22,7 @@ lxb_dom_shadow_root_interface_create(lxb_dom_document_t *document) lxb_dom_node_t *node = lxb_dom_interface_node(element); node->owner_document = lxb_dom_document_owner(document); - node->type = LXB_DOM_NODE_TYPE_UNDEF; + node->type = LXB_DOM_NODE_TYPE_SHADOW_ROOT; return element; } diff --git a/ext/dom/lexbor/lexbor/encoding/base.h b/ext/dom/lexbor/lexbor/encoding/base.h index 88d74cc9bf8f..459287df3832 100644 --- a/ext/dom/lexbor/lexbor/encoding/base.h +++ b/ext/dom/lexbor/lexbor/encoding/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -16,7 +16,7 @@ extern "C" { #define LXB_ENCODING_VERSION_MAJOR 2 -#define LXB_ENCODING_VERSION_MINOR 2 +#define LXB_ENCODING_VERSION_MINOR 3 #define LXB_ENCODING_VERSION_PATCH 0 #define LXB_ENCODING_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/encoding/encode.c b/ext/dom/lexbor/lexbor/encoding/encode.c index 4377fb31f58a..f9a4f9f8effb 100644 --- a/ext/dom/lexbor/lexbor/encoding/encode.c +++ b/ext/dom/lexbor/lexbor/encoding/encode.c @@ -111,6 +111,122 @@ return 1 +lxb_inline uint16_t +lxb_encoding_multi_big5_index(lxb_codepoint_t cp) +{ + if (cp > 0x2F8A7) { + return UINT16_MAX; + } + + if (cp < 65518) { + if (cp >= 167 && cp < 1106) { + return lxb_encoding_multi_big5_167_1106_map[cp - 167]; + } + else if (cp >= 8211) { + if (cp < 40882) { + return lxb_encoding_multi_big5_8211_40882_map[cp - 8211]; + } + else if (cp >= 64012) { + return lxb_encoding_multi_big5_64012_65518_map[cp - 64012]; + } + } + } + else if (cp >= 131210) { + if (cp < 172369) { + return lxb_encoding_multi_big5_131210_172369_map[cp - 131210]; + } + else if (cp >= 194708) { + if (cp < 194727) { + return lxb_encoding_multi_big5_194708_194727_map[cp - 194708]; + } + } + } + + return UINT16_MAX; +} + +lxb_inline uint16_t +lxb_encoding_multi_euc_kr_index(lxb_codepoint_t cp) +{ + if (cp > 0xFFE7) { + return UINT16_MAX; + } + + if (cp < 13278) { + if (cp >= 161 && cp < 1106) { + return lxb_encoding_multi_euc_kr_161_1106_map[cp - 161]; + } + else if (cp >= 8213) { + return lxb_encoding_multi_euc_kr_8213_13278_map[cp - 8213]; + } + } + else if (cp >= 19968) { + if (cp < 55204) { + return lxb_encoding_multi_euc_kr_19968_55204_map[cp - 19968]; + } + else if (cp >= 63744) { + if (cp < 65511) { + return lxb_encoding_multi_euc_kr_63744_65511_map[cp - 63744]; + } + } + } + + return UINT16_MAX; +} + +lxb_inline uint16_t +lxb_encoding_multi_gb18030_index(lxb_codepoint_t cp) +{ + if (cp > 0xFFE6) { + return UINT16_MAX; + } + + if (cp < 40892) { + if (cp >= 164 && cp < 1106) { + return lxb_encoding_multi_gb18030_164_1106_map[cp - 164]; + } + else if (cp >= 7743) { + return lxb_encoding_multi_gb18030_7743_40892_map[cp - 7743]; + } + } + else if (cp >= 57344) { + if (cp < 65510) { + return lxb_encoding_multi_gb18030_57344_65510_map[cp - 57344]; + } + } + + return UINT16_MAX; +} + +lxb_inline uint16_t +lxb_encoding_multi_jis0208_index(lxb_codepoint_t cp) +{ + if (cp > 0xFFE6) { + return UINT16_MAX; + } + + if (cp < 13262) { + if (cp >= 167 && cp < 1106) { + return lxb_encoding_multi_jis0208_167_1106_map[cp - 167]; + } + else if (cp >= 8208) { + return lxb_encoding_multi_jis0208_8208_13262_map[cp - 8208]; + } + } + else if (cp >= 19968) { + if (cp < 40865) { + return lxb_encoding_multi_jis0208_19968_40865_map[cp - 19968]; + } + else if (cp >= 63785) { + if (cp < 65510) { + return lxb_encoding_multi_jis0208_63785_65510_map[cp - 63785]; + } + } + } + + return UINT16_MAX; +} + lxb_status_t lxb_encoding_encode_default(lxb_encoding_encode_t *ctx, const lxb_codepoint_t **cps, const lxb_codepoint_t *end) @@ -327,10 +443,10 @@ lxb_encoding_encode_iso_2022_jp(lxb_encoding_encode_t *ctx, const lxb_codepoint_ unsigned state; lxb_codepoint_t cp; - size = 0; state = ctx->state; for (; *cps < end; (*cps)++) { + size = 0; cp = **cps; begin: diff --git a/ext/dom/lexbor/lexbor/encoding/encoding.c b/ext/dom/lexbor/lexbor/encoding/encoding.c index 19d3a1474688..2a43f0fd70a2 100644 --- a/ext/dom/lexbor/lexbor/encoding/encoding.c +++ b/ext/dom/lexbor/lexbor/encoding/encoding.c @@ -55,6 +55,74 @@ lxb_encoding_data_by_pre_name(const lxb_char_t *name, size_t length) return entry->value; } +lxb_encoding_t +lxb_encoding_prescan_validate(const lxb_char_t *name, size_t length) +{ + const lxb_encoding_data_t *data; + + data = lxb_encoding_data_by_pre_name(name, length); + if (data == NULL) { + return LXB_ENCODING_DEFAULT; + } + + if (data->encoding == LXB_ENCODING_UTF_16BE + || data->encoding == LXB_ENCODING_UTF_16LE) + { + return LXB_ENCODING_UTF_8; + } + + if (data->encoding == LXB_ENCODING_X_USER_DEFINED) { + return LXB_ENCODING_WINDOWS_1252; + } + + return data->encoding; +} + +const lxb_encoding_data_t * +lxb_encoding_data_prescan_validate(const lxb_char_t *name, size_t length) +{ + const lxb_encoding_data_t *data; + + data = lxb_encoding_data_by_pre_name(name, length); + if (data == NULL) { + return NULL; + } + + if (data->encoding == LXB_ENCODING_UTF_16BE + || data->encoding == LXB_ENCODING_UTF_16LE) + { + return lxb_encoding_data(LXB_ENCODING_UTF_8); + } + + if (data->encoding == LXB_ENCODING_X_USER_DEFINED) { + return lxb_encoding_data(LXB_ENCODING_WINDOWS_1252); + } + + return data; +} + +lxb_encoding_t +lxb_encoding_bom_sniff(const lxb_char_t *begin, size_t length) +{ + if (length >= 3) { + if (begin[0] == 0xEF && begin[1] == 0xBB && begin[2] == 0xBF) { + return LXB_ENCODING_UTF_8; + } + } + + if (length >= 2) { + if (begin[0] == 0xFE && begin[1] == 0xFF) { + return LXB_ENCODING_UTF_16BE; + } + + if (begin[0] == 0xFF && begin[1] == 0xFE) { + return LXB_ENCODING_UTF_16LE; + } + } + + return LXB_ENCODING_DEFAULT; +} + void lxb_encoding_utf_8_skip_bom(const lxb_char_t **begin, size_t *length) { @@ -100,6 +168,54 @@ lxb_encoding_utf_16le_skip_bom(const lxb_char_t **begin, size_t *length) } } +const lxb_encoding_data_t * +lxb_encoding_data_by_name(const lxb_char_t *name, size_t length) +{ + const lexbor_shs_entry_t *entry; + + if (length == 0) { + return NULL; + } + + entry = lexbor_shs_entry_get_lower_static(lxb_encoding_res_shs_entities, + name, length); + if (entry == NULL) { + return NULL; + } + + return (const lxb_encoding_data_t *) entry->value; +} + +const lxb_encoding_data_t * +lxb_encoding_data(lxb_encoding_t encoding) +{ + if (encoding >= LXB_ENCODING_LAST_ENTRY) { + return NULL; + } + + return &lxb_encoding_res_map[encoding]; +} + +lxb_encoding_encode_f +lxb_encoding_encode_function(lxb_encoding_t encoding) +{ + if (encoding >= LXB_ENCODING_LAST_ENTRY) { + return NULL; + } + + return lxb_encoding_res_map[encoding].encode; +} + +lxb_encoding_decode_f +lxb_encoding_decode_function(lxb_encoding_t encoding) +{ + if (encoding >= LXB_ENCODING_LAST_ENTRY) { + return NULL; + } + + return lxb_encoding_res_map[encoding].decode; +} + /* * No inline functions for ABI. */ diff --git a/ext/dom/lexbor/lexbor/encoding/encoding.h b/ext/dom/lexbor/lexbor/encoding/encoding.h index 7bda3ba5f56c..7e08a3687993 100644 --- a/ext/dom/lexbor/lexbor/encoding/encoding.h +++ b/ext/dom/lexbor/lexbor/encoding/encoding.h @@ -27,9 +27,18 @@ extern "C" { LXB_API const lxb_encoding_data_t * lxb_encoding_data_by_pre_name(const lxb_char_t *name, size_t length); +LXB_API lxb_encoding_t +lxb_encoding_prescan_validate(const lxb_char_t *name, size_t length); + +LXB_API const lxb_encoding_data_t * +lxb_encoding_data_prescan_validate(const lxb_char_t *name, size_t length); + /* * To skip BOM. */ +LXB_API lxb_encoding_t +lxb_encoding_bom_sniff(const lxb_char_t *begin, size_t length); + LXB_API void lxb_encoding_utf_8_skip_bom(const lxb_char_t **begin, size_t *length); @@ -39,6 +48,20 @@ lxb_encoding_utf_16be_skip_bom(const lxb_char_t **begin, size_t *length); LXB_API void lxb_encoding_utf_16le_skip_bom(const lxb_char_t **begin, size_t *length); +/* + * Encoding data. + */ +LXB_API const lxb_encoding_data_t * +lxb_encoding_data_by_name(const lxb_char_t *name, size_t length); + +LXB_API const lxb_encoding_data_t * +lxb_encoding_data(lxb_encoding_t encoding); + +LXB_API lxb_encoding_encode_f +lxb_encoding_encode_function(lxb_encoding_t encoding); + +LXB_API lxb_encoding_decode_f +lxb_encoding_decode_function(lxb_encoding_t encoding); /* * Inline functions @@ -305,54 +328,6 @@ lxb_encoding_decode_finish_single(lxb_encoding_decode_t *decode) /* * Encoding data. */ -lxb_inline const lxb_encoding_data_t * -lxb_encoding_data_by_name(const lxb_char_t *name, size_t length) -{ - const lexbor_shs_entry_t *entry; - - if (length == 0) { - return NULL; - } - - entry = lexbor_shs_entry_get_lower_static(lxb_encoding_res_shs_entities, - name, length); - if (entry == NULL) { - return NULL; - } - - return (const lxb_encoding_data_t *) entry->value; -} - -lxb_inline const lxb_encoding_data_t * -lxb_encoding_data(lxb_encoding_t encoding) -{ - if (encoding >= LXB_ENCODING_LAST_ENTRY) { - return NULL; - } - - return &lxb_encoding_res_map[encoding]; -} - -lxb_inline lxb_encoding_encode_f -lxb_encoding_encode_function(lxb_encoding_t encoding) -{ - if (encoding >= LXB_ENCODING_LAST_ENTRY) { - return NULL; - } - - return lxb_encoding_res_map[encoding].encode; -} - -lxb_inline lxb_encoding_decode_f -lxb_encoding_decode_function(lxb_encoding_t encoding) -{ - if (encoding >= LXB_ENCODING_LAST_ENTRY) { - return NULL; - } - - return lxb_encoding_res_map[encoding].decode; -} - lxb_inline lxb_status_t lxb_encoding_data_call_encode(lxb_encoding_data_t *encoding_data, lxb_encoding_encode_t *ctx, const lxb_codepoint_t **cp, const lxb_codepoint_t *end) diff --git a/ext/dom/lexbor/lexbor/encoding/multi.c b/ext/dom/lexbor/lexbor/encoding/multi.c index 78cd93ea82b1..2651648c5c96 100644 --- a/ext/dom/lexbor/lexbor/encoding/multi.c +++ b/ext/dom/lexbor/lexbor/encoding/multi.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/encoding/multi.h b/ext/dom/lexbor/lexbor/encoding/multi.h index 4e6da7b4728b..a4c5def5ba6a 100644 --- a/ext/dom/lexbor/lexbor/encoding/multi.h +++ b/ext/dom/lexbor/lexbor/encoding/multi.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Alexander Borisov + * Copyright (C) 2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -19,7 +19,7 @@ extern "C" { #include "lexbor/encoding/base.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN LXB_EXTERN lxb_codepoint_t lxb_encoding_multi_big5_map[19782]; LXB_EXTERN lxb_codepoint_t lxb_encoding_multi_euc_kr_map[23750]; LXB_EXTERN lxb_codepoint_t lxb_encoding_multi_gb18030_map[23940]; @@ -53,161 +53,7 @@ LXB_EXTERN uint16_t lxb_encoding_multi_jis0208_167_1106_map[939]; LXB_EXTERN uint16_t lxb_encoding_multi_jis0208_8208_13262_map[5054]; LXB_EXTERN uint16_t lxb_encoding_multi_jis0208_19968_40865_map[20897]; LXB_EXTERN uint16_t lxb_encoding_multi_jis0208_63785_65510_map[1725]; - -lxb_inline uint16_t -lxb_encoding_multi_big5_index(lxb_codepoint_t cp) -{ - if (cp > 0x2F8A7) { - return UINT16_MAX; - } - - if (cp < 65518) { - if (cp >= 167 && cp < 1106) { - return lxb_encoding_multi_big5_167_1106_map[cp - 167]; - } - else if (cp >= 8211) { - if (cp < 40882) { - return lxb_encoding_multi_big5_8211_40882_map[cp - 8211]; - } - else if (cp >= 64012) { - return lxb_encoding_multi_big5_64012_65518_map[cp - 64012]; - } - } - } - else if (cp >= 131210) { - if (cp < 172369) { - return lxb_encoding_multi_big5_131210_172369_map[cp - 131210]; - } - else if (cp >= 194708) { - if (cp < 194727) { - return lxb_encoding_multi_big5_194708_194727_map[cp - 194708]; - } - } - } - - return UINT16_MAX; -} - -lxb_inline uint16_t -lxb_encoding_multi_euc_kr_index(lxb_codepoint_t cp) -{ - if (cp > 0xFFE7) { - return UINT16_MAX; - } - - if (cp < 13278) { - if (cp >= 161 && cp < 1106) { - return lxb_encoding_multi_euc_kr_161_1106_map[cp - 161]; - } - else if (cp >= 8213) { - return lxb_encoding_multi_euc_kr_8213_13278_map[cp - 8213]; - } - } - else if (cp >= 19968) { - if (cp < 55204) { - return lxb_encoding_multi_euc_kr_19968_55204_map[cp - 19968]; - } - else if (cp >= 63744) { - if (cp < 65511) { - return lxb_encoding_multi_euc_kr_63744_65511_map[cp - 63744]; - } - } - } - - return UINT16_MAX; -} - -lxb_inline uint16_t -lxb_encoding_multi_gb18030_index(lxb_codepoint_t cp) -{ - if (cp > 0xFFE6) { - return UINT16_MAX; - } - - if (cp < 40892) { - if (cp >= 164 && cp < 1106) { - return lxb_encoding_multi_gb18030_164_1106_map[cp - 164]; - } - else if (cp >= 7743) { - return lxb_encoding_multi_gb18030_7743_40892_map[cp - 7743]; - } - } - else if (cp >= 57344) { - if (cp < 65510) { - return lxb_encoding_multi_gb18030_57344_65510_map[cp - 57344]; - } - } - - return UINT16_MAX; -} - -lxb_inline uint16_t -lxb_encoding_multi_iso_2022_jp_katakana_index(lxb_codepoint_t cp) -{ - if (cp >= 12289 && cp < 12541) { - return lxb_encoding_multi_iso_2022_jp_katakana_12289_12541_map[cp - 12289]; - } - - return UINT16_MAX; -} - -lxb_inline uint16_t -lxb_encoding_multi_jis0212_index(lxb_codepoint_t cp) -{ - if (cp > 0xFF5F) { - return UINT16_MAX; - } - - if (cp < 8483) { - if (cp >= 161 && cp < 1120) { - return lxb_encoding_multi_jis0212_161_1120_map[cp - 161]; - } - else if (cp >= 8470) { - return lxb_encoding_multi_jis0212_8470_8483_map[cp - 8470]; - } - } - else if (cp >= 19970) { - if (cp < 40870) { - return lxb_encoding_multi_jis0212_19970_40870_map[cp - 19970]; - } - else if (cp >= 65374) { - if (cp < 65375) { - return lxb_encoding_multi_jis0212_65374_65375_map[cp - 65374]; - } - } - } - - return UINT16_MAX; -} - -lxb_inline uint16_t -lxb_encoding_multi_jis0208_index(lxb_codepoint_t cp) -{ - if (cp > 0xFFE6) { - return UINT16_MAX; - } - - if (cp < 13262) { - if (cp >= 167 && cp < 1106) { - return lxb_encoding_multi_jis0208_167_1106_map[cp - 167]; - } - else if (cp >= 8208) { - return lxb_encoding_multi_jis0208_8208_13262_map[cp - 8208]; - } - } - else if (cp >= 19968) { - if (cp < 40865) { - return lxb_encoding_multi_jis0208_19968_40865_map[cp - 19968]; - } - else if (cp >= 63785) { - if (cp < 65510) { - return lxb_encoding_multi_jis0208_63785_65510_map[cp - 63785]; - } - } - } - - return UINT16_MAX; -} +#endif /* !LEXBOR_DISABLE_INTERNAL_EXTERN */ #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/encoding/range.h b/ext/dom/lexbor/lexbor/encoding/range.h index 18b331034423..ed9833d1cce9 100644 --- a/ext/dom/lexbor/lexbor/encoding/range.h +++ b/ext/dom/lexbor/lexbor/encoding/range.h @@ -23,8 +23,9 @@ extern "C" { #define LXB_ENCODING_RANGE_INDEX_GB18030_SIZE 207 - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN LXB_EXTERN const lxb_encoding_range_index_t lxb_encoding_range_index_gb18030[207]; +#endif /* !LEXBOR_DISABLE_INTERNAL_EXTERN */ #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/encoding/res.h b/ext/dom/lexbor/lexbor/encoding/res.h index 46a9f91ae9a9..25334ebd27cf 100644 --- a/ext/dom/lexbor/lexbor/encoding/res.h +++ b/ext/dom/lexbor/lexbor/encoding/res.h @@ -22,10 +22,10 @@ extern "C" { #include "lexbor/encoding/base.h" #include "lexbor/core/shs.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN LXB_EXTERN const lxb_encoding_data_t lxb_encoding_res_map[LXB_ENCODING_LAST_ENTRY]; LXB_EXTERN const lexbor_shs_entry_t lxb_encoding_res_shs_entities[220]; - +#endif /* !LEXBOR_DISABLE_INTERNAL_EXTERN */ #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/encoding/single.h b/ext/dom/lexbor/lexbor/encoding/single.h index 906279bf33e7..c2a4271ac90c 100644 --- a/ext/dom/lexbor/lexbor/encoding/single.h +++ b/ext/dom/lexbor/lexbor/encoding/single.h @@ -51,7 +51,7 @@ extern "C" { #define LXB_ENCODING_SINGLE_HASH_WINDOWS_874_SIZE 359 #define LXB_ENCODING_SINGLE_HASH_X_MAC_CYRILLIC_SIZE 373 - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN LXB_EXTERN const lxb_encoding_single_index_t lxb_encoding_single_index_ibm866[128]; LXB_EXTERN const lxb_encoding_single_index_t lxb_encoding_single_index_iso_8859_10[128]; LXB_EXTERN const lxb_encoding_single_index_t lxb_encoding_single_index_iso_8859_13[128]; @@ -107,6 +107,7 @@ LXB_EXTERN const lexbor_shs_hash_t lxb_encoding_single_hash_windows_1257[356]; LXB_EXTERN const lexbor_shs_hash_t lxb_encoding_single_hash_windows_1258[406]; LXB_EXTERN const lexbor_shs_hash_t lxb_encoding_single_hash_windows_874[360]; LXB_EXTERN const lexbor_shs_hash_t lxb_encoding_single_hash_x_mac_cyrillic[374]; +#endif /* !LEXBOR_DISABLE_INTERNAL_EXTERN */ #ifdef __cplusplus diff --git a/ext/dom/lexbor/lexbor/html/base.h b/ext/dom/lexbor/lexbor/html/base.h index a701dc35c680..570222c6de5e 100644 --- a/ext/dom/lexbor/lexbor/html/base.h +++ b/ext/dom/lexbor/lexbor/html/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -15,7 +15,7 @@ extern "C" { #define LXB_HTML_VERSION_MAJOR 2 -#define LXB_HTML_VERSION_MINOR 6 +#define LXB_HTML_VERSION_MINOR 8 #define LXB_HTML_VERSION_PATCH 0 #define LXB_HTML_VERSION_STRING LEXBOR_STRINGIZE(LXB_HTML_VERSION_MAJOR) "." \ diff --git a/ext/dom/lexbor/lexbor/html/encoding.c b/ext/dom/lexbor/lexbor/html/encoding.c index 5368400dab84..857661246b5c 100644 --- a/ext/dom/lexbor/lexbor/html/encoding.c +++ b/ext/dom/lexbor/lexbor/html/encoding.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -9,6 +9,31 @@ #include "lexbor/core/str.h" +typedef struct { + lexbor_str_t alias; + lexbor_str_t name; +} +lxb_html_encoding_name_t; + +static const lxb_html_encoding_name_t lxb_html_encoding_names[] = { + /* UTF-16BE */ + { lexbor_str("unicodefffe"), lexbor_str("UTF-8") }, + { lexbor_str("utf-16be"), lexbor_str("UTF-8") }, + + /* UTF-16LE */ + { lexbor_str("csunicode"), lexbor_str("UTF-8") }, + { lexbor_str("iso-10646-ucs-2"), lexbor_str("UTF-8") }, + { lexbor_str("ucs-2"), lexbor_str("UTF-8") }, + { lexbor_str("unicode"), lexbor_str("UTF-8") }, + { lexbor_str("unicodefeff"), lexbor_str("UTF-8") }, + { lexbor_str("utf-16"), lexbor_str("UTF-8") }, + { lexbor_str("utf-16le"), lexbor_str("UTF-8") }, + + /* x-user-defined */ + { lexbor_str("x-user-defined"), lexbor_str("windows-1252") } +}; + + static const lxb_char_t * lxb_html_encoding_meta(lxb_html_encoding_t *em, const lxb_char_t *data, const lxb_char_t *end); @@ -99,6 +124,73 @@ lxb_html_encoding_destroy(lxb_html_encoding_t *em, bool self_destroy) return em; } +const lxb_char_t * +lxb_html_encoding_prescan(lxb_html_encoding_t *em, const lxb_char_t *data, + const lxb_char_t *end, size_t *out_length) +{ + size_t len, length; + lxb_status_t status; + lxb_html_encoding_entry_t *entry; + const lxb_html_encoding_name_t *name; + + static const lexbor_str_t lxb_html_encoding_utf_16le = lexbor_str("UTF-16LE"); + static const lexbor_str_t lxb_html_encoding_utf_16be = lexbor_str("UTF-16BE"); + + len = end - data; + + /* Prescan for UTF-16 XML declarations: If position points to. */ + if (len >= 6) { + if (data[0] == 0x3C && data[1] == 0x00 && data[2] == 0x3F + && data[3] == 0x00 && data[4] == 0x78 && data[5] == 0x00) + { + *out_length = lxb_html_encoding_utf_16le.length; + return lxb_html_encoding_utf_16le.data; + } + + if (data[0] == 0x00 && data[1] == 0x3C && data[2] == 0x00 + && data[3] == 0x3F && data[4] == 0x00 && data[5] == 0x78) + { + *out_length = lxb_html_encoding_utf_16be.length; + return lxb_html_encoding_utf_16be.data; + } + } + + status = lxb_html_encoding_determine(em, data, end); + if (status != LXB_STATUS_OK) { + goto EMPTY; + } + + if (lxb_html_encoding_meta_length(em) == 0) { + goto EMPTY; + } + + entry = lxb_html_encoding_meta_entry(em, 0); + len = entry->end - entry->name; + length = sizeof(lxb_html_encoding_names) / sizeof(lxb_html_encoding_name_t); + + for (size_t i = 0; i < length; i++) { + name = &lxb_html_encoding_names[i]; + + if (len == name->alias.length + && lexbor_str_data_ncasecmp(entry->name, name->alias.data, + name->alias.length)) + { + *out_length = lxb_html_encoding_names[i].name.length; + return lxb_html_encoding_names[i].name.data; + } + } + + *out_length = entry->end - entry->name; + + return entry->name; + +EMPTY: + + *out_length = 0; + + return NULL; +} + lxb_status_t lxb_html_encoding_determine(lxb_html_encoding_t *em, const lxb_char_t *data, const lxb_char_t *end) @@ -381,12 +473,12 @@ lxb_html_encoding_content(const lxb_char_t *data, const lxb_char_t *end, for (; data < end; data++) { if (*data == **name_end) { - break; + *name_end = data; + goto done; } } - *name_end = data; - goto done; + return NULL; } name = data; diff --git a/ext/dom/lexbor/lexbor/html/encoding.h b/ext/dom/lexbor/lexbor/html/encoding.h index ec65778f715e..ad5a6198f945 100644 --- a/ext/dom/lexbor/lexbor/html/encoding.h +++ b/ext/dom/lexbor/lexbor/html/encoding.h @@ -1,5 +1,14 @@ /* - * Copyright (C) 2019 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov + * + * Functions for detecting encoding in an HTML byte stream. + * + * The HTML parser accepts only UTF-8 input. The detected encoding can be used + * with the Encoding module to convert the original byte stream from its + * encoding to UTF-8 before passing it to the parser. + * + * By specification: + * https://html.spec.whatwg.org/#determining-the-character-encoding * * Author: Alexander Borisov */ @@ -12,12 +21,13 @@ extern "C" { #endif #include "lexbor/html/base.h" - #include "lexbor/core/array_obj.h" typedef struct { + /* Pointer to the beginning of the encoding name in the original data. */ const lxb_char_t *name; + /* Pointer to the end of the encoding name in the original data. */ const lxb_char_t *end; } lxb_html_encoding_entry_t; @@ -29,17 +39,101 @@ typedef struct { lxb_html_encoding_t; +/* + * Initialization of the lxb_html_encoding_t object. + * + * The object can be allocated on the stack or created using + * lxb_html_encoding_create() function. + * + * @param[in] lxb_html_encoding_t * + * + * @return LXB_STATUS_OK if successful, otherwise an error status value. + */ LXB_API lxb_status_t lxb_html_encoding_init(lxb_html_encoding_t *em); +/* + * Destruction of the lxb_html_encoding_t object. + * + * Releases internal resources of the object. + * If the object was created using lxb_html_encoding_create(), set self_destroy + * to true. + * + * @param[in] lxb_html_encoding_t * + * @param[in] If true, the object itself will be freed. + * + * @return NULL if self_destroy is true. Pointer to the object if false. + */ LXB_API lxb_html_encoding_t * lxb_html_encoding_destroy(lxb_html_encoding_t *em, bool self_destroy); +/* + * Prescan a byte stream to determine its encoding. + * + * By specification: + * https://html.spec.whatwg.org/#prescan-a-byte-stream-to-determine-its-encoding + * + * Returns the validated encoding name if found, or NULL otherwise. + * + * Important: + * The returned pointer is not guaranteed to point into the input data stream. + * It may reference an internal static string (e.g. when the found encoding name + * is matched against a known alias). Do not assume the returned pointer lies + * within the [data, end) range. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + * @param[in] Pointer to the beginning of the data. Not NULL. + * @param[in] Pointer to the end of the data. Not NULL. + * @param[out] Length of the returned encoding name. Not NULL. + * + * @return Pointer to the encoding name, or NULL if no encoding was found. + */ +LXB_API const lxb_char_t * +lxb_html_encoding_prescan(lxb_html_encoding_t *em, const lxb_char_t *data, + const lxb_char_t *end, size_t *out_length); +/* + * Prescan a byte stream to determine its encoding. + * + * Implementation of the HTML specification algorithm for extracting encoding + * from tags. Scans raw HTML bytes looking for and + * declarations. + * + * Results can be retrieved using lxb_html_encoding_meta_entry() and + * lxb_html_encoding_meta_length() functions. + * + * Important: + * The HTML specification requires that if the determined charset is + * UTF-16BE/LE, it must be replaced with UTF-8, and if it is x-user-defined, + * it must be replaced with windows-1252. This function does not perform these + * replacements because it returns pointers to the original data (start and end + * of the found encoding name), which can be useful for developers. To get the + * validated encoding according to the specification, use the + * lxb_encoding_data_prescan_validate()/lxb_encoding_prescan_validate() + * functions from the Encoding module, or handle these cases manually. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + * @param[in] Pointer to the beginning of the data. Not NULL. + * @param[in] Pointer to the end of the data. Not NULL. + * + * @return LXB_STATUS_OK if successful, otherwise an error status value. + */ LXB_API lxb_status_t lxb_html_encoding_determine(lxb_html_encoding_t *em, const lxb_char_t *data, const lxb_char_t *end); +/* + * Extract encoding name from a Content-Type string. + * + * Parses the value of a content attribute looking for "charset=" + * pattern. For example, from "text/html; charset=utf-8" extracts "utf-8". + * + * @param[in] Pointer to the beginning of the content string. Not NULL. + * @param[in] Pointer to the end of the content string. Not NULL. + * @param[out] Pointer to the end of the encoding name. Not NULL. + * + * @return Pointer to the beginning of the encoding name, or NULL if not found. + */ LXB_API const lxb_char_t * lxb_html_encoding_content(const lxb_char_t *data, const lxb_char_t *end, const lxb_char_t **name_end); @@ -48,6 +142,14 @@ lxb_html_encoding_content(const lxb_char_t *data, const lxb_char_t *end, /* * Inline functions */ + +/* + * Create an lxb_html_encoding_t object on the heap. + * + * The object must be initialized using lxb_html_encoding_init() after creation. + * + * @return Pointer to a new object, or NULL if memory allocation failed. + */ lxb_inline lxb_html_encoding_t * lxb_html_encoding_create(void) { @@ -55,6 +157,14 @@ lxb_html_encoding_create(void) sizeof(lxb_html_encoding_t)); } +/* + * Clean the lxb_html_encoding_t object for reuse. + * + * Resets internal state so the object can be used for a new prescan without + * reallocation. Does not free memory. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + */ lxb_inline void lxb_html_encoding_clean(lxb_html_encoding_t *em) { @@ -62,18 +172,45 @@ lxb_html_encoding_clean(lxb_html_encoding_t *em) lexbor_array_obj_clean(&em->result); } +/* + * Get an encoding entry from the results by index. + * + * Returns a pointer to the lxb_html_encoding_entry_t which contains pointers + * to the beginning and end of the encoding name in the original data. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + * @param[in] Index of the entry. + * + * @return Pointer to the entry, or NULL if the index is out of bounds. + */ lxb_inline lxb_html_encoding_entry_t * lxb_html_encoding_meta_entry(lxb_html_encoding_t *em, size_t idx) { return (lxb_html_encoding_entry_t *) lexbor_array_obj_get(&em->result, idx); } +/* + * Get the number of encoding entries found. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + * + * @return Number of entries in the result. + */ lxb_inline size_t lxb_html_encoding_meta_length(lxb_html_encoding_t *em) { return lexbor_array_obj_length(&em->result); } +/* + * Get the result array object directly. + * + * Returns the internal array of lxb_html_encoding_entry_t entries. + * + * @param[in] lxb_html_encoding_t *. Not NULL. + * + * @return Pointer to the lexbor_array_obj_t with results. + */ lxb_inline lexbor_array_obj_t * lxb_html_encoding_meta_result(lxb_html_encoding_t *em) { diff --git a/ext/dom/lexbor/lexbor/html/interface.c b/ext/dom/lexbor/lexbor/html/interface.c index 1e7156d92a41..1b2a57c813e9 100644 --- a/ext/dom/lexbor/lexbor/html/interface.c +++ b/ext/dom/lexbor/lexbor/html/interface.c @@ -26,30 +26,33 @@ lxb_html_interface_create(lxb_html_document_t *document, lxb_tag_id_t tag_id, lxb_ns_id_t ns) { lxb_dom_node_t *node; + lxb_dom_element_t *domel; + lxb_html_unknown_element_t *unel; if (tag_id >= LXB_TAG__LAST_ENTRY) { if (ns == LXB_NS_HTML) { - lxb_html_unknown_element_t *unel; - unel = lxb_html_unknown_element_interface_create(document); node = lxb_dom_interface_node(unel); } else if (ns == LXB_NS_SVG) { /* TODO: For this need implement SVGElement */ - lxb_dom_element_t *domel; domel = lxb_dom_element_interface_create(&document->dom_document); node = lxb_dom_interface_node(domel); } else { - lxb_dom_element_t *domel; - domel = lxb_dom_element_interface_create(&document->dom_document); node = lxb_dom_interface_node(domel); } } else { - node = lxb_html_interface_res_constructors[tag_id][ns](document); + if (ns < LXB_NS__LAST_ENTRY) { + node = lxb_html_interface_res_constructors[tag_id][ns](document); + } + else { + domel = lxb_dom_element_interface_create(&document->dom_document); + node = lxb_dom_interface_node(domel); + } } if (node == NULL) { diff --git a/ext/dom/lexbor/lexbor/html/interface.h b/ext/dom/lexbor/lexbor/html/interface.h index a58a9e7474d7..503bef6345ac 100644 --- a/ext/dom/lexbor/lexbor/html/interface.h +++ b/ext/dom/lexbor/lexbor/html/interface.h @@ -71,6 +71,7 @@ extern "C" { #define lxb_html_interface_quote(obj) ((lxb_html_quote_element_t *) (obj)) #define lxb_html_interface_script(obj) ((lxb_html_script_element_t *) (obj)) #define lxb_html_interface_select(obj) ((lxb_html_select_element_t *) (obj)) +#define lxb_html_interface_selectedcontent(obj) ((lxb_html_selectedcontent_element_t *) obj) #define lxb_html_interface_slot(obj) ((lxb_html_slot_element_t *) (obj)) #define lxb_html_interface_source(obj) ((lxb_html_source_element_t *) (obj)) #define lxb_html_interface_span(obj) ((lxb_html_span_element_t *) (obj)) @@ -146,6 +147,8 @@ typedef struct lxb_html_progress_element lxb_html_progress_element_t; typedef struct lxb_html_quote_element lxb_html_quote_element_t; typedef struct lxb_html_script_element lxb_html_script_element_t; typedef struct lxb_html_select_element lxb_html_select_element_t; +typedef struct lxb_html_selectedcontent_element lxb_html_selectedcontent_element_t; +typedef struct lxb_html_search_element lxb_html_search_element_t; typedef struct lxb_html_slot_element lxb_html_slot_element_t; typedef struct lxb_html_source_element lxb_html_source_element_t; typedef struct lxb_html_span_element lxb_html_span_element_t; diff --git a/ext/dom/lexbor/lexbor/html/interface_res.h b/ext/dom/lexbor/lexbor/html/interface_res.h index 980be3c7de01..8a2f765c30ff 100644 --- a/ext/dom/lexbor/lexbor/html/interface_res.h +++ b/ext/dom/lexbor/lexbor/html/interface_res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2025 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -14,12 +14,10 @@ #ifndef LXB_HTML_INTERFACE_RES_H #define LXB_HTML_INTERFACE_RES_H -#endif /* LXB_HTML_INTERFACE_RES_H */ - #ifdef LXB_TAG_CONST_VERSION -#ifndef LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 +#ifndef LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 #error Mismatched tags version! See "lexbor/tag/const.h". -#endif /* LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 */ +#endif /* LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 */ #else #error You need to include "lexbor/tag/const.h". #endif /* LXB_TAG_CONST_VERSION */ @@ -97,7 +95,9 @@ #include "lexbor/html/interfaces/progress_element.h" #include "lexbor/html/interfaces/quote_element.h" #include "lexbor/html/interfaces/script_element.h" +#include "lexbor/html/interfaces/search_element.h" #include "lexbor/html/interfaces/select_element.h" +#include "lexbor/html/interfaces/selectedcontent_element.h" #include "lexbor/html/interfaces/slot_element.h" #include "lexbor/html/interfaces/source_element.h" #include "lexbor/html/interfaces/span_element.h" @@ -130,18 +130,6 @@ lxb_dom_element_interface_destroy_wrapper(void *interface) return lxb_dom_element_interface_destroy(interface); } -lxb_inline void * -lxb_html_unknown_element_interface_create_wrapper(void *interface) -{ - return lxb_html_unknown_element_interface_create(interface); -} - -lxb_inline void * -lxb_html_unknown_element_interface_destroy_wrapper(void *interface) -{ - return lxb_html_unknown_element_interface_destroy(interface); -} - lxb_inline void * lxb_html_element_interface_create_wrapper(void *interface) { @@ -166,6 +154,18 @@ lxb_dom_text_interface_destroy_wrapper(void *interface) return lxb_dom_text_interface_destroy(interface); } +lxb_inline void * +lxb_dom_document_interface_create_wrapper(void *interface) +{ + return lxb_dom_document_interface_create(interface); +} + +lxb_inline void * +lxb_dom_document_interface_destroy_wrapper(void *interface) +{ + return lxb_dom_document_interface_destroy(interface); +} + lxb_inline void * lxb_html_document_interface_create_wrapper(void *interface) { @@ -214,6 +214,18 @@ lxb_html_anchor_element_interface_destroy_wrapper(void *interface) return lxb_html_anchor_element_interface_destroy(interface); } +lxb_inline void * +lxb_html_unknown_element_interface_create_wrapper(void *interface) +{ + return lxb_html_unknown_element_interface_create(interface); +} + +lxb_inline void * +lxb_html_unknown_element_interface_destroy_wrapper(void *interface) +{ + return lxb_html_unknown_element_interface_destroy(interface); +} + lxb_inline void * lxb_html_area_element_interface_create_wrapper(void *interface) { @@ -826,6 +838,18 @@ lxb_html_script_element_interface_destroy_wrapper(void *interface) return lxb_html_script_element_interface_destroy(interface); } +lxb_inline void * +lxb_html_search_element_interface_create_wrapper(void *interface) +{ + return lxb_html_search_element_interface_create(interface); +} + +lxb_inline void * +lxb_html_search_element_interface_destroy_wrapper(void *interface) +{ + return lxb_html_search_element_interface_destroy(interface); +} + lxb_inline void * lxb_html_select_element_interface_create_wrapper(void *interface) { @@ -838,6 +862,18 @@ lxb_html_select_element_interface_destroy_wrapper(void *interface) return lxb_html_select_element_interface_destroy(interface); } +lxb_inline void * +lxb_html_selectedcontent_element_interface_create_wrapper(void *interface) +{ + return lxb_html_selectedcontent_element_interface_create(interface); +} + +lxb_inline void * +lxb_html_selectedcontent_element_interface_destroy_wrapper(void *interface) +{ + return lxb_html_selectedcontent_element_interface_destroy(interface); +} + lxb_inline void * lxb_html_slot_element_interface_create_wrapper(void *interface) { @@ -1019,15 +1055,12 @@ lxb_html_video_element_interface_destroy_wrapper(void *interface) } -#ifdef LXB_HTML_INTERFACE_RES_CONSTRUCTORS -#ifndef LXB_HTML_INTERFACE_RES_CONSTRUCTORS_ENABLED -#define LXB_HTML_INTERFACE_RES_CONSTRUCTORS_ENABLED static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY] = { /* LXB_TAG__UNDEF */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1037,8 +1070,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG__END_OF_FILE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1048,52 +1081,52 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG__TEXT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_text_interface_create_wrapper }, /* LXB_TAG__DOCUMENT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_document_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_interface_create_wrapper }, /* LXB_TAG__EM_COMMENT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_comment_interface_create_wrapper }, /* LXB_TAG__EM_DOCTYPE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_document_type_interface_create_wrapper }, /* LXB_TAG_A */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_anchor_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1103,8 +1136,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ABBR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1114,8 +1147,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ACRONYM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1125,8 +1158,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ADDRESS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1136,8 +1169,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ALTGLYPH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1147,8 +1180,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ALTGLYPHDEF */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1158,8 +1191,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ALTGLYPHITEM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1169,8 +1202,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ANIMATECOLOR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1180,8 +1213,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ANIMATEMOTION */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1191,8 +1224,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ANIMATETRANSFORM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1202,8 +1235,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ANNOTATION_XML */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1213,8 +1246,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_APPLET */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1224,8 +1257,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_AREA */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_area_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1235,8 +1268,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ARTICLE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1246,8 +1279,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ASIDE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1257,8 +1290,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_AUDIO */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_audio_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1268,8 +1301,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_B */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1279,8 +1312,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BASE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_base_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1290,8 +1323,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BASEFONT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1301,8 +1334,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BDI */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1312,8 +1345,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BDO */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1323,8 +1356,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BGSOUND */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1334,8 +1367,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BIG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1345,8 +1378,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BLINK */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1356,8 +1389,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BLOCKQUOTE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_quote_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1367,8 +1400,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BODY */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_body_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1378,8 +1411,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_br_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1389,8 +1422,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_BUTTON */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_button_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1400,8 +1433,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CANVAS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_canvas_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1411,8 +1444,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CAPTION */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_caption_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1422,8 +1455,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CENTER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1433,8 +1466,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CITE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1444,8 +1477,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CLIPPATH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1455,8 +1488,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_CODE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1466,8 +1499,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_COL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_col_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1477,8 +1510,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_COLGROUP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_col_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1488,8 +1521,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DATA */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_data_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1499,8 +1532,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DATALIST */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_data_list_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1510,8 +1543,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1521,8 +1554,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DEL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_mod_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1532,8 +1565,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DESC */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1543,8 +1576,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DETAILS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_details_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1554,8 +1587,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DFN */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1565,8 +1598,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DIALOG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_dialog_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1576,8 +1609,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DIR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_directory_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1587,8 +1620,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DIV */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_div_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1598,8 +1631,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_d_list_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1609,8 +1642,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_DT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1620,8 +1653,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_EM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1631,8 +1664,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_EMBED */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_embed_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1642,8 +1675,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEBLEND */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1653,8 +1686,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FECOLORMATRIX */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1664,8 +1697,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FECOMPONENTTRANSFER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1675,8 +1708,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FECOMPOSITE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1686,8 +1719,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FECONVOLVEMATRIX */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1697,8 +1730,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEDIFFUSELIGHTING */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1708,8 +1741,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEDISPLACEMENTMAP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1719,8 +1752,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEDISTANTLIGHT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1730,8 +1763,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEDROPSHADOW */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1741,8 +1774,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEFLOOD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1752,8 +1785,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEFUNCA */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1763,8 +1796,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEFUNCB */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1774,8 +1807,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEFUNCG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1785,8 +1818,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEFUNCR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1796,8 +1829,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEGAUSSIANBLUR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1807,8 +1840,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEIMAGE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1818,8 +1851,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEMERGE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1829,8 +1862,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEMERGENODE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1840,8 +1873,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEMORPHOLOGY */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1851,8 +1884,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEOFFSET */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1862,8 +1895,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FEPOINTLIGHT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1873,8 +1906,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FESPECULARLIGHTING */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1884,8 +1917,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FESPOTLIGHT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1895,8 +1928,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FETILE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1906,8 +1939,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FETURBULENCE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1917,8 +1950,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FIELDSET */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_field_set_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1928,8 +1961,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FIGCAPTION */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1939,8 +1972,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FIGURE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1950,8 +1983,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FONT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_font_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1961,8 +1994,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FOOTER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1972,8 +2005,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FOREIGNOBJECT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1983,8 +2016,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FORM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_form_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -1994,8 +2027,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FRAME */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_frame_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2005,8 +2038,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_FRAMESET */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_frame_set_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2016,8 +2049,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_GLYPHREF */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2027,8 +2060,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H1 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2038,8 +2071,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H2 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2049,8 +2082,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H3 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2060,8 +2093,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H4 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2071,8 +2104,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H5 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2082,8 +2115,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_H6 */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_heading_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2093,8 +2126,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_HEAD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_head_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2104,8 +2137,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_HEADER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2115,8 +2148,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_HGROUP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2126,8 +2159,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_HR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_hr_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2137,8 +2170,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_HTML */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2148,8 +2181,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_I */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2159,8 +2192,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_IFRAME */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_iframe_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2170,8 +2203,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_IMAGE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_image_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2181,8 +2214,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_IMG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_image_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2192,8 +2225,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_INPUT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_input_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2203,8 +2236,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_INS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_mod_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2214,8 +2247,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_ISINDEX */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2225,8 +2258,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_KBD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2236,8 +2269,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_KEYGEN */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2247,8 +2280,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LABEL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_label_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2258,8 +2291,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LEGEND */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_legend_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2269,8 +2302,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LI */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_li_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2280,8 +2313,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LINEARGRADIENT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2291,8 +2324,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LINK */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_link_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2302,8 +2335,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_LISTING */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_pre_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2313,8 +2346,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MAIN */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2324,8 +2357,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MALIGNMARK */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2335,8 +2368,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MAP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_map_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2346,8 +2379,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MARK */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2357,8 +2390,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MARQUEE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_marquee_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2368,8 +2401,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MATH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2379,8 +2412,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MENU */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_menu_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2390,8 +2423,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_META */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_meta_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2401,8 +2434,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_METER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_meter_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2412,8 +2445,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MFENCED */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2423,8 +2456,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MGLYPH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2434,8 +2467,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MI */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2445,8 +2478,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MN */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2456,8 +2489,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MO */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2467,8 +2500,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2478,8 +2511,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MTEXT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2489,8 +2522,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_MULTICOL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2500,8 +2533,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NAV */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2511,8 +2544,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NEXTID */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2522,8 +2555,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NOBR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2533,8 +2566,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NOEMBED */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2544,8 +2577,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NOFRAMES */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2555,8 +2588,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_NOSCRIPT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2566,8 +2599,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_OBJECT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_object_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2577,8 +2610,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_OL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_o_list_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2588,8 +2621,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_OPTGROUP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_opt_group_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2599,8 +2632,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_OPTION */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_option_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2610,8 +2643,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_OUTPUT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_output_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2621,8 +2654,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_P */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_paragraph_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2632,8 +2665,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PARAM */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_param_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2643,8 +2676,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PATH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2654,8 +2687,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PICTURE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_picture_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2665,8 +2698,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PLAINTEXT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2676,8 +2709,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PRE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_pre_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2687,8 +2720,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_PROGRESS */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_progress_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2698,8 +2731,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_Q */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_quote_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2709,8 +2742,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RADIALGRADIENT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2720,8 +2753,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RB */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2731,8 +2764,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2742,8 +2775,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2753,8 +2786,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RTC */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2764,8 +2797,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_RUBY */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2775,8 +2808,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_S */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2786,8 +2819,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SAMP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2797,8 +2830,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SCRIPT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_script_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2806,10 +2839,21 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper }, + /* LXB_TAG_SEARCH */ + { + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_html_search_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + }, /* LXB_TAG_SECTION */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2819,8 +2863,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SELECT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_select_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2828,10 +2872,21 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper }, + /* LXB_TAG_SELECTEDCONTENT */ + { + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_html_selectedcontent_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper + }, /* LXB_TAG_SLOT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_slot_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2841,8 +2896,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SMALL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2852,8 +2907,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SOURCE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_source_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2863,8 +2918,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SPACER */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2874,8 +2929,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SPAN */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_span_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2885,8 +2940,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_STRIKE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2896,8 +2951,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_STRONG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2907,8 +2962,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_STYLE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_style_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2918,8 +2973,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SUB */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2929,8 +2984,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SUMMARY */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2940,8 +2995,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SUP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2951,8 +3006,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_SVG */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2962,8 +3017,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TABLE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2973,8 +3028,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TBODY */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_section_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2984,8 +3039,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_cell_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -2995,8 +3050,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TEMPLATE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_template_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3006,8 +3061,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TEXTAREA */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_text_area_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3017,8 +3072,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TEXTPATH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3028,8 +3083,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TFOOT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_section_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3039,8 +3094,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TH */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_cell_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3050,8 +3105,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_THEAD */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_section_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3061,8 +3116,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TIME */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_time_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3072,8 +3127,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TITLE */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_title_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3083,8 +3138,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_table_row_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3094,8 +3149,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TRACK */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_track_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3105,8 +3160,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_TT */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3116,8 +3171,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_U */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3127,8 +3182,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_UL */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_u_list_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3138,8 +3193,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_VAR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3149,8 +3204,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_VIDEO */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_video_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3160,8 +3215,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_WBR */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3171,8 +3226,8 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ }, /* LXB_TAG_XMP */ { - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, - (lxb_dom_interface_constructor_f) lxb_html_unknown_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, + (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_html_pre_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper, @@ -3181,18 +3236,13 @@ static lxb_dom_interface_constructor_f lxb_html_interface_res_constructors[LXB_ (lxb_dom_interface_constructor_f) lxb_dom_element_interface_create_wrapper } }; -#endif /* LXB_HTML_INTERFACE_RES_CONSTRUCTORS_ENABLED */ -#endif /* LXB_HTML_INTERFACE_RES_CONSTRUCTORS */ -#ifdef LXB_HTML_INTERFACE_RES_DESTRUCTOR -#ifndef LXB_HTML_INTERFACE_RES_DESTRUCTOR_ENABLED -#define LXB_HTML_INTERFACE_RES_DESTRUCTOR_ENABLED static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY] = { /* LXB_TAG__UNDEF */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3202,8 +3252,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG__END_OF_FILE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3213,52 +3263,52 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG__TEXT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_text_interface_destroy_wrapper }, /* LXB_TAG__DOCUMENT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_document_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_interface_destroy_wrapper }, /* LXB_TAG__EM_COMMENT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_comment_interface_destroy_wrapper }, /* LXB_TAG__EM_DOCTYPE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_document_type_interface_destroy_wrapper }, /* LXB_TAG_A */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_anchor_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3268,8 +3318,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ABBR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3279,8 +3329,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ACRONYM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3290,8 +3340,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ADDRESS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3301,8 +3351,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ALTGLYPH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3312,8 +3362,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ALTGLYPHDEF */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3323,8 +3373,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ALTGLYPHITEM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3334,8 +3384,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ANIMATECOLOR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3345,8 +3395,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ANIMATEMOTION */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3356,8 +3406,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ANIMATETRANSFORM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3367,8 +3417,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ANNOTATION_XML */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3378,8 +3428,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_APPLET */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3389,8 +3439,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_AREA */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_area_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3400,8 +3450,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ARTICLE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3411,8 +3461,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ASIDE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3422,8 +3472,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_AUDIO */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_audio_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3433,8 +3483,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_B */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3444,8 +3494,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BASE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_base_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3455,8 +3505,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BASEFONT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3466,8 +3516,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BDI */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3477,8 +3527,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BDO */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3488,8 +3538,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BGSOUND */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3499,8 +3549,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BIG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3510,8 +3560,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BLINK */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3521,8 +3571,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BLOCKQUOTE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_quote_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3532,8 +3582,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BODY */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_body_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3543,8 +3593,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_br_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3554,8 +3604,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_BUTTON */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_button_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3565,8 +3615,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CANVAS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_canvas_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3576,8 +3626,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CAPTION */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_caption_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3587,8 +3637,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CENTER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3598,8 +3648,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CITE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3609,8 +3659,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CLIPPATH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3620,8 +3670,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_CODE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3631,8 +3681,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_COL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_col_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3642,8 +3692,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_COLGROUP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_col_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3653,8 +3703,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DATA */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_data_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3664,8 +3714,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DATALIST */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_data_list_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3675,8 +3725,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3686,8 +3736,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DEL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_mod_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3697,8 +3747,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DESC */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3708,8 +3758,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DETAILS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_details_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3719,8 +3769,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DFN */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3730,8 +3780,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DIALOG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_dialog_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3741,8 +3791,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DIR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_directory_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3752,8 +3802,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DIV */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_div_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3763,8 +3813,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_d_list_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3774,8 +3824,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_DT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3785,8 +3835,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_EM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3796,8 +3846,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_EMBED */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_embed_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3807,8 +3857,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEBLEND */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3818,8 +3868,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FECOLORMATRIX */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3829,8 +3879,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FECOMPONENTTRANSFER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3840,8 +3890,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FECOMPOSITE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3851,8 +3901,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FECONVOLVEMATRIX */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3862,8 +3912,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEDIFFUSELIGHTING */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3873,8 +3923,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEDISPLACEMENTMAP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3884,8 +3934,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEDISTANTLIGHT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3895,8 +3945,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEDROPSHADOW */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3906,8 +3956,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEFLOOD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3917,8 +3967,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEFUNCA */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3928,8 +3978,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEFUNCB */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3939,8 +3989,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEFUNCG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3950,8 +4000,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEFUNCR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3961,8 +4011,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEGAUSSIANBLUR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3972,8 +4022,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEIMAGE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3983,8 +4033,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEMERGE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -3994,8 +4044,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEMERGENODE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4005,8 +4055,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEMORPHOLOGY */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4016,8 +4066,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEOFFSET */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4027,8 +4077,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FEPOINTLIGHT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4038,8 +4088,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FESPECULARLIGHTING */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4049,8 +4099,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FESPOTLIGHT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4060,8 +4110,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FETILE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4071,8 +4121,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FETURBULENCE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4082,8 +4132,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FIELDSET */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_field_set_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4093,8 +4143,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FIGCAPTION */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4104,8 +4154,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FIGURE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4115,8 +4165,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FONT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_font_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4126,8 +4176,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FOOTER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4137,8 +4187,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FOREIGNOBJECT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4148,8 +4198,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FORM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_form_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4159,8 +4209,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FRAME */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_frame_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4170,8 +4220,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_FRAMESET */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_frame_set_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4181,8 +4231,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_GLYPHREF */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4192,8 +4242,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H1 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4203,8 +4253,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H2 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4214,8 +4264,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H3 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4225,8 +4275,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H4 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4236,8 +4286,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H5 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4247,8 +4297,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_H6 */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_heading_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4258,8 +4308,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_HEAD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_head_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4269,8 +4319,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_HEADER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4280,8 +4330,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_HGROUP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4291,8 +4341,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_HR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_hr_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4302,8 +4352,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_HTML */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4313,8 +4363,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_I */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4324,8 +4374,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_IFRAME */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_iframe_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4335,8 +4385,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_IMAGE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_image_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4346,8 +4396,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_IMG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_image_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4357,8 +4407,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_INPUT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_input_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4368,8 +4418,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_INS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_mod_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4379,8 +4429,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_ISINDEX */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4390,8 +4440,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_KBD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4401,8 +4451,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_KEYGEN */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4412,8 +4462,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LABEL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_label_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4423,8 +4473,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LEGEND */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_legend_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4434,8 +4484,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LI */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_li_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4445,8 +4495,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LINEARGRADIENT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4456,8 +4506,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LINK */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_link_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4467,8 +4517,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_LISTING */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_pre_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4478,8 +4528,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MAIN */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4489,8 +4539,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MALIGNMARK */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4500,8 +4550,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MAP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_map_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4511,8 +4561,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MARK */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4522,8 +4572,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MARQUEE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_marquee_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4533,8 +4583,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MATH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4544,8 +4594,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MENU */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_menu_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4555,8 +4605,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_META */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_meta_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4566,8 +4616,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_METER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_meter_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4577,8 +4627,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MFENCED */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4588,8 +4638,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MGLYPH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4599,8 +4649,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MI */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4610,8 +4660,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MN */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4621,8 +4671,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MO */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4632,8 +4682,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4643,8 +4693,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MTEXT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4654,8 +4704,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_MULTICOL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4665,8 +4715,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NAV */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4676,8 +4726,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NEXTID */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4687,8 +4737,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NOBR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4698,8 +4748,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NOEMBED */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4709,8 +4759,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NOFRAMES */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4720,8 +4770,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_NOSCRIPT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4731,8 +4781,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_OBJECT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_object_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4742,8 +4792,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_OL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_o_list_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4753,8 +4803,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_OPTGROUP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_opt_group_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4764,8 +4814,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_OPTION */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_option_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4775,8 +4825,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_OUTPUT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_output_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4786,8 +4836,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_P */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_paragraph_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4797,8 +4847,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PARAM */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_param_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4808,8 +4858,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PATH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4819,8 +4869,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PICTURE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_picture_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4830,8 +4880,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PLAINTEXT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4841,8 +4891,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PRE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_pre_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4852,8 +4902,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_PROGRESS */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_progress_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4863,8 +4913,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_Q */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_quote_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4874,8 +4924,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RADIALGRADIENT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4885,8 +4935,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RB */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4896,8 +4946,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4907,8 +4957,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4918,8 +4968,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RTC */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4929,8 +4979,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_RUBY */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4940,8 +4990,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_S */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4951,8 +5001,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SAMP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4962,8 +5012,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SCRIPT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_script_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4971,10 +5021,21 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper }, + /* LXB_TAG_SEARCH */ + { + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_html_search_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + }, /* LXB_TAG_SECTION */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4984,8 +5045,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SELECT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_select_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -4993,10 +5054,21 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper }, + /* LXB_TAG_SELECTEDCONTENT */ + { + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_html_selectedcontent_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper + }, /* LXB_TAG_SLOT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_slot_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5006,8 +5078,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SMALL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5017,8 +5089,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SOURCE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_source_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5028,8 +5100,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SPACER */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5039,8 +5111,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SPAN */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_span_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5050,8 +5122,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_STRIKE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5061,8 +5133,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_STRONG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5072,8 +5144,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_STYLE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_style_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5083,8 +5155,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SUB */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5094,8 +5166,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SUMMARY */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5105,8 +5177,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SUP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5116,8 +5188,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_SVG */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5127,8 +5199,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TABLE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5138,8 +5210,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TBODY */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_section_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5149,8 +5221,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_cell_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5160,8 +5232,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TEMPLATE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_template_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5171,8 +5243,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TEXTAREA */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_text_area_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5182,8 +5254,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TEXTPATH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5193,8 +5265,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TFOOT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_section_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5204,8 +5276,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TH */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_cell_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5215,8 +5287,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_THEAD */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_section_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5226,8 +5298,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TIME */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_time_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5237,8 +5309,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TITLE */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_title_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5248,8 +5320,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_table_row_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5259,8 +5331,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TRACK */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_track_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5270,8 +5342,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_TT */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5281,8 +5353,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_U */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5292,8 +5364,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_UL */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_u_list_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5303,8 +5375,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_VAR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5314,8 +5386,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_VIDEO */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_video_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5325,8 +5397,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_WBR */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5336,8 +5408,8 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG }, /* LXB_TAG_XMP */ { - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, - (lxb_dom_interface_destructor_f) lxb_html_unknown_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, + (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_html_pre_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper, @@ -5346,5 +5418,5 @@ static lxb_dom_interface_destructor_f lxb_html_interface_res_destructor[LXB_TAG (lxb_dom_interface_destructor_f) lxb_dom_element_interface_destroy_wrapper } }; -#endif /* LXB_HTML_INTERFACE_RES_DESTRUCTOR_ENABLED */ -#endif /* LXB_HTML_INTERFACE_RES_DESTRUCTOR */ + +#endif /* LXB_HTML_INTERFACE_RES_H */ diff --git a/ext/dom/lexbor/lexbor/html/interfaces/document.c b/ext/dom/lexbor/lexbor/html/interfaces/document.c index 34a2c6db0e5a..b40c6c8692f1 100644 --- a/ext/dom/lexbor/lexbor/html/interfaces/document.c +++ b/ext/dom/lexbor/lexbor/html/interfaces/document.c @@ -11,16 +11,18 @@ #include "lexbor/html/interfaces/style_element.h" #include "lexbor/html/node.h" #include "lexbor/html/parser.h" +#include "lexbor/html/tokenizer.h" #include "lexbor/tag/tag.h" #include "lexbor/dom/interfaces/text.h" #include "lexbor/dom/interfaces/element.h" -#define LXB_HTML_TAG_RES_DATA -#define LXB_HTML_TAG_RES_SHS_DATA -#include "lexbor/html/tag_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN lxb_html_tag_category_t lxb_html_tag_res_cats[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY]; + LXB_EXTERN lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY]; +#endif lxb_status_t lxb_html_parse_chunk_prepare(lxb_html_parser_t *parser, @@ -34,7 +36,7 @@ lxb_html_document_title_walker(lxb_dom_node_t *node, void *ctx); lxb_inline lxb_dom_interface_t * -lxb_html_document_interface_create_wrapper(lxb_dom_document_t *document, +lxb_html_document_interface_create_handler(lxb_dom_document_t *document, lxb_tag_id_t tag_id, lxb_ns_id_t ns) { return lxb_html_interface_create(lxb_html_interface_document(document), @@ -60,7 +62,7 @@ lxb_html_document_interface_create(lxb_html_document_t *document) } status = lxb_dom_document_init(doc, lxb_dom_interface_document(document), - lxb_html_document_interface_create_wrapper, + lxb_html_document_interface_create_handler, lxb_html_interface_clone, lxb_html_interface_destroy, LXB_DOM_DOCUMENT_DTYPE_HTML, LXB_NS_HTML); @@ -267,6 +269,7 @@ lxb_html_document_parser_prepare(lxb_html_document_t *document) { lxb_status_t status; lxb_dom_document_t *doc; + lxb_html_parser_t *parser; doc = lxb_dom_interface_document(document); @@ -278,6 +281,10 @@ lxb_html_document_parser_prepare(lxb_html_document_t *document) lxb_html_parser_destroy(doc->parser); return status; } + + parser = doc->parser; + + lxb_html_tokenizer_keep_duplicate_set(parser->tkz, true); } else if (lxb_html_parser_state(doc->parser) != LXB_HTML_PARSER_STATE_BEGIN) { lxb_html_parser_clean(doc->parser); diff --git a/ext/dom/lexbor/lexbor/html/interfaces/option_element.c b/ext/dom/lexbor/lexbor/html/interfaces/option_element.c index 77e1e23d3878..19f085da0423 100644 --- a/ext/dom/lexbor/lexbor/html/interfaces/option_element.c +++ b/ext/dom/lexbor/lexbor/html/interfaces/option_element.c @@ -5,6 +5,8 @@ */ #include "lexbor/html/interfaces/option_element.h" +#include "lexbor/html/interfaces/select_element.h" +#include "lexbor/html/interfaces/selectedcontent_element.h" #include "lexbor/html/interfaces/document.h" @@ -33,3 +35,48 @@ lxb_html_option_element_interface_destroy(lxb_html_option_element_t *option_elem (void) lxb_dom_node_interface_destroy(lxb_dom_interface_node(option_element)); return NULL; } + +lxb_dom_exception_code_t +lxb_html_option_maybe_clone_to_selectedcontent(lxb_html_option_element_t *option) +{ + bool is; + lxb_dom_node_t *select; + lxb_html_select_element_t *select_el; + lxb_html_selectedcontent_element_t *sel_content; + + is = lxb_html_option_element_selectedness(lxb_html_interface_option(option)); + if (!is) { + return LXB_DOM_EXCEPTION_OK; + } + + select = lxb_dom_interface_node(option); + + do { + select = select->parent; + + if (select == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + } + while (select->local_name != LXB_TAG_SELECT || select->ns != LXB_NS_HTML); + + select_el = lxb_html_interface_select(select); + + sel_content = lxb_html_select_get_enabled_selectedcontent(select_el); + if (sel_content == NULL) { + return LXB_DOM_EXCEPTION_OK; + } + + return lxb_html_selectedcontent_clone_option(sel_content, option); +} + +bool +lxb_html_option_element_selectedness(lxb_html_option_element_t *option) +{ + lxb_dom_attr_t *selected; + + selected = lxb_dom_element_attr_by_id(lxb_dom_interface_element(option), + LXB_DOM_ATTR_SELECTED); + + return selected != NULL; +} diff --git a/ext/dom/lexbor/lexbor/html/interfaces/option_element.h b/ext/dom/lexbor/lexbor/html/interfaces/option_element.h index a59763898def..99d4977aa031 100644 --- a/ext/dom/lexbor/lexbor/html/interfaces/option_element.h +++ b/ext/dom/lexbor/lexbor/html/interfaces/option_element.h @@ -27,6 +27,13 @@ LXB_API lxb_html_option_element_t * lxb_html_option_element_interface_destroy(lxb_html_option_element_t *option_element); +LXB_API lxb_dom_exception_code_t +lxb_html_option_maybe_clone_to_selectedcontent(lxb_html_option_element_t *option); + +LXB_API bool +lxb_html_option_element_selectedness(lxb_html_option_element_t *option); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/ext/dom/lexbor/lexbor/html/interfaces/search_element.c b/ext/dom/lexbor/lexbor/html/interfaces/search_element.c new file mode 100644 index 000000000000..00ca2a6ba3fc --- /dev/null +++ b/ext/dom/lexbor/lexbor/html/interfaces/search_element.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2018 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/html/interfaces/search_element.h" +#include "lexbor/html/interfaces/document.h" + + +lxb_html_search_element_t * +lxb_html_search_element_interface_create(lxb_html_document_t *document) +{ + lxb_html_search_element_t *element; + + element = lexbor_mraw_calloc(document->dom_document.mraw, + sizeof(lxb_html_search_element_t)); + if (element == NULL) { + return NULL; + } + + lxb_dom_node_t *node = lxb_dom_interface_node(element); + + node->owner_document = lxb_html_document_original_ref(document); + node->type = LXB_DOM_NODE_TYPE_ELEMENT; + + return element; +} + +lxb_html_search_element_t * +lxb_html_search_element_interface_destroy(lxb_html_search_element_t *search_element) +{ + (void) lxb_dom_node_interface_destroy(lxb_dom_interface_node(search_element)); + return NULL; +} diff --git a/ext/dom/lexbor/lexbor/html/interfaces/search_element.h b/ext/dom/lexbor/lexbor/html/interfaces/search_element.h new file mode 100644 index 000000000000..a42862176409 --- /dev/null +++ b/ext/dom/lexbor/lexbor/html/interfaces/search_element.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2018 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#ifndef LEXBOR_HTML_SEARCH_ELEMENT_H +#define LEXBOR_HTML_SEARCH_ELEMENT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lexbor/html/interface.h" +#include "lexbor/html/interfaces/element.h" + + +struct lxb_html_search_element { + lxb_html_element_t element; +}; + + +LXB_API lxb_html_search_element_t * +lxb_html_search_element_interface_create(lxb_html_document_t *document); + +LXB_API lxb_html_search_element_t * +lxb_html_search_element_interface_destroy(lxb_html_search_element_t *search_element); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LEXBOR_HTML_SEARCH_ELEMENT_H */ diff --git a/ext/dom/lexbor/lexbor/html/interfaces/select_element.c b/ext/dom/lexbor/lexbor/html/interfaces/select_element.c index 69f8abe8dd51..8b338dc76da7 100644 --- a/ext/dom/lexbor/lexbor/html/interfaces/select_element.c +++ b/ext/dom/lexbor/lexbor/html/interfaces/select_element.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -8,6 +8,10 @@ #include "lexbor/html/interfaces/document.h" +static lexbor_action_t +lxb_html_select_find_selectedcontent_cb(lxb_dom_node_t *node, void *ctx); + + lxb_html_select_element_t * lxb_html_select_element_interface_create(lxb_html_document_t *document) { @@ -33,3 +37,44 @@ lxb_html_select_element_interface_destroy(lxb_html_select_element_t *select_elem (void) lxb_dom_node_interface_destroy(lxb_dom_interface_node(select_element)); return NULL; } + +lxb_html_selectedcontent_element_t * +lxb_html_select_get_enabled_selectedcontent(lxb_html_select_element_t *el) +{ + lxb_dom_attr_t *multiple; + lxb_dom_node_t *selectedcontent, *node; + + multiple = lxb_dom_element_attr_by_id(lxb_dom_interface_element(el), + LXB_DOM_ATTR_MULTIPLE); + if (multiple != NULL) { + return NULL; + } + + selectedcontent = NULL; + node = lxb_dom_interface_node(el); + + lxb_dom_node_simple_walk(node, lxb_html_select_find_selectedcontent_cb, + &selectedcontent); + if (selectedcontent == NULL) { + return NULL; + } + + return lxb_html_interface_selectedcontent(selectedcontent); +} + +static lexbor_action_t +lxb_html_select_find_selectedcontent_cb(lxb_dom_node_t *node, void *ctx) +{ + lxb_dom_node_t **selectedcontent; + + if (node->local_name == LXB_TAG_SELECTEDCONTENT + && node->ns == LXB_NS_HTML) + { + selectedcontent = ctx; + *selectedcontent = node; + + return LEXBOR_ACTION_STOP; + } + + return LEXBOR_ACTION_OK; +} diff --git a/ext/dom/lexbor/lexbor/html/interfaces/select_element.h b/ext/dom/lexbor/lexbor/html/interfaces/select_element.h index 8676db5da902..03e20d197cd3 100644 --- a/ext/dom/lexbor/lexbor/html/interfaces/select_element.h +++ b/ext/dom/lexbor/lexbor/html/interfaces/select_element.h @@ -26,6 +26,8 @@ lxb_html_select_element_interface_create(lxb_html_document_t *document); LXB_API lxb_html_select_element_t * lxb_html_select_element_interface_destroy(lxb_html_select_element_t *select_element); +LXB_API lxb_html_selectedcontent_element_t * +lxb_html_select_get_enabled_selectedcontent(lxb_html_select_element_t *el); #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.c b/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.c new file mode 100644 index 000000000000..41b1c0d58b8f --- /dev/null +++ b/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2025 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/dom/interfaces/document_fragment.h" +#include "lexbor/html/interfaces/selectedcontent_element.h" +#include "lexbor/html/interfaces/document.h" + + +lxb_html_selectedcontent_element_t * +lxb_html_selectedcontent_element_interface_create(lxb_html_document_t *document) +{ + lxb_html_selectedcontent_element_t *element; + + element = lexbor_mraw_calloc(document->dom_document.mraw, + sizeof(lxb_html_selectedcontent_element_t)); + if (element == NULL) { + return NULL; + } + + lxb_dom_node_t *node = lxb_dom_interface_node(element); + + node->owner_document = lxb_html_document_original_ref(document); + node->type = LXB_DOM_NODE_TYPE_ELEMENT; + + return element; +} + +lxb_html_selectedcontent_element_t * +lxb_html_selectedcontent_element_interface_destroy(lxb_html_selectedcontent_element_t *selectedcontent_element) +{ + (void) lxb_dom_node_interface_destroy(lxb_dom_interface_node(selectedcontent_element)); + return NULL; +} + +lxb_dom_exception_code_t +lxb_html_selectedcontent_clone_option(lxb_html_selectedcontent_element_t *sc, + lxb_html_option_element_t *option) +{ + lxb_dom_node_t *node, *child, *opt_node; + lxb_dom_document_fragment_t fragment; + + memset(&fragment, 0x00, sizeof(lxb_dom_document_fragment_t)); + + opt_node = lxb_dom_interface_node(option); + + fragment.node.type = LXB_DOM_NODE_TYPE_DOCUMENT_FRAGMENT; + fragment.node.owner_document = opt_node->owner_document; + + node = opt_node->first_child; + + while (node != NULL) { + child = lxb_dom_node_clone(node, true); + if (child == NULL) { + return LXB_DOM_EXCEPTION_ERR; + } + + lxb_dom_node_insert_child_wo_events(lxb_dom_interface_node(&fragment), + child); + node = node->next; + } + + return lxb_dom_node_replace_all_spec(lxb_dom_interface_node(sc), + lxb_dom_interface_node(&fragment)); +} diff --git a/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.h b/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.h new file mode 100644 index 000000000000..5d38b59f501c --- /dev/null +++ b/ext/dom/lexbor/lexbor/html/interfaces/selectedcontent_element.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2025 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#ifndef LEXBOR_HTML_SELECTEDCONTENT_ELEMENT_H +#define LEXBOR_HTML_SELECTEDCONTENT_ELEMENT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lexbor/html/interface.h" +#include "lexbor/html/interfaces/element.h" + + +struct lxb_html_selectedcontent_element { + lxb_html_element_t element; +}; + + +LXB_API lxb_html_selectedcontent_element_t * +lxb_html_selectedcontent_element_interface_create(lxb_html_document_t *document); + +LXB_API lxb_html_selectedcontent_element_t * +lxb_html_selectedcontent_element_interface_destroy(lxb_html_selectedcontent_element_t *selectedcontent_element); + +LXB_API lxb_dom_exception_code_t +lxb_html_selectedcontent_clone_option(lxb_html_selectedcontent_element_t *sc, + lxb_html_option_element_t *option); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LEXBOR_HTML_SELECTEDCONTENT_ELEMENT_H */ diff --git a/ext/dom/lexbor/lexbor/html/parser.c b/ext/dom/lexbor/lexbor/html/parser.c index caca15e4be26..7d051045101e 100644 --- a/ext/dom/lexbor/lexbor/html/parser.c +++ b/ext/dom/lexbor/lexbor/html/parser.c @@ -13,9 +13,10 @@ #include "lexbor/html/tree/template_insertion.h" #include "lexbor/html/tree/insertion_mode.h" -#define LXB_HTML_TAG_RES_DATA -#define LXB_HTML_TAG_RES_SHS_DATA -#include "lexbor/html/tag_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN lxb_html_tag_category_t lxb_html_tag_res_cats[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY]; + LXB_EXTERN lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY]; +#endif static void @@ -43,6 +44,8 @@ lxb_html_parser_init(lxb_html_parser_t *parser) return status; } + lxb_html_tokenizer_keep_duplicate_set(parser->tkz, true); + /* Tree */ parser->tree = lxb_html_tree_create(); status = lxb_html_tree_init(parser->tree, parser->tkz); @@ -339,7 +342,9 @@ lxb_html_parse_fragment_chunk_destroy(lxb_html_parser_t *parser) parser->tree->fragment = NULL; } - if (lxb_html_document_is_original(parser->tree->document) == false) { + if (parser->tree->document != NULL + && lxb_html_document_is_original(parser->tree->document) == false) + { if (parser->root != NULL) { doc = lxb_dom_interface_node(parser->tree->document)->owner_document; parser->root->parent = &doc->node; diff --git a/ext/dom/lexbor/lexbor/html/style.c b/ext/dom/lexbor/lexbor/html/style.c deleted file mode 100644 index b07dbf12cae0..000000000000 --- a/ext/dom/lexbor/lexbor/html/style.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022-2023 Alexander Borisov - * - * Author: Alexander Borisov - */ - -#include "lexbor/html/style.h" - - -uintptr_t -lxb_html_style_id_by_name(lxb_html_document_t *doc, - const lxb_char_t *name, size_t size) -{ - const lxb_css_entry_data_t *data; - - data = lxb_css_property_by_name(name, size); - - if (data == NULL) { - return lxb_html_document_css_customs_find_id(doc, name, size); - } - - return data->unique; -} diff --git a/ext/dom/lexbor/lexbor/html/style.h b/ext/dom/lexbor/lexbor/html/style.h deleted file mode 100644 index 10800bcd6593..000000000000 --- a/ext/dom/lexbor/lexbor/html/style.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2022-2023 Alexander Borisov - * - * Author: Alexander Borisov - */ - -#ifndef LEXBOR_HTML_STYLE_H -#define LEXBOR_HTML_STYLE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lexbor/core/avl.h" -#include "lexbor/css/selectors/selector.h" -#include "lexbor/html/interfaces/document.h" - - -typedef struct lxb_html_style_weak lxb_html_style_weak_t; - -struct lxb_html_style_weak { - void *value; - lxb_css_selector_specificity_t sp; - - lxb_html_style_weak_t *next; -}; - -typedef struct { - lexbor_avl_node_t entry; - lxb_html_style_weak_t *weak; - - lxb_css_selector_specificity_t sp; -} -lxb_html_style_node_t; - - -LXB_API uintptr_t -lxb_html_style_id_by_name(lxb_html_document_t *doc, - const lxb_char_t *name, size_t size); - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LEXBOR_HTML_STYLE_H */ diff --git a/ext/dom/lexbor/lexbor/html/tag.c b/ext/dom/lexbor/lexbor/html/tag.c new file mode 100644 index 000000000000..48f894963c56 --- /dev/null +++ b/ext/dom/lexbor/lexbor/html/tag.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2026 Alexander Borisov + * + * Author: Alexander Borisov + */ + +#include "lexbor/html/tag.h" +#include "lexbor/html/tag_res.h" + + +bool +lxb_html_tag_is_category(lxb_tag_id_t tag_id, lxb_ns_id_t ns, + lxb_html_tag_category_t cat) +{ + if (tag_id < LXB_TAG__LAST_ENTRY && ns < LXB_NS__LAST_ENTRY) { + return lxb_html_tag_res_cats[tag_id][ns] & cat; + } + + return (LXB_HTML_TAG_CATEGORY_ORDINARY) & cat; +} + +const lxb_html_tag_fixname_t * +lxb_html_tag_fixname_svg(lxb_tag_id_t tag_id) +{ + if (tag_id >= LXB_TAG__LAST_ENTRY) { + return NULL; + } + + return &lxb_html_tag_res_fixname_svg[tag_id]; +} diff --git a/ext/dom/lexbor/lexbor/html/tag.h b/ext/dom/lexbor/lexbor/html/tag.h index 6570d7d40b7c..b559d31f6882 100644 --- a/ext/dom/lexbor/lexbor/html/tag.h +++ b/ext/dom/lexbor/lexbor/html/tag.h @@ -28,8 +28,7 @@ enum lxb_html_tag_category { LXB_HTML_TAG_CATEGORY_SCOPE = 0x0008, LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM = 0x0010, LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON = 0x0020, - LXB_HTML_TAG_CATEGORY_SCOPE_TABLE = 0x0040, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT = 0x0080, + LXB_HTML_TAG_CATEGORY_SCOPE_TABLE = 0x0040 }; typedef struct { @@ -39,35 +38,17 @@ typedef struct { lxb_html_tag_fixname_t; -#define LXB_HTML_TAG_RES_CATS -#define LXB_HTML_TAG_RES_FIXNAME_SVG -#include "lexbor/html/tag_res.h" +LXB_API bool +lxb_html_tag_is_category(lxb_tag_id_t tag_id, lxb_ns_id_t ns, + lxb_html_tag_category_t cat); + +LXB_API const lxb_html_tag_fixname_t * +lxb_html_tag_fixname_svg(lxb_tag_id_t tag_id); /* * Inline functions */ -lxb_inline bool -lxb_html_tag_is_category(lxb_tag_id_t tag_id, lxb_ns_id_t ns, - lxb_html_tag_category_t cat) -{ - if (tag_id < LXB_TAG__LAST_ENTRY && ns < LXB_NS__LAST_ENTRY) { - return lxb_html_tag_res_cats[tag_id][ns] & cat; - } - - return (LXB_HTML_TAG_CATEGORY_ORDINARY|LXB_HTML_TAG_CATEGORY_SCOPE_SELECT) & cat; -} - -lxb_inline const lxb_html_tag_fixname_t * -lxb_html_tag_fixname_svg(lxb_tag_id_t tag_id) -{ - if (tag_id >= LXB_TAG__LAST_ENTRY) { - return NULL; - } - - return &lxb_html_tag_res_fixname_svg[tag_id]; -} - lxb_inline bool lxb_html_tag_is_void(lxb_tag_id_t tag_id) { diff --git a/ext/dom/lexbor/lexbor/html/tag_res.h b/ext/dom/lexbor/lexbor/html/tag_res.h index 97c28640ccd1..5e2453a59f2a 100644 --- a/ext/dom/lexbor/lexbor/html/tag_res.h +++ b/ext/dom/lexbor/lexbor/html/tag_res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -14,14 +14,10 @@ #ifndef LXB_HTML_TAG_RES_H #define LXB_HTML_TAG_RES_H -#include "lexbor/html/tag.h" - -#endif /* LXB_HTML_TAG_RES_H */ - #ifdef LXB_TAG_CONST_VERSION -#ifndef LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 +#ifndef LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 #error Mismatched tags version! See "lexbor/tag/const.h". -#endif /* LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 */ +#endif /* LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 */ #else #error You need to include "lexbor/tag/const.h". #endif /* LXB_TAG_CONST_VERSION */ @@ -34,1835 +30,1476 @@ #error You need to include "lexbor/ns/const.h". #endif /* LXB_NS_CONST_VERSION */ -#ifdef LXB_HTML_TAG_RES_CATS -#ifndef LXB_HTML_TAG_RES_CATS_ENABLED -#define LXB_HTML_TAG_RES_CATS_ENABLED -static lxb_html_tag_category_t lxb_html_tag_res_cats[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY] = +LXB_API lxb_html_tag_category_t lxb_html_tag_res_cats[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY] = { /* LXB_TAG__UNDEF */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG__END_OF_FILE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG__TEXT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY }, /* LXB_TAG__DOCUMENT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY }, /* LXB_TAG__EM_COMMENT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY }, /* LXB_TAG__EM_DOCTYPE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY_ORDINARY }, /* LXB_TAG_A */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ABBR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ACRONYM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ADDRESS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ALTGLYPH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ALTGLYPHDEF */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ALTGLYPHITEM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ANIMATECOLOR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ANIMATEMOTION */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ANIMATETRANSFORM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ANNOTATION_XML */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_APPLET */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_AREA */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ARTICLE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ASIDE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_AUDIO */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_B */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BASE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BASEFONT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BDI */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BDO */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BGSOUND */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BIG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BLINK */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BLOCKQUOTE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BODY */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_BUTTON */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CANVAS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CAPTION */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CENTER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CITE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CLIPPATH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_CODE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_COL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_COLGROUP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DATA */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DATALIST */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DEL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DESC */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DETAILS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DFN */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DIALOG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DIR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DIV */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_DT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_EM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_EMBED */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEBLEND */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FECOLORMATRIX */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FECOMPONENTTRANSFER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FECOMPOSITE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FECONVOLVEMATRIX */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEDIFFUSELIGHTING */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEDISPLACEMENTMAP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEDISTANTLIGHT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEDROPSHADOW */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEFLOOD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEFUNCA */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEFUNCB */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEFUNCG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEFUNCR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEGAUSSIANBLUR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEIMAGE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEMERGE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEMERGENODE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEMORPHOLOGY */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEOFFSET */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FEPOINTLIGHT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FESPECULARLIGHTING */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FESPOTLIGHT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FETILE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FETURBULENCE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FIELDSET */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FIGCAPTION */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FIGURE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FONT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FOOTER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FOREIGNOBJECT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FORM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FRAME */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_FRAMESET */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_GLYPHREF */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H1 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H2 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H3 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H4 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H5 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_H6 */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_HEAD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_HEADER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_HGROUP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_HR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_HTML */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SCOPE_TABLE |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_I */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_IFRAME */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_IMAGE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_IMG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_INPUT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_INS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_ISINDEX */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_KBD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_KEYGEN */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LABEL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LEGEND */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LI */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LINEARGRADIENT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LINK */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_LISTING */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MAIN */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MALIGNMARK */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_ORDINARY, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MAP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MARK */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MARQUEE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MATH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MENU */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_META */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_METER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MFENCED */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MGLYPH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_ORDINARY, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_ORDINARY, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MI */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MN */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MO */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MTEXT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_MULTICOL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NAV */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NEXTID */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NOBR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NOEMBED */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NOFRAMES */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_NOSCRIPT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_OBJECT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_OL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_OPTGROUP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_OPTION */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_OUTPUT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_P */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PARAM */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PATH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PICTURE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PLAINTEXT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PRE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_PROGRESS */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_Q */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RADIALGRADIENT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RB */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RTC */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_RUBY */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_S */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SAMP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SCRIPT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF + }, + /* LXB_TAG_SEARCH */ + { + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SECTION */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SELECT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SCOPE + |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON + |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF + }, + /* LXB_TAG_SELECTEDCONTENT */ + { + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SLOT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SMALL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SOURCE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SPACER */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SPAN */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_STRIKE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_STRONG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_STYLE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SUB */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SUMMARY */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SUP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_SVG */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TABLE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SCOPE_TABLE |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TBODY */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TEMPLATE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SCOPE_TABLE |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TEXTAREA */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TEXTPATH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TFOOT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TH */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_THEAD */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TIME */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TITLE */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE |LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON |LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TRACK */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_TT */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_U */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_FORMATTING - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_FORMATTING,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_UL */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_VAR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_VIDEO */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_ORDINARY - |LXB_HTML_TAG_CATEGORY_SCOPE_SELECT, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_ORDINARY,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_WBR */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF }, /* LXB_TAG_XMP */ { - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT - |LXB_HTML_TAG_CATEGORY_SPECIAL, - LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF, - LXB_HTML_TAG_CATEGORY__UNDEF, LXB_HTML_TAG_CATEGORY__UNDEF + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY_SPECIAL,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF, + LXB_HTML_TAG_CATEGORY__UNDEF,LXB_HTML_TAG_CATEGORY__UNDEF } }; -#endif /* LXB_HTML_TAG_RES_CATS_ENABLED */ -#endif /* LXB_HTML_TAG_RES_CATS */ -#ifdef LXB_HTML_TAG_RES_FIXNAME_SVG -#ifndef LXB_HTML_TAG_RES_FIXNAME_SVG_ENABLED -#define LXB_HTML_TAG_RES_FIXNAME_SVG_ENABLED -static lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY] = +LXB_API lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY] = { /* LXB_TAG__UNDEF */ {NULL, 0}, @@ -2188,10 +1825,14 @@ static lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY] {NULL, 0}, /* LXB_TAG_SCRIPT */ {NULL, 0}, + /* LXB_TAG_SEARCH */ + {NULL, 0}, /* LXB_TAG_SECTION */ {NULL, 0}, /* LXB_TAG_SELECT */ {NULL, 0}, + /* LXB_TAG_SELECTEDCONTENT */ + {NULL, 0}, /* LXB_TAG_SLOT */ {NULL, 0}, /* LXB_TAG_SMALL */ @@ -2256,7 +1897,7 @@ static lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY] {NULL, 0}, /* LXB_TAG_XMP */ {NULL, 0}, - + }; -#endif /* LXB_HTML_TAG_RES_FIXNAME_SVG_ENABLED */ -#endif /* LXB_HTML_TAG_RES_FIXNAME_SVG */ + +#endif /* LXB_HTML_TAG_RES_H */ diff --git a/ext/dom/lexbor/lexbor/html/token.c b/ext/dom/lexbor/lexbor/html/token.c index 0f5d076adf59..d4ab1bbb767d 100644 --- a/ext/dom/lexbor/lexbor/html/token.c +++ b/ext/dom/lexbor/lexbor/html/token.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,11 +7,12 @@ #include "lexbor/html/token.h" #include "lexbor/html/tokenizer.h" -#define LEXBOR_STR_RES_MAP_LOWERCASE -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_MAP_HEX -#define LEXBOR_STR_RES_MAP_NUM -#include "lexbor/core/str_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_num[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; +#endif #include "lexbor/dom/interfaces/document_type.h" diff --git a/ext/dom/lexbor/lexbor/html/tokenizer.c b/ext/dom/lexbor/lexbor/html/tokenizer.c index 0bd9aec504f0..1d9f3781255d 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer.c @@ -11,19 +11,20 @@ #include "lexbor/html/tokenizer/state_script.h" #include "lexbor/html/tree.h" -#define LXB_HTML_TAG_RES_DATA -#define LXB_HTML_TAG_RES_SHS_DATA -#include "lexbor/html/tag_res.h" + +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN lxb_html_tag_category_t lxb_html_tag_res_cats[LXB_TAG__LAST_ENTRY][LXB_NS__LAST_ENTRY]; + LXB_EXTERN lxb_html_tag_fixname_t lxb_html_tag_res_fixname_svg[LXB_TAG__LAST_ENTRY]; +#endif #define LXB_HTML_TKZ_TEMP_SIZE (4096 * 4) enum { - LXB_HTML_TOKENIZER_OPT_UNDEF = 0x00, - LXB_HTML_TOKENIZER_OPT_TAGS_SELF = 0x01, - LXB_HTML_TOKENIZER_OPT_ATTRS_SELF = 0x02, - LXB_HTML_TOKENIZER_OPT_ATTRS_MRAW_SELF = 0x04 + LXB_HTML_TOKENIZER_OPT_TAGS_SELF = 1 << 0, + LXB_HTML_TOKENIZER_OPT_ATTRS_SELF = 1 << 1, + LXB_HTML_TOKENIZER_OPT_ATTRS_MRAW_SELF = 1 << 2 }; @@ -206,6 +207,8 @@ lxb_html_tokenizer_clean(lxb_html_tokenizer_t *tkz) tkz->is_eof = false; tkz->status = LXB_STATUS_OK; + tkz->utf8_buf_len = 0; + tkz->pos = tkz->start; lexbor_mraw_clean(tkz->mraw); @@ -304,12 +307,268 @@ lxb_html_tokenizer_begin(lxb_html_tokenizer_t *tkz) return LXB_STATUS_OK; } +/* + * Input stream validation. + * + * Per the HTML spec §13.2.3.5: surrogates, noncharacters, and controls + * (other than ASCII whitespace and NULL) in the input stream are parse errors. + * + * This is a fast linear scan that only fires when + * LXB_HTML_TOKENIZER_OPT_VALIDATE_INPUT is set. + */ + +/* + * Lookup: 1 if the byte is a single-byte control that needs reporting. + * Covers 0x01–0x08, 0x0B, 0x0E–0x1F, 0x7F. + * Excludes 0x00 (handled by tokenizer as UNNUCH), 0x09 (TAB), 0x0A (LF), + * 0x0C (FF), 0x0D (CR), 0x20 (SPACE). + */ +static const lxb_char_t +lxb_html_tkz_validate_ctl[256] = +{ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ +/* 0 */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, +/* 1 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 3 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 6 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 7 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, +/* 8+ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static void +lxb_html_tokenizer_validate_codepoint(lxb_html_tokenizer_t *tkz, + uint32_t cp, const lxb_char_t *pos) +{ + /* C1 controls: U+0080–U+009F */ + if (cp >= 0x0080 && cp <= 0x009F) { + lxb_html_tokenizer_error_add(tkz->parse_errors, pos, + LXB_HTML_TOKENIZER_ERROR_COCHININST); + return; + } + + /* Surrogates: U+D800–U+DFFF */ + if (cp >= 0xD800 && cp <= 0xDFFF) { + lxb_html_tokenizer_error_add(tkz->parse_errors, pos, + LXB_HTML_TOKENIZER_ERROR_SUININST); + return; + } + + /* Noncharacters: U+FDD0–U+FDEF */ + if (cp >= 0xFDD0 && cp <= 0xFDEF) { + lxb_html_tokenizer_error_add(tkz->parse_errors, pos, + LXB_HTML_TOKENIZER_ERROR_NOININST); + return; + } + + /* Noncharacters: U+xFFFE and U+xFFFF on every plane */ + if ((cp & 0xFFFE) == 0xFFFE && cp <= 0x10FFFF) { + lxb_html_tokenizer_error_add(tkz->parse_errors, pos, + LXB_HTML_TOKENIZER_ERROR_NOININST); + } +} + +static void +lxb_html_tokenizer_validate_flush_utf8(lxb_html_tokenizer_t *tkz, + const lxb_char_t *pos) +{ + uint32_t cp; + unsigned len = tkz->utf8_buf_len; + const lxb_char_t *b = tkz->utf8_buf; + + if (len < 2) { + goto done; + } + + if ((b[0] & 0xE0) == 0xC0) { + cp = ((uint32_t)(b[0] & 0x1F) << 6) | (b[1] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, pos); + goto done; + } + + if (len < 3) { + goto done; + } + + if ((b[0] & 0xF0) == 0xE0) { + cp = ((uint32_t)(b[0] & 0x0F) << 12) + | ((uint32_t)(b[1] & 0x3F) << 6) + | (b[2] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, pos); + goto done; + } + + if (len < 4) { + goto done; + } + + if ((b[0] & 0xF8) == 0xF0) { + cp = ((uint32_t)(b[0] & 0x07) << 18) + | ((uint32_t)(b[1] & 0x3F) << 12) + | ((uint32_t)(b[2] & 0x3F) << 6) + | (b[3] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, pos); + } + +done: + + tkz->utf8_buf_len = 0; +} + +static void +lxb_html_tokenizer_validate_input(lxb_html_tokenizer_t *tkz, + const lxb_char_t *data, size_t size) +{ + uint32_t cp; + unsigned need, len; + const lxb_char_t *p, *end; + + p = data; + end = data + size; + + /* Continue incomplete UTF-8 sequence from previous chunk. */ + if (tkz->utf8_buf_len > 0) { + lxb_char_t lead = tkz->utf8_buf[0]; + + if ((lead & 0xE0) == 0xC0) { + need = 2; + } + else if ((lead & 0xF0) == 0xE0) { + need = 3; + } + else { + need = 4; + } + + while (tkz->utf8_buf_len < need && p < end) { + if ((*p & 0xC0) != 0x80) { + /* Broken sequence, skip. */ + tkz->utf8_buf_len = 0; + break; + } + + tkz->utf8_buf[tkz->utf8_buf_len++] = *p++; + } + + if (tkz->utf8_buf_len == need) { + lxb_html_tokenizer_validate_flush_utf8(tkz, data); + } + else if (p >= end) { + /* Still incomplete, wait for more data. */ + return; + } + else { + /* Broken sequence was reset above. */ + } + } + + while (p < end) { + lxb_char_t b = *p; + + /* Fast path: printable ASCII (0x20–0x7E), TAB, LF, FF, CR, NULL. */ + if (b < 0x80) { + if (lxb_html_tkz_validate_ctl[b]) { + lxb_html_tokenizer_error_add(tkz->parse_errors, p, + LXB_HTML_TOKENIZER_ERROR_COCHININST); + } + + p++; + continue; + } + + /* Multi-byte UTF-8. Determine expected length. */ + if ((b & 0xE0) == 0xC0) { + need = 2; + } + else if ((b & 0xF0) == 0xE0) { + need = 3; + } + else if ((b & 0xF8) == 0xF0) { + need = 4; + } + else { + /* Invalid lead byte or continuation byte, skip. */ + p++; + continue; + } + + /* Check if the full sequence is available in this chunk. */ + if ((unsigned)(end - p) < need) { + /* Save partial sequence for next chunk. */ + len = (unsigned)(end - p); + memcpy(tkz->utf8_buf, p, len); + tkz->utf8_buf_len = len; + return; + } + + /* Quick filter: only decode if lead byte can start a bad codepoint. + * + * 0xC2 -> C1 controls (U+0080–U+009F): second byte 0x80–0x9F + * 0xED -> surrogates (U+D800–U+DFFF): second byte 0xA0–0xBF + * 0xEF -> nonchars U+FDD0–U+FDEF (0xEF 0xB7 0x90–0xAF) + * and U+FFFE/U+FFFF (0xEF 0xBF 0xBE/0xBF) + * 0xF0–0xF4 -> nonchars U+xFFFE/U+xFFFF on planes 1–16 + */ + if (b == 0xC2) { + if (p[1] <= 0x9F) { + cp = ((uint32_t)(b & 0x1F) << 6) | (p[1] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, p); + } + } + else if (b == 0xED) { + if (p[1] >= 0xA0) { + cp = ((uint32_t)(b & 0x0F) << 12) + | ((uint32_t)(p[1] & 0x3F) << 6) + | (p[2] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, p); + } + } + else if (b == 0xEF) { + if (p[1] == 0xB7 && p[2] >= 0x90 && p[2] <= 0xAF) { + /* U+FDD0–U+FDEF */ + lxb_html_tokenizer_error_add(tkz->parse_errors, p, + LXB_HTML_TOKENIZER_ERROR_NOININST); + } + else if (p[1] == 0xBF && (p[2] == 0xBE || p[2] == 0xBF)) { + /* U+FFFE, U+FFFF */ + lxb_html_tokenizer_error_add(tkz->parse_errors, p, + LXB_HTML_TOKENIZER_ERROR_NOININST); + } + } + else if (b >= 0xF0 && b <= 0xF4) { + /* 4-byte: check for xFFFE/xFFFF. */ + if (p[2] == 0xBF && (p[3] == 0xBE || p[3] == 0xBF)) { + cp = ((uint32_t)(b & 0x07) << 18) + | ((uint32_t)(p[1] & 0x3F) << 12) + | ((uint32_t)(p[2] & 0x3F) << 6) + | (p[3] & 0x3F); + lxb_html_tokenizer_validate_codepoint(tkz, cp, p); + } + } + + p += need; + } +} + lxb_status_t lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, size_t size) { const lxb_char_t *end = data + size; + if (tkz->opt & LXB_HTML_TOKENIZER_OPT_VALIDATE_INPUT) { + lxb_html_tokenizer_validate_input(tkz, data, size); + } + tkz->is_eof = false; tkz->status = LXB_STATUS_OK; tkz->last = end; @@ -457,6 +716,46 @@ lxb_html_tokenizer_set_state_by_tag(lxb_html_tokenizer_t *tkz, bool scripting, } } +void +lxb_html_tokenizer_attr_last_duplicate(lxb_html_tokenizer_t *tkz) +{ + lxb_html_token_t *token; + lxb_html_token_attr_t *attr, *last; + + token = tkz->token; + attr = token->attr_first; + last = token->attr_last; + + while (attr != last) { + if (attr->name == last->name) { + lxb_html_tokenizer_error_add(tkz->parse_errors, last->name_begin, + LXB_HTML_TOKENIZER_ERROR_DUAT); + + lxb_html_token_attr_remove(token, last); + lxb_html_token_attr_destroy(last, tkz->dobj_token_attr); + return; + } + + attr = attr->next; + } +} + +void +lxb_html_tokenizer_validate_close_tag(lxb_html_tokenizer_t *tkz) +{ + if (tkz->token->attr_last != NULL) { + lxb_html_tokenizer_error_add(tkz->parse_errors, + tkz->token->attr_last->name_begin, + LXB_HTML_TOKENIZER_ERROR_ENTAWIAT); + } + + if (tkz->token->type & LXB_HTML_TOKEN_TYPE_CLOSE_SELF) { + lxb_html_tokenizer_error_add(tkz->parse_errors, tkz->token->end, + LXB_HTML_TOKENIZER_ERROR_ENTAWITRSO); + } +} + + /* * No inline functions for ABI. */ @@ -508,6 +807,13 @@ lxb_html_tokenizer_tree_set_noi(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_tree_set(tkz, tree); } +void +lxb_html_tokenizer_input_validation_set_noi(lxb_html_tokenizer_t *tkz, + bool enabled) +{ + lxb_html_tokenizer_input_validation_set(tkz, enabled); +} + lexbor_mraw_t * lxb_html_tokenizer_mraw_noi(lxb_html_tokenizer_t *tkz) { @@ -519,3 +825,10 @@ lxb_html_tokenizer_tags_noi(lxb_html_tokenizer_t *tkz) { return lxb_html_tokenizer_tags(tkz); } + +void +lxb_html_tokenizer_keep_duplicate_set_noi(lxb_html_tokenizer_t *tkz, + bool keep) +{ + lxb_html_tokenizer_keep_duplicate_set(tkz, keep); +} diff --git a/ext/dom/lexbor/lexbor/html/tokenizer.h b/ext/dom/lexbor/lexbor/html/tokenizer.h index 74bb55ef0fd7..aa1ac37d996d 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer.h +++ b/ext/dom/lexbor/lexbor/html/tokenizer.h @@ -21,6 +21,12 @@ extern "C" { #include "lexbor/ns/ns.h" +enum { + LXB_HTML_TOKENIZER_OPT_UNDEF = 0x00, + LXB_HTML_TOKENIZER_OPT_VALIDATE_INPUT = 1 << 3, + LXB_HTML_TOKENIZER_OPT_ATTR_KEEP_DUPLICATE = 1 << 4 +}; + /* State */ typedef const lxb_char_t * (*lxb_html_tokenizer_state_f)(lxb_html_tokenizer_t *tkz, @@ -90,6 +96,10 @@ struct lxb_html_tokenizer { lxb_status_t status; bool is_eof; + /* Input stream validation (for cross-chunk UTF-8). */ + lxb_char_t utf8_buf[4]; + unsigned utf8_buf_len; + lxb_html_tokenizer_t *base; size_t ref_count; }; @@ -97,8 +107,9 @@ struct lxb_html_tokenizer { #include "lexbor/html/tokenizer/error.h" - -extern const lxb_char_t *lxb_html_tokenizer_eof; +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t *lxb_html_tokenizer_eof; +#endif LXB_API lxb_html_tokenizer_t * lxb_html_tokenizer_create(void); @@ -156,6 +167,11 @@ LXB_API void lxb_html_tokenizer_set_state_by_tag(lxb_html_tokenizer_t *tkz, bool scripting, lxb_tag_id_t tag_id, lxb_ns_id_t ns); +LXB_API void +lxb_html_tokenizer_attr_last_duplicate(lxb_html_tokenizer_t *tkz); + +LXB_API void +lxb_html_tokenizer_validate_close_tag(lxb_html_tokenizer_t *tkz); /* * Inline functions @@ -250,6 +266,28 @@ lxb_html_tokenizer_mraw(lxb_html_tokenizer_t *tkz) return tkz->mraw; } +lxb_inline void +lxb_html_tokenizer_input_validation_set(lxb_html_tokenizer_t *tkz, bool enabled) +{ + if (enabled) { + tkz->opt |= LXB_HTML_TOKENIZER_OPT_VALIDATE_INPUT; + } + else { + tkz->opt &= ~LXB_HTML_TOKENIZER_OPT_VALIDATE_INPUT; + } +} + +lxb_inline void +lxb_html_tokenizer_keep_duplicate_set(lxb_html_tokenizer_t *tkz, bool keep) +{ + if (keep) { + tkz->opt |= LXB_HTML_TOKENIZER_OPT_ATTR_KEEP_DUPLICATE; + } + else { + tkz->opt &= ~LXB_HTML_TOKENIZER_OPT_ATTR_KEEP_DUPLICATE; + } +} + lxb_inline lxb_status_t lxb_html_tokenizer_temp_realloc(lxb_html_tokenizer_t *tkz, size_t size) { @@ -331,12 +369,20 @@ LXB_API void lxb_html_tokenizer_tree_set_noi(lxb_html_tokenizer_t *tkz, lxb_html_tree_t *tree); +LXB_API void +lxb_html_tokenizer_input_validation_set_noi(lxb_html_tokenizer_t *tkz, + bool enabled); + LXB_API lexbor_mraw_t * lxb_html_tokenizer_mraw_noi(lxb_html_tokenizer_t *tkz); LXB_API lexbor_hash_t * lxb_html_tokenizer_tags_noi(lxb_html_tokenizer_t *tkz); +LXB_API void +lxb_html_tokenizer_keep_duplicate_set_noi(lxb_html_tokenizer_t *tkz, + bool keep); + #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/error.c b/ext/dom/lexbor/lexbor/html/tokenizer/error.c index c2381ad97c87..241fac509768 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/error.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/error.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ +#include "lexbor/core/str.h" #include "lexbor/html/tokenizer/error.h" @@ -26,3 +27,76 @@ lxb_html_tokenizer_error_add(lexbor_array_obj_t *parse_errors, return entry; } + +const lxb_char_t * +lxb_html_tokenizer_error_to_string(lxb_html_tokenizer_error_id_t id, + size_t *len) +{ + static const lexbor_str_t unknown = lexbor_str("unknown error"); + + static const lexbor_str_t errors[LXB_HTML_TOKENIZER_ERROR_LAST_ENTRY] = { + lexbor_str("abrupt closing of empty comment"), + lexbor_str("abrupt doctype public identifier"), + lexbor_str("abrupt doctype system identifier"), + lexbor_str("absence of digits in numeric character reference"), + lexbor_str("cdata in html content"), + lexbor_str("character reference outside unicode range"), + lexbor_str("control character in input stream"), + lexbor_str("control character reference"), + lexbor_str("end tag with attributes"), + lexbor_str("duplicate attribute"), + lexbor_str("end tag with trailing solidus"), + lexbor_str("eof before tag name"), + lexbor_str("eof in cdata"), + lexbor_str("eof in comment"), + lexbor_str("eof in doctype"), + lexbor_str("eof in script html comment like text"), + lexbor_str("eof in tag"), + lexbor_str("incorrectly closed comment"), + lexbor_str("incorrectly opened comment"), + lexbor_str("invalid character sequence after doctype name"), + lexbor_str("invalid first character of tag name"), + lexbor_str("missing attribute value"), + lexbor_str("missing doctype name"), + lexbor_str("missing doctype public identifier"), + lexbor_str("missing doctype system identifier"), + lexbor_str("missing end tag name"), + lexbor_str("missing quote before doctype public identifier"), + lexbor_str("missing quote before doctype system identifier"), + lexbor_str("missing semicolon after character reference"), + lexbor_str("missing whitespace after doctype public keyword"), + lexbor_str("missing whitespace after doctype system keyword"), + lexbor_str("missing whitespace before doctype name"), + lexbor_str("missing whitespace between attributes"), + lexbor_str("missing whitespace between doctype public and system identifiers"), + lexbor_str("nested comment"), + lexbor_str("noncharacter character reference"), + lexbor_str("noncharacter in input stream"), + lexbor_str("non void html element start tag with trailing solidus"), + lexbor_str("null character reference"), + lexbor_str("surrogate character reference"), + lexbor_str("surrogate in input stream"), + lexbor_str("unexpected character after doctype system identifier"), + lexbor_str("unexpected character in attribute name"), + lexbor_str("unexpected character in unquoted attribute value"), + lexbor_str("unexpected equals sign before attribute name"), + lexbor_str("unexpected null character"), + lexbor_str("unexpected question mark instead of tag name"), + lexbor_str("unexpected solidus in tag"), + lexbor_str("unknown named character reference") + }; + + if (id >= (sizeof(errors) / sizeof(lexbor_str_t))) { + if (len != NULL) { + *len = unknown.length; + } + + return unknown.data; + } + + if (len != NULL) { + *len = errors[id].length; + } + + return errors[id].data; +} diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/error.h b/ext/dom/lexbor/lexbor/html/tokenizer/error.h index 2685f039d510..617ff636935b 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/error.h +++ b/ext/dom/lexbor/lexbor/html/tokenizer/error.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -21,102 +21,103 @@ typedef enum { /* abrupt-closing-of-empty-comment */ LXB_HTML_TOKENIZER_ERROR_ABCLOFEMCO = 0x0000, /* abrupt-doctype-public-identifier */ - LXB_HTML_TOKENIZER_ERROR_ABDOPUID = 0x0001, + LXB_HTML_TOKENIZER_ERROR_ABDOPUID, /* abrupt-doctype-system-identifier */ - LXB_HTML_TOKENIZER_ERROR_ABDOSYID = 0x0002, + LXB_HTML_TOKENIZER_ERROR_ABDOSYID, /* absence-of-digits-in-numeric-character-reference */ - LXB_HTML_TOKENIZER_ERROR_ABOFDIINNUCHRE = 0x0003, + LXB_HTML_TOKENIZER_ERROR_ABOFDIINNUCHRE, /* cdata-in-html-content */ - LXB_HTML_TOKENIZER_ERROR_CDINHTCO = 0x0004, + LXB_HTML_TOKENIZER_ERROR_CDINHTCO, /* character-reference-outside-unicode-range */ - LXB_HTML_TOKENIZER_ERROR_CHREOUUNRA = 0x0005, + LXB_HTML_TOKENIZER_ERROR_CHREOUUNRA, /* control-character-in-input-stream */ - LXB_HTML_TOKENIZER_ERROR_COCHININST = 0x0006, + LXB_HTML_TOKENIZER_ERROR_COCHININST, /* control-character-reference */ - LXB_HTML_TOKENIZER_ERROR_COCHRE = 0x0007, + LXB_HTML_TOKENIZER_ERROR_COCHRE, /* end-tag-with-attributes */ - LXB_HTML_TOKENIZER_ERROR_ENTAWIAT = 0x0008, + LXB_HTML_TOKENIZER_ERROR_ENTAWIAT, /* duplicate-attribute */ - LXB_HTML_TOKENIZER_ERROR_DUAT = 0x0009, + LXB_HTML_TOKENIZER_ERROR_DUAT, /* end-tag-with-trailing-solidus */ - LXB_HTML_TOKENIZER_ERROR_ENTAWITRSO = 0x000A, + LXB_HTML_TOKENIZER_ERROR_ENTAWITRSO, /* eof-before-tag-name */ - LXB_HTML_TOKENIZER_ERROR_EOBETANA = 0x000B, + LXB_HTML_TOKENIZER_ERROR_EOBETANA, /* eof-in-cdata */ - LXB_HTML_TOKENIZER_ERROR_EOINCD = 0x000C, + LXB_HTML_TOKENIZER_ERROR_EOINCD, /* eof-in-comment */ - LXB_HTML_TOKENIZER_ERROR_EOINCO = 0x000D, + LXB_HTML_TOKENIZER_ERROR_EOINCO, /* eof-in-doctype */ - LXB_HTML_TOKENIZER_ERROR_EOINDO = 0x000E, + LXB_HTML_TOKENIZER_ERROR_EOINDO, /* eof-in-script-html-comment-like-text */ - LXB_HTML_TOKENIZER_ERROR_EOINSCHTCOLITE = 0x000F, + LXB_HTML_TOKENIZER_ERROR_EOINSCHTCOLITE, /* eof-in-tag */ - LXB_HTML_TOKENIZER_ERROR_EOINTA = 0x0010, + LXB_HTML_TOKENIZER_ERROR_EOINTA, /* incorrectly-closed-comment */ - LXB_HTML_TOKENIZER_ERROR_INCLCO = 0x0011, + LXB_HTML_TOKENIZER_ERROR_INCLCO, /* incorrectly-opened-comment */ - LXB_HTML_TOKENIZER_ERROR_INOPCO = 0x0012, + LXB_HTML_TOKENIZER_ERROR_INOPCO, /* invalid-character-sequence-after-doctype-name */ - LXB_HTML_TOKENIZER_ERROR_INCHSEAFDONA = 0x0013, + LXB_HTML_TOKENIZER_ERROR_INCHSEAFDONA, /* invalid-first-character-of-tag-name */ - LXB_HTML_TOKENIZER_ERROR_INFICHOFTANA = 0x0014, + LXB_HTML_TOKENIZER_ERROR_INFICHOFTANA, /* missing-attribute-value */ - LXB_HTML_TOKENIZER_ERROR_MIATVA = 0x0015, + LXB_HTML_TOKENIZER_ERROR_MIATVA, /* missing-doctype-name */ - LXB_HTML_TOKENIZER_ERROR_MIDONA = 0x0016, + LXB_HTML_TOKENIZER_ERROR_MIDONA, /* missing-doctype-public-identifier */ - LXB_HTML_TOKENIZER_ERROR_MIDOPUID = 0x0017, + LXB_HTML_TOKENIZER_ERROR_MIDOPUID, /* missing-doctype-system-identifier */ - LXB_HTML_TOKENIZER_ERROR_MIDOSYID = 0x0018, + LXB_HTML_TOKENIZER_ERROR_MIDOSYID, /* missing-end-tag-name */ - LXB_HTML_TOKENIZER_ERROR_MIENTANA = 0x0019, + LXB_HTML_TOKENIZER_ERROR_MIENTANA, /* missing-quote-before-doctype-public-identifier */ - LXB_HTML_TOKENIZER_ERROR_MIQUBEDOPUID = 0x001A, + LXB_HTML_TOKENIZER_ERROR_MIQUBEDOPUID, /* missing-quote-before-doctype-system-identifier */ - LXB_HTML_TOKENIZER_ERROR_MIQUBEDOSYID = 0x001B, + LXB_HTML_TOKENIZER_ERROR_MIQUBEDOSYID, /* missing-semicolon-after-character-reference */ - LXB_HTML_TOKENIZER_ERROR_MISEAFCHRE = 0x001C, + LXB_HTML_TOKENIZER_ERROR_MISEAFCHRE, /* missing-whitespace-after-doctype-public-keyword */ - LXB_HTML_TOKENIZER_ERROR_MIWHAFDOPUKE = 0x001D, + LXB_HTML_TOKENIZER_ERROR_MIWHAFDOPUKE, /* missing-whitespace-after-doctype-system-keyword */ - LXB_HTML_TOKENIZER_ERROR_MIWHAFDOSYKE = 0x001E, + LXB_HTML_TOKENIZER_ERROR_MIWHAFDOSYKE, /* missing-whitespace-before-doctype-name */ - LXB_HTML_TOKENIZER_ERROR_MIWHBEDONA = 0x001F, + LXB_HTML_TOKENIZER_ERROR_MIWHBEDONA, /* missing-whitespace-between-attributes */ - LXB_HTML_TOKENIZER_ERROR_MIWHBEAT = 0x0020, + LXB_HTML_TOKENIZER_ERROR_MIWHBEAT, /* missing-whitespace-between-doctype-public-and-system-identifiers */ - LXB_HTML_TOKENIZER_ERROR_MIWHBEDOPUANSYID = 0x0021, + LXB_HTML_TOKENIZER_ERROR_MIWHBEDOPUANSYID, /* nested-comment */ - LXB_HTML_TOKENIZER_ERROR_NECO = 0x0022, + LXB_HTML_TOKENIZER_ERROR_NECO, /* noncharacter-character-reference */ - LXB_HTML_TOKENIZER_ERROR_NOCHRE = 0x0023, + LXB_HTML_TOKENIZER_ERROR_NOCHRE, /* noncharacter-in-input-stream */ - LXB_HTML_TOKENIZER_ERROR_NOININST = 0x0024, + LXB_HTML_TOKENIZER_ERROR_NOININST, /* non-void-html-element-start-tag-with-trailing-solidus */ - LXB_HTML_TOKENIZER_ERROR_NOVOHTELSTTAWITRSO = 0x0025, + LXB_HTML_TOKENIZER_ERROR_NOVOHTELSTTAWITRSO, /* null-character-reference */ - LXB_HTML_TOKENIZER_ERROR_NUCHRE = 0x0026, + LXB_HTML_TOKENIZER_ERROR_NUCHRE, /* surrogate-character-reference */ - LXB_HTML_TOKENIZER_ERROR_SUCHRE = 0x0027, + LXB_HTML_TOKENIZER_ERROR_SUCHRE, /* surrogate-in-input-stream */ - LXB_HTML_TOKENIZER_ERROR_SUININST = 0x0028, + LXB_HTML_TOKENIZER_ERROR_SUININST, /* unexpected-character-after-doctype-system-identifier */ - LXB_HTML_TOKENIZER_ERROR_UNCHAFDOSYID = 0x0029, + LXB_HTML_TOKENIZER_ERROR_UNCHAFDOSYID, /* unexpected-character-in-attribute-name */ - LXB_HTML_TOKENIZER_ERROR_UNCHINATNA = 0x002A, + LXB_HTML_TOKENIZER_ERROR_UNCHINATNA, /* unexpected-character-in-unquoted-attribute-value */ - LXB_HTML_TOKENIZER_ERROR_UNCHINUNATVA = 0x002B, + LXB_HTML_TOKENIZER_ERROR_UNCHINUNATVA, /* unexpected-equals-sign-before-attribute-name */ - LXB_HTML_TOKENIZER_ERROR_UNEQSIBEATNA = 0x002C, + LXB_HTML_TOKENIZER_ERROR_UNEQSIBEATNA, /* unexpected-null-character */ - LXB_HTML_TOKENIZER_ERROR_UNNUCH = 0x002D, + LXB_HTML_TOKENIZER_ERROR_UNNUCH, /* unexpected-question-mark-instead-of-tag-name */ - LXB_HTML_TOKENIZER_ERROR_UNQUMAINOFTANA = 0x002E, + LXB_HTML_TOKENIZER_ERROR_UNQUMAINOFTANA, /* unexpected-solidus-in-tag */ - LXB_HTML_TOKENIZER_ERROR_UNSOINTA = 0x002F, + LXB_HTML_TOKENIZER_ERROR_UNSOINTA, /* unknown-named-character-reference */ - LXB_HTML_TOKENIZER_ERROR_UNNACHRE = 0x0030, - LXB_HTML_TOKENIZER_ERROR_LAST_ENTRY = 0x0031, + LXB_HTML_TOKENIZER_ERROR_UNNACHRE, + + LXB_HTML_TOKENIZER_ERROR_LAST_ENTRY } lxb_html_tokenizer_error_id_t; @@ -132,10 +133,13 @@ lxb_html_tokenizer_error_add(lexbor_array_obj_t *parse_errors, const lxb_char_t *pos, lxb_html_tokenizer_error_id_t id); +LXB_API const lxb_char_t * +lxb_html_tokenizer_error_to_string(lxb_html_tokenizer_error_id_t id, + size_t *len); + #ifdef __cplusplus } /* extern "C" */ #endif #endif /* LEXBOR_HTML_TOKENIZER_ERROR_H */ - diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/res.h b/ext/dom/lexbor/lexbor/html/tokenizer/res.h index 5ec5c68bf65d..55c77f9e6c39 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/res.h +++ b/ext/dom/lexbor/lexbor/html/tokenizer/res.h @@ -1,12 +1,12 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ /* - * Caution!!! Important!!! - * This file is generated by the script + * Important! + * This file generated by the script * "utils/lexbor/html/tokenizer_entities_bst.py"! * Do not change this file! */ @@ -15,12 +15,6 @@ #ifndef LXB_HTML_TOKENIZER_RES_H #define LXB_HTML_TOKENIZER_RES_H -#endif /* LXB_HTML_TOKENIZER_RES */ - - -#ifdef LXB_HTML_TOKENIZER_RES_ENTITIES_SBST -#ifndef LXB_HTML_TOKENIZER_RES_ENTITIES_SBST_ENABLED -#define LXB_HTML_TOKENIZER_RES_ENTITIES_SBST_ENABLED static const lexbor_sbst_entry_static_t lxb_html_tokenizer_res_entities_sbst[] = { {0x00, {0}, 0, 0, 0, 0}, {0x61, {0}, 0, 3, 2, 53}, @@ -4951,6 +4945,6 @@ static const lexbor_sbst_entry_static_t lxb_html_tokenizer_res_entities_sbst[] = {0x3b, "\xd1\x8e", 2, 0, 0, 0}, {0x70, {0}, 0, 0, 0, 9852}, {0x66, {0}, 0, 0, 0, 9853}, {0x3b, "\xf0\x9d\x95\xaa", 4, 0, 0, 0} }; -#endif /* LXB_HTML_TOKENIZER_RES_ENTITIES_SBST_ENABLED */ -#endif /* LXB_HTML_TOKENIZER_RES_ENTITIES_SBST */ + +#endif /* LXB_HTML_TOKENIZER_RES */ diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state.c b/ext/dom/lexbor/lexbor/html/tokenizer/state.c index 207b909a1892..6c3cbebe92a3 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -8,16 +8,16 @@ #include "lexbor/html/tokenizer/state_comment.h" #include "lexbor/html/tokenizer/state_doctype.h" -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_ALPHANUMERIC_CHARACTER -#define LEXBOR_STR_RES_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_ALPHA_CHARACTER -#define LEXBOR_STR_RES_MAP_HEX -#define LEXBOR_STR_RES_MAP_NUM -#include "lexbor/core/str_res.h" -#include "lexbor/core/swar.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_num[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_map_hex[256]; + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const size_t lexbor_str_res_alphanumeric_character[256]; + LXB_EXTERN const size_t lexbor_str_res_alpha_character[256]; + LXB_EXTERN const size_t lexbor_str_res_replacement_character[160]; +#endif -#define LXB_HTML_TOKENIZER_RES_ENTITIES_SBST +#include "lexbor/core/swar.h" #include "lexbor/html/tokenizer/res.h" @@ -123,11 +123,6 @@ lxb_html_tokenizer_state_markup_declaration_cdata(lxb_html_tokenizer_t *tkz, const lxb_char_t *end); /* CDATA Section */ -static const lxb_char_t * -lxb_html_tokenizer_state_cdata_section_before(lxb_html_tokenizer_t *tkz, - const lxb_char_t *data, - const lxb_char_t *end); - static const lxb_char_t * lxb_html_tokenizer_state_cdata_section(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, @@ -282,7 +277,7 @@ lxb_html_tokenizer_state_data(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_state_token_set_end_eof(tkz); } - if (tkz->token->begin != tkz->token->end) { + if (tkz->pos != tkz->start) { tkz->token->tag_id = LXB_TAG__TEXT; lxb_html_tokenizer_state_append_data_m(tkz, data); @@ -381,7 +376,7 @@ lxb_html_tokenizer_state_plaintext(lxb_html_tokenizer_t *tkz, } lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -1451,8 +1446,8 @@ lxb_html_tokenizer_state_markup_declaration_open(lxb_html_tokenizer_t *tkz, else if (*data == 0x5B) { if ((end - data) < 7) { tkz->markup = (lxb_char_t *) "[CDATA["; - tkz->state = lxb_html_tokenizer_state_markup_declaration_cdata; + return data; } @@ -1469,6 +1464,9 @@ lxb_html_tokenizer_state_markup_declaration_open(lxb_html_tokenizer_t *tkz, return data; } + lxb_html_tokenizer_error_add(tkz->parse_errors, data, + LXB_HTML_TOKENIZER_ERROR_CDINHTCO); + tkz->state = lxb_html_tokenizer_state_bogus_comment_before; return data; @@ -1504,6 +1502,8 @@ lxb_html_tokenizer_state_markup_declaration_comment(lxb_html_tokenizer_t *tkz, return (data + 1); } + lxb_html_tokenizer_state_append_m(tkz, "-", 1); + lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_INOPCO); @@ -1538,6 +1538,8 @@ lxb_html_tokenizer_state_markup_declaration_doctype(lxb_html_tokenizer_t *tkz, return data; } + lxb_html_tokenizer_state_append_m(tkz, data, (end - data)); + tkz->markup = pos; return end; @@ -1575,6 +1577,9 @@ lxb_html_tokenizer_state_markup_declaration_cdata(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_state_append_m(tkz, "[CDATA", 6); + lxb_html_tokenizer_error_add(tkz->parse_errors, data, + LXB_HTML_TOKENIZER_ERROR_CDINHTCO); + tkz->state = lxb_html_tokenizer_state_bogus_comment_before; return data; } @@ -1587,7 +1592,7 @@ lxb_html_tokenizer_state_markup_declaration_cdata(lxb_html_tokenizer_t *tkz, /* * Helper function. No in the specification. For 12.2.5.69 */ -static const lxb_char_t * +const lxb_char_t * lxb_html_tokenizer_state_cdata_section_before(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end) @@ -1661,7 +1666,7 @@ lxb_html_tokenizer_state_cdata_section(lxb_html_tokenizer_t *tkz, } lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -1726,7 +1731,7 @@ lxb_html_tokenizer_state_cdata_section_end(lxb_html_tokenizer_t *tkz, tkz->state = lxb_html_tokenizer_state_data_before; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return (data + 1); } @@ -1857,9 +1862,28 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz, */ /* U+003B SEMICOLON character (;) */ if (tkz->is_attribute && tkz->entity_match->key != 0x3B) { + lxb_char_t ch; + + /* + * The "next input character" per the spec is the character immediately + * after the matched entity, not the character that broke the SBST + * lookup. For example, for "¬i;" the match is "¬" + * and the next input character is 'i', not ';'. + * + * If there are trailing characters in the buffer after the match, + * the next input character is the first one after entity_end. + * Otherwise it is *data (the character that terminated the SBST). + */ + if (&tkz->start[tkz->entity_end + 1] < tkz->pos) { + ch = tkz->start[tkz->entity_end + 1]; + } + else { + ch = *data; + } + /* U+003D EQUALS SIGN character (=) or ASCII alphanumeric */ - if (*data == 0x3D - || lexbor_str_res_alphanumeric_character[*data] != LEXBOR_STR_RES_SLIP) + if (ch == 0x3D + || lexbor_str_res_alphanumeric_character[ch] != LEXBOR_STR_RES_SLIP) { return data; } @@ -1902,16 +1926,30 @@ lxb_html_tokenizer_state_char_ref_ambiguous_ampersand(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end) { - /* ASCII alphanumeric */ - /* Skipped, not need */ + const lxb_char_t *begin = data; - /* U+003B SEMICOLON (;) */ - if (*data == 0x3B) { - lxb_html_tokenizer_error_add(tkz->parse_errors, data, - LXB_HTML_TOKENIZER_ERROR_UNNACHRE); + while (data < end) { + /* Not ASCII alphanumeric */ + if (lexbor_str_res_alphanumeric_character[ *data ] == LEXBOR_STR_RES_SLIP) { + lxb_html_tokenizer_state_append_m(tkz, begin, (data - begin)); + + /* U+003B SEMICOLON (;) */ + if (*data == 0x3B) { + lxb_html_tokenizer_error_add(tkz->parse_errors, data, + LXB_HTML_TOKENIZER_ERROR_UNNACHRE); + } + + tkz->state = tkz->state_return; + + return data; + } + + data += 1; } - tkz->state = tkz->state_return; + if (begin < data) { + lxb_html_tokenizer_state_append_m(tkz, begin, (data - begin)); + } return data; } @@ -2002,6 +2040,10 @@ lxb_html_tokenizer_state_char_ref_hexademical(lxb_html_tokenizer_t *tkz, if (*data == ';') { data++; } + else { + lxb_html_tokenizer_error_add(tkz->parse_errors, data, + LXB_HTML_TOKENIZER_ERROR_MISEAFCHRE); + } return lxb_html_tokenizer_state_char_ref_numeric_end(tkz, data, end); } @@ -2032,6 +2074,10 @@ lxb_html_tokenizer_state_char_ref_decimal(lxb_html_tokenizer_t *tkz, if (*data == ';') { data++; } + else { + lxb_html_tokenizer_error_add(tkz->parse_errors, data, + LXB_HTML_TOKENIZER_ERROR_MISEAFCHRE); + } return lxb_html_tokenizer_state_char_ref_numeric_end(tkz, data, end); } diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state.h b/ext/dom/lexbor/lexbor/html/tokenizer/state.h index 5b095b4249d5..52eaa9a2c07b 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state.h +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state.h @@ -110,6 +110,10 @@ extern "C" { #define lxb_html_tokenizer_state_token_attr_add_m(tkz, attr, v_return) \ do { \ + if (!(tkz->opt & LXB_HTML_TOKENIZER_OPT_ATTR_KEEP_DUPLICATE)) { \ + lxb_html_tokenizer_attr_last_duplicate(tkz); \ + } \ + \ attr = lxb_html_token_attr_append(tkz->token, tkz->dobj_token_attr); \ if (attr == NULL) { \ tkz->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; \ @@ -145,6 +149,14 @@ extern "C" { (tkz->token->attr_last->value_end = tkz->last) #define _lxb_html_tokenizer_state_token_done_m(tkz, v_end) \ + if (!(tkz->opt & LXB_HTML_TOKENIZER_OPT_ATTR_KEEP_DUPLICATE)) { \ + lxb_html_tokenizer_attr_last_duplicate(tkz); \ + } \ + \ + if (tkz->token->type & LXB_HTML_TOKEN_TYPE_CLOSE) { \ + lxb_html_tokenizer_validate_close_tag(tkz); \ + } \ + \ tkz->token = tkz->callback_token_done(tkz, tkz->token, \ tkz->callback_token_ctx); \ if (tkz->token == NULL) { \ @@ -154,23 +166,32 @@ extern "C" { return v_end; \ } -#define lxb_html_tokenizer_state_token_done_m(tkz, v_end) \ +#define lxb_html_tokenizer_state_token_text_done_m(tkz, v_end) \ do { \ - if (tkz->token->begin != tkz->token->end) { \ - _lxb_html_tokenizer_state_token_done_m(tkz, v_end) \ + if (tkz->token->text_start != tkz->token->text_end) { \ + _lxb_html_tokenizer_state_token_done_m(tkz, v_end); \ } \ lxb_html_token_clean(tkz->token); \ tkz->pos = tkz->start; \ } \ while (0) -#define lxb_html_tokenizer_state_token_done_wo_check_m(tkz, v_end) \ +#define lxb_html_tokenizer_state_token_done_m(tkz, v_end) \ do { \ _lxb_html_tokenizer_state_token_done_m(tkz, v_end) \ lxb_html_token_clean(tkz->token); \ + tkz->pos = tkz->start; \ } \ while (0) +/* + * This macro is alias; it serves to ensure that when reading the code, + * we clearly understand where checks are not necessary, i.e., we are 100% sure + * that the token has been collected and is ready to be sent. + */ +#define lxb_html_tokenizer_state_token_done_wo_check_m(tkz, v_end) \ + lxb_html_tokenizer_state_token_done_m(tkz, v_end) + #define lxb_html_tokenizer_state_set_text(tkz) \ do { \ tkz->token->text_start = tkz->start; \ @@ -180,7 +201,7 @@ extern "C" { #define lxb_html_tokenizer_state_token_emit_text_not_empty_m(tkz, v_end) \ do { \ - if (tkz->token->begin != tkz->token->end) { \ + if (tkz->start != tkz->pos) { \ tkz->token->tag_id = LXB_TAG__TEXT; \ \ lxb_html_tokenizer_state_set_text(tkz); \ @@ -211,6 +232,11 @@ lxb_html_tokenizer_state_self_closing_start_tag(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end); +LXB_API const lxb_char_t * +lxb_html_tokenizer_state_cdata_section_before(lxb_html_tokenizer_t *tkz, + const lxb_char_t *data, + const lxb_char_t *end); + LXB_API const lxb_char_t * lxb_html_tokenizer_state_cr(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end); diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state_comment.c b/ext/dom/lexbor/lexbor/html/tokenizer/state_comment.c index fd1c2ead980b..870b54578c62 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state_comment.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state_comment.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,9 +7,9 @@ #include "lexbor/html/tokenizer/state_comment.h" #include "lexbor/html/tokenizer/state.h" -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN +LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; +#endif static const lxb_char_t * lxb_html_tokenizer_state_comment_start(lxb_html_tokenizer_t *tkz, @@ -143,8 +143,6 @@ lxb_html_tokenizer_state_comment_start_dash(lxb_html_tokenizer_t *tkz, /* EOF */ else if (*data == 0x00) { if (tkz->is_eof) { - lxb_html_tokenizer_state_append_m(tkz, "-", 1); - lxb_html_tokenizer_error_add(tkz->parse_errors, tkz->last, LXB_HTML_TOKENIZER_ERROR_EOINCO); @@ -452,8 +450,12 @@ lxb_html_tokenizer_state_comment_end_bang(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end) { + static const lexbor_str_t two = lexbor_str("--!"); + /* U+002D HYPHEN-MINUS (-) */ if (*data == 0x2D) { + lxb_html_tokenizer_state_append_m(tkz, two.data, two.length); + tkz->state = lxb_html_tokenizer_state_comment_end_dash; return (data + 1); @@ -481,6 +483,11 @@ lxb_html_tokenizer_state_comment_end_bang(lxb_html_tokenizer_t *tkz, return end; } + + lxb_html_tokenizer_state_append_m(tkz, two.data, two.length); + } + else { + lxb_html_tokenizer_state_append_m(tkz, two.data, two.length); } tkz->state = lxb_html_tokenizer_state_comment; diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state_doctype.c b/ext/dom/lexbor/lexbor/html/tokenizer/state_doctype.c index 90466789cc09..7ccb02e08b2a 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state_doctype.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state_doctype.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,10 +7,9 @@ #include "lexbor/html/tokenizer/state_doctype.h" #include "lexbor/html/tokenizer/state.h" - -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; +#endif lxb_dom_attr_data_t * lxb_dom_attr_local_name_append(lexbor_hash_t *hash, @@ -527,6 +526,7 @@ lxb_html_tokenizer_state_doctype_after_name_public(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_INCHSEAFDONA); + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; tkz->state = lxb_html_tokenizer_state_doctype_bogus; return data; @@ -577,6 +577,7 @@ lxb_html_tokenizer_state_doctype_after_name_system(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_INCHSEAFDONA); + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; tkz->state = lxb_html_tokenizer_state_doctype_bogus; return data; @@ -797,6 +798,7 @@ lxb_html_tokenizer_state_doctype_public_identifier_double_quoted(lxb_html_tokeni /* U+003E GREATER-THAN SIGN (>) */ case 0x3E: tkz->state = lxb_html_tokenizer_state_data_before; + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_ABDOPUID); @@ -912,6 +914,7 @@ lxb_html_tokenizer_state_doctype_public_identifier_single_quoted(lxb_html_tokeni /* U+003E GREATER-THAN SIGN (>) */ case 0x3E: tkz->state = lxb_html_tokenizer_state_data_before; + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_ABDOPUID); @@ -1350,6 +1353,7 @@ lxb_html_tokenizer_state_doctype_system_identifier_double_quoted(lxb_html_tokeni /* U+003E GREATER-THAN SIGN (>) */ case 0x3E: tkz->state = lxb_html_tokenizer_state_data_before; + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_ABDOSYID); @@ -1465,6 +1469,7 @@ lxb_html_tokenizer_state_doctype_system_identifier_single_quoted(lxb_html_tokeni /* U+003E GREATER-THAN SIGN (>) */ case 0x3E: tkz->state = lxb_html_tokenizer_state_data_before; + tkz->token->type |= LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS; lxb_html_tokenizer_error_add(tkz->parse_errors, data, LXB_HTML_TOKENIZER_ERROR_ABDOSYID); diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state_rawtext.c b/ext/dom/lexbor/lexbor/html/tokenizer/state_rawtext.c index 6629ca910342..456266b6e33a 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state_rawtext.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state_rawtext.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,10 +7,10 @@ #include "lexbor/html/tokenizer/state_rawtext.h" #include "lexbor/html/tokenizer/state.h" -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_ALPHA_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const size_t lexbor_str_res_alpha_character[256]; +#endif const lxb_tag_data_t * lxb_tag_append_lower(lexbor_hash_t *hash, @@ -114,7 +114,7 @@ lxb_html_tokenizer_state_rawtext(lxb_html_tokenizer_t *tkz, tkz->token->tag_id = LXB_TAG__TEXT; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -246,7 +246,7 @@ lxb_html_tokenizer_state_rawtext_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -291,7 +291,7 @@ lxb_html_tokenizer_state_rawtext_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state_rcdata.c b/ext/dom/lexbor/lexbor/html/tokenizer/state_rcdata.c index f47dc7e87a22..02e68b324546 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state_rcdata.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state_rcdata.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,10 +7,10 @@ #include "lexbor/html/tokenizer/state_rcdata.h" #include "lexbor/html/tokenizer/state.h" -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#define LEXBOR_STR_RES_ALPHA_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const size_t lexbor_str_res_alpha_character[256]; +#endif const lxb_tag_data_t * lxb_tag_append_lower(lexbor_hash_t *hash, @@ -123,7 +123,7 @@ lxb_html_tokenizer_state_rcdata(lxb_html_tokenizer_t *tkz, tkz->token->tag_id = LXB_TAG__TEXT; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -255,7 +255,7 @@ lxb_html_tokenizer_state_rcdata_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -300,7 +300,7 @@ lxb_html_tokenizer_state_rcdata_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; diff --git a/ext/dom/lexbor/lexbor/html/tokenizer/state_script.c b/ext/dom/lexbor/lexbor/html/tokenizer/state_script.c index 4d56d18f7f3f..26e694f8f517 100644 --- a/ext/dom/lexbor/lexbor/html/tokenizer/state_script.c +++ b/ext/dom/lexbor/lexbor/html/tokenizer/state_script.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -7,12 +7,11 @@ #include "lexbor/html/tokenizer/state_script.h" #include "lexbor/html/tokenizer/state.h" -#define LEXBOR_STR_RES_ALPHA_CHARACTER -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" - -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const size_t lexbor_str_res_alpha_character[256]; + LXB_EXTERN const size_t lexbor_str_res_replacement_character[160]; + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; +#endif const lxb_tag_data_t * lxb_tag_append_lower(lexbor_hash_t *hash, @@ -203,7 +202,7 @@ lxb_html_tokenizer_state_script_data(lxb_html_tokenizer_t *tkz, tkz->token->tag_id = LXB_TAG__TEXT; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -347,7 +346,7 @@ lxb_html_tokenizer_state_script_data_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -391,7 +390,7 @@ lxb_html_tokenizer_state_script_data_end_tag_name(lxb_html_tokenizer_t *tkz, tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -517,7 +516,7 @@ lxb_html_tokenizer_state_script_data_escaped(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_state_set_text(tkz); lxb_html_tokenizer_state_token_set_end_eof(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -581,7 +580,7 @@ lxb_html_tokenizer_state_script_data_escaped_dash(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_state_set_text(tkz); lxb_html_tokenizer_state_token_set_end_eof(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -758,7 +757,7 @@ lxb_html_tokenizer_state_script_data_escaped_end_tag_name( tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -802,7 +801,7 @@ lxb_html_tokenizer_state_script_data_escaped_end_tag_name( tkz->pos = &tkz->start[tkz->entity_start]; lxb_html_tokenizer_state_set_text(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); /* Init close token */ tkz->token->tag_id = tkz->tmp_tag_id; @@ -947,7 +946,7 @@ lxb_html_tokenizer_state_script_data_double_escaped(lxb_html_tokenizer_t *tkz, lxb_html_tokenizer_state_set_text(tkz); lxb_html_tokenizer_state_token_set_end_eof(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -1011,7 +1010,7 @@ lxb_html_tokenizer_state_script_data_double_escaped_dash(lxb_html_tokenizer_t *t lxb_html_tokenizer_state_set_text(tkz); lxb_html_tokenizer_state_token_set_end_eof(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } @@ -1077,7 +1076,7 @@ lxb_html_tokenizer_state_script_data_double_escaped_dash_dash( lxb_html_tokenizer_state_set_text(tkz); lxb_html_tokenizer_state_token_set_end_eof(tkz); - lxb_html_tokenizer_state_token_done_m(tkz, end); + lxb_html_tokenizer_state_token_text_done_m(tkz, end); return end; } diff --git a/ext/dom/lexbor/lexbor/html/tree.c b/ext/dom/lexbor/lexbor/html/tree.c index 91bfd17ee1db..3f4c18d7fa40 100644 --- a/ext/dom/lexbor/lexbor/html/tree.c +++ b/ext/dom/lexbor/lexbor/html/tree.c @@ -19,6 +19,7 @@ #include "lexbor/html/interface.h" #include "lexbor/html/interfaces/template_element.h" #include "lexbor/html/interfaces/unknown_element.h" +#include "lexbor/html/interfaces/option_element.h" #include "lexbor/html/tokenizer/state_rawtext.h" #include "lexbor/html/tokenizer/state_rcdata.h" @@ -390,7 +391,8 @@ lxb_html_tree_appropriate_place_inserting_node(lxb_html_tree_t *tree, lxb_html_element_t * lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree, - lxb_html_token_t *token, lxb_ns_id_t ns) + lxb_html_token_t *token, lxb_ns_id_t ns, + bool only_add_stack) { lxb_status_t status; lxb_dom_node_t *pos; @@ -407,7 +409,9 @@ lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree, return NULL; } - lxb_html_tree_insert_node(pos, lxb_dom_interface_node(element), ipos); + if (only_add_stack == false) { + lxb_html_tree_insert_node(pos, lxb_dom_interface_node(element), ipos); + } status = lxb_html_tree_open_elements_push(tree, lxb_dom_interface_node(element)); @@ -1033,44 +1037,7 @@ lxb_html_tree_reset_insertion_mode_appropriately(lxb_html_tree_t *tree) continue; } - /* Step 4 */ - if (node->local_name == LXB_TAG_SELECT) { - /* Step 4.1 */ - if (last) { - tree->mode = lxb_html_tree_insertion_mode_in_select; - return; - } - - /* Step 4.2 */ - size_t ancestor = idx; - - for (;;) { - /* Step 4.3 */ - if (ancestor == 0) { - tree->mode = lxb_html_tree_insertion_mode_in_select; - return; - } - - /* Step 4.4 */ - ancestor--; - - /* Step 4.5 */ - lxb_dom_node_t *ancestor_node = list[ancestor]; - - if(lxb_html_tree_node_is(ancestor_node, LXB_TAG_TEMPLATE)) { - tree->mode = lxb_html_tree_insertion_mode_in_select; - return; - } - - /* Step 4.6 */ - else if(lxb_html_tree_node_is(ancestor_node, LXB_TAG_TABLE)) { - tree->mode = lxb_html_tree_insertion_mode_in_select_in_table; - return; - } - } - } - - /* Step 5-15 */ + /* Step 4-15 */ switch (node->local_name) { case LXB_TAG_TD: case LXB_TAG_TH: @@ -1309,6 +1276,41 @@ lxb_html_tree_element_in_scope_td_th(lxb_html_tree_t *tree) return NULL; } +lxb_dom_node_t * +lxb_html_tree_element_in_scope_option_optgroup(lxb_html_tree_t *tree) +{ + lxb_dom_node_t *node; + + size_t idx = tree->open_elements->length; + void **list = tree->open_elements->list; + + while (idx != 0) { + idx--; + node = list[idx]; + + switch (node->local_name) { + case LXB_TAG_OPTION: + case LXB_TAG_OPTGROUP: + if (node->ns == LXB_NS_HTML) { + return node; + } + + break; + + default: + break; + } + + if (lxb_html_tag_is_category(node->local_name, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE)) + { + return NULL; + } + } + + return NULL; +} + bool lxb_html_tree_check_scope_element(lxb_html_tree_t *tree) { @@ -1362,8 +1364,6 @@ lxb_html_tree_close_p_element(lxb_html_tree_t *tree, lxb_html_token_t *token) true); } -#include "lexbor/html/serialize.h" - bool lxb_html_tree_adoption_agency_algorithm(lxb_html_tree_t *tree, lxb_html_token_t *token, diff --git a/ext/dom/lexbor/lexbor/html/tree.h b/ext/dom/lexbor/lexbor/html/tree.h index 8ad32a4c1bec..7b2c62030497 100644 --- a/ext/dom/lexbor/lexbor/html/tree.h +++ b/ext/dom/lexbor/lexbor/html/tree.h @@ -114,7 +114,8 @@ lxb_html_tree_appropriate_place_inserting_node(lxb_html_tree_t *tree, LXB_API lxb_html_element_t * lxb_html_tree_insert_foreign_element(lxb_html_tree_t *tree, - lxb_html_token_t *token, lxb_ns_id_t ns); + lxb_html_token_t *token, lxb_ns_id_t ns, + bool only_add_stack); LXB_API lxb_html_element_t * lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree, @@ -201,6 +202,9 @@ lxb_html_tree_element_in_scope_tbody_thead_tfoot(lxb_html_tree_t *tree); LXB_API lxb_dom_node_t * lxb_html_tree_element_in_scope_td_th(lxb_html_tree_t *tree); +LXB_API lxb_dom_node_t * +lxb_html_tree_element_in_scope_option_optgroup(lxb_html_tree_t *tree); + LXB_API bool lxb_html_tree_check_scope_element(lxb_html_tree_t *tree); @@ -307,7 +311,8 @@ lxb_inline lxb_html_element_t * lxb_html_tree_insert_html_element(lxb_html_tree_t *tree, lxb_html_token_t *token) { - return lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_HTML); + return lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_HTML, + false); } lxb_inline void @@ -374,6 +379,21 @@ lxb_html_tree_attach_document(lxb_html_tree_t *tree, lxb_html_document_t *doc) tree->document = doc; } +lxb_inline bool +lxb_html_tree_is_fragment(lxb_html_tree_t *tree) +{ + return tree->fragment != NULL; +} + +lxb_inline bool +lxb_html_tree_is_fragment_element(lxb_html_tree_t *tree, + lxb_tag_id_t tag_id, lxb_ns_id_t ns) +{ + lxb_dom_node_t *fragment = tree->fragment; + + return lxb_html_tree_is_fragment(tree) + && fragment->local_name == tag_id && fragment->ns == ns; +} #ifdef __cplusplus } /* extern "C" */ diff --git a/ext/dom/lexbor/lexbor/html/tree/error.c b/ext/dom/lexbor/lexbor/html/tree/error.c index 88ad8c44795a..ef36eab8d228 100644 --- a/ext/dom/lexbor/lexbor/html/tree/error.c +++ b/ext/dom/lexbor/lexbor/html/tree/error.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ +#include "lexbor/core/str.h" #include "lexbor/html/tree/error.h" @@ -27,3 +28,68 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors, return entry; } + +const lxb_char_t * +lxb_html_tree_error_to_string(lxb_html_tree_error_id_t id, size_t *len) +{ + static const lexbor_str_t unknown = lexbor_str("unknown error"); + + static const lexbor_str_t errors[LXB_HTML_RULES_ERROR_LAST_ENTRY] = { + lexbor_str("unexpected token"), + lexbor_str("unexpected closed token"), + lexbor_str("null character"), + lexbor_str("unexpected character token"), + lexbor_str("unexpected token in initial mode"), + lexbor_str("bad doctype token in initial mode"), + lexbor_str("doctype token in before html mode"), + lexbor_str("unexpected closed token in before html mode"), + lexbor_str("doctype token in before head mode"), + lexbor_str("unexpected closed token in before head mode"), + lexbor_str("doctype token in head mode"), + lexbor_str("non void html element start tag with trailing solidus"), + lexbor_str("head token in head mode"), + lexbor_str("unexpected closed token in head mode"), + lexbor_str("template closed token without opening in head mode"), + lexbor_str("template element is not current in head mode"), + lexbor_str("doctype token in head noscript mode"), + lexbor_str("doctype token after head mode"), + lexbor_str("head token after head mode"), + lexbor_str("doctype token in body mode"), + lexbor_str("bad ending open elements is wrong"), + lexbor_str("open elements is wrong"), + lexbor_str("unexpected element in open elements stack"), + lexbor_str("missing element in open elements stack"), + lexbor_str("no body element in scope"), + lexbor_str("missing element in scope"), + lexbor_str("unexpected element in scope"), + lexbor_str("unexpected element in active formatting stack"), + lexbor_str("unexpected end of file"), + lexbor_str("characters in table text"), + lexbor_str("doctype token in table mode"), + lexbor_str("doctype token in select mode"), + lexbor_str("doctype token after body mode"), + lexbor_str("doctype token in frameset mode"), + lexbor_str("doctype token after frameset mode"), + lexbor_str("doctype token foreign content mode"), + lexbor_str("select in scope"), + lexbor_str("fragment parsing select in context parse input"), + lexbor_str("fragment parsing select in context parse select"), + lexbor_str("hr parsing select option optgroup in scope"), + lexbor_str("option parsing option in scope"), + lexbor_str("optgroup parsing option optgroup in scope") + }; + + if (id >= (sizeof(errors) / sizeof(lexbor_str_t))) { + if (len != NULL) { + *len = unknown.length; + } + + return unknown.data; + } + + if (len != NULL) { + *len = errors[id].length; + } + + return errors[id].data; +} diff --git a/ext/dom/lexbor/lexbor/html/tree/error.h b/ext/dom/lexbor/lexbor/html/tree/error.h index ed1859f355a6..b1867725ef98 100644 --- a/ext/dom/lexbor/lexbor/html/tree/error.h +++ b/ext/dom/lexbor/lexbor/html/tree/error.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -90,6 +90,18 @@ typedef enum { LXB_HTML_RULES_ERROR_DOTOAFFRMO, /* doctype-token-foreign-content-mode */ LXB_HTML_RULES_ERROR_DOTOFOCOMO, + /* select-in-scope */ + LXB_HTML_RULES_ERROR_SEINSC, + /* fragment-parsing-select-in-context-parse-input */ + LXB_HTML_RULES_ERROR_FRPASEINCOPAIN, + /* fragment-parsing-select-in-context-parse-select */ + LXB_HTML_RULES_ERROR_FRPASEINCOPASE, + /* hr-parsing-select-option-optgroup-in-scope */ + LXB_HTML_RULES_ERROR_HRPASEOPOPINSC, + /* option-parsing-option-in-scope */ + LXB_HTML_RULES_ERROR_OPPAOPINSC, + /* optgroup-parsing-option-optgroup-in-scope */ + LXB_HTML_RULES_ERROR_OPPAOPOPINSC, LXB_HTML_RULES_ERROR_LAST_ENTRY } @@ -108,10 +120,12 @@ LXB_API lxb_html_tree_error_t * lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors, lxb_html_token_t *token, lxb_html_tree_error_id_t id); +LXB_API const lxb_char_t * +lxb_html_tree_error_to_string(lxb_html_tree_error_id_t id, size_t *len); + #ifdef __cplusplus } /* extern "C" */ #endif #endif /* LEXBOR_HTML_TREE_ERROR_H */ - diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode.h b/ext/dom/lexbor/lexbor/html/tree/insertion_mode.h index 97cc29fa6aad..5817f3c015fd 100644 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode.h +++ b/ext/dom/lexbor/lexbor/html/tree/insertion_mode.h @@ -91,14 +91,6 @@ LXB_API bool lxb_html_tree_insertion_mode_in_cell(lxb_html_tree_t *tree, lxb_html_token_t *token); -LXB_API bool -lxb_html_tree_insertion_mode_in_select(lxb_html_tree_t *tree, - lxb_html_token_t *token); - -LXB_API bool -lxb_html_tree_insertion_mode_in_select_in_table(lxb_html_tree_t *tree, - lxb_html_token_t *token); - LXB_API bool lxb_html_tree_insertion_mode_in_template(lxb_html_tree_t *tree, lxb_html_token_t *token); diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/foreign_content.c b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/foreign_content.c index 900557a59c33..7e546e34fd9c 100644 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/foreign_content.c +++ b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/foreign_content.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -8,10 +8,10 @@ #include "lexbor/html/tree/open_elements.h" #include "lexbor/html/interfaces/element.h" -#define LEXBOR_TOKENIZER_CHARS_MAP -#define LEXBOR_STR_RES_ANSI_REPLACEMENT_CHARACTER -#include "lexbor/core/str_res.h" - +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_ansi_replacement_character[4]; + LXB_EXTERN const unsigned char lexbor_tokenizer_chars_map[256]; +#endif lxb_status_t lxb_dom_element_qualified_name_set(lxb_dom_element_t *element, @@ -87,7 +87,8 @@ lxb_html_tree_insertion_mode_foreign_content_anything_else(lxb_html_tree_t *tree tree->before_append_attr = lxb_html_tree_adjust_attributes_svg; } - element = lxb_html_tree_insert_foreign_element(tree, token, node->ns); + element = lxb_html_tree_insert_foreign_element(tree, token, node->ns, + false); if (element == NULL) { tree->before_append_attr = NULL; tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; @@ -259,22 +260,19 @@ lxb_html_tree_insertion_mode_foreign_content_all(lxb_html_tree_t *tree, lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); - if (tree->fragment != NULL) { - return lxb_html_tree_insertion_mode_foreign_content_anything_else(tree, - token); - } + node = lxb_html_tree_current_node(tree); - do { + while (node != NULL && + !(lxb_html_tree_mathml_text_integration_point(node) + || lxb_html_tree_html_integration_point(node) + || node->ns == LXB_NS_HTML)) + { lxb_html_tree_open_elements_pop(tree); node = lxb_html_tree_current_node(tree); } - while (node && - !(lxb_html_tree_mathml_text_integration_point(node) - || lxb_html_tree_html_integration_point(node) - || node->ns == LXB_NS_HTML)); - return false; + return tree->mode(tree, token); } bool @@ -286,6 +284,10 @@ lxb_html_tree_insertion_mode_foreign_content(lxb_html_tree_t *tree, case LXB_TAG_SCRIPT: return lxb_html_tree_insertion_mode_foreign_content_script_closed(tree, token); + case LXB_TAG_P: + case LXB_TAG_BR: + return lxb_html_tree_insertion_mode_foreign_content_all(tree, + token); default: return lxb_html_tree_insertion_mode_foreign_content_anything_else_closed(tree, token); diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_body.c b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_body.c index 32cc40476948..38610c7cdd27 100644 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_body.c +++ b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_body.c @@ -1,19 +1,25 @@ /* - * Copyright (C) 2018-2020 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ -#define LEXBOR_TOKENIZER_CHARS_MAP -#include "lexbor/core/str_res.h" - #include "lexbor/html/tree/insertion_mode.h" #include "lexbor/html/tree/open_elements.h" #include "lexbor/html/tree/active_formatting.h" #include "lexbor/html/interfaces/head_element.h" +#include "lexbor/html/interfaces/option_element.h" #include "lexbor/html/tokenizer/state.h" +#include "lexbor/html/parser.h" #include "lexbor/html/tokenizer/state_rcdata.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const unsigned char lexbor_tokenizer_chars_map[256]; +#endif + +static bool +lxb_html_tree_insertion_mode_in_body_anything_else_closed(lxb_html_tree_t *tree, + lxb_html_token_t *token); /* * User case insertion mode. @@ -691,7 +697,7 @@ lxb_html_tree_insertion_mode_in_body_button(lxb_html_tree_t *tree, * "address", "article", "aside", "blockquote", "button", "center", "details", * "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", * "header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre", "section", - * "summary", "ul" + * "select", "summary", "ul" */ lxb_inline bool lxb_html_tree_insertion_mode_in_body_abcdfhlmnopsu_closed(lxb_html_tree_t *tree, @@ -1204,13 +1210,63 @@ lxb_html_tree_insertion_mode_in_body_br_closed(lxb_html_tree_t *tree, return lxb_html_tree_insertion_mode_in_body_abeikw(tree, token); } +lxb_inline bool +lxb_html_tree_insertion_mode_in_body_option_closed(lxb_html_tree_t *tree, + lxb_html_token_t *token) +{ + bool is; + size_t index; + lxb_dom_node_t *node; + lxb_html_option_element_t *option; + lxb_dom_exception_code_t code; + + node = lxb_html_tree_open_elements_find_reverse(tree, LXB_TAG_OPTION, + LXB_NS_HTML, &index); + + lxb_html_tree_insertion_mode_in_body_anything_else_closed(tree, token); + + if (node != NULL) { + is = lxb_html_tree_open_elements_find_by_node(tree, node, &index); + + if (!is) { + option = lxb_html_interface_option(node); + + code = lxb_html_option_maybe_clone_to_selectedcontent(option); + if (code != LXB_DOM_EXCEPTION_OK) { + tree->status = LXB_STATUS_ERROR; + + return lxb_html_tree_process_abort(tree); + } + } + } + + return true; +} + lxb_inline bool lxb_html_tree_insertion_mode_in_body_input(lxb_html_tree_t *tree, lxb_html_token_t *token) { + bool is; + lxb_dom_node_t *node; lxb_dom_attr_t *attr; lxb_html_element_t *element; + is = lxb_html_tree_is_fragment_element(tree, LXB_TAG_SELECT, LXB_NS_HTML); + if (is) { + lxb_html_tree_parse_error(tree, token, + LXB_HTML_RULES_ERROR_FRPASEINCOPAIN); + return true; + } + + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_SEINSC); + lxb_html_tree_open_elements_pop_until_node(tree, node, true); + } + + tree->status = lxb_html_tree_active_formatting_reconstruct_elements(tree); if (tree->status != LXB_STATUS_OK) { return lxb_html_tree_process_abort(tree); @@ -1277,6 +1333,19 @@ lxb_html_tree_insertion_mode_in_body_hr(lxb_html_tree_t *tree, lxb_html_tree_close_p_element(tree, token); } + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_generate_implied_end_tags(tree, LXB_TAG__UNDEF, + LXB_NS__UNDEF); + + node = lxb_html_tree_element_in_scope_option_optgroup(tree); + if (node != NULL) { + lxb_html_tree_parse_error(tree, token, + LXB_HTML_RULES_ERROR_HRPASEOPOPINSC); + } + } + element = lxb_html_tree_insert_html_element(tree, token); if (element == NULL) { tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; @@ -1396,8 +1465,25 @@ lxb_inline bool lxb_html_tree_insertion_mode_in_body_select(lxb_html_tree_t *tree, lxb_html_token_t *token) { + bool is; + lxb_dom_node_t *node; lxb_html_element_t *element; + is = lxb_html_tree_is_fragment_element(tree, LXB_TAG_SELECT, LXB_NS_HTML); + if (is) { + lxb_html_tree_parse_error(tree, token, + LXB_HTML_RULES_ERROR_FRPASEINCOPASE); + return true; + } + + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_SEINSC); + lxb_html_tree_open_elements_pop_until_node(tree, node, true); + return true; + } + tree->status = lxb_html_tree_active_formatting_reconstruct_elements(tree); if (tree->status != LXB_STATUS_OK) { return lxb_html_tree_process_abort(tree); @@ -1412,34 +1498,81 @@ lxb_html_tree_insertion_mode_in_body_select(lxb_html_tree_t *tree, tree->frameset_ok = false; - if (tree->mode == lxb_html_tree_insertion_mode_in_table - || tree->mode == lxb_html_tree_insertion_mode_in_caption - || tree->mode == lxb_html_tree_insertion_mode_in_table_body - || tree->mode == lxb_html_tree_insertion_mode_in_row - || tree->mode == lxb_html_tree_insertion_mode_in_cell) - { - tree->mode = lxb_html_tree_insertion_mode_in_select_in_table; + return true; +} + +/* + * "option" + */ +lxb_inline bool +lxb_html_tree_insertion_mode_in_body_option(lxb_html_tree_t *tree, + lxb_html_token_t *token) +{ + lxb_dom_node_t *node; + lxb_html_element_t *element; + + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_generate_implied_end_tags(tree, LXB_TAG_OPTGROUP, + LXB_NS_HTML); + + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_OPTION, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_parse_error(tree, token, + LXB_HTML_RULES_ERROR_OPPAOPINSC); + } } else { - tree->mode = lxb_html_tree_insertion_mode_in_select; + node = lxb_html_tree_current_node(tree); + if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { + lxb_html_tree_open_elements_pop(tree); + } + } + + tree->status = lxb_html_tree_active_formatting_reconstruct_elements(tree); + if (tree->status != LXB_STATUS_OK) { + return lxb_html_tree_process_abort(tree); + } + + element = lxb_html_tree_insert_html_element(tree, token); + if (element == NULL) { + tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + + return lxb_html_tree_process_abort(tree); } return true; } /* - * "optgroup", "option" + * "optgroup" */ lxb_inline bool -lxb_html_tree_insertion_mode_in_body_optopt(lxb_html_tree_t *tree, - lxb_html_token_t *token) +lxb_html_tree_insertion_mode_in_body_optgroup(lxb_html_tree_t *tree, + lxb_html_token_t *token) { lxb_dom_node_t *node; lxb_html_element_t *element; - node = lxb_html_tree_current_node(tree); - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { - lxb_html_tree_open_elements_pop(tree); + node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, + LXB_HTML_TAG_CATEGORY_SCOPE); + if (node != NULL) { + lxb_html_tree_generate_implied_end_tags(tree, LXB_TAG__UNDEF, + LXB_NS__UNDEF); + + node = lxb_html_tree_element_in_scope_option_optgroup(tree); + if (node != NULL) { + lxb_html_tree_parse_error(tree, token, + LXB_HTML_RULES_ERROR_OPPAOPOPINSC); + } + } + else { + node = lxb_html_tree_current_node(tree); + if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { + lxb_html_tree_open_elements_pop(tree); + } } tree->status = lxb_html_tree_active_formatting_reconstruct_elements(tree); @@ -1539,7 +1672,8 @@ lxb_html_tree_insertion_mode_in_body_math(lxb_html_tree_t *tree, tree->before_append_attr = lxb_html_tree_adjust_attributes_mathml; - element = lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_MATH); + element = lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_MATH, + false); if (element == NULL) { tree->before_append_attr = NULL; tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; @@ -1570,7 +1704,8 @@ lxb_html_tree_insertion_mode_in_body_svg(lxb_html_tree_t *tree, tree->before_append_attr = lxb_html_tree_adjust_attributes_svg; - element = lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_SVG); + element = lxb_html_tree_insert_foreign_element(tree, token, LXB_NS_SVG, + false); if (element == NULL) { tree->before_append_attr = NULL; tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; @@ -1643,7 +1778,7 @@ lxb_html_tree_insertion_mode_in_body_noscript(lxb_html_tree_t *tree, return true; } -lxb_inline bool +static bool lxb_html_tree_insertion_mode_in_body_anything_else_closed(lxb_html_tree_t *tree, lxb_html_token_t *token) { @@ -1719,7 +1854,9 @@ lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree, case LXB_TAG_NAV: case LXB_TAG_OL: case LXB_TAG_PRE: + case LXB_TAG_SEARCH: case LXB_TAG_SECTION: + case LXB_TAG_SELECT: case LXB_TAG_SUMMARY: case LXB_TAG_UL: return lxb_html_tree_insertion_mode_in_body_abcdfhlmnopsu_closed(tree, @@ -1770,6 +1907,10 @@ lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree, return lxb_html_tree_insertion_mode_in_body_br_closed(tree, token); + case LXB_TAG_OPTION: + return lxb_html_tree_insertion_mode_in_body_option_closed(tree, + token); + default: return lxb_html_tree_insertion_mode_in_body_anything_else_closed(tree, token); @@ -1831,6 +1972,7 @@ lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree, case LXB_TAG_NAV: case LXB_TAG_OL: case LXB_TAG_P: + case LXB_TAG_SEARCH: case LXB_TAG_SECTION: case LXB_TAG_SUMMARY: case LXB_TAG_UL: @@ -1934,9 +2076,11 @@ lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree, case LXB_TAG_SELECT: return lxb_html_tree_insertion_mode_in_body_select(tree, token); - case LXB_TAG_OPTGROUP: case LXB_TAG_OPTION: - return lxb_html_tree_insertion_mode_in_body_optopt(tree, token); + return lxb_html_tree_insertion_mode_in_body_option(tree, token); + + case LXB_TAG_OPTGROUP: + return lxb_html_tree_insertion_mode_in_body_optgroup(tree, token); case LXB_TAG_RB: case LXB_TAG_RTC: diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_head_noscript.c b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_head_noscript.c index 78e4c5919fe7..1b40ecf62d86 100644 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_head_noscript.c +++ b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_head_noscript.c @@ -101,6 +101,13 @@ lxb_html_tree_insertion_mode_in_head_noscript_closed(lxb_html_tree_t *tree, token); } + if (token->tag_id == LXB_TAG_NOSCRIPT) { + lxb_html_tree_open_elements_pop(tree); + tree->mode = lxb_html_tree_insertion_mode_in_head; + + return true; + } + lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); return true; diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select.c b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select.c deleted file mode 100644 index b4eed2c5d3a8..000000000000 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (C) 2018-2020 Alexander Borisov - * - * Author: Alexander Borisov - */ - -#include "lexbor/html/tree/insertion_mode.h" -#include "lexbor/html/tree/open_elements.h" - - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_text(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lexbor_str_t str; - - if (token->null_count != 0) { - lxb_html_tree_parse_error(tree, token, - LXB_HTML_RULES_ERROR_NUCH); - - tree->status = lxb_html_token_make_text_drop_null(token, &str, - tree->document->dom_document.text); - } - else { - tree->status = lxb_html_token_make_text(token, &str, - tree->document->dom_document.text); - } - - if (tree->status != LXB_STATUS_OK) { - return lxb_html_tree_process_abort(tree); - } - - /* Can be zero only if all NULL are gone */ - if (str.length == 0) { - lexbor_str_destroy(&str, tree->document->dom_document.text, false); - - return true; - } - - tree->status = lxb_html_tree_insert_character_for_data(tree, &str, NULL); - if (tree->status != LXB_STATUS_OK) { - return lxb_html_tree_process_abort(tree); - } - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_comment(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_comment_t *comment; - - comment = lxb_html_tree_insert_comment(tree, token, NULL); - if (comment == NULL) { - tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - - return lxb_html_tree_process_abort(tree); - } - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_doctype(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_DOTOINSEMO); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_html(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - return lxb_html_tree_insertion_mode_in_body(tree, token); -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_option(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_element_t *element; - lxb_dom_node_t *node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { - lxb_html_tree_open_elements_pop(tree); - } - - element = lxb_html_tree_insert_html_element(tree, token); - if (element == NULL) { - tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - - return lxb_html_tree_process_abort(tree); - } - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_optgroup(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_element_t *element; - lxb_dom_node_t *node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { - lxb_html_tree_open_elements_pop(tree); - } - - node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTGROUP)) { - lxb_html_tree_open_elements_pop(tree); - } - - element = lxb_html_tree_insert_html_element(tree, token); - if (element == NULL) { - tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - - return lxb_html_tree_process_abort(tree); - } - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_hr(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_element_t *element; - lxb_dom_node_t *node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION)) { - lxb_html_tree_open_elements_pop(tree); - } - - node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTGROUP)) { - lxb_html_tree_open_elements_pop(tree); - } - - element = lxb_html_tree_insert_html_element(tree, token); - if (element == NULL) { - tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - - return lxb_html_tree_process_abort(tree); - } - - lxb_html_tree_open_elements_pop(tree); - - lxb_html_tree_acknowledge_token_self_closing(tree, token); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_optgroup_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION) - && tree->open_elements->length > 1) - { - node = lxb_html_tree_open_elements_get(tree, - tree->open_elements->length - 2); - if (node != NULL && lxb_html_tree_node_is(node, LXB_TAG_OPTGROUP)) { - lxb_html_tree_open_elements_pop(tree); - } - } - - node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTGROUP) == false) { - lxb_html_tree_parse_error(tree, token, - LXB_HTML_RULES_ERROR_UNELINOPELST); - return true; - } - - lxb_html_tree_open_elements_pop(tree); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_option_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node = lxb_html_tree_current_node(tree); - - if (lxb_html_tree_node_is(node, LXB_TAG_OPTION) == false) { - lxb_html_tree_parse_error(tree, token, - LXB_HTML_RULES_ERROR_UNELINOPELST); - return true; - } - - lxb_html_tree_open_elements_pop(tree); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_select_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node; - - node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT); - if (node == NULL) { - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNCLTO); - - return true; - } - - lxb_html_tree_open_elements_pop_until_tag_id(tree, LXB_TAG_SELECT, - LXB_NS_HTML, true); - - lxb_html_tree_reset_insertion_mode_appropriately(tree); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_select(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node; - - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); - - node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT); - if (node == NULL) { - return true; - } - - lxb_html_tree_open_elements_pop_until_tag_id(tree, LXB_TAG_SELECT, - LXB_NS_HTML, true); - - lxb_html_tree_reset_insertion_mode_appropriately(tree); - - return true; -} - -/* - * "input", "keygen", "textarea" - */ -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_ikt(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node; - - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); - - node = lxb_html_tree_element_in_scope(tree, LXB_TAG_SELECT, LXB_NS_HTML, - LXB_HTML_TAG_CATEGORY_SCOPE_SELECT); - if (node == NULL) { - return true; - } - - lxb_html_tree_open_elements_pop_until_tag_id(tree, LXB_TAG_SELECT, - LXB_NS_HTML, true); - - lxb_html_tree_reset_insertion_mode_appropriately(tree); - - return false; -} - -/* - * A start tag whose tag name is one of: "script", "template" - * An end tag whose tag name is "template" - */ -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_st_open_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - return lxb_html_tree_insertion_mode_in_head(tree, token); -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_end_of_file(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - return lxb_html_tree_insertion_mode_in_body(tree, token); -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_anything_else(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); - - return true; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_anything_else_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNCLTO); - - return true; -} - -bool -lxb_html_tree_insertion_mode_in_select(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - if (token->type & LXB_HTML_TOKEN_TYPE_CLOSE) { - switch (token->tag_id) { - case LXB_TAG_OPTGROUP: - return lxb_html_tree_insertion_mode_in_select_optgroup_closed(tree, - token); - case LXB_TAG_OPTION: - return lxb_html_tree_insertion_mode_in_select_option_closed(tree, - token); - case LXB_TAG_SELECT: - return lxb_html_tree_insertion_mode_in_select_select_closed(tree, - token); - case LXB_TAG_TEMPLATE: - return lxb_html_tree_insertion_mode_in_select_st_open_closed(tree, - token); - default: - return lxb_html_tree_insertion_mode_in_select_anything_else_closed(tree, - token); - } - } - - switch (token->tag_id) { - case LXB_TAG__TEXT: - return lxb_html_tree_insertion_mode_in_select_text(tree, token); - - case LXB_TAG__EM_COMMENT: - return lxb_html_tree_insertion_mode_in_select_comment(tree, token); - - case LXB_TAG__EM_DOCTYPE: - return lxb_html_tree_insertion_mode_in_select_doctype(tree, token); - - case LXB_TAG_HTML: - return lxb_html_tree_insertion_mode_in_select_html(tree, token); - - case LXB_TAG_OPTION: - return lxb_html_tree_insertion_mode_in_select_option(tree, token); - - case LXB_TAG_OPTGROUP: - return lxb_html_tree_insertion_mode_in_select_optgroup(tree, token); - - case LXB_TAG_HR: - return lxb_html_tree_insertion_mode_in_select_hr(tree, token); - - case LXB_TAG_SELECT: - return lxb_html_tree_insertion_mode_in_select_select(tree, token); - - case LXB_TAG_INPUT: - case LXB_TAG_KEYGEN: - case LXB_TAG_TEXTAREA: - return lxb_html_tree_insertion_mode_in_select_ikt(tree, token); - - case LXB_TAG_SCRIPT: - case LXB_TAG_TEMPLATE: - return lxb_html_tree_insertion_mode_in_select_st_open_closed(tree, - token); - case LXB_TAG__END_OF_FILE: - return lxb_html_tree_insertion_mode_in_select_end_of_file(tree, - token); - default: - return lxb_html_tree_insertion_mode_in_select_anything_else(tree, - token); - } -} diff --git a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select_in_table.c b/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select_in_table.c deleted file mode 100644 index 7db2e259191e..000000000000 --- a/ext/dom/lexbor/lexbor/html/tree/insertion_mode/in_select_in_table.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2018-2019 Alexander Borisov - * - * Author: Alexander Borisov - */ - -#include "lexbor/html/tree/insertion_mode.h" -#include "lexbor/html/tree/open_elements.h" - - -/* - * "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th" - */ -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_in_table_ct(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNTO); - - lxb_html_tree_open_elements_pop_until_tag_id(tree, LXB_TAG_SELECT, - LXB_NS_HTML, true); - - lxb_html_tree_reset_insertion_mode_appropriately(tree); - - return false; -} - -/* - * "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th" - */ -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_in_table_ct_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - lxb_dom_node_t *node; - - lxb_html_tree_parse_error(tree, token, LXB_HTML_RULES_ERROR_UNCLTO); - - node = lxb_html_tree_element_in_scope(tree, token->tag_id, LXB_NS_HTML, - LXB_HTML_TAG_CATEGORY_SCOPE_TABLE); - if (node == NULL) { - return true; - } - - lxb_html_tree_open_elements_pop_until_tag_id(tree, LXB_TAG_SELECT, - LXB_NS_HTML, true); - - lxb_html_tree_reset_insertion_mode_appropriately(tree); - - return false; -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_in_table_anything_else(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - return lxb_html_tree_insertion_mode_in_select(tree, token); -} - -lxb_inline bool -lxb_html_tree_insertion_mode_in_select_in_table_anything_else_closed(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - return lxb_html_tree_insertion_mode_in_select_in_table_anything_else(tree, - token); -} - -bool -lxb_html_tree_insertion_mode_in_select_in_table(lxb_html_tree_t *tree, - lxb_html_token_t *token) -{ - if (token->tag_id >= LXB_TAG__LAST_ENTRY) { - if (token->type & LXB_HTML_TOKEN_TYPE_CLOSE) { - return lxb_html_tree_insertion_mode_in_select_in_table_anything_else_closed(tree, - token); - } - - return lxb_html_tree_insertion_mode_in_select_in_table_anything_else(tree, - token); - } - - if (token->type & LXB_HTML_TOKEN_TYPE_CLOSE) { - switch (token->tag_id) { - case LXB_TAG_CAPTION: - case LXB_TAG_TABLE: - case LXB_TAG_TBODY: - case LXB_TAG_TFOOT: - case LXB_TAG_THEAD: - case LXB_TAG_TR: - case LXB_TAG_TH: - case LXB_TAG_TD: - return lxb_html_tree_insertion_mode_in_select_in_table_ct_closed(tree, - token); - default: - return lxb_html_tree_insertion_mode_in_select_in_table_anything_else_closed(tree, - token); - } - } - - switch (token->tag_id) { - case LXB_TAG_CAPTION: - case LXB_TAG_TABLE: - case LXB_TAG_TBODY: - case LXB_TAG_TFOOT: - case LXB_TAG_THEAD: - case LXB_TAG_TR: - case LXB_TAG_TH: - case LXB_TAG_TD: - return lxb_html_tree_insertion_mode_in_select_in_table_ct(tree, - token); - default: - return lxb_html_tree_insertion_mode_in_select_in_table_anything_else(tree, - token); - } -} diff --git a/ext/dom/lexbor/lexbor/ns/base.h b/ext/dom/lexbor/lexbor/ns/base.h index a5b01baa0e6c..94ee0b7f8719 100644 --- a/ext/dom/lexbor/lexbor/ns/base.h +++ b/ext/dom/lexbor/lexbor/ns/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Alexander Borisov + * Copyright (C) 2019-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -16,7 +16,7 @@ extern "C" { #define LXB_NS_VERSION_MAJOR 1 -#define LXB_NS_VERSION_MINOR 2 +#define LXB_NS_VERSION_MINOR 4 #define LXB_NS_VERSION_PATCH 0 #define LXB_NS_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/ns/const.h b/ext/dom/lexbor/lexbor/ns/const.h index 463d8d4998bc..2115629b9bdd 100644 --- a/ext/dom/lexbor/lexbor/ns/const.h +++ b/ext/dom/lexbor/lexbor/ns/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ diff --git a/ext/dom/lexbor/lexbor/ns/ns.c b/ext/dom/lexbor/lexbor/ns/ns.c index 87e870cf627c..4ffd02519c94 100644 --- a/ext/dom/lexbor/lexbor/ns/ns.c +++ b/ext/dom/lexbor/lexbor/ns/ns.c @@ -1,13 +1,14 @@ /* - * Copyright (C) 2018-2019 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ #include "lexbor/core/shs.h" -#define LEXBOR_STR_RES_MAP_LOWERCASE -#include "lexbor/core/str_res.h" +#ifndef LEXBOR_DISABLE_INTERNAL_EXTERN + LXB_EXTERN const lxb_char_t lexbor_str_res_map_lowercase[256]; +#endif #include "lexbor/ns/ns.h" #include "lexbor/ns/res.h" diff --git a/ext/dom/lexbor/lexbor/ns/res.h b/ext/dom/lexbor/lexbor/ns/res.h index ca3ab04cb6e7..c953ab074696 100644 --- a/ext/dom/lexbor/lexbor/ns/res.h +++ b/ext/dom/lexbor/lexbor/ns/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -50,7 +50,7 @@ static const lxb_ns_prefix_data_t lxb_ns_prefix_res_data[LXB_NS__LAST_ENTRY] = {{.u.short_str = "xmlns", .length = 5, .next = NULL}, LXB_NS_XMLNS, 1, true} }; -static const lexbor_shs_entry_t lxb_ns_res_shs_data[] = +static const lexbor_shs_entry_t lxb_ns_res_shs_data[29] = { {NULL, NULL, 28, 0}, {"html", (void *) &lxb_ns_prefix_res_data[2], 4, 0}, {"xmlns", (void *) &lxb_ns_prefix_res_data[7], 5, 0}, {NULL, NULL, 0, 0}, @@ -69,7 +69,7 @@ static const lexbor_shs_entry_t lxb_ns_res_shs_data[] = {"xml", (void *) &lxb_ns_prefix_res_data[6], 3, 0} }; -static const lexbor_shs_entry_t lxb_ns_res_shs_link_data[] = +static const lexbor_shs_entry_t lxb_ns_res_shs_link_data[23] = { {NULL, NULL, 22, 0}, {"http://www.w3.org/1999/xhtml", (void *) &lxb_ns_res_data[2], 28, 0}, diff --git a/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c b/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c index 7a494017a2d6..26e6f333fa8a 100644 --- a/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c +++ b/ext/dom/lexbor/lexbor/selectors-adapted/selectors.c @@ -1,9 +1,9 @@ /* - * Copyright (C) 2021-2025 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov * Adapted for PHP + libxml2 by: Niels Dossche - * Based on Lexbor (upstream commit 971faf11a5f45433b9193a143e2897d8c0fd5611) + * Based on Lexbor (upstream commit 5291cde0d40f77e7c4ea364b7cd726269e0bf1f9) */ #include @@ -1356,8 +1356,8 @@ lxb_selectors_state_after_nth_child(lxb_selectors_t *selectors, current = selectors->current; if (current->index == 0) { - selectors->state = lxb_selectors_state_not_found; selectors->current = selectors->current->parent; + lxb_selectors_switch_to_not_found(selectors, selectors->current); return selectors->current->entry; } diff --git a/ext/dom/lexbor/lexbor/selectors/base.h b/ext/dom/lexbor/lexbor/selectors/base.h index 64af0261a75c..19bdda73849a 100644 --- a/ext/dom/lexbor/lexbor/selectors/base.h +++ b/ext/dom/lexbor/lexbor/selectors/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Alexander Borisov + * Copyright (C) 2021-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -15,7 +15,7 @@ extern "C" { #define LXB_SELECTORS_VERSION_MAJOR 0 -#define LXB_SELECTORS_VERSION_MINOR 3 +#define LXB_SELECTORS_VERSION_MINOR 6 #define LXB_SELECTORS_VERSION_PATCH 0 #define LXB_SELECTORS_VERSION_STRING LEXBOR_STRINGIZE(LXB_SELECTORS_VERSION_MAJOR) "." \ diff --git a/ext/dom/lexbor/lexbor/selectors/selectors.c b/ext/dom/lexbor/lexbor/selectors/selectors.c index 45db265302a2..20324323405d 100644 --- a/ext/dom/lexbor/lexbor/selectors/selectors.c +++ b/ext/dom/lexbor/lexbor/selectors/selectors.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Alexander Borisov + * Copyright (C) 2021-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -10,48 +10,74 @@ static lxb_status_t -lxb_selectors_state_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root, - const lxb_css_selector_list_t *list); +lxb_selectors_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root); static lxb_status_t -lxb_selectors_state_run(lxb_selectors_t *selectors, lxb_dom_node_t *node, - const lxb_css_selector_list_t *list); +lxb_selectors_run(lxb_selectors_t *selectors, lxb_dom_node_t *node); static lxb_selectors_entry_t * lxb_selectors_state_find(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry); static lxb_selectors_entry_t * -lxb_selectors_state_find_check(lxb_selectors_t *selectors, lxb_dom_node_t *node, - const lxb_css_selector_t *selector, - lxb_selectors_entry_t *entry); +lxb_selectors_state_found_check(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + +static lxb_selectors_entry_t * +lxb_selectors_state_found_check_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + +static lxb_selectors_entry_t * +lxb_selectors_state_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); static lxb_selectors_entry_t * -lxb_selectors_state_pseudo_class_function(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry); +lxb_selectors_state_found_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); -static lxb_dom_node_t * -lxb_selectors_next_node(lxb_selectors_nested_t *main); +static lxb_selectors_entry_t * +lxb_selectors_state_not_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); -static lxb_dom_node_t * -lxb_selectors_state_has_relative(lxb_dom_node_t *node, - const lxb_css_selector_t *selector); +static lxb_selectors_entry_t * +lxb_selectors_state_not_found_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); static lxb_selectors_entry_t * -lxb_selectors_state_after_find_has(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry); +lxb_selectors_next_list(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + +static lxb_selectors_entry_t * +lxb_selectors_next_list_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + +static lxb_selectors_entry_t * +lxb_selectors_make_following(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + +static lxb_selectors_entry_t * +lxb_selectors_make_following_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); static lxb_selectors_entry_t * lxb_selectors_state_after_find(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry); +static lxb_selectors_entry_t * +lxb_selectors_state_after_not(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + static lxb_selectors_entry_t * lxb_selectors_state_after_nth_child(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry); +static lxb_selectors_entry_t * +lxb_selectors_state_nth_child_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry); + static bool lxb_selectors_match(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node); + lxb_dom_node_t *node); static bool lxb_selectors_match_element(const lxb_css_selector_t *selector, @@ -73,7 +99,8 @@ lxb_selectors_pseudo_class(const lxb_css_selector_t *selector, const lxb_dom_node_t *node); static bool -lxb_selectors_pseudo_class_function(const lxb_css_selector_t *selector, +lxb_selectors_pseudo_class_function(lxb_selectors_t *selectors, + const lxb_css_selector_t *selector, lxb_dom_node_t *node); static bool @@ -109,6 +136,10 @@ static lxb_status_t lxb_selectors_cb_not(lxb_dom_node_t *node, lxb_css_selector_specificity_t spec, void *ctx); +static lxb_status_t +lxb_selectors_cb_nth_ok(lxb_dom_node_t *node, + lxb_css_selector_specificity_t spec, void *ctx); + lxb_selectors_t * lxb_selectors_create(void) @@ -168,17 +199,118 @@ lxb_selectors_destroy(lxb_selectors_t *selectors, bool self_destroy) return selectors; } +static lxb_selectors_entry_t * +lxb_selectors_state_entry_create(lxb_selectors_t *selectors, + const lxb_css_selector_t *selector, + lxb_selectors_entry_t *root, + lxb_dom_node_t *node) +{ + lxb_selectors_entry_t *entry; + lxb_css_selector_combinator_t combinator; + + combinator = selector->combinator; + + do { + selector = selector->prev; + + entry = lexbor_dobject_calloc(selectors->objs); + if (entry == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; + } + + entry->combinator = selector->combinator; + entry->selector = selector; + entry->node = node; + + if (root->prev != NULL) { + root->prev->next = entry; + entry->prev = root->prev; + } + + entry->next = root; + root->prev = entry; + } + while (selector->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE + && selector->prev != NULL); + + entry->combinator = combinator; + + return entry; +} + +static lxb_selectors_entry_t * +lxb_selectors_state_entry_create_forward(lxb_selectors_t *selectors, + const lxb_css_selector_t *selector, + lxb_selectors_entry_t *root, + lxb_dom_node_t *node) +{ + lxb_selectors_entry_t *entry; + + selector = selector->next; + + entry = lexbor_dobject_calloc(selectors->objs); + if (entry == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; + } + + entry->combinator = selector->combinator; + entry->selector = selector; + entry->node = node; + + entry->prev = root; + root->next = entry; + + return entry; +} + +static lxb_selectors_entry_t * +lxb_selectors_entry_make_first(lxb_selectors_t *selectors, + lxb_css_selector_t *selector) +{ + lxb_selectors_entry_t *entry, *prev; + + prev = NULL; + + do { + entry = lexbor_dobject_calloc(selectors->objs); + if (entry == NULL) { + return NULL; + } + + entry->selector = selector; + entry->combinator = LXB_CSS_SELECTOR_COMBINATOR_CLOSE; + + if (prev != NULL) { + prev->next = entry; + entry->prev = prev; + } + + if (selector->combinator != LXB_CSS_SELECTOR_COMBINATOR_CLOSE + || selector->prev == NULL) + { + break; + } + + prev = entry; + selector = selector->prev; + } + while (true); + + return entry; +} + lxb_inline lxb_dom_node_t * lxb_selectors_descendant(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node) { node = node->parent; while (node != NULL) { if (node->type == LXB_DOM_NODE_TYPE_ELEMENT - && lxb_selectors_match(selectors, entry, selector, node)) + && lxb_selectors_match(selectors, entry, node)) { return node; } @@ -189,11 +321,69 @@ lxb_selectors_descendant(lxb_selectors_t *selectors, return NULL; } +lxb_inline lxb_dom_node_t * +lxb_selectors_descendant_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry, + lxb_dom_node_t *node) +{ + lxb_dom_node_t *root; + lxb_selectors_nested_t *current = selectors->current; + + if (entry->prev != NULL) { + root = entry->prev->node; + } + else { + root = current->root; + } + + do { + if (node->first_child != NULL) { + node = node->first_child; + } + else { + + next: + + while (node != root && node->next == NULL) { + node = node->parent; + } + + if (node == root) { + break; + } + + node = node->next; + } + + if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) { + goto next; + } + + if (lxb_selectors_match(selectors, entry, node)) { + return node; + } + } + while (node != NULL); + + return NULL; +} + lxb_inline lxb_dom_node_t * lxb_selectors_close(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node) + lxb_dom_node_t *node) +{ + if (lxb_selectors_match(selectors, entry, node)) { + return node; + } + + return NULL; +} + +lxb_inline lxb_dom_node_t * +lxb_selectors_close_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry, lxb_dom_node_t *node) { - if (lxb_selectors_match(selectors, entry, selector, node)) { + if (lxb_selectors_match(selectors, entry, node)) { return node; } @@ -202,12 +392,12 @@ lxb_selectors_close(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, lxb_inline lxb_dom_node_t * lxb_selectors_child(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *root) + lxb_dom_node_t *root) { root = root->parent; if (root != NULL && root->type == LXB_DOM_NODE_TYPE_ELEMENT - && lxb_selectors_match(selectors, entry, selector, root)) + && lxb_selectors_match(selectors, entry, root)) { return root; } @@ -215,15 +405,47 @@ lxb_selectors_child(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, return NULL; } +lxb_inline lxb_dom_node_t * +lxb_selectors_child_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry, lxb_dom_node_t *root) +{ + if (entry->prev != NULL) { + if (entry->prev->node == root) { + root = root->first_child; + } + else { + root = root->next; + } + } + else if (selectors->current->root == root) { + root = root->first_child; + } + else { + root = root->next; + } + + while (root != NULL) { + if (root->type == LXB_DOM_NODE_TYPE_ELEMENT + && lxb_selectors_match(selectors, entry, root)) + { + return root; + } + + root = root->next; + } + + return NULL; +} + lxb_inline lxb_dom_node_t * lxb_selectors_sibling(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node) + lxb_dom_node_t *node) { node = node->prev; while (node != NULL) { if (node->type == LXB_DOM_NODE_TYPE_ELEMENT) { - if (lxb_selectors_match(selectors, entry, selector, node)) { + if (lxb_selectors_match(selectors, entry, node)) { return node; } @@ -236,15 +458,36 @@ lxb_selectors_sibling(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, return NULL; } +lxb_inline lxb_dom_node_t * +lxb_selectors_sibling_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry, lxb_dom_node_t *node) +{ + node = node->next; + + while (node != NULL) { + if (node->type == LXB_DOM_NODE_TYPE_ELEMENT) { + if (lxb_selectors_match(selectors, entry, node)) { + return node; + } + + return NULL; + } + + node = node->next; + } + + return NULL; +} + lxb_inline lxb_dom_node_t * lxb_selectors_following(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node) + lxb_dom_node_t *node) { node = node->prev; while (node != NULL) { if (node->type == LXB_DOM_NODE_TYPE_ELEMENT && - lxb_selectors_match(selectors, entry, selector, node)) + lxb_selectors_match(selectors, entry, node)) { return node; } @@ -255,6 +498,57 @@ lxb_selectors_following(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry return NULL; } +lxb_inline lxb_dom_node_t * +lxb_selectors_following_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry, + lxb_dom_node_t *node) +{ + node = node->next; + + while (node != NULL) { + if (node->type == LXB_DOM_NODE_TYPE_ELEMENT && + lxb_selectors_match(selectors, entry, node)) + { + return node; + } + + node = node->next; + } + + return NULL; +} + +lxb_inline void +lxb_selectors_switch_to_found_check(lxb_selectors_t *selectors, + lxb_selectors_nested_t *current) +{ + if (current->forward) { + selectors->state = lxb_selectors_state_found_check_forward; + } + else { + selectors->state = lxb_selectors_state_found_check; + } +} + +lxb_inline void +lxb_selectors_switch_to_not_found(lxb_selectors_t *selectors, + lxb_selectors_nested_t *current) +{ + if (current->forward) { + selectors->state = lxb_selectors_state_not_found_forward; + } + else { + selectors->state = lxb_selectors_state_not_found; + } +} + +static lxb_selectors_entry_t * +lxb_selectors_state_failed(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + return NULL; +} + lxb_status_t lxb_selectors_find(lxb_selectors_t *selectors, lxb_dom_node_t *root, const lxb_css_selector_list_t *list, @@ -263,23 +557,23 @@ lxb_selectors_find(lxb_selectors_t *selectors, lxb_dom_node_t *root, lxb_selectors_entry_t *entry; lxb_selectors_nested_t nested; - entry = lexbor_dobject_calloc(selectors->objs); + entry = lxb_selectors_entry_make_first(selectors, list->last); if (entry == NULL) { return LXB_STATUS_ERROR_MEMORY_ALLOCATION; } - entry->combinator = LXB_CSS_SELECTOR_COMBINATOR_CLOSE; - entry->selector = list->last; - nested.parent = NULL; nested.entry = entry; + nested.first = entry; + nested.top = entry; nested.cb = cb; nested.ctx = ctx; + nested.forward = false; selectors->current = &nested; selectors->status = LXB_STATUS_OK; - return lxb_selectors_state_tree(selectors, root, list); + return lxb_selectors_tree(selectors, root); } lxb_status_t @@ -295,23 +589,23 @@ lxb_selectors_match_node(lxb_selectors_t *selectors, lxb_dom_node_t *node, return LXB_STATUS_OK; } - entry = lexbor_dobject_calloc(selectors->objs); + entry = lxb_selectors_entry_make_first(selectors, list->last); if (entry == NULL) { return LXB_STATUS_ERROR_MEMORY_ALLOCATION; } - entry->combinator = LXB_CSS_SELECTOR_COMBINATOR_CLOSE; - entry->selector = list->last; - nested.parent = NULL; nested.entry = entry; + nested.first = entry; + nested.top = entry; nested.cb = cb; nested.ctx = ctx; + nested.forward = false; selectors->current = &nested; selectors->status = LXB_STATUS_OK; - status = lxb_selectors_state_run(selectors, node, list); + status = lxb_selectors_run(selectors, node); lxb_selectors_clean(selectors); @@ -320,15 +614,14 @@ lxb_selectors_match_node(lxb_selectors_t *selectors, lxb_dom_node_t *node, lxb_status_t lxb_selectors_find_reverse(lxb_selectors_t *selectors, lxb_dom_node_t *root, - lxb_css_selector_list_t *list, + const lxb_css_selector_list_t *list, lxb_selectors_cb_f cb, void *ctx) { return lxb_selectors_find(selectors, root, list, cb, ctx); } static lxb_status_t -lxb_selectors_state_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root, - const lxb_css_selector_list_t *list) +lxb_selectors_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root) { lxb_status_t status; lxb_dom_node_t *node; @@ -353,7 +646,7 @@ lxb_selectors_state_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root, goto next; } - status = lxb_selectors_state_run(selectors, node, list); + status = lxb_selectors_run(selectors, node); if (status != LXB_STATUS_OK) { if (status == LXB_STATUS_STOP) { break; @@ -391,32 +684,24 @@ lxb_selectors_state_tree(lxb_selectors_t *selectors, lxb_dom_node_t *root, } static lxb_status_t -lxb_selectors_state_run(lxb_selectors_t *selectors, lxb_dom_node_t *node, - const lxb_css_selector_list_t *list) +lxb_selectors_run(lxb_selectors_t *selectors, lxb_dom_node_t *node) { lxb_selectors_entry_t *entry; + lxb_selectors_nested_t *current = selectors->current; - entry = selectors->current->entry; + entry = current->entry; entry->node = node; + current->root = node; selectors->state = lxb_selectors_state_find; - selectors->first = entry; - -again: do { entry = selectors->state(selectors, entry); } while (entry != NULL); - if (selectors->current->parent != NULL - && selectors->status == LXB_STATUS_OK) - { - entry = selectors->current->entry; - selectors->state = selectors->current->return_state; - - goto again; - } + current->first = current->top; + current->entry = current->top; return selectors->status; } @@ -426,92 +711,28 @@ lxb_selectors_state_find(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry) { lxb_dom_node_t *node; - lxb_selectors_entry_t *next; - const lxb_css_selector_t *selector; - const lxb_css_selector_anb_of_t *anb; - const lxb_css_selector_pseudo_t *pseudo; - - selector = entry->selector; - - if (selector->type == LXB_CSS_SELECTOR_TYPE_PSEUDO_CLASS_FUNCTION) { - pseudo = &selector->u.pseudo; - - /* Optimizing. */ - switch (pseudo->type) { - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD: - anb = pseudo->data; - - if (anb->of != NULL) { - break; - } - - goto godoit; - - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE: - goto godoit; - - default: - break; - } - - if (entry->nested == NULL) { - next = lexbor_dobject_calloc(selectors->objs); - if (next == NULL) { - selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - return NULL; - } - - next->combinator = LXB_CSS_SELECTOR_COMBINATOR_CLOSE; - - entry->nested = lexbor_dobject_calloc(selectors->nested); - if (entry->nested == NULL) { - selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - return NULL; - } - - entry->nested->entry = next; - entry->nested->parent = selectors->current; - } - - selectors->state = lxb_selectors_state_pseudo_class_function; - selectors->current->last = entry; - selectors->current = entry->nested; - - next = entry->nested->entry; - next->node = entry->node; - - return next; - } - -godoit: + selectors->state = lxb_selectors_state_found_check; switch (entry->combinator) { case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - node = lxb_selectors_descendant(selectors, entry, - selector, entry->node); + node = lxb_selectors_descendant(selectors, entry, entry->node); break; case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: - node = lxb_selectors_close(selectors, entry, - selector, entry->node); + node = lxb_selectors_close(selectors, entry, entry->node); break; case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - node = lxb_selectors_child(selectors, entry, - selector, entry->node); + node = lxb_selectors_child(selectors, entry, entry->node); break; case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - node = lxb_selectors_sibling(selectors, entry, - selector, entry->node); + node = lxb_selectors_sibling(selectors, entry, entry->node); break; case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = lxb_selectors_following(selectors, entry, - selector, entry->node); + node = lxb_selectors_following(selectors, entry, entry->node); break; case LXB_CSS_SELECTOR_COMBINATOR_CELL: @@ -520,534 +741,447 @@ lxb_selectors_state_find(lxb_selectors_t *selectors, return NULL; } - return lxb_selectors_state_find_check(selectors, node, selector, entry); + if (node == NULL) { + selectors->state = lxb_selectors_state_not_found; + } + else { + selectors->current->entry->node = node; + } + + return selectors->current->entry; } static lxb_selectors_entry_t * -lxb_selectors_state_find_check(lxb_selectors_t *selectors, lxb_dom_node_t *node, - const lxb_css_selector_t *selector, - lxb_selectors_entry_t *entry) +lxb_selectors_state_find_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_selectors_entry_t *next; - lxb_selectors_nested_t *current; - - if (node == NULL) { - - try_next: - - if (entry->next == NULL) { - - try_next_list: - - if (selector->list->next == NULL) { - return NULL; - } - - /* - * Try the following selectors from the selector list. - */ + lxb_dom_node_t *node; - if (entry->following != NULL) { - entry->following->node = entry->node; + selectors->state = lxb_selectors_state_found_check_forward; - if (selectors->current->parent == NULL) { - selectors->first = entry->following; - } + switch (entry->combinator) { + case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: + node = lxb_selectors_descendant_forward(selectors, entry, + entry->node); + break; - return entry->following; - } + case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: + node = lxb_selectors_close_forward(selectors, entry, + entry->node); + break; - next = lexbor_dobject_calloc(selectors->objs); - if (next == NULL) { - selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - return NULL; - } + case LXB_CSS_SELECTOR_COMBINATOR_CHILD: + node = lxb_selectors_child_forward(selectors, entry, entry->node); + break; - next->combinator = LXB_CSS_SELECTOR_COMBINATOR_CLOSE; - next->selector = selector->list->next->last; - next->node = entry->node; + case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: + node = lxb_selectors_sibling_forward(selectors, entry, entry->node); + break; - entry->following = next; + case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: + node = lxb_selectors_following_forward(selectors, entry, + entry->node); + break; - if (selectors->current->parent == NULL) { - selectors->first = next; - } + case LXB_CSS_SELECTOR_COMBINATOR_CELL: + default: + selectors->status = LXB_STATUS_ERROR; + return NULL; + } - return next; - } + if (node == NULL) { + try_next: do { - entry = entry->next; - - while (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE) { - if (entry->next == NULL) { - selector = entry->selector; - goto try_next; - } - - entry = entry->next; + if (entry->prev == NULL) { + return lxb_selectors_next_list_forward(selectors, entry); } - switch (entry->combinator) { - case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - node = entry->node->parent; - - if (node == NULL - || node->type != LXB_DOM_NODE_TYPE_ELEMENT) - { - node = NULL; - } - - break; - - case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = entry->node->prev; - break; - - case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: - node = NULL; - break; - - case LXB_CSS_SELECTOR_COMBINATOR_CELL: - default: - selectors->status = LXB_STATUS_ERROR; - return NULL; - } + entry = entry->prev; } - while (node == NULL); + while (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE); - entry->node = node; + if (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_SIBLING) { + goto try_next; + } - return entry; + selectors->current->entry = entry; + selectors->state = lxb_selectors_state_find_forward; + } + else { + selectors->current->entry->node = node; } - if (selector->prev == NULL) { - current = selectors->current; - - selectors->status = current->cb(current->entry->node, - selector->list->specificity, - current->ctx); + return selectors->current->entry; +} - if ((selectors->options & LXB_SELECTORS_OPT_MATCH_FIRST) == 0 - && current->parent == NULL) - { - if (selectors->status == LXB_STATUS_OK) { - entry = selectors->first; - goto try_next_list; - } - } +lxb_inline lxb_selectors_entry_t * +lxb_selectors_done(lxb_selectors_t *selectors) +{ + lxb_selectors_nested_t *current = selectors->current; + if (current->parent == NULL) { return NULL; } - if (entry->prev == NULL) { - next = lexbor_dobject_calloc(selectors->objs); - if (next == NULL) { - selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; - return NULL; - } + selectors->current = current->parent; - next->combinator = selector->combinator; - next->selector = selector->prev; - next->node = node; + return selectors->current->entry; +} - next->next = entry; - entry->prev = next; +lxb_inline lxb_selectors_entry_t * +lxb_selectors_exit(lxb_selectors_t *selectors) +{ + lxb_selectors_nested_t *current = selectors->current; - return next; + if (current->parent == NULL) { + return NULL; } - entry->prev->node = node; + selectors->state = current->return_state; - return entry->prev; + return current->entry; } static lxb_selectors_entry_t * -lxb_selectors_state_pseudo_class_function(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry) +lxb_selectors_state_found_check(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_dom_node_t *node, *base; lxb_selectors_nested_t *current; - const lxb_css_selector_list_t *list; - lxb_css_selector_anb_of_t *anb; - const lxb_css_selector_pseudo_t *pseudo; + lxb_dom_node_t *node; + lxb_selectors_entry_t *prev; + const lxb_css_selector_t *selector; current = selectors->current; + entry = current->entry; + node = entry->node; - base = lxb_selectors_next_node(current); - if (base == NULL) { - goto not_found; - } - - pseudo = ¤t->parent->last->selector->u.pseudo; - - switch (pseudo->type) { - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS: - list = (lxb_css_selector_list_t *) pseudo->data; - node = lxb_selectors_state_has_relative(base, list->first); - - if (node == NULL) { - selectors->current = selectors->current->parent; - entry = selectors->current->last; - - selectors->state = lxb_selectors_state_find; - - return lxb_selectors_state_find_check(selectors, NULL, - entry->selector, entry); - } - - current->root = base; - - current->entry->selector = list->last; - current->entry->node = node; - current->return_state = lxb_selectors_state_after_find_has; - current->cb = lxb_selectors_cb_ok; - current->ctx = ¤t->found; - current->found = false; - - selectors->state = lxb_selectors_state_find; + if (entry->prev == NULL) { + selector = entry->selector; - return entry; + while (selector->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE + && selector->prev != NULL) + { + selector = selector->prev; + } - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE: - current->entry->selector = ((lxb_css_selector_list_t *) pseudo->data)->last; - current->entry->node = base; - current->return_state = lxb_selectors_state_after_find; - current->cb = lxb_selectors_cb_ok; - current->ctx = ¤t->found; - current->found = false; + if (selector->prev == NULL) { + return lxb_selectors_state_found(selectors, entry); + } - selectors->state = lxb_selectors_state_find; + prev = lxb_selectors_state_entry_create(selectors, selector, + entry, node); + current->entry = prev; + selectors->state = lxb_selectors_state_find; - return entry; + return prev; + } - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT: - current->entry->selector = ((lxb_css_selector_list_t *) pseudo->data)->last; - current->entry->node = base; - current->return_state = lxb_selectors_state_after_find; - current->cb = lxb_selectors_cb_not; - current->ctx = ¤t->found; - current->found = true; + selectors->state = lxb_selectors_state_find; - selectors->state = lxb_selectors_state_find; + current->entry = entry->prev; + entry->prev->node = node; - return entry; + return entry->prev; +} - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD: - anb = pseudo->data; +static lxb_selectors_entry_t * +lxb_selectors_state_found_check_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + lxb_selectors_nested_t *current; + lxb_dom_node_t *node; + lxb_selectors_entry_t *next; + const lxb_css_selector_t *selector; - current->entry->selector = anb->of->last; - current->entry->node = base; - current->return_state = lxb_selectors_state_after_nth_child; - current->cb = lxb_selectors_cb_ok; - current->ctx = ¤t->found; - current->root = base; - current->index = 0; - current->found = false; + current = selectors->current; + entry = current->entry; + node = entry->node; - selectors->state = lxb_selectors_state_find; + if (entry->next == NULL) { + selector = entry->selector; - return entry; + if (selector->next == NULL) { + return lxb_selectors_state_found_forward(selectors, entry); + } - /* - * This one can only happen if the user has somehow messed up the - * selector. - */ + next = lxb_selectors_state_entry_create_forward(selectors, selector, + entry, node); + current->entry = next; + selectors->state = lxb_selectors_state_find_forward; - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL: - case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL: - default: - break; + return next; } -not_found: + selectors->state = lxb_selectors_state_find_forward; - selectors->current = selectors->current->parent; - entry = selectors->current->last; + current->entry = entry->next; + entry->next->node = node; - selectors->state = lxb_selectors_state_find; - - return lxb_selectors_state_find_check(selectors, NULL, - entry->selector, entry); + return entry->next; } -static lxb_dom_node_t * -lxb_selectors_next_node(lxb_selectors_nested_t *main) +static lxb_selectors_entry_t * +lxb_selectors_state_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_dom_node_t *node = main->entry->node; - - switch (main->parent->last->combinator) { - case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - if (node->parent == NULL - || node->parent->type != LXB_DOM_NODE_TYPE_ELEMENT) - { - return NULL; - } - - return node->parent; + lxb_selectors_nested_t *current; + const lxb_css_selector_t *selector; - case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: - return node; + current = selectors->current; + selector = current->entry->selector; - case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = node->prev; - break; + selectors->state = lxb_selectors_state_find; - default: - return NULL; - } + selectors->status = current->cb(current->root, + selector->list->specificity, + current->ctx); - while (node != NULL) { - if (node->type == LXB_DOM_NODE_TYPE_ELEMENT) { - break; + if ((selectors->options & LXB_SELECTORS_OPT_MATCH_FIRST) == 0 + && current->parent == NULL) + { + if (selectors->status == LXB_STATUS_OK) { + entry = selectors->current->first; + return lxb_selectors_next_list(selectors, entry); } - - node = node->prev; } - return node; + return lxb_selectors_done(selectors); } -static lxb_dom_node_t * -lxb_selectors_state_has_relative(lxb_dom_node_t *node, - const lxb_css_selector_t *selector) +static lxb_selectors_entry_t * +lxb_selectors_state_found_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_dom_node_t *root = node; - - switch (selector->combinator) { - case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - node = node->first_child; - break; - - case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = node->next; - break; + lxb_selectors_nested_t *current; + const lxb_css_selector_t *selector; - default: - return NULL; - } + current = selectors->current; + selector = current->entry->selector; - while (node != NULL) { - if (node->type == LXB_DOM_NODE_TYPE_ELEMENT) { - break; - } + selectors->state = lxb_selectors_state_find_forward; - while (node !=root && node->next == NULL) { - node = node->parent; - } + selectors->status = current->cb(current->root, + selector->list->specificity, + current->ctx); - if (node == root) { - return NULL; + if ((selectors->options & LXB_SELECTORS_OPT_MATCH_FIRST) == 0 + && current->parent == NULL) + { + if (selectors->status == LXB_STATUS_OK) { + entry = selectors->current->first; + return lxb_selectors_next_list_forward(selectors, entry); } - - node = node->next; } - return node; + return lxb_selectors_done(selectors); } + static lxb_selectors_entry_t * -lxb_selectors_state_after_find_has(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry) +lxb_selectors_state_not_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_dom_node_t *node; - lxb_selectors_entry_t *parent; lxb_selectors_nested_t *current; - if (selectors->current->found) { - node = selectors->current->root; - - selectors->current = selectors->current->parent; - parent = selectors->current->last; + current = selectors->current; + entry = current->entry; - selectors->state = lxb_selectors_state_find; +try_next: - return lxb_selectors_state_find_check(selectors, node, - parent->selector, parent); + if (entry->next == NULL) { + return lxb_selectors_next_list(selectors, entry); } - current = selectors->current; - node = entry->node; + entry = entry->next; - switch (entry->selector->list->first->combinator) { - case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - if (node->first_child != NULL) { - node = node->first_child; - } - else { - - next: + while (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE) { + if (entry->next == NULL) { + goto try_next; + } - while (node != current->root && node->next == NULL) { - node = node->parent; - } + entry = entry->next; + } - if (node == current->root) { - goto failed; - } + switch (entry->combinator) { + case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: + case LXB_CSS_SELECTOR_COMBINATOR_CHILD: + case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: + goto try_next; - node = node->next; - } + default: + break; + } - if (node->type != LXB_DOM_NODE_TYPE_ELEMENT) { - goto next; - } + current->entry = entry; + selectors->state = lxb_selectors_state_find; - break; + return entry; +} - case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = node->next; +static lxb_selectors_entry_t * +lxb_selectors_state_not_found_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ +try_next: - while (node != NULL && node->type != LXB_DOM_NODE_TYPE_ELEMENT) { - node = node->next; - } + if (entry->prev == NULL) { + return lxb_selectors_next_list_forward(selectors, entry); + } - if (node == NULL) { - goto failed; - } + while (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_CLOSE) { + if (entry->prev == NULL) { + goto try_next; + } - break; + entry = entry->prev; + } - case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - goto failed; + if (entry->combinator == LXB_CSS_SELECTOR_COMBINATOR_SIBLING) { + if (entry->prev != NULL) { + entry = entry->prev; + } - case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: - case LXB_CSS_SELECTOR_COMBINATOR_CELL: - default: - selectors->status = LXB_STATUS_ERROR; - return NULL; + goto try_next; } - entry->node = node; - selectors->state = lxb_selectors_state_find; + selectors->current->entry = entry; + selectors->state = lxb_selectors_state_find_forward; return entry; +} -failed: - - selectors->current = selectors->current->parent; - parent = selectors->current->last; +static lxb_selectors_entry_t * +lxb_selectors_next_list(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + if (entry->selector->list->next == NULL) { + return lxb_selectors_exit(selectors); + } selectors->state = lxb_selectors_state_find; - return lxb_selectors_state_find_check(selectors, NULL, - parent->selector, parent); + /* + * Try the following selectors from the selector list. + */ + + return lxb_selectors_make_following(selectors, entry); } +static lxb_selectors_entry_t * +lxb_selectors_next_list_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + if (entry->selector->list->next == NULL) { + return lxb_selectors_exit(selectors); + } + + selectors->state = lxb_selectors_state_find_forward; + + /* + * Try the following selectors from the selector list. + */ + + return lxb_selectors_make_following_forward(selectors, entry); +} static lxb_selectors_entry_t * -lxb_selectors_state_after_find(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry) +lxb_selectors_make_following(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - lxb_dom_node_t *node; - lxb_selectors_entry_t *parent; + lxb_selectors_entry_t *next; lxb_selectors_nested_t *current; + const lxb_css_selector_t *selector; + selector = entry->selector; current = selectors->current; - if (current->found) { - node = entry->node; - - selectors->current = current->parent; - parent = selectors->current->last; + if (entry->following != NULL) { + entry->following->node = current->root; + current->first = entry->following; + current->entry = entry->following; - selectors->state = lxb_selectors_state_find; + return entry->following; + } - return lxb_selectors_state_find_check(selectors, node, - parent->selector, parent); + next = lxb_selectors_entry_make_first(selectors, + selector->list->next->last); + if (next == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; } - node = entry->node; + next->node = current->root; - switch (current->parent->last->combinator) { - case LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT: - if (node->parent != NULL - && node->parent->type == LXB_DOM_NODE_TYPE_ELEMENT) - { - node = node->parent; - } - else { - node = NULL; - } + entry->following = next; + current->first = next; + current->entry = next; - break; + return next; +} - case LXB_CSS_SELECTOR_COMBINATOR_FOLLOWING: - node = node->prev; +static lxb_selectors_entry_t * +lxb_selectors_make_following_forward(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + lxb_selectors_entry_t *next; + lxb_selectors_nested_t *current; + const lxb_css_selector_t *selector; - while (node != NULL && node->type != LXB_DOM_NODE_TYPE_ELEMENT) { - node = node->prev; - } + selector = entry->selector; + current = selectors->current; - break; + if (entry->following != NULL) { + entry->following->node = current->root; + current->first = entry->following; + current->entry = entry->following; - case LXB_CSS_SELECTOR_COMBINATOR_CHILD: - case LXB_CSS_SELECTOR_COMBINATOR_SIBLING: - case LXB_CSS_SELECTOR_COMBINATOR_CLOSE: - node = NULL; - break; + return entry->following; + } - case LXB_CSS_SELECTOR_COMBINATOR_CELL: - default: - selectors->status = LXB_STATUS_ERROR; - return NULL; + next = lexbor_dobject_calloc(selectors->objs); + if (next == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; } - if (node == NULL) { - selectors->current = current->parent; - parent = selectors->current->last; + next->selector = selector->list->next->first; + next->node = current->root; + next->combinator = next->selector->combinator; - selectors->state = lxb_selectors_state_find; + entry->following = next; + current->first = next; + current->entry = next; - return lxb_selectors_state_find_check(selectors, node, - parent->selector, parent); - } + return next; +} - entry->node = node; - selectors->state = lxb_selectors_state_find; +static lxb_selectors_entry_t * +lxb_selectors_state_after_find(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + selectors->current = selectors->current->parent; - return entry; + lxb_selectors_switch_to_not_found(selectors, selectors->current); + + return selectors->current->entry; } static lxb_selectors_entry_t * -lxb_selectors_state_after_nth_child(lxb_selectors_t *selectors, - lxb_selectors_entry_t *entry) +lxb_selectors_state_after_not(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) { - bool found; - lxb_dom_node_t *node; - lxb_selectors_entry_t *parent; - lxb_selectors_nested_t *current; - const lxb_css_selector_t *selector; - const lxb_css_selector_pseudo_t *pseudo; - - current = selectors->current; - selector = current->parent->last->selector; - pseudo = &selector->u.pseudo; + selectors->current = selectors->current->parent; - node = entry->node; + lxb_selectors_switch_to_found_check(selectors, selectors->current); - if (current->found) { - current->index += 1; - } - else if (current->root == node) { - node = NULL; - goto done; - } + return selectors->current->entry; +} +lxb_inline lxb_dom_node_t * +lxb_selectors_state_nth_child_node(const lxb_css_selector_pseudo_t *pseudo, + lxb_dom_node_t *node) +{ if (pseudo->type == LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD) { node = node->prev; @@ -1071,48 +1205,100 @@ lxb_selectors_state_after_nth_child(lxb_selectors_t *selectors, } } + return node; +} + +lxb_inline lxb_selectors_entry_t * +lxb_selectors_state_nth_child_done(lxb_selectors_t *selectors, + const lxb_css_selector_pseudo_t *pseudo, + size_t index) +{ + if (lxb_selectors_anb_calc(pseudo->data, index)) { + lxb_selectors_switch_to_found_check(selectors, selectors->current); + } + else { + lxb_selectors_switch_to_not_found(selectors, selectors->current); + } + + return selectors->current->entry; +} + +static lxb_selectors_entry_t * +lxb_selectors_state_after_nth_child(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + lxb_dom_node_t *node; + lxb_selectors_nested_t *current; + const lxb_css_selector_pseudo_t *pseudo; + + current = selectors->current; + + if (current->index == 0) { + selectors->current = selectors->current->parent; + lxb_selectors_switch_to_not_found(selectors, selectors->current); + + return selectors->current->entry; + } + + pseudo = ¤t->parent->entry->selector->u.pseudo; + node = lxb_selectors_state_nth_child_node(pseudo, current->root); + if (node == NULL) { - goto done; + selectors->current = selectors->current->parent; + + return lxb_selectors_state_nth_child_done(selectors, pseudo, + current->index); } - entry->node = node; - current->found = false; + current->root = node; + current->entry->node = node; + selectors->state = lxb_selectors_state_find; return entry; +} -done: +static lxb_selectors_entry_t * +lxb_selectors_state_nth_child_found(lxb_selectors_t *selectors, + lxb_selectors_entry_t *entry) +{ + lxb_dom_node_t *node; + lxb_selectors_nested_t *current; + const lxb_css_selector_pseudo_t *pseudo; - if (current->index > 0) { - found = lxb_selectors_anb_calc(pseudo->data, current->index); + current = entry->nested; + pseudo = &entry->selector->u.pseudo; + node = lxb_selectors_state_nth_child_node(pseudo, current->root); - node = (found) ? current->root : NULL; + if (node == NULL) { + return lxb_selectors_state_nth_child_done(selectors, pseudo, + current->index); } - selectors->state = lxb_selectors_state_find; - selectors->current = selectors->current->parent; + current->root = node; + current->entry->node = node; - parent = selectors->current->last; + selectors->current = current; + selectors->state = lxb_selectors_state_find; - return lxb_selectors_state_find_check(selectors, node, - parent->selector, parent); + return current->entry; } static bool lxb_selectors_match(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, - const lxb_css_selector_t *selector, lxb_dom_node_t *node) + lxb_dom_node_t *node) { lxb_dom_element_t *element; - switch (selector->type) { + switch (entry->selector->type) { case LXB_CSS_SELECTOR_TYPE_ANY: return true; case LXB_CSS_SELECTOR_TYPE_ELEMENT: - return lxb_selectors_match_element(selector, node, entry); + return lxb_selectors_match_element(entry->selector, node, entry); case LXB_CSS_SELECTOR_TYPE_ID: - return lxb_selectors_match_id(selector, node); + return lxb_selectors_match_id(entry->selector, node); case LXB_CSS_SELECTOR_TYPE_CLASS: element = lxb_dom_interface_element(node); @@ -1124,19 +1310,19 @@ lxb_selectors_match(lxb_selectors_t *selectors, lxb_selectors_entry_t *entry, } return lxb_selectors_match_class(element->attr_class->value, - &selector->name, true); + &entry->selector->name, true); case LXB_CSS_SELECTOR_TYPE_ATTRIBUTE: - return lxb_selectors_match_attribute(selector, node, entry); + return lxb_selectors_match_attribute(entry->selector, node, entry); case LXB_CSS_SELECTOR_TYPE_PSEUDO_CLASS: - return lxb_selectors_pseudo_class(selector, node); + return lxb_selectors_pseudo_class(entry->selector, node); case LXB_CSS_SELECTOR_TYPE_PSEUDO_CLASS_FUNCTION: - return lxb_selectors_pseudo_class_function(selector, node); - + return lxb_selectors_pseudo_class_function(selectors, + entry->selector, node); case LXB_CSS_SELECTOR_TYPE_PSEUDO_ELEMENT: - return lxb_selectors_pseudo_element(selector, node); + return lxb_selectors_pseudo_element(entry->selector, node); case LXB_CSS_SELECTOR_TYPE_PSEUDO_ELEMENT_FUNCTION: return false; @@ -1641,19 +1827,141 @@ lxb_selectors_pseudo_class(const lxb_css_selector_t *selector, return false; } +static lxb_selectors_nested_t * +lxb_selectors_nested_make(lxb_selectors_t *selectors, lxb_dom_node_t *node, + lxb_css_selector_t *selector, bool forward) +{ + lxb_selectors_entry_t *next; + lxb_selectors_entry_t *entry; + + entry = selectors->current->entry; + entry->node = node; + + if (entry->nested == NULL) { + if (!forward) { + next = lxb_selectors_entry_make_first(selectors, selector); + if (next == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; + } + } + else { + next = lexbor_dobject_calloc(selectors->objs); + if (next == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; + } + + next->combinator = selector->combinator; + next->selector = selector; + } + + entry->nested = lexbor_dobject_calloc(selectors->nested); + if (entry->nested == NULL) { + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + return NULL; + } + + entry->nested->top = next; + entry->nested->parent = selectors->current; + entry->nested->forward = forward; + } + + selectors->current = entry->nested; + entry->nested->entry = entry->nested->top; + entry->nested->first = entry->nested->top; + + selectors->current->root = node; + selectors->current->ctx = selectors; + + return selectors->current; +} + static bool -lxb_selectors_pseudo_class_function(const lxb_css_selector_t *selector, +lxb_selectors_pseudo_class_function(lxb_selectors_t *selectors, + const lxb_css_selector_t *selector, lxb_dom_node_t *node) { + bool is; size_t index; lxb_dom_node_t *base; + lxb_selectors_nested_t *current; + const lexbor_str_t *str; + const lxb_dom_text_t *text; + const lxb_css_selector_list_t *list; + const lxb_css_selector_anb_of_t *anb; const lxb_css_selector_pseudo_t *pseudo; + const lxb_css_selector_contains_t *contains; pseudo = &selector->u.pseudo; switch (pseudo->type) { + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS: + list = (lxb_css_selector_list_t *) pseudo->data; + + current = lxb_selectors_nested_make(selectors, node, + list->first, true); + if (current == NULL) { + goto failed; + } + + current->cb = lxb_selectors_cb_ok; + current->return_state = lxb_selectors_state_after_find; + selectors->state = lxb_selectors_state_find_forward; + + break; + + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT: + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS: + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE: + list = (lxb_css_selector_list_t *) pseudo->data; + + current = lxb_selectors_nested_make(selectors, node, list->last, + false); + if (current == NULL) { + goto failed; + } + + current->cb = lxb_selectors_cb_ok; + current->return_state = lxb_selectors_state_after_find; + selectors->state = lxb_selectors_state_find; + + break; + + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT: + list = (lxb_css_selector_list_t *) pseudo->data; + + current = lxb_selectors_nested_make(selectors, node, list->last, + false); + if (current == NULL) { + goto failed; + } + + current->cb = lxb_selectors_cb_not; + current->return_state = lxb_selectors_state_after_not; + selectors->state = lxb_selectors_state_find; + + break; + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD: case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD: + anb = pseudo->data; + + if (anb->of != NULL) { + current = lxb_selectors_nested_make(selectors, node, + anb->of->last, false); + if (current == NULL) { + goto failed; + } + + current->return_state = lxb_selectors_state_after_nth_child; + current->cb = lxb_selectors_cb_nth_ok; + current->index = 0; + selectors->state = lxb_selectors_state_find; + + return true; + } + index = 0; if (pseudo->type == LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD) { @@ -1711,15 +2019,52 @@ lxb_selectors_pseudo_class_function(const lxb_css_selector_t *selector, return lxb_selectors_anb_calc(pseudo->data, index); + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LEXBOR_CONTAINS: + contains = pseudo->data; + + node = node->first_child; + while (node != NULL) { + if (node->type == LXB_DOM_NODE_TYPE_TEXT) { + text = lxb_dom_interface_text(node); + str = &text->char_data.data; + + if (contains->insensitive) { + is = lexbor_str_data_ncasecmp_contain(str->data, str->length, + contains->str.data, + contains->str.length); + } + else { + is = lexbor_str_data_ncmp_contain(str->data, str->length, + contains->str.data, + contains->str.length); + } + + if (is) { + return true; + } + } + + node = node->next; + } + + return false; + case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR: case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG: case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL: case LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL: default: - break; + return false; } - return false; + return true; + +failed: + + selectors->state = lxb_selectors_state_failed; + selectors->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION; + + return true; } static bool @@ -1900,7 +2245,10 @@ static lxb_status_t lxb_selectors_cb_ok(lxb_dom_node_t *node, lxb_css_selector_specificity_t spec, void *ctx) { - *((bool *) ctx) = true; + lxb_selectors_t *selectors = ctx; + + lxb_selectors_switch_to_found_check(selectors, selectors->current->parent); + return LXB_STATUS_OK; } @@ -1908,7 +2256,22 @@ static lxb_status_t lxb_selectors_cb_not(lxb_dom_node_t *node, lxb_css_selector_specificity_t spec, void *ctx) { - *((bool *) ctx) = false; + lxb_selectors_t *selectors = ctx; + + lxb_selectors_switch_to_not_found(selectors, selectors->current->parent); + + return LXB_STATUS_OK; +} + +static lxb_status_t +lxb_selectors_cb_nth_ok(lxb_dom_node_t *node, + lxb_css_selector_specificity_t spec, void *ctx) +{ + lxb_selectors_t *selectors = ctx; + + selectors->current->index += 1; + selectors->state = lxb_selectors_state_nth_child_found; + return LXB_STATUS_OK; } diff --git a/ext/dom/lexbor/lexbor/selectors/selectors.h b/ext/dom/lexbor/lexbor/selectors/selectors.h index a9db864ff17f..b6fe28a4eacb 100644 --- a/ext/dom/lexbor/lexbor/selectors/selectors.h +++ b/ext/dom/lexbor/lexbor/selectors/selectors.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Alexander Borisov + * Copyright (C) 2021-2025 Alexander Borisov * * Author: Alexander Borisov */ @@ -89,11 +89,13 @@ struct lxb_selectors_nested { void *ctx; lxb_dom_node_t *root; - lxb_selectors_entry_t *last; lxb_selectors_nested_t *parent; + lxb_selectors_entry_t *first; + lxb_selectors_entry_t *top; size_t index; - bool found; + + bool forward; }; struct lxb_selectors { @@ -102,7 +104,6 @@ struct lxb_selectors { lexbor_dobject_t *nested; lxb_selectors_nested_t *current; - lxb_selectors_entry_t *first; lxb_selectors_opt_t options; lxb_status_t status; @@ -220,7 +221,7 @@ lxb_selectors_match_node(lxb_selectors_t *selectors, lxb_dom_node_t *node, */ LXB_API LXB_DEPRECATED(lxb_status_t lxb_selectors_find_reverse(lxb_selectors_t *selectors, lxb_dom_node_t *root, - lxb_css_selector_list_t *list, + const lxb_css_selector_list_t *list, lxb_selectors_cb_f cb, void *ctx)); /* diff --git a/ext/dom/lexbor/lexbor/tag/base.h b/ext/dom/lexbor/lexbor/tag/base.h index 94886ee4f47c..27ba326cf40f 100644 --- a/ext/dom/lexbor/lexbor/tag/base.h +++ b/ext/dom/lexbor/lexbor/tag/base.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Alexander Borisov + * Copyright (C) 2019-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -16,7 +16,7 @@ extern "C" { #define LXB_TAG_VERSION_MAJOR 1 -#define LXB_TAG_VERSION_MINOR 3 +#define LXB_TAG_VERSION_MINOR 5 #define LXB_TAG_VERSION_PATCH 0 #define LXB_TAG_VERSION_STRING \ diff --git a/ext/dom/lexbor/lexbor/tag/const.h b/ext/dom/lexbor/lexbor/tag/const.h index 1a598d347472..b08e387da326 100644 --- a/ext/dom/lexbor/lexbor/tag/const.h +++ b/ext/dom/lexbor/lexbor/tag/const.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -14,8 +14,8 @@ #ifndef LXB_TAG_CONST_H #define LXB_TAG_CONST_H -#define LXB_TAG_CONST_VERSION "A161EC911182C3254E7A972D5C51DF86" -#define LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 +#define LXB_TAG_CONST_VERSION "5AB3094FB370521074947DC082575715" +#define LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 typedef uintptr_t lxb_tag_id_t; @@ -183,41 +183,43 @@ typedef enum { LXB_TAG_S = 0x009f, LXB_TAG_SAMP = 0x00a0, LXB_TAG_SCRIPT = 0x00a1, - LXB_TAG_SECTION = 0x00a2, - LXB_TAG_SELECT = 0x00a3, - LXB_TAG_SLOT = 0x00a4, - LXB_TAG_SMALL = 0x00a5, - LXB_TAG_SOURCE = 0x00a6, - LXB_TAG_SPACER = 0x00a7, - LXB_TAG_SPAN = 0x00a8, - LXB_TAG_STRIKE = 0x00a9, - LXB_TAG_STRONG = 0x00aa, - LXB_TAG_STYLE = 0x00ab, - LXB_TAG_SUB = 0x00ac, - LXB_TAG_SUMMARY = 0x00ad, - LXB_TAG_SUP = 0x00ae, - LXB_TAG_SVG = 0x00af, - LXB_TAG_TABLE = 0x00b0, - LXB_TAG_TBODY = 0x00b1, - LXB_TAG_TD = 0x00b2, - LXB_TAG_TEMPLATE = 0x00b3, - LXB_TAG_TEXTAREA = 0x00b4, - LXB_TAG_TEXTPATH = 0x00b5, - LXB_TAG_TFOOT = 0x00b6, - LXB_TAG_TH = 0x00b7, - LXB_TAG_THEAD = 0x00b8, - LXB_TAG_TIME = 0x00b9, - LXB_TAG_TITLE = 0x00ba, - LXB_TAG_TR = 0x00bb, - LXB_TAG_TRACK = 0x00bc, - LXB_TAG_TT = 0x00bd, - LXB_TAG_U = 0x00be, - LXB_TAG_UL = 0x00bf, - LXB_TAG_VAR = 0x00c0, - LXB_TAG_VIDEO = 0x00c1, - LXB_TAG_WBR = 0x00c2, - LXB_TAG_XMP = 0x00c3, - LXB_TAG__LAST_ENTRY = 0x00c4 + LXB_TAG_SEARCH = 0x00a2, + LXB_TAG_SECTION = 0x00a3, + LXB_TAG_SELECT = 0x00a4, + LXB_TAG_SELECTEDCONTENT = 0x00a5, + LXB_TAG_SLOT = 0x00a6, + LXB_TAG_SMALL = 0x00a7, + LXB_TAG_SOURCE = 0x00a8, + LXB_TAG_SPACER = 0x00a9, + LXB_TAG_SPAN = 0x00aa, + LXB_TAG_STRIKE = 0x00ab, + LXB_TAG_STRONG = 0x00ac, + LXB_TAG_STYLE = 0x00ad, + LXB_TAG_SUB = 0x00ae, + LXB_TAG_SUMMARY = 0x00af, + LXB_TAG_SUP = 0x00b0, + LXB_TAG_SVG = 0x00b1, + LXB_TAG_TABLE = 0x00b2, + LXB_TAG_TBODY = 0x00b3, + LXB_TAG_TD = 0x00b4, + LXB_TAG_TEMPLATE = 0x00b5, + LXB_TAG_TEXTAREA = 0x00b6, + LXB_TAG_TEXTPATH = 0x00b7, + LXB_TAG_TFOOT = 0x00b8, + LXB_TAG_TH = 0x00b9, + LXB_TAG_THEAD = 0x00ba, + LXB_TAG_TIME = 0x00bb, + LXB_TAG_TITLE = 0x00bc, + LXB_TAG_TR = 0x00bd, + LXB_TAG_TRACK = 0x00be, + LXB_TAG_TT = 0x00bf, + LXB_TAG_U = 0x00c0, + LXB_TAG_UL = 0x00c1, + LXB_TAG_VAR = 0x00c2, + LXB_TAG_VIDEO = 0x00c3, + LXB_TAG_WBR = 0x00c4, + LXB_TAG_XMP = 0x00c5, + LXB_TAG__LAST_ENTRY = 0x00c6 } lxb_tag_id_enum_t; diff --git a/ext/dom/lexbor/lexbor/tag/res.h b/ext/dom/lexbor/lexbor/tag/res.h index 4ad1f37e034e..5672d4a5a5f2 100644 --- a/ext/dom/lexbor/lexbor/tag/res.h +++ b/ext/dom/lexbor/lexbor/tag/res.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Alexander Borisov + * Copyright (C) 2018-2026 Alexander Borisov * * Author: Alexander Borisov */ @@ -17,9 +17,9 @@ #endif /* LXB_TAG_RES_H */ #ifdef LXB_TAG_CONST_VERSION -#ifndef LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 +#ifndef LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 #error Mismatched tags version! See "lexbor/tag/const.h". -#endif /* LXB_TAG_CONST_VERSION_A161EC911182C3254E7A972D5C51DF86 */ +#endif /* LXB_TAG_CONST_VERSION_5AB3094FB370521074947DC082575715 */ #else #error You need to include "lexbor/tag/const.h". #endif /* LXB_TAG_CONST_VERSION */ @@ -188,8 +188,10 @@ static const lxb_tag_data_t lxb_tag_res_data_default[LXB_TAG__LAST_ENTRY] = {{.u.short_str = "s", .length = 1, .next = NULL}, LXB_TAG_S, 1, true}, {{.u.short_str = "samp", .length = 4, .next = NULL}, LXB_TAG_SAMP, 1, true}, {{.u.short_str = "script", .length = 6, .next = NULL}, LXB_TAG_SCRIPT, 1, true}, + {{.u.short_str = "search", .length = 6, .next = NULL}, LXB_TAG_SEARCH, 1, true}, {{.u.short_str = "section", .length = 7, .next = NULL}, LXB_TAG_SECTION, 1, true}, {{.u.short_str = "select", .length = 6, .next = NULL}, LXB_TAG_SELECT, 1, true}, + {{.u.short_str = "selectedcontent", .length = 15, .next = NULL}, LXB_TAG_SELECTEDCONTENT, 1, true}, {{.u.short_str = "slot", .length = 4, .next = NULL}, LXB_TAG_SLOT, 1, true}, {{.u.short_str = "small", .length = 5, .next = NULL}, LXB_TAG_SMALL, 1, true}, {{.u.short_str = "source", .length = 6, .next = NULL}, LXB_TAG_SOURCE, 1, true}, @@ -389,8 +391,10 @@ static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] {{.u.short_str = "S", .length = 1, .next = NULL}, LXB_TAG_S, 1, true}, {{.u.short_str = "SAMP", .length = 4, .next = NULL}, LXB_TAG_SAMP, 1, true}, {{.u.short_str = "SCRIPT", .length = 6, .next = NULL}, LXB_TAG_SCRIPT, 1, true}, + {{.u.short_str = "SEARCH", .length = 6, .next = NULL}, LXB_TAG_SEARCH, 1, true}, {{.u.short_str = "SECTION", .length = 7, .next = NULL}, LXB_TAG_SECTION, 1, true}, {{.u.short_str = "SELECT", .length = 6, .next = NULL}, LXB_TAG_SELECT, 1, true}, + {{.u.short_str = "SELECTEDCONTENT", .length = 15, .next = NULL}, LXB_TAG_SELECTEDCONTENT, 1, true}, {{.u.short_str = "SLOT", .length = 4, .next = NULL}, LXB_TAG_SLOT, 1, true}, {{.u.short_str = "SMALL", .length = 5, .next = NULL}, LXB_TAG_SMALL, 1, true}, {{.u.short_str = "SOURCE", .length = 6, .next = NULL}, LXB_TAG_SOURCE, 1, true}, @@ -426,81 +430,81 @@ static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] }; #endif -static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[] = +static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[263] = { {NULL, NULL, 262, 0}, {"radialgradient", (void *) &lxb_tag_res_data_default[153], 14, 0}, {"fecomponenttransfer", (void *) &lxb_tag_res_data_default[58], 19, 0}, {"abbr", (void *) &lxb_tag_res_data_default[7], 4, 1}, {"feflood", (void *) &lxb_tag_res_data_default[65], 7, 0}, {"marquee", (void *) &lxb_tag_res_data_default[121], 7, 0}, {"feblend", (void *) &lxb_tag_res_data_default[56], 7, 4}, {"optgroup", (void *) &lxb_tag_res_data_default[142], 8, 0}, - {"video", (void *) &lxb_tag_res_data_default[193], 5, 10}, {"u", (void *) &lxb_tag_res_data_default[190], 1, 0}, + {"video", (void *) &lxb_tag_res_data_default[195], 5, 10}, {"u", (void *) &lxb_tag_res_data_default[192], 1, 0}, {"iframe", (void *) &lxb_tag_res_data_default[103], 6, 0}, {"animatecolor", (void *) &lxb_tag_res_data_default[13], 12, 0}, {"output", (void *) &lxb_tag_res_data_default[144], 6, 0}, {"figcaption", (void *) &lxb_tag_res_data_default[82], 10, 0}, {"mglyph", (void *) &lxb_tag_res_data_default[127], 6, 0}, {"!--", (void *) &lxb_tag_res_data_default[4], 3, 0}, {"fefuncg", (void *) &lxb_tag_res_data_default[68], 7, 0}, {"aside", (void *) &lxb_tag_res_data_default[20], 5, 0}, - {"style", (void *) &lxb_tag_res_data_default[171], 5, 0}, {"strike", (void *) &lxb_tag_res_data_default[169], 6, 0}, + {"style", (void *) &lxb_tag_res_data_default[173], 5, 0}, {"strike", (void *) &lxb_tag_res_data_default[171], 6, 0}, {"header", (void *) &lxb_tag_res_data_default[98], 6, 0}, {"glyphref", (void *) &lxb_tag_res_data_default[90], 8, 23}, {"label", (void *) &lxb_tag_res_data_default[111], 5, 0}, {"feconvolvematrix", (void *) &lxb_tag_res_data_default[60], 16, 0}, - {"altglyphdef", (void *) &lxb_tag_res_data_default[11], 11, 0}, {"title", (void *) &lxb_tag_res_data_default[186], 5, 0}, + {"altglyphdef", (void *) &lxb_tag_res_data_default[11], 11, 0}, {"title", (void *) &lxb_tag_res_data_default[188], 5, 0}, {"head", (void *) &lxb_tag_res_data_default[97], 4, 0}, {"noframes", (void *) &lxb_tag_res_data_default[138], 8, 0}, {"code", (void *) &lxb_tag_res_data_default[39], 4, 30}, {"rb", (void *) &lxb_tag_res_data_default[154], 2, 5}, {"blink", (void *) &lxb_tag_res_data_default[29], 5, 0}, {"image", (void *) &lxb_tag_res_data_default[104], 5, 0}, {"col", (void *) &lxb_tag_res_data_default[40], 3, 8}, {"object", (void *) &lxb_tag_res_data_default[140], 6, 12}, - {"template", (void *) &lxb_tag_res_data_default[179], 8, 36}, {"h2", (void *) &lxb_tag_res_data_default[92], 2, 13}, + {"template", (void *) &lxb_tag_res_data_default[181], 8, 36}, {"h2", (void *) &lxb_tag_res_data_default[92], 2, 13}, {"lineargradient", (void *) &lxb_tag_res_data_default[114], 14, 0}, {"math", (void *) &lxb_tag_res_data_default[122], 4, 0}, {"base", (void *) &lxb_tag_res_data_default[23], 4, 45}, {"dl", (void *) &lxb_tag_res_data_default[52], 2, 14}, - {"del", (void *) &lxb_tag_res_data_default[45], 3, 16}, {"svg", (void *) &lxb_tag_res_data_default[175], 3, 17}, + {"del", (void *) &lxb_tag_res_data_default[45], 3, 16}, {"svg", (void *) &lxb_tag_res_data_default[177], 3, 17}, {"dir", (void *) &lxb_tag_res_data_default[50], 3, 0}, {"article", (void *) &lxb_tag_res_data_default[19], 7, 0}, - {"strong", (void *) &lxb_tag_res_data_default[170], 6, 0}, {"dialog", (void *) &lxb_tag_res_data_default[49], 6, 0}, - {"details", (void *) &lxb_tag_res_data_default[47], 7, 0}, {"textpath", (void *) &lxb_tag_res_data_default[181], 8, 52}, + {"strong", (void *) &lxb_tag_res_data_default[172], 6, 0}, {"dialog", (void *) &lxb_tag_res_data_default[49], 6, 0}, + {"details", (void *) &lxb_tag_res_data_default[47], 7, 0}, {"textpath", (void *) &lxb_tag_res_data_default[183], 8, 52}, {"mark", (void *) &lxb_tag_res_data_default[120], 4, 0}, {"basefont", (void *) &lxb_tag_res_data_default[24], 8, 0}, {"fediffuselighting", (void *) &lxb_tag_res_data_default[61], 17, 0}, {"fespecularlighting", (void *) &lxb_tag_res_data_default[77], 18, 0}, {"blockquote", (void *) &lxb_tag_res_data_default[30], 10, 0}, {"script", (void *) &lxb_tag_res_data_default[161], 6, 58}, {"malignmark", (void *) &lxb_tag_res_data_default[118], 10, 0}, {"hr", (void *) &lxb_tag_res_data_default[100], 2, 18}, - {"source", (void *) &lxb_tag_res_data_default[166], 6, 19}, {"mn", (void *) &lxb_tag_res_data_default[129], 2, 0}, - {"select", (void *) &lxb_tag_res_data_default[163], 6, 0}, {"main", (void *) &lxb_tag_res_data_default[117], 4, 20}, + {"source", (void *) &lxb_tag_res_data_default[168], 6, 19}, {"mn", (void *) &lxb_tag_res_data_default[129], 2, 0}, + {"select", (void *) &lxb_tag_res_data_default[164], 6, 0}, {"main", (void *) &lxb_tag_res_data_default[117], 4, 20}, {"fieldset", (void *) &lxb_tag_res_data_default[81], 8, 62}, {"ins", (void *) &lxb_tag_res_data_default[107], 3, 0}, {"frameset", (void *) &lxb_tag_res_data_default[89], 8, 0}, {"button", (void *) &lxb_tag_res_data_default[33], 6, 0}, {"fecolormatrix", (void *) &lxb_tag_res_data_default[57], 13, 0}, {"q", (void *) &lxb_tag_res_data_default[152], 1, 0}, - {"animatemotion", (void *) &lxb_tag_res_data_default[14], 13, 0}, {"time", (void *) &lxb_tag_res_data_default[185], 4, 21}, - {"table", (void *) &lxb_tag_res_data_default[176], 5, 25}, {"h6", (void *) &lxb_tag_res_data_default[96], 2, 26}, + {"animatemotion", (void *) &lxb_tag_res_data_default[14], 13, 0}, {"time", (void *) &lxb_tag_res_data_default[187], 4, 21}, + {"table", (void *) &lxb_tag_res_data_default[178], 5, 25}, {"h6", (void *) &lxb_tag_res_data_default[96], 2, 26}, {"cite", (void *) &lxb_tag_res_data_default[37], 4, 28}, {"img", (void *) &lxb_tag_res_data_default[105], 3, 34}, {"fepointlight", (void *) &lxb_tag_res_data_default[76], 12, 0}, {"audio", (void *) &lxb_tag_res_data_default[21], 5, 0}, {"#end-of-file", (void *) &lxb_tag_res_data_default[1], 12, 0}, {"noscript", (void *) &lxb_tag_res_data_default[139], 8, 0}, - {"foreignobject", (void *) &lxb_tag_res_data_default[86], 13, 0}, {"spacer", (void *) &lxb_tag_res_data_default[167], 6, 0}, - {"samp", (void *) &lxb_tag_res_data_default[160], 4, 0}, {"altglyphitem", (void *) &lxb_tag_res_data_default[12], 12, 0}, - {"dt", (void *) &lxb_tag_res_data_default[53], 2, 0}, {"data", (void *) &lxb_tag_res_data_default[42], 4, 0}, + {"foreignobject", (void *) &lxb_tag_res_data_default[86], 13, 77}, {"selectedcontent", (void *) &lxb_tag_res_data_default[165], 15, 0}, + {"spacer", (void *) &lxb_tag_res_data_default[169], 6, 0}, {"samp", (void *) &lxb_tag_res_data_default[160], 4, 0}, + {"altglyphitem", (void *) &lxb_tag_res_data_default[12], 12, 0}, {"data", (void *) &lxb_tag_res_data_default[42], 4, 0}, {"mtext", (void *) &lxb_tag_res_data_default[132], 5, 0}, {"path", (void *) &lxb_tag_res_data_default[147], 4, 0}, - {"input", (void *) &lxb_tag_res_data_default[106], 5, 0}, {"th", (void *) &lxb_tag_res_data_default[183], 2, 38}, - {"p", (void *) &lxb_tag_res_data_default[145], 1, 0}, {"animatetransform", (void *) &lxb_tag_res_data_default[15], 16, 0}, - {"datalist", (void *) &lxb_tag_res_data_default[43], 8, 0}, {"small", (void *) &lxb_tag_res_data_default[165], 5, 0}, + {"input", (void *) &lxb_tag_res_data_default[106], 5, 0}, {"th", (void *) &lxb_tag_res_data_default[185], 2, 38}, + {"p", (void *) &lxb_tag_res_data_default[145], 1, 0}, {"dt", (void *) &lxb_tag_res_data_default[53], 2, 0}, + {"animatetransform", (void *) &lxb_tag_res_data_default[15], 16, 0}, {"datalist", (void *) &lxb_tag_res_data_default[43], 8, 0}, {"b", (void *) &lxb_tag_res_data_default[22], 1, 46}, {"nextid", (void *) &lxb_tag_res_data_default[135], 6, 47}, - {"noembed", (void *) &lxb_tag_res_data_default[137], 7, 0}, {"nav", (void *) &lxb_tag_res_data_default[134], 3, 0}, - {"bgsound", (void *) &lxb_tag_res_data_default[27], 7, 0}, {"slot", (void *) &lxb_tag_res_data_default[164], 4, 0}, - {"param", (void *) &lxb_tag_res_data_default[146], 5, 0}, {"font", (void *) &lxb_tag_res_data_default[84], 4, 53}, - {"figure", (void *) &lxb_tag_res_data_default[83], 6, 0}, {"femerge", (void *) &lxb_tag_res_data_default[72], 7, 0}, - {"femergenode", (void *) &lxb_tag_res_data_default[73], 11, 0}, {"feoffset", (void *) &lxb_tag_res_data_default[75], 8, 60}, - {"#text", (void *) &lxb_tag_res_data_default[2], 5, 0}, {"ul", (void *) &lxb_tag_res_data_default[191], 2, 0}, + {"noembed", (void *) &lxb_tag_res_data_default[137], 7, 0}, {"small", (void *) &lxb_tag_res_data_default[167], 5, 0}, + {"nav", (void *) &lxb_tag_res_data_default[134], 3, 0}, {"slot", (void *) &lxb_tag_res_data_default[166], 4, 0}, + {"search", (void *) &lxb_tag_res_data_default[162], 6, 0}, {"font", (void *) &lxb_tag_res_data_default[84], 4, 53}, + {"bgsound", (void *) &lxb_tag_res_data_default[27], 7, 0}, {"param", (void *) &lxb_tag_res_data_default[146], 5, 0}, + {"figure", (void *) &lxb_tag_res_data_default[83], 6, 0}, {"feoffset", (void *) &lxb_tag_res_data_default[75], 8, 60}, + {"#text", (void *) &lxb_tag_res_data_default[2], 5, 0}, {"femerge", (void *) &lxb_tag_res_data_default[72], 7, 0}, {"fespotlight", (void *) &lxb_tag_res_data_default[78], 11, 66}, {"form", (void *) &lxb_tag_res_data_default[87], 4, 72}, {"#document", (void *) &lxb_tag_res_data_default[3], 9, 76}, {"fedistantlight", (void *) &lxb_tag_res_data_default[63], 14, 0}, - {"track", (void *) &lxb_tag_res_data_default[188], 5, 0}, {"h3", (void *) &lxb_tag_res_data_default[93], 2, 77}, - {"h1", (void *) &lxb_tag_res_data_default[91], 2, 0}, {"i", (void *) &lxb_tag_res_data_default[102], 1, 0}, - {"altglyph", (void *) &lxb_tag_res_data_default[10], 8, 0}, {"legend", (void *) &lxb_tag_res_data_default[112], 6, 115}, - {"tbody", (void *) &lxb_tag_res_data_default[177], 5, 0}, {"address", (void *) &lxb_tag_res_data_default[9], 7, 0}, - {"caption", (void *) &lxb_tag_res_data_default[35], 7, 0}, {"option", (void *) &lxb_tag_res_data_default[143], 6, 0}, - {"sup", (void *) &lxb_tag_res_data_default[174], 3, 0}, {"body", (void *) &lxb_tag_res_data_default[31], 4, 78}, - {"progress", (void *) &lxb_tag_res_data_default[151], 8, 122}, {"acronym", (void *) &lxb_tag_res_data_default[8], 7, 0}, + {"track", (void *) &lxb_tag_res_data_default[190], 5, 0}, {"h3", (void *) &lxb_tag_res_data_default[93], 2, 78}, + {"femergenode", (void *) &lxb_tag_res_data_default[73], 11, 0}, {"i", (void *) &lxb_tag_res_data_default[102], 1, 0}, + {"ul", (void *) &lxb_tag_res_data_default[193], 2, 0}, {"h1", (void *) &lxb_tag_res_data_default[91], 2, 0}, + {"tbody", (void *) &lxb_tag_res_data_default[179], 5, 0}, {"altglyph", (void *) &lxb_tag_res_data_default[10], 8, 0}, + {"legend", (void *) &lxb_tag_res_data_default[112], 6, 117}, {"address", (void *) &lxb_tag_res_data_default[9], 7, 0}, + {"sup", (void *) &lxb_tag_res_data_default[176], 3, 0}, {"body", (void *) &lxb_tag_res_data_default[31], 4, 79}, + {"caption", (void *) &lxb_tag_res_data_default[35], 7, 0}, {"acronym", (void *) &lxb_tag_res_data_default[8], 7, 0}, + {"option", (void *) &lxb_tag_res_data_default[143], 6, 0}, {"progress", (void *) &lxb_tag_res_data_default[151], 8, 124}, {"fegaussianblur", (void *) &lxb_tag_res_data_default[70], 14, 0}, {NULL, NULL, 0, 0}, - {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"mi", (void *) &lxb_tag_res_data_default[128], 2, 79}, {NULL, NULL, 0, 0}, - {"dfn", (void *) &lxb_tag_res_data_default[48], 3, 0}, {"a", (void *) &lxb_tag_res_data_default[6], 1, 80}, - {"listing", (void *) &lxb_tag_res_data_default[116], 7, 87}, {"span", (void *) &lxb_tag_res_data_default[168], 4, 0}, + {"mi", (void *) &lxb_tag_res_data_default[128], 2, 80}, {NULL, NULL, 0, 0}, + {"dfn", (void *) &lxb_tag_res_data_default[48], 3, 0}, {"a", (void *) &lxb_tag_res_data_default[6], 1, 87}, + {"listing", (void *) &lxb_tag_res_data_default[116], 7, 88}, {"span", (void *) &lxb_tag_res_data_default[170], 4, 0}, {"area", (void *) &lxb_tag_res_data_default[18], 4, 0}, {"clippath", (void *) &lxb_tag_res_data_default[38], 8, 0}, - {"section", (void *) &lxb_tag_res_data_default[162], 7, 0}, {"li", (void *) &lxb_tag_res_data_default[113], 2, 88}, + {"section", (void *) &lxb_tag_res_data_default[163], 7, 0}, {"li", (void *) &lxb_tag_res_data_default[113], 2, 89}, {NULL, NULL, 0, 0}, {"html", (void *) &lxb_tag_res_data_default[101], 4, 0}, {NULL, NULL, 0, 0}, {"fedropshadow", (void *) &lxb_tag_res_data_default[64], 12, 0}, {"embed", (void *) &lxb_tag_res_data_default[55], 5, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"multicol", (void *) &lxb_tag_res_data_default[133], 8, 0}, - {"var", (void *) &lxb_tag_res_data_default[192], 3, 89}, {"rp", (void *) &lxb_tag_res_data_default[155], 2, 0}, + {"var", (void *) &lxb_tag_res_data_default[194], 3, 93}, {"rp", (void *) &lxb_tag_res_data_default[155], 2, 0}, {NULL, NULL, 0, 0}, {"link", (void *) &lxb_tag_res_data_default[115], 4, 0}, {"mo", (void *) &lxb_tag_res_data_default[130], 2, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"annotation-xml", (void *) &lxb_tag_res_data_default[16], 14, 0}, @@ -510,54 +514,54 @@ static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[] = {"fefuncb", (void *) &lxb_tag_res_data_default[67], 7, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"meter", (void *) &lxb_tag_res_data_default[125], 5, 0}, {NULL, NULL, 0, 0}, - {NULL, NULL, 0, 0}, {"tt", (void *) &lxb_tag_res_data_default[189], 2, 0}, - {"big", (void *) &lxb_tag_res_data_default[28], 3, 93}, {NULL, NULL, 0, 0}, - {"tfoot", (void *) &lxb_tag_res_data_default[182], 5, 0}, {"desc", (void *) &lxb_tag_res_data_default[46], 4, 0}, + {NULL, NULL, 0, 0}, {"tt", (void *) &lxb_tag_res_data_default[191], 2, 0}, + {"big", (void *) &lxb_tag_res_data_default[28], 3, 94}, {NULL, NULL, 0, 0}, + {"tfoot", (void *) &lxb_tag_res_data_default[184], 5, 0}, {"desc", (void *) &lxb_tag_res_data_default[46], 4, 96}, {"isindex", (void *) &lxb_tag_res_data_default[108], 7, 0}, {NULL, NULL, 0, 0}, {"menu", (void *) &lxb_tag_res_data_default[123], 4, 0}, {"hgroup", (void *) &lxb_tag_res_data_default[99], 6, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"wbr", (void *) &lxb_tag_res_data_default[194], 3, 0}, {NULL, NULL, 0, 0}, - {"pre", (void *) &lxb_tag_res_data_default[150], 3, 94}, {NULL, NULL, 0, 0}, + {"wbr", (void *) &lxb_tag_res_data_default[196], 3, 0}, {NULL, NULL, 0, 0}, + {"pre", (void *) &lxb_tag_res_data_default[150], 3, 98}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"picture", (void *) &lxb_tag_res_data_default[148], 7, 0}, {"h4", (void *) &lxb_tag_res_data_default[94], 2, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"meta", (void *) &lxb_tag_res_data_default[124], 4, 96}, {NULL, NULL, 0, 0}, + {"meta", (void *) &lxb_tag_res_data_default[124], 4, 99}, {NULL, NULL, 0, 0}, {"rtc", (void *) &lxb_tag_res_data_default[157], 3, 0}, {NULL, NULL, 0, 0}, - {"frame", (void *) &lxb_tag_res_data_default[88], 5, 0}, {"fetile", (void *) &lxb_tag_res_data_default[79], 6, 98}, - {"feimage", (void *) &lxb_tag_res_data_default[71], 7, 99}, {NULL, NULL, 0, 0}, - {"xmp", (void *) &lxb_tag_res_data_default[195], 3, 0}, {NULL, NULL, 0, 0}, - {"fecomposite", (void *) &lxb_tag_res_data_default[59], 11, 100}, {"feturbulence", (void *) &lxb_tag_res_data_default[80], 12, 0}, - {NULL, NULL, 0, 0}, {"summary", (void *) &lxb_tag_res_data_default[173], 7, 0}, + {"frame", (void *) &lxb_tag_res_data_default[88], 5, 0}, {"fetile", (void *) &lxb_tag_res_data_default[79], 6, 100}, + {"feimage", (void *) &lxb_tag_res_data_default[71], 7, 103}, {NULL, NULL, 0, 0}, + {"xmp", (void *) &lxb_tag_res_data_default[197], 3, 0}, {NULL, NULL, 0, 0}, + {"fecomposite", (void *) &lxb_tag_res_data_default[59], 11, 110}, {"feturbulence", (void *) &lxb_tag_res_data_default[80], 12, 0}, + {NULL, NULL, 0, 0}, {"summary", (void *) &lxb_tag_res_data_default[175], 7, 0}, {"mfenced", (void *) &lxb_tag_res_data_default[126], 7, 0}, {NULL, NULL, 0, 0}, - {"sub", (void *) &lxb_tag_res_data_default[172], 3, 0}, {"colgroup", (void *) &lxb_tag_res_data_default[41], 8, 0}, + {"sub", (void *) &lxb_tag_res_data_default[174], 3, 0}, {"colgroup", (void *) &lxb_tag_res_data_default[41], 8, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {NULL, NULL, 0, 0}, {"dd", (void *) &lxb_tag_res_data_default[44], 2, 103}, + {NULL, NULL, 0, 0}, {"dd", (void *) &lxb_tag_res_data_default[44], 2, 112}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"div", (void *) &lxb_tag_res_data_default[51], 3, 0}, {"textarea", (void *) &lxb_tag_res_data_default[180], 8, 0}, + {"div", (void *) &lxb_tag_res_data_default[51], 3, 0}, {"textarea", (void *) &lxb_tag_res_data_default[182], 8, 0}, {"!doctype", (void *) &lxb_tag_res_data_default[5], 8, 0}, {"applet", (void *) &lxb_tag_res_data_default[17], 6, 0}, - {NULL, NULL, 0, 0}, {"br", (void *) &lxb_tag_res_data_default[32], 2, 110}, + {NULL, NULL, 0, 0}, {"br", (void *) &lxb_tag_res_data_default[32], 2, 113}, {NULL, NULL, 0, 0}, {"keygen", (void *) &lxb_tag_res_data_default[110], 6, 0}, {"kbd", (void *) &lxb_tag_res_data_default[109], 3, 0}, {NULL, NULL, 0, 0}, {"plaintext", (void *) &lxb_tag_res_data_default[149], 9, 0}, {"s", (void *) &lxb_tag_res_data_default[159], 1, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {"bdo", (void *) &lxb_tag_res_data_default[26], 3, 0}, {"td", (void *) &lxb_tag_res_data_default[178], 2, 0}, + {"bdo", (void *) &lxb_tag_res_data_default[26], 3, 0}, {"td", (void *) &lxb_tag_res_data_default[180], 2, 0}, {"fefunca", (void *) &lxb_tag_res_data_default[66], 7, 0}, {"ol", (void *) &lxb_tag_res_data_default[141], 2, 0}, - {"thead", (void *) &lxb_tag_res_data_default[184], 5, 0}, {"nobr", (void *) &lxb_tag_res_data_default[136], 4, 112}, - {NULL, NULL, 0, 0}, {"tr", (void *) &lxb_tag_res_data_default[187], 2, 0}, + {"thead", (void *) &lxb_tag_res_data_default[186], 5, 0}, {"nobr", (void *) &lxb_tag_res_data_default[136], 4, 115}, + {NULL, NULL, 0, 0}, {"tr", (void *) &lxb_tag_res_data_default[189], 2, 0}, {"map", (void *) &lxb_tag_res_data_default[119], 3, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, - {NULL, NULL, 0, 0}, {"#undef", (void *) &lxb_tag_res_data_default[0], 6, 113}, + {NULL, NULL, 0, 0}, {"#undef", (void *) &lxb_tag_res_data_default[0], 6, 116}, {"em", (void *) &lxb_tag_res_data_default[54], 2, 0}, {NULL, NULL, 0, 0}, {"bdi", (void *) &lxb_tag_res_data_default[25], 3, 0}, {"femorphology", (void *) &lxb_tag_res_data_default[74], 12, 0}, - {"ms", (void *) &lxb_tag_res_data_default[131], 2, 116}, {"footer", (void *) &lxb_tag_res_data_default[85], 6, 0}, - {"fefuncr", (void *) &lxb_tag_res_data_default[69], 7, 0}, {"rt", (void *) &lxb_tag_res_data_default[156], 2, 117}, + {"ms", (void *) &lxb_tag_res_data_default[131], 2, 120}, {"footer", (void *) &lxb_tag_res_data_default[85], 6, 0}, + {"fefuncr", (void *) &lxb_tag_res_data_default[69], 7, 0}, {"rt", (void *) &lxb_tag_res_data_default[156], 2, 122}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0}, {"h5", (void *) &lxb_tag_res_data_default[95], 2, 0}, - {NULL, NULL, 0, 0}, {"ruby", (void *) &lxb_tag_res_data_default[158], 4, 120}, + {NULL, NULL, 0, 0}, {"ruby", (void *) &lxb_tag_res_data_default[158], 4, 123}, {"canvas", (void *) &lxb_tag_res_data_default[34], 6, 0}, {NULL, NULL, 0, 0}, {NULL, NULL, 0, 0} }; diff --git a/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch b/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch index 0da274053ec2..32d9d42d2bf1 100644 --- a/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch +++ b/ext/dom/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch @@ -1,4 +1,4 @@ -From 4c133fe5adfe4b8ccdd8b014d884b685143b9e66 Mon Sep 17 00:00:00 2001 +From 0cd2add6c46400b808329442f81451b369863983 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:08:59 +0200 Subject: [PATCH 1/6] Expose line and column information for use in PHP @@ -15,10 +15,10 @@ Subject: [PATCH 1/6] Expose line and column information for use in PHP 8 files changed, 48 insertions(+), 5 deletions(-) diff --git a/source/lexbor/dom/interfaces/node.h b/source/lexbor/dom/interfaces/node.h -index b052cf5..b5d2c50 100644 +index 6c74ac5..b95373c 100644 --- a/source/lexbor/dom/interfaces/node.h +++ b/source/lexbor/dom/interfaces/node.h -@@ -83,6 +83,8 @@ struct lxb_dom_node { +@@ -86,6 +86,8 @@ struct lxb_dom_node { lxb_dom_node_type_t type; @@ -41,10 +41,10 @@ index 79accd0..0b7f4fd 100644 const lxb_char_t *text_start; const lxb_char_t *text_end; diff --git a/source/lexbor/html/tokenizer.c b/source/lexbor/html/tokenizer.c -index 741bced..0bd9aec 100644 +index 22b88ed..1d9f378 100644 --- a/source/lexbor/html/tokenizer.c +++ b/source/lexbor/html/tokenizer.c -@@ -91,6 +91,7 @@ lxb_html_tokenizer_init(lxb_html_tokenizer_t *tkz) +@@ -92,6 +92,7 @@ lxb_html_tokenizer_init(lxb_html_tokenizer_t *tkz) tkz->pos = tkz->start; tkz->end = tkz->start + LXB_HTML_TKZ_TEMP_SIZE; @@ -52,7 +52,7 @@ index 741bced..0bd9aec 100644 tkz->tree = NULL; tkz->tags = NULL; -@@ -152,6 +153,8 @@ lxb_html_tokenizer_inherit(lxb_html_tokenizer_t *tkz_to, +@@ -153,6 +154,8 @@ lxb_html_tokenizer_inherit(lxb_html_tokenizer_t *tkz_to, tkz_to->start = tkz_from->start; tkz_to->end = tkz_from->end; tkz_to->pos = tkz_to->start; @@ -61,7 +61,7 @@ index 741bced..0bd9aec 100644 return LXB_STATUS_OK; } -@@ -312,7 +315,26 @@ lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, +@@ -571,7 +574,26 @@ lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, tkz->last = end; while (data < end) { @@ -90,10 +90,10 @@ index 741bced..0bd9aec 100644 return tkz->status; diff --git a/source/lexbor/html/tokenizer.h b/source/lexbor/html/tokenizer.h -index ba9602f..74bb55e 100644 +index 12b7c81..aa1ac37 100644 --- a/source/lexbor/html/tokenizer.h +++ b/source/lexbor/html/tokenizer.h -@@ -73,6 +73,8 @@ struct lxb_html_tokenizer { +@@ -79,6 +79,8 @@ struct lxb_html_tokenizer { const lxb_char_t *end; const lxb_char_t *begin; const lxb_char_t *last; @@ -103,7 +103,7 @@ index ba9602f..74bb55e 100644 /* Entities */ const lexbor_sbst_entry_static_t *entity; diff --git a/source/lexbor/html/tokenizer/state.h b/source/lexbor/html/tokenizer/state.h -index 17939b9..5b095b4 100644 +index 5e91444..52eaa9a 100644 --- a/source/lexbor/html/tokenizer/state.h +++ b/source/lexbor/html/tokenizer/state.h @@ -90,6 +90,8 @@ extern "C" { @@ -116,10 +116,10 @@ index 17939b9..5b095b4 100644 while (0) diff --git a/source/lexbor/html/tree.c b/source/lexbor/html/tree.c -index ece26e9..91bfd17 100644 +index 062ea56..3f4c18d 100644 --- a/source/lexbor/html/tree.c +++ b/source/lexbor/html/tree.c -@@ -427,6 +427,9 @@ lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree, +@@ -431,6 +431,9 @@ lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree, return NULL; } @@ -129,7 +129,7 @@ index ece26e9..91bfd17 100644 lxb_status_t status; lxb_dom_element_t *element = lxb_dom_interface_element(node); -@@ -763,6 +766,11 @@ lxb_html_tree_insert_character_for_data(lxb_html_tree_t *tree, +@@ -767,6 +770,11 @@ lxb_html_tree_insert_character_for_data(lxb_html_tree_t *tree, lxb_dom_interface_text(text)->char_data.data = *str; @@ -141,7 +141,7 @@ index ece26e9..91bfd17 100644 if (ret_node != NULL) { *ret_node = text; } -@@ -802,6 +810,9 @@ lxb_html_tree_insert_comment(lxb_html_tree_t *tree, +@@ -806,6 +814,9 @@ lxb_html_tree_insert_comment(lxb_html_tree_t *tree, return NULL; } @@ -152,10 +152,10 @@ index ece26e9..91bfd17 100644 tree->document->dom_document.text); if (tree->status != LXB_STATUS_OK) { diff --git a/source/lexbor/html/tree/error.c b/source/lexbor/html/tree/error.c -index e6e43f4..88ad8c4 100644 +index ffdc55c..ef36eab 100644 --- a/source/lexbor/html/tree/error.c +++ b/source/lexbor/html/tree/error.c -@@ -21,8 +21,9 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors, +@@ -22,8 +22,9 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors, } entry->id = id; @@ -168,10 +168,10 @@ index e6e43f4..88ad8c4 100644 return entry; } diff --git a/source/lexbor/html/tree/error.h b/source/lexbor/html/tree/error.h -index 2fd06cb..ed1859f 100644 +index 7a212af..b186772 100644 --- a/source/lexbor/html/tree/error.h +++ b/source/lexbor/html/tree/error.h -@@ -97,8 +97,9 @@ lxb_html_tree_error_id_t; +@@ -109,8 +109,9 @@ lxb_html_tree_error_id_t; typedef struct { lxb_html_tree_error_id_t id; @@ -184,5 +184,5 @@ index 2fd06cb..ed1859f 100644 lxb_html_tree_error_t; -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch b/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch index a2df20e3bae4..1902abf96e3a 100644 --- a/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch +++ b/ext/dom/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch @@ -1,4 +1,4 @@ -From eb5e3769950cd9c0bc59066d94d6da9291f43af8 Mon Sep 17 00:00:00 2001 +From a4c29ba8d1ea1065ce6bd4a34382d53140cf1924 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 14 Aug 2023 20:18:51 +0200 Subject: [PATCH 2/6] Track implied added nodes for options use in PHP @@ -11,7 +11,7 @@ Subject: [PATCH 2/6] Track implied added nodes for options use in PHP 4 files changed, 8 insertions(+) diff --git a/source/lexbor/html/tree.h b/source/lexbor/html/tree.h -index 9564608..8ad32a4 100644 +index 4912efb..7b2c620 100644 --- a/source/lexbor/html/tree.h +++ b/source/lexbor/html/tree.h @@ -55,6 +55,9 @@ struct lxb_html_tree { @@ -63,5 +63,5 @@ index 05fe738..1e09cda 100644 break; -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch b/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch index 4c3cdc67a65d..51f77483bc6e 100644 --- a/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch +++ b/ext/dom/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch @@ -1,4 +1,4 @@ -From de74c24d95342280266ebdac6f8dabc70ccfacab Mon Sep 17 00:00:00 2001 +From 46fc776449252e74795569759a19d13857a59069 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 24 Aug 2023 22:57:48 +0200 Subject: [PATCH 3/6] Patch utilities and data structure to be able to generate @@ -8,10 +8,10 @@ Changed the generation script to check if everything fits in 32-bits. And change the actual field types to 32-bits. This decreases the hash tables in size. --- - source/lexbor/core/shs.h | 4 +- - utils/lexbor/encoding/single-byte.py | 2 +- - utils/lexbor/lexbor/LXB.py | 12 +- - 3 files changed, 12 insertions(+), 6 deletions(-) + source/lexbor/core/shs.h | 4 ++-- + utils/lexbor/encoding/single-byte.py | 4 ++-- + utils/lexbor/lexbor/LXB.py | 12 +++++++++--- + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/source/lexbor/core/shs.h b/source/lexbor/core/shs.h index 7a63a07..c84dfaa 100644 @@ -30,7 +30,7 @@ index 7a63a07..c84dfaa 100644 lexbor_shs_hash_t; diff --git a/utils/lexbor/encoding/single-byte.py b/utils/lexbor/encoding/single-byte.py -index 9a85d54..ec2023c 100755 +index d7d1bb2..5420c16 100755 --- a/utils/lexbor/encoding/single-byte.py +++ b/utils/lexbor/encoding/single-byte.py @@ -128,7 +128,7 @@ class SingleByte: @@ -42,6 +42,15 @@ index 9a85d54..ec2023c 100755 return hash_key.create(rate = 1) +@@ -161,7 +161,7 @@ def toHex(s): + lst = [] + + for ch in bytes(s, 'utf-8'): +- hv = hex(ch).replace('0x', '\\\\x') ++ hv = hex(ch).replace('0x', '\\x') + lst.append("'{}'".format(hv)) + + return ', '.join(lst) diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py index 3e75812..2370c66 100755 --- a/utils/lexbor/lexbor/LXB.py @@ -84,5 +93,5 @@ index 3e75812..2370c66 100755 result.append("};") -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch b/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch index c678146f2ada..6cb6658a164b 100644 --- a/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch +++ b/ext/dom/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch @@ -1,4 +1,4 @@ -From 1837e6a296a2bac71e37e566435542f208b4fa23 Mon Sep 17 00:00:00 2001 +From ae9d7254ac129cc3be34de6fd34af27baf3bb396 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:26:47 +0100 Subject: [PATCH 4/6] Remove unused upper case tag static data @@ -9,10 +9,10 @@ Subject: [PATCH 4/6] Remove unused upper case tag static data 2 files changed, 4 insertions(+) diff --git a/source/lexbor/tag/res.h b/source/lexbor/tag/res.h -index c7190c5..4ad1f37 100644 +index 604757f..5672d4a 100644 --- a/source/lexbor/tag/res.h +++ b/source/lexbor/tag/res.h -@@ -224,6 +224,7 @@ static const lxb_tag_data_t lxb_tag_res_data_default[LXB_TAG__LAST_ENTRY] = +@@ -226,6 +226,7 @@ static const lxb_tag_data_t lxb_tag_res_data_default[LXB_TAG__LAST_ENTRY] = {{.u.short_str = "xmp", .length = 3, .next = NULL}, LXB_TAG_XMP, 1, true} }; @@ -20,13 +20,13 @@ index c7190c5..4ad1f37 100644 static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] = { {{.u.short_str = "#UNDEF", .length = 6, .next = NULL}, LXB_TAG__UNDEF, 1, true}, -@@ -423,6 +424,7 @@ static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] +@@ -427,6 +428,7 @@ static const lxb_tag_data_t lxb_tag_res_data_upper_default[LXB_TAG__LAST_ENTRY] {{.u.short_str = "WBR", .length = 3, .next = NULL}, LXB_TAG_WBR, 1, true}, {{.u.short_str = "XMP", .length = 3, .next = NULL}, LXB_TAG_XMP, 1, true} }; +#endif - static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[] = + static const lexbor_shs_entry_t lxb_tag_res_shs_data_default[263] = { diff --git a/source/lexbor/tag/tag.c b/source/lexbor/tag/tag.c index 780bc47..be5bb30 100644 @@ -49,5 +49,5 @@ index 780bc47..be5bb30 100644 /* * No inline functions for ABI. -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch b/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch index bf2acce1a848..9ef6e305e498 100644 --- a/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch +++ b/ext/dom/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch @@ -1,4 +1,4 @@ -From 065923a993a004b8891ad3992c99e7e63e77bad3 Mon Sep 17 00:00:00 2001 +From 19cf6183813e013dfe0eb2303c15eaf6e01b9faf Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:29:31 +0100 Subject: [PATCH 5/6] Shrink size of static binary search tree @@ -7,10 +7,9 @@ This also makes it more efficient on the data cache. --- source/lexbor/core/sbst.h | 19 ++++++++++++++----- source/lexbor/html/tokenizer/state.c | 2 +- - utils/lexbor/html/tmp/tokenizer_res.h | 2 +- - utils/lexbor/html/tokenizer_entities_bst.py | 10 +++++----- + utils/lexbor/html/tokenizer_entities_bst.py | 8 ++++---- utils/lexbor/lexbor/LXB.py | 2 +- - 5 files changed, 21 insertions(+), 12 deletions(-) + 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h index b0fbc54..15a1d40 100644 @@ -48,10 +47,10 @@ index b0fbc54..15a1d40 100644 lexbor_sbst_entry_static_t; diff --git a/source/lexbor/html/tokenizer/state.c b/source/lexbor/html/tokenizer/state.c -index 158aade..207b909 100644 +index db362c6..6c3cbeb 100644 --- a/source/lexbor/html/tokenizer/state.c +++ b/source/lexbor/html/tokenizer/state.c -@@ -1820,7 +1820,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz, +@@ -1825,7 +1825,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz, goto done; } @@ -60,21 +59,8 @@ index 158aade..207b909 100644 tkz->entity_end = (tkz->pos + (data - begin)) - tkz->start; tkz->entity_match = entry; } -diff --git a/utils/lexbor/html/tmp/tokenizer_res.h b/utils/lexbor/html/tmp/tokenizer_res.h -index b3701d5..73ab66e 100644 ---- a/utils/lexbor/html/tmp/tokenizer_res.h -+++ b/utils/lexbor/html/tmp/tokenizer_res.h -@@ -6,7 +6,7 @@ - - /* - * Caution!!! Important!!! -- * This file generated by the script -+ * This file is generated by the script - * "utils/lexbor/html/tokenizer_entities_bst.py"! - * Do not change this file! - */ diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py -index 4fa0999..8bd83b2 100755 +index b34bca1..2bfea81 100755 --- a/utils/lexbor/html/tokenizer_entities_bst.py +++ b/utils/lexbor/html/tokenizer_entities_bst.py @@ -1,6 +1,6 @@ @@ -112,15 +98,8 @@ index 4fa0999..8bd83b2 100755 lst.append(hv) return ''.join(lst) -@@ -210,5 +210,5 @@ def entities_bst_print(bst): - - if __name__ == "__main__": - entities_bst("tmp/tokenizer_res.h", -- "../../../source/lexbor/html/tokenizer_res.h", -+ "../../../source/lexbor/html/tokenizer/res.h", - "data/entities.json"); diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py -index 3e75812..b068ea3 100755 +index 2370c66..c41e645 100755 --- a/utils/lexbor/lexbor/LXB.py +++ b/utils/lexbor/lexbor/LXB.py @@ -27,7 +27,7 @@ class Temp: @@ -133,5 +112,5 @@ index 3e75812..b068ea3 100755 fh.close() -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch b/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch index aa64d88ceb18..a643f9716488 100644 --- a/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch +++ b/ext/dom/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch @@ -1,19 +1,17 @@ -From fbb1e8945c4b12d43e7fddc3c34670b5792e2dca Mon Sep 17 00:00:00 2001 +From 54399ee441d922d89c32909e2028f899f6091cd6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 7 Jan 2024 21:59:28 +0100 Subject: [PATCH 6/6] Patch out unused CSS style code --- - source/lexbor/css/rule.h | 2 ++ - source/lexbor/style/dom/interfaces/document.c | 12 ++++++++---- - source/lexbor/style/html/interfaces/document.h | 2 ++ - 3 files changed, 12 insertions(+), 4 deletions(-) + source/lexbor/css/rule.h | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/source/lexbor/css/rule.h b/source/lexbor/css/rule.h -index 7cc4f0b..bd191f9 100644 +index 308dced..d192a01 100644 --- a/source/lexbor/css/rule.h +++ b/source/lexbor/css/rule.h -@@ -339,6 +339,7 @@ lxb_css_rule_ref_dec(lxb_css_rule_t *rule) +@@ -361,6 +361,7 @@ lxb_css_rule_ref_dec(lxb_css_rule_t *rule) lxb_inline void lxb_css_rule_ref_dec_destroy(lxb_css_rule_t *rule) { @@ -21,7 +19,7 @@ index 7cc4f0b..bd191f9 100644 if (rule->ref_count > 0) { rule->ref_count--; } -@@ -346,6 +347,7 @@ lxb_css_rule_ref_dec_destroy(lxb_css_rule_t *rule) +@@ -368,6 +369,7 @@ lxb_css_rule_ref_dec_destroy(lxb_css_rule_t *rule) if (rule->ref_count == 0) { (void) lxb_css_rule_destroy(rule, true); } @@ -29,96 +27,6 @@ index 7cc4f0b..bd191f9 100644 } lxb_inline void -diff --git a/source/lexbor/style/dom/interfaces/document.c b/source/lexbor/style/dom/interfaces/document.c -index 8a63e8e..f885dc3 100644 ---- a/source/lexbor/style/dom/interfaces/document.c -+++ b/source/lexbor/style/dom/interfaces/document.c -@@ -280,6 +280,7 @@ lxb_status_t - lxb_dom_document_stylesheet_apply(lxb_dom_document_t *document, - lxb_css_stylesheet_t *sst) - { -+#if 0 - lxb_status_t status = LXB_STATUS_OK; - lxb_css_rule_t *rule; - lxb_css_rule_list_t *list; -@@ -310,7 +311,7 @@ lxb_dom_document_stylesheet_apply(lxb_dom_document_t *document, - - rule = rule->next; - } -- -+#endif - return LXB_STATUS_OK; - } - -@@ -329,6 +330,7 @@ lxb_status_t - lxb_dom_document_stylesheet_remove(lxb_dom_document_t *document, - lxb_css_stylesheet_t *sst) - { -+#if 0 - size_t i, length; - lxb_status_t status = LXB_STATUS_OK; - lxb_css_rule_t *rule; -@@ -372,13 +374,14 @@ lxb_dom_document_stylesheet_remove(lxb_dom_document_t *document, - length = lexbor_array_length(document->css->stylesheets); - } - } -- -+#endif - return LXB_STATUS_OK; - } - - lxb_status_t - lxb_dom_document_element_styles_attach(lxb_dom_element_t *element) - { -+#if 0 - lxb_status_t status = LXB_STATUS_OK; - lxb_css_rule_t *rule; - lexbor_array_t *ssts; -@@ -413,7 +416,7 @@ lxb_dom_document_element_styles_attach(lxb_dom_element_t *element) - rule = rule->next; - } - } -- -+#endif - return LXB_STATUS_OK; - } - -@@ -521,6 +524,7 @@ lxb_dom_document_style_attach_cb(lxb_dom_node_t *node, - lxb_status_t - lxb_document_apply_stylesheets(lxb_dom_document_t *document) - { -+#if 0 - size_t i, length; - lxb_status_t status; - lxb_css_stylesheet_t *sst; -@@ -539,6 +543,6 @@ lxb_document_apply_stylesheets(lxb_dom_document_t *document) - return status; - } - } -- -+#endif - return LXB_STATUS_OK; - } -diff --git a/source/lexbor/style/html/interfaces/document.h b/source/lexbor/style/html/interfaces/document.h -index 0307cd9..127c4cd 100644 ---- a/source/lexbor/style/html/interfaces/document.h -+++ b/source/lexbor/style/html/interfaces/document.h -@@ -134,6 +134,7 @@ lxb_html_document_stylesheet_destroy_all(lxb_html_document_t *document, - destroy_memory); - } - -+#if 0 - lxb_inline lxb_status_t - lxb_html_document_style_attach(lxb_html_document_t *document, - lxb_css_rule_style_t *style) -@@ -158,6 +159,7 @@ lxb_html_document_style_attach_by_element(lxb_html_document_t *document, - return lxb_dom_document_style_attach_by_element(lxb_dom_interface_document(document), - element, style); - } -+#endif - - lxb_inline lxb_status_t - lxb_html_document_apply_stylesheets(lxb_html_document_t *document) -- -2.49.0 +2.51.2 diff --git a/ext/dom/lexbor/patches/README.md b/ext/dom/lexbor/patches/README.md index 93ca862c99c0..8d2bceb1bc1d 100644 --- a/ext/dom/lexbor/patches/README.md +++ b/ext/dom/lexbor/patches/README.md @@ -1,7 +1,10 @@ # Lexbor patches +> [!IMPORTANT] +> This process was largely automated in update-lexbor.sh. + Upon syncing the Lexbor sources, the patches in this directory need to be applied. -The current Lexbor version is 2.5.0. +The current Lexbor version is 2.7.0. ## Overview diff --git a/ext/dom/lexbor/patches/update-lexbor.sh b/ext/dom/lexbor/patches/update-lexbor.sh new file mode 100755 index 000000000000..7421d8e7d321 --- /dev/null +++ b/ext/dom/lexbor/patches/update-lexbor.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +set -e + +PATCHES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +LEXBOR_REPO="https://github.com/lexbor/lexbor" +LEXBOR_REF="v2.7.0" +LEXBOR_BASE="$(cd "$PATCHES_DIR/.." && pwd)" +LEXBOR_DIR="$LEXBOR_BASE/lexbor" +LEXBOR_TMP_DIR="$LEXBOR_BASE/lexbor_tmp" +LEXBOR_COMPONENTS=(core css dom encoding html ns ports selectors tag) +LEXBOR_PRESERVED_FILES=( + selectors-adapted/selectors.c + selectors-adapted/selectors.h +) + +# Clone +git clone "$LEXBOR_REPO" "$LEXBOR_TMP_DIR" +(cd "$LEXBOR_TMP_DIR" && git checkout "$LEXBOR_REF") + +# Apply patches +mapfile -t patches < <(ls "$PATCHES_DIR"/*.patch) +cd "$LEXBOR_TMP_DIR" +for patch in "${patches[@]}"; do + if ! git am -3 "$patch"; then + read -p "Patch $(basename "$patch") did not apply cleanly. Resolve, stage and press Enter to continue. " + git am --continue + fi +done + +# Refresh patches +NUM_PATCHES=${#patches[@]} +git format-patch "HEAD~$NUM_PATCHES" -o "$PATCHES_DIR" + +# Run code-generation tools +(cd "$LEXBOR_TMP_DIR/utils/lexbor/encoding" && python3 single-byte.py) +(cd "$LEXBOR_TMP_DIR/utils/lexbor/html" && python3 tokenizer_entities_bst.py) + +# (Re)move files +mv source/lexbor/encoding/multi_res.c source/lexbor/encoding/multi.c +mv source/lexbor/encoding/range_res.c source/lexbor/encoding/range.c +mv source/lexbor/encoding/single_res.c source/lexbor/encoding/single.c +rm source/lexbor/html/serialize.c +rm source/lexbor/ports/posix/lexbor/core/fs.c +rm source/lexbor/ports/posix/lexbor/core/perf.c +rm source/lexbor/ports/windows_nt/lexbor/core/fs.c +rm source/lexbor/ports/windows_nt/lexbor/core/perf.c +find . -name "*.cmake" -delete + +# Copy preserved files +for f in "${LEXBOR_PRESERVED_FILES[@]}"; do + dst="source/lexbor/$f" + mkdir -p "$(dirname "$dst")" + cp "$LEXBOR_DIR/$f" "$dst" +done + +# Replace components +for dir in "${LEXBOR_COMPONENTS[@]}"; do + dst="$LEXBOR_DIR/$dir" + rm -rf "$dst" + cp -r "source/lexbor/$dir" "$dst" +done +rm -rf "$LEXBOR_TMP_DIR" diff --git a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt index 058d4432b49d..89574b7a631f 100644 --- a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt +++ b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt @@ -60,6 +60,6 @@ echo $dom->saveXML(), "\n"; - + From f7eb5ef31050df5dd022d27f087de04dd73352d3 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 16 Apr 2026 14:16:47 +0200 Subject: [PATCH 248/300] [skip ci] Add note for lexbor v2.7.0 upgrade --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index f3b3e3a6aa38..2790d81dccf9 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ PHP NEWS declarations after setAttributeNS()). (David Carlier) . Fixed bug GH-21688 (segmentation fault on empty HTMLDocument). (David Carlier) + . Upgrade to lexbor v2.7.0. (ndossche, ilutov) - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) From e2a923265d6080db5950ec4f6947c2bb9d0915e3 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Apr 2026 19:58:24 +0100 Subject: [PATCH 249/300] ext/phar: use zend_string for entry in phar_split_fname() (#21767) This saves us to do multiple reallocations from zend_string* to char* back to a zend_string*. --- ext/phar/dirstream.c | 4 +-- ext/phar/func_interceptors.c | 10 +++---- ext/phar/phar.c | 10 ++----- ext/phar/phar_internal.h | 2 +- ext/phar/phar_object.c | 55 ++++++++++++++++++------------------ ext/phar/stream.c | 10 +++---- ext/phar/util.c | 4 +-- 7 files changed, 46 insertions(+), 49 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 51e5d70a6e65..c486fd41abfd 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -350,7 +350,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, NULL, NULL, 2, 2)) { + if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, NULL, 2, 2)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", no phar archive specified", url_from); return 0; } @@ -476,7 +476,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, NULL, NULL, 2, 2)) { + if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, NULL, 2, 2)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url); return 0; } diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index a8867ed57cd5..e70dcb5e5a14 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -48,7 +48,7 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { php_stream_context *context = NULL; php_stream *stream; char *name; @@ -94,7 +94,7 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool return NULL; } - if (FAILURE == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { + if (FAILURE == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { return NULL; } @@ -496,7 +496,7 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ phar = PHAR_G(last_phar); goto splitted; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { /* fopen within phar, if :// is not in the url, then prepend phar:/// */ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { efree(arch); @@ -737,7 +737,7 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { phar_archive_data *phar; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ @@ -795,7 +795,7 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0)) { + if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { phar_archive_data *phar; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 02a2f09f9527..d597434d5eb3 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2163,7 +2163,7 @@ zend_string* phar_fix_filepath(const char *path, size_t path_length, bool use_cw * * This is used by phar_parse_url() */ -zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len, int executable, int for_create) /* {{{ */ +zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, zend_string **entry, int executable, int for_create) /* {{{ */ { const char *ext_str; #ifdef PHP_WIN32 @@ -2219,13 +2219,9 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a size_t computed_entry_len = filename_len - *arch_len; /* We don't need to unixify the path on Windows, * as ext_str is derived from filename that was already unixify */ - zend_string *entry_str = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false); - *entry = estrndup(ZSTR_VAL(entry_str), ZSTR_LEN(entry_str)); - *entry_len = ZSTR_LEN(entry_str); - zend_string_release_ex(entry_str, false); + *entry = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false); } else { - *entry_len = 1; - *entry = estrndup("/", 1); + *entry = ZSTR_CHAR('/'); } } diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index a2b7e67a2e81..c20e5d42b313 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -474,7 +474,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, ch ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); ZEND_ATTRIBUTE_NONNULL int phar_flush(phar_archive_data *archive, char **error); zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete); -zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, char **entry, size_t *entry_len, int executable, int for_create); +zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, zend_string **entry, int executable, int for_create); typedef enum { pcr_use_query, diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f522d52ba6c4..ef997184d03d 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -419,7 +419,7 @@ PHP_METHOD(Phar, running) if ( zend_string_starts_with_literal_ci(fname, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 2, 0) + && SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0) ) { if (retphar) { RETVAL_STRINGL(ZSTR_VAL(fname), arch_len + 7); @@ -444,8 +444,8 @@ PHP_METHOD(Phar, running) */ PHP_METHOD(Phar, mount) { - char *fname, *arch = NULL, *entry = NULL, *path, *actual; - size_t fname_len, arch_len, entry_len; + char *fname, *arch = NULL, *path, *actual; + size_t fname_len, arch_len; size_t path_len, actual_len; phar_archive_data *pphar; #ifdef PHP_WIN32 @@ -476,9 +476,8 @@ PHP_METHOD(Phar, mount) } #endif - if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, NULL, NULL, 2, 0)) { - entry = NULL; - + zend_string *entry = NULL; + if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, NULL, 2, 0)) { if (path_len > 7 && !memcmp(path, "phar://", 7)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path); efree(arch); @@ -505,8 +504,8 @@ PHP_METHOD(Phar, mount) zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch); } - if (entry && path == entry) { - efree(entry); + if (entry && path == ZSTR_VAL(entry)) { + zend_string_release_ex(entry, false); } if (arch) { @@ -522,9 +521,9 @@ PHP_METHOD(Phar, mount) } goto carry_on; - } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { - path = entry; - path_len = entry_len; + } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, 2, 0)) { + path = ZSTR_VAL(entry); + path_len = ZSTR_LEN(entry); goto carry_on2; } @@ -1078,9 +1077,9 @@ static const spl_other_handler phar_spl_foreign_handler = { */ PHP_METHOD(Phar, __construct) { - char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname; + char *fname, *alias = NULL, *error, *arch = NULL, *save_fname; size_t fname_len, alias_len = 0; - size_t arch_len, entry_len; + size_t arch_len; bool is_data; zend_long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS; zend_long format = 0; @@ -1108,7 +1107,8 @@ PHP_METHOD(Phar, __construct) } save_fname = fname; - if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, 2)) { + zend_string *entry = NULL; + if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, !is_data, 2)) { /* use arch (the basename for the archive) for fname instead of fname */ /* this allows support for RecursiveDirectoryIterator of subdirectories */ #ifdef PHP_WIN32 @@ -1133,7 +1133,7 @@ PHP_METHOD(Phar, __construct) } if (entry) { - efree(entry); + zend_string_release_ex(entry, false); } if (error) { @@ -1166,7 +1166,7 @@ PHP_METHOD(Phar, __construct) zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Phar class can only be used for executable tar and zip archives"); } - efree(entry); + zend_string_release_ex(entry, false); RETURN_THROWS(); } @@ -1184,9 +1184,9 @@ PHP_METHOD(Phar, __construct) file_name_for_recursive_director_iterator_constructor = zend_string_concat3( ZEND_STRL("phar://"), phar_data->fname, phar_data->fname_len, - entry, entry_len + ZSTR_VAL(entry), ZSTR_LEN(entry) ); - efree(entry); + zend_string_release_ex(entry, false); } else { file_name_for_recursive_director_iterator_constructor = zend_string_concat2( ZEND_STRL("phar://"), @@ -1289,7 +1289,7 @@ PHP_METHOD(Phar, unlinkArchive) if ( zend_file_name && zend_string_starts_with_literal_ci(zend_file_name, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), &arch, &arch_len, NULL, NULL, 2, 0) + && SUCCESS == phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), &arch, &arch_len, NULL, 2, 0) ) { if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname); @@ -4392,11 +4392,10 @@ PHP_METHOD(Phar, extractTo) /* {{{ Construct a Phar entry object */ PHP_METHOD(PharFileInfo, __construct) { - char *fname, *arch, *entry, *error; + char *fname, *arch, *error; size_t fname_len; - size_t arch_len, entry_len; + size_t arch_len; phar_entry_object *entry_obj; - phar_entry_info *entry_info; phar_archive_data *phar_data; zval arg1; @@ -4411,7 +4410,8 @@ PHP_METHOD(PharFileInfo, __construct) RETURN_THROWS(); } - if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0) == FAILURE) { + zend_string *entry = NULL; + if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, 2, 0) == FAILURE) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, "'%s' is not a valid phar archive URL (must have at least phar://filename.phar)", fname); RETURN_THROWS(); @@ -4431,16 +4431,17 @@ PHP_METHOD(PharFileInfo, __construct) RETURN_THROWS(); } - if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, true)) == NULL) { + phar_entry_info *entry_info = phar_get_entry_info_dir(phar_data, ZSTR_VAL(entry), ZSTR_LEN(entry), 1, &error, true); + if (UNEXPECTED(!entry_info)) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? error : ""); + "Cannot access phar file entry '%s' in archive '%s'%s%s", ZSTR_VAL(entry), arch, error ? ", " : "", error ? error : ""); + zend_string_release_ex(entry, false); efree(arch); - efree(entry); RETURN_THROWS(); } + zend_string_release_ex(entry, false); efree(arch); - efree(entry); entry_obj->entry = entry_info; if (!entry_info->is_persistent && !entry_info->is_temp_dir) { diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 6694fec9479b..4b49703b4abe 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -58,8 +58,8 @@ const php_stream_wrapper php_stream_phar_wrapper = { php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options) /* {{{ */ { php_url *resource; - char *arch = NULL, *entry = NULL, *error; - size_t arch_len, entry_len; + char *arch = NULL, *error; + size_t arch_len; if (strncasecmp(filename, "phar://", 7)) { return NULL; @@ -70,7 +70,8 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const } return NULL; } - if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len, 2, (mode[0] == 'w' ? 2 : 0)) == FAILURE) { + zend_string *entry = NULL; + if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, 2, (mode[0] == 'w' ? 2 : 0)) == FAILURE) { if (!(options & PHP_STREAM_URL_STAT_QUIET)) { if (arch && !entry) { php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch); @@ -85,8 +86,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const resource->scheme = ZSTR_INIT_LITERAL("phar", 0); resource->host = zend_string_init(arch, arch_len, 0); efree(arch); - resource->path = zend_string_init(entry, entry_len, 0); - efree(entry); + resource->path = entry; #ifdef MBO_0 if (resource) { diff --git a/ext/phar/util.c b/ext/phar/util.c index aad6e5f7f085..1e9fedbcbb23 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -300,7 +300,7 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data goto splitted; } - if (!is_file_a_phar_wrapper || SUCCESS != phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, NULL, 1, 0)) { + if (!is_file_a_phar_wrapper || SUCCESS != phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 1, 0)) { return NULL; } @@ -344,7 +344,7 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data if (ret && zend_string_starts_with_literal_ci(ret, "phar://")) { /* found phar:// */ - if (SUCCESS != phar_split_fname(ZSTR_VAL(ret), ZSTR_LEN(ret), &arch, &arch_len, NULL, NULL, 1, 0)) { + if (SUCCESS != phar_split_fname(ZSTR_VAL(ret), ZSTR_LEN(ret), &arch, &arch_len, NULL, 1, 0)) { return ret; } From eb763fbdf5b4574e222808adbcaffd650a469be0 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 16 Apr 2026 22:45:09 +0100 Subject: [PATCH 250/300] ext/phar: arch variable is only needed once in phar_file_stat() (#21780) This removes an allocation and cleans up the logic of freeing the arch we retrieve from phar_split_fname() --- ext/phar/func_interceptors.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index e70dcb5e5a14..0e7d2df0db61 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -475,8 +475,6 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ } if (!IS_ABSOLUTE_PATH(filename, filename_length) && !strstr(filename, "://")) { - char *arch; - size_t arch_len; zend_string *fname; zend_stat_t sb = {0}; phar_archive_data *phar; @@ -490,16 +488,17 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ } if (PHAR_G(last_phar) && ZSTR_LEN(fname) - 7 >= PHAR_G(last_phar_name_len) && !memcmp(ZSTR_VAL(fname) + 7, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len))) { - arch = estrndup(PHAR_G(last_phar_name), PHAR_G(last_phar_name_len)); - arch_len = PHAR_G(last_phar_name_len); /* fopen within phar, if :// is not in the url, then prepend phar:/// */ phar = PHAR_G(last_phar); goto splitted; } + char *arch; + size_t arch_len; if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { - efree(arch); + zend_result has_archive = phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL); + efree(arch); + if (FAILURE == has_archive) { goto skip_phar; } splitted:; @@ -520,7 +519,6 @@ splitted:; } if (zend_hash_exists(&(phar->virtual_dirs), entry)) { zend_string_release_ex(entry, false); - efree(arch); if (IS_EXISTS_CHECK(type)) { RETURN_TRUE; } @@ -550,7 +548,6 @@ splitted:; PHAR_G(cwd_len) = save_len; zend_string_release_ex(entry, false); if (IS_EXISTS_CHECK(type)) { - efree(arch); RETURN_TRUE; } goto stat_entry; @@ -559,7 +556,6 @@ splitted:; PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; zend_string_release_ex(entry, false); - efree(arch); if (IS_EXISTS_CHECK(type)) { RETURN_TRUE; } @@ -574,7 +570,6 @@ splitted:; PHAR_G(cwd) = save; PHAR_G(cwd_len) = save_len; zend_string_release_ex(entry, false); - efree(arch); /* Error Occurred */ if (!IS_EXISTS_CHECK(type)) { php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename); @@ -582,7 +577,6 @@ splitted:; RETURN_FALSE; } stat_entry: - efree(arch); if (!data->is_dir) { sb.st_size = data->uncompressed_filesize; sb.st_mode = data->flags & PHAR_ENT_PERM_MASK; From 60314974f98caa8693c2491b1186dfc038ead7e6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 17 Apr 2026 00:11:28 +0100 Subject: [PATCH 251/300] ext/phar: add const qualifiers (#21779) This is probably going to be round 1 of a few different iterations of adding const qualifiers after figuring out more of the extension code. --- ext/phar/phar.c | 10 ++++++---- ext/phar/phar_internal.h | 20 ++++++++++---------- ext/phar/phar_object.c | 11 +++++++---- ext/phar/tar.c | 6 +++--- ext/phar/util.c | 40 +++++++++++++++++++++------------------- ext/phar/zip.c | 8 ++++---- 6 files changed, 51 insertions(+), 44 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index d597434d5eb3..5fb6c864be74 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -256,7 +256,8 @@ bool phar_archive_delref(phar_archive_data *phar) /* {{{ */ } else if (!phar->refcount) { /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; /* This is a new phar that has perhaps had an alias/metadata set, but has never been flushed. */ bool remove_fname_cache = !zend_hash_num_elements(&phar->manifest); @@ -1263,7 +1264,7 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname } if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { signature = NULL; fp = NULL; MAPPHAR_FAIL("Cannot open archive \"%s\", alias is already in use by existing archive"); @@ -1462,7 +1463,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(c phar_archive_data *fd_ptr; if (alias && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias); zend_hash_str_del(&(PHAR_G(phar_fname_map)), mydata->fname, fname_len); @@ -3333,7 +3334,8 @@ void phar_request_initialize(void) /* {{{ */ if (!PHAR_G(request_init)) { PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; PHAR_G(has_bz2) = zend_hash_str_exists(&module_registry, "bz2", sizeof("bz2")-1); PHAR_G(has_zlib) = zend_hash_str_exists(&module_registry, "zlib", sizeof("zlib")-1); PHAR_G(request_init) = 1; diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index c20e5d42b313..a60c5ed5d432 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -149,7 +149,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phar) char* last_phar_name; uint32_t last_phar_name_len; uint32_t last_alias_len; - char* last_alias; + const char* last_alias; phar_archive_data* last_phar; HashTable mime_types; ZEND_END_MODULE_GLOBALS(phar) @@ -398,7 +398,7 @@ static inline void phar_set_inode(phar_entry_info *entry) /* {{{ */ } /* }}} */ -static inline bool phar_entry_can_remove(phar_entry_info *entry) +static inline bool phar_entry_can_remove(const phar_entry_info *entry) { return entry->fp_refcount == 0 && entry->fileinfo_lock_count == 0; } @@ -413,9 +413,9 @@ zend_result phar_open_from_filename(char *fname, size_t fname_len, char *alias, ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(3) zend_result phar_open_executed_filename(char *alias, size_t alias_len, char **error); -zend_result phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_len); -zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fname_len, char *alias, size_t alias_len, char **error); -zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, char *fname, char **signature, size_t *signature_len, char **error); +zend_result phar_free_alias(const phar_archive_data *phar); +zend_result phar_get_archive(phar_archive_data **archive, const char *fname, size_t fname_len, const char *alias, size_t alias_len, char **error); +zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, const char *fname, char **signature, size_t *signature_len, char **error); ZEND_ATTRIBUTE_NONNULL zend_result phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, size_t *signature_length, char **error); /* utility functions */ @@ -424,8 +424,8 @@ const char *phar_decompress_filter(const phar_entry_info *entry, bool return_unk const char *phar_compress_filter(const phar_entry_info *entry, bool return_unknown); /* void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); */ -void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len); -zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t filename_len, char *path, size_t path_len); +void phar_add_virtual_dirs(phar_archive_data *phar, const char *filename, size_t filename_len); +zend_result phar_mount_entry(phar_archive_data *phar, const char *filename, size_t filename_len, char *path, size_t path_len); zend_string *phar_find_in_include_path(zend_string *file, phar_archive_data **pphar); zend_string* phar_fix_filepath(const char *path, size_t path_length, bool use_cwd); ZEND_ATTRIBUTE_NONNULL phar_entry_info * phar_open_jit(const phar_archive_data *phar, phar_entry_info *entry, char **error); @@ -448,12 +448,12 @@ zend_result phar_copy_on_write(phar_archive_data **pphar); /* tar functions in tar.c */ bool phar_is_tar(const char *buf, const char *fname); -zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error); +zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_len, const char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_tar(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_tar_flush(phar_archive_data *phar, zend_string *user_stub, bool is_default_stub, char **error); /* zip functions in zip.c */ -zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error); +zend_result phar_parse_zipfile(php_stream *fp, const char *fname, size_t fname_len, const char *alias, size_t alias_len, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_open_or_create_zip(char *fname, size_t fname_len, char *alias, size_t alias_len, bool is_data, uint32_t options, phar_archive_data** pphar, char **error); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_zip_flush(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); @@ -470,7 +470,7 @@ void phar_entry_delref(phar_entry_data *idata); phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t path_len, char **error, bool security); phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, bool security); ZEND_ATTRIBUTE_NONNULL phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security, uint32_t timestamp); -ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); +ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, const char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security); ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); ZEND_ATTRIBUTE_NONNULL int phar_flush(phar_archive_data *archive, char **error); zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete); diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index ef997184d03d..f97240010d48 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1313,7 +1313,8 @@ PHP_METHOD(Phar, unlinkArchive) /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; phar_archive_delref(phar); unlink(fname); @@ -2216,7 +2217,8 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; php_stream *tmp_fp = php_stream_fopen_tmpfile(); if (tmp_fp == NULL) { @@ -2688,7 +2690,8 @@ PHP_METHOD(Phar, setAlias) /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; if (phar_obj->archive->is_data) { if (phar_obj->archive->is_tar) { @@ -2705,7 +2708,7 @@ PHP_METHOD(Phar, setAlias) RETURN_TRUE; } if (NULL != (fd_ptr = zend_hash_find_ptr(&(PHAR_G(phar_alias_map)), new_alias))) { - if (SUCCESS != phar_free_alias(fd_ptr, ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { + if (SUCCESS != phar_free_alias(fd_ptr)) { zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), fd_ptr->fname); RETURN_THROWS(); } diff --git a/ext/phar/tar.c b/ext/phar/tar.c index aee0fc71c601..ef356bfc7a28 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -197,7 +197,7 @@ static zend_result phar_tar_process_metadata(phar_entry_info *entry, php_stream } /* }}} */ -zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error) /* {{{ */ +zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_len, const char *alias, size_t alias_len, phar_archive_data** pphar, uint32_t compression, char **error) /* {{{ */ { char buf[512], *actual_alias = NULL, *p; phar_entry_info entry = {0}; @@ -663,7 +663,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch myphar->is_temporary_alias = 0; if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, myphar->alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, myphar->alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname); } @@ -678,7 +678,7 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch if (alias_len) { if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname); } diff --git a/ext/phar/util.c b/ext/phar/util.c index 1e9fedbcbb23..8af0c488f5ca 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -34,7 +34,7 @@ #include #include #else -static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, zend_off_t end, char *key, size_t key_len, char **signature, size_t *signature_len, uint32_t sig_type); +static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, zend_off_t end, const char *key, size_t key_len, char **signature, size_t *signature_len, uint32_t sig_type); #endif /* for links to relative location, prepend cwd of the entry */ @@ -188,7 +188,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of /* }}} */ /* mount an absolute path or uri to a path internal to the phar archive */ -zend_result phar_mount_entry(phar_archive_data *phar, char *filename, size_t filename_len, char *path, size_t path_len) /* {{{ */ +zend_result phar_mount_entry(phar_archive_data *phar, const char *filename, size_t filename_len, char *path, size_t path_len) /* {{{ */ { phar_entry_info entry = {0}; php_stream_statbuf ssb; @@ -462,7 +462,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result phar_separate_entry_fp(phar_entry_info * appended, truncated, or read. For read, if the entry is marked unmodified, it is * assumed that the file pointer, if present, is opened for reading */ -ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ +ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, const char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security) /* {{{ */ { phar_archive_data *phar; phar_entry_info *entry; @@ -929,7 +929,7 @@ ZEND_ATTRIBUTE_NONNULL phar_entry_info * phar_open_jit(const phar_archive_data * } /* }}} */ -zend_result phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_len) /* {{{ */ +zend_result phar_free_alias(const phar_archive_data *phar) /* {{{ */ { if (phar->refcount || phar->is_persistent) { return FAILURE; @@ -942,7 +942,8 @@ zend_result phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_l /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; return SUCCESS; } @@ -952,11 +953,10 @@ zend_result phar_free_alias(phar_archive_data *phar, char *alias, size_t alias_l * Looks up a phar archive in the filename map, connecting it to the alias * (if any) or returns null */ -zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fname_len, char *alias, size_t alias_len, char **error) /* {{{ */ +zend_result phar_get_archive(phar_archive_data **archive, const char *fname, size_t fname_len, const char *alias, size_t alias_len, char **error) /* {{{ */ { phar_archive_data *fd, *fd_ptr; - char *my_realpath, *save; - size_t save_len; + char *my_realpath; phar_request_initialize(); @@ -1003,7 +1003,7 @@ zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fn if (error) { spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, fd_ptr->fname, fname); } - if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS == phar_free_alias(fd_ptr)) { if (error) { efree(*error); *error = NULL; @@ -1029,8 +1029,8 @@ zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fn } my_realpath = NULL; - save = fname; - save_len = fname_len; + const char *save = fname; + size_t save_len = fname_len; if (fname && fname_len) { if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len))) { @@ -1113,14 +1113,15 @@ zend_result phar_get_archive(phar_archive_data **archive, char *fname, size_t fn my_realpath = expand_filepath(fname, my_realpath); if (my_realpath) { - fname_len = strlen(my_realpath); + size_t my_realpath_len = strlen(my_realpath); +#ifdef PHP_WIN32 + phar_unixify_path_separators(my_realpath, my_realpath_len); +#endif + fname_len = my_realpath_len; fname = my_realpath; } else { return FAILURE; } -#ifdef PHP_WIN32 - phar_unixify_path_separators(fname, fname_len); -#endif if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len))) { realpath_success: @@ -1382,7 +1383,7 @@ static int phar_hex_str(const char *digest, size_t digest_len, char **signature) /* }}} */ #ifndef PHAR_HAVE_OPENSSL -static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, zend_off_t end, char *key, size_t key_len, char **signature, size_t *signature_len, uint32_t sig_type) /* {{{ */ +static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, zend_off_t end, const char *key, size_t key_len, char **signature, size_t *signature_len, uint32_t sig_type) /* {{{ */ { zval retval, zp[4]; zend_string *str; @@ -1473,7 +1474,7 @@ static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, ze /* }}} */ #endif /* #ifndef PHAR_HAVE_OPENSSL */ -zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, char *fname, char **signature, size_t *signature_len, char **error) /* {{{ */ +zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, char *sig, size_t sig_len, const char *fname, char **signature, size_t *signature_len, char **error) /* {{{ */ { size_t read_size, len; zend_off_t read_len; @@ -1959,7 +1960,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_create_signature(phar_archive_data *phar /* }}} */ // TODO: convert this to zend_string too -void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, size_t filename_len) /* {{{ */ +void phar_add_virtual_dirs(phar_archive_data *phar, const char *filename, size_t filename_len) /* {{{ */ { const char *s; zend_string *str; @@ -2074,7 +2075,8 @@ zend_result phar_copy_on_write(phar_archive_data **pphar) /* {{{ */ newpphar = Z_PTR_P(pzv); /* invalidate phar cache */ PHAR_G(last_phar) = NULL; - PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL; + PHAR_G(last_alias) = NULL; + PHAR_G(last_phar_name) = NULL; if (newpphar->alias_len && NULL == zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), newpphar->alias, newpphar->alias_len, newpphar)) { zend_hash_str_del(&(PHAR_G(phar_fname_map)), (*pphar)->fname, (*pphar)->fname_len); diff --git a/ext/phar/zip.c b/ext/phar/zip.c index e6a8cdad324a..f757adc90c88 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -224,7 +224,7 @@ static char *phar_find_eocd(const char *s, size_t n) * This is used by phar_open_from_fp to process a zip-based phar, but can be called * directly. */ -zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, char *alias, size_t alias_len, phar_archive_data** pphar, char **error) /* {{{ */ +zend_result phar_parse_zipfile(php_stream *fp, const char *fname, size_t fname_len, const char *alias, size_t alias_len, phar_archive_data** pphar, char **error) /* {{{ */ { phar_zip_dir_end locator; char buf[sizeof(locator) + 65536]; @@ -740,7 +740,7 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch mydata->is_temporary_alias = 0; if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, mydata->alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, mydata->alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with implicit alias, alias is already in use", fname); } @@ -762,7 +762,7 @@ zend_result phar_parse_zipfile(php_stream *fp, char *fname, size_t fname_len, ch if (alias_len) { if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with explicit alias, alias is already in use", fname); } @@ -1279,7 +1279,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_zip_flush(phar_archive_data *phar, ze /* set stub */ if (user_stub && !is_default_stub) { - char *pos = php_stristr(ZSTR_VAL(user_stub), halt_stub, ZSTR_LEN(user_stub), strlen(halt_stub)); + const char *pos = php_stristr(ZSTR_VAL(user_stub), halt_stub, ZSTR_LEN(user_stub), strlen(halt_stub)); if (pos == NULL) { spprintf(error, 0, "illegal stub for zip-based phar \"%s\"", phar->fname); From 8d28c0562b70f6b0512ad7c05780cc51a43709bc Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 17 Apr 2026 18:53:08 +0100 Subject: [PATCH 252/300] ext/phar: refactor phar_split_fname() to return zend_string* rather than out params (#21777) --- ext/phar/dirstream.c | 20 +++--- ext/phar/func_interceptors.c | 64 ++++++++--------- ext/phar/phar.c | 27 +++++--- ext/phar/phar_internal.h | 3 +- ext/phar/phar_object.c | 131 ++++++++++++++++------------------- ext/phar/stream.c | 16 ++--- ext/phar/util.c | 38 +++++----- 7 files changed, 147 insertions(+), 152 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index c486fd41abfd..64cace889922 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -345,21 +345,21 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo { phar_entry_info entry, *e; phar_archive_data *phar = NULL; - char *error, *arch; - size_t arch_len; + char *error; php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, NULL, 2, 2)) { + zend_string *arch = phar_split_fname(url_from, strlen(url_from), NULL, 2, 2); + if (!arch) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", no phar archive specified", url_from); return 0; } - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { + if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL)) { phar = NULL; } - efree(arch); + zend_string_release_ex(arch, false); if (PHAR_G(readonly) && (!phar || !phar->is_data)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", write operations disabled", url_from); @@ -471,21 +471,21 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options { phar_entry_info *entry; phar_archive_data *phar = NULL; - char *error, *arch; - size_t arch_len; + char *error; php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ - if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, NULL, 2, 2)) { + zend_string *arch = phar_split_fname(url, strlen(url), NULL, 2, 2); + if (!arch) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url); return 0; } - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { + if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL)) { phar = NULL; } - efree(arch); + zend_string_release_ex(arch, false); if (PHAR_G(readonly) && (!phar || !phar->is_data)) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot rmdir directory \"%s\", write operations disabled", url); diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 0e7d2df0db61..20ce0e8d7258 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -38,8 +38,6 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch; - size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -48,7 +46,8 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (arch) { php_stream_context *context = NULL; php_stream *stream; char *name; @@ -58,12 +57,12 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ zend_string *entry = phar_fix_filepath(filename, filename_len, true); if (ZSTR_VAL(entry)[0] == '/') { - spprintf(&name, 4096, "phar://%s%s", arch, ZSTR_VAL(entry)); + spprintf(&name, 4096, "phar://%s%s", ZSTR_VAL(arch), ZSTR_VAL(entry)); } else { - spprintf(&name, 4096, "phar://%s/%s", arch, ZSTR_VAL(entry)); + spprintf(&name, 4096, "phar://%s/%s", ZSTR_VAL(arch), ZSTR_VAL(entry)); } zend_string_release_ex(entry, false); - efree(arch); + zend_string_release_ex(arch, false); if (zcontext) { context = php_stream_context_from_zval(zcontext, 0); } @@ -84,8 +83,6 @@ PHP_FUNCTION(phar_opendir) /* {{{ */ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool using_include_path) { - char *arch; - size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -94,15 +91,16 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool return NULL; } - if (FAILURE == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (!arch) { return NULL; } /* fopen within phar, if :// is not in the url, then prepend phar:/// */ /* retrieving a file defaults to within the current directory, so use this if possible */ phar_archive_data *phar; - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { - efree(arch); + if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL)) { + zend_string_release_ex(arch, false); return NULL; } @@ -110,7 +108,7 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool if (using_include_path) { if (!(name = phar_find_in_include_path(filename, NULL))) { /* this file is not in the phar, use the original path */ - efree(arch); + zend_string_release_ex(arch, false); return NULL; } } else { @@ -124,24 +122,24 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool /* this file is not in the phar, use the original path */ if (!is_in_phar) { zend_string_release_ex(entry, false); - efree(arch); + zend_string_release_ex(arch, false); return NULL; } /* auto-convert to phar:// */ if (ZSTR_VAL(entry)[0] == '/') { - ZEND_ASSERT(strlen("phar://") + arch_len + ZSTR_LEN(entry) < 4096); + ZEND_ASSERT(strlen("phar://") + ZSTR_LEN(arch) + ZSTR_LEN(entry) < 4096); name = zend_string_concat3( "phar://", strlen("phar://"), - arch, arch_len, + ZSTR_VAL(arch), ZSTR_LEN(arch), ZSTR_VAL(entry), ZSTR_LEN(entry) ); } else { - name = strpprintf(4096, "phar://%s/%s", arch, ZSTR_VAL(entry)); + name = strpprintf(4096, "phar://%s/%s", ZSTR_VAL(arch), ZSTR_VAL(entry)); } zend_string_release_ex(entry, false); } - efree(arch); + zend_string_release_ex(arch, false); return name; } @@ -492,12 +490,12 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ phar = PHAR_G(last_phar); goto splitted; } - char *arch; - size_t arch_len; - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { + + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (arch) { /* fopen within phar, if :// is not in the url, then prepend phar:/// */ - zend_result has_archive = phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL); - efree(arch); + zend_result has_archive = phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL); + zend_string_release_ex(arch, false); if (FAILURE == has_archive) { goto skip_phar; } @@ -721,8 +719,6 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ goto skip_phar; } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch; - size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -731,12 +727,15 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (arch) { phar_archive_data *phar; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ /* retrieving a file within the current directory, so use this if possible */ - if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { + zend_result has_archive = phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL); + zend_string_release_ex(arch, false); + if (has_archive == SUCCESS) { phar_entry_info *etemp; zend_string *entry = phar_fix_filepath(filename, filename_len, true); @@ -747,12 +746,10 @@ PHP_FUNCTION(phar_is_file) /* {{{ */ } zend_string_release_ex(entry, false); if (etemp) { - efree(arch); RETURN_BOOL(!etemp->is_dir); } /* this file is not in the current directory, use the original path */ } - efree(arch); RETURN_FALSE; } } @@ -779,8 +776,6 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ goto skip_phar; } if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { - char *arch; - size_t arch_len; zend_string *fname = zend_get_executed_filename_ex(); /* we are checking for existence of a file within the relative path. Chances are good that this is @@ -789,12 +784,15 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ goto skip_phar; } - if (SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0)) { + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (arch) { phar_archive_data *phar; /* fopen within phar, if :// is not in the url, then prepend phar:/// */ /* retrieving a file within the current directory, so use this if possible */ - if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { + zend_result has_archive = phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL); + zend_string_release_ex(arch, false); + if (has_archive == SUCCESS) { phar_entry_info *etemp; zend_string *entry = phar_fix_filepath(filename, filename_len, true); @@ -805,11 +803,9 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ } zend_string_release_ex(entry, false); if (etemp) { - efree(arch); RETURN_BOOL(etemp->link); } } - efree(arch); RETURN_FALSE; } } diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 5fb6c864be74..3008316f6274 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2164,7 +2164,7 @@ zend_string* phar_fix_filepath(const char *path, size_t path_length, bool use_cw * * This is used by phar_parse_url() */ -zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, zend_string **entry, int executable, int for_create) /* {{{ */ +zend_string* phar_split_fname_ex(const char *filename, size_t filename_len, zend_string **entry, int executable, int for_create, const char **error) /* {{{ */ { const char *ext_str; #ifdef PHP_WIN32 @@ -2172,8 +2172,11 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a #endif size_t ext_len; + if (error) { + *error = NULL; + } if (zend_char_has_nul_byte(filename, filename_len)) { - return FAILURE; + return NULL; } if (!strncasecmp(filename, "phar://", 7)) { @@ -2191,12 +2194,12 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a #endif if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, false) == FAILURE) { if (ext_len != -1) { - if (!ext_str) { + if (!ext_str && error) { /* no / detected, restore arch for error message */ #ifdef PHP_WIN32 - *arch = save; + *error = save; #else - *arch = (char*)filename; + *error = filename; #endif } @@ -2205,19 +2208,19 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a efree((char *)filename); } #endif - return FAILURE; + return NULL; } ext_len = 0; /* no extension detected - instead we are dealing with an alias */ } - *arch_len = ext_str - filename + ext_len; - *arch = estrndup(filename, *arch_len); + size_t arch_len = ext_str - filename + ext_len; + zend_string *arch = zend_string_init(filename, arch_len, false); if (entry) { if (ext_str[ext_len]) { - size_t computed_entry_len = filename_len - *arch_len; + size_t computed_entry_len = filename_len - arch_len; /* We don't need to unixify the path on Windows, * as ext_str is derived from filename that was already unixify */ *entry = phar_fix_filepath(ext_str+ext_len, computed_entry_len, false); @@ -2232,10 +2235,14 @@ zend_result phar_split_fname(const char *filename, size_t filename_len, char **a } #endif - return SUCCESS; + return arch; } /* }}} */ +zend_string* phar_split_fname(const char *filename, size_t filename_len, zend_string **entry, int executable, int for_create) { + return phar_split_fname_ex(filename, filename_len, entry, executable, for_create, NULL); +} + /** * Invoked when a user calls Phar::mapPhar() from within an executing .phar * to set up its manifest directly diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index a60c5ed5d432..34f221f43e0e 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -474,7 +474,8 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, co ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_flush_ex(phar_archive_data *archive, zend_string *user_stub, bool is_default_stub, char **error); ZEND_ATTRIBUTE_NONNULL int phar_flush(phar_archive_data *archive, char **error); zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const char **ext_str, size_t *ext_len, int executable, int for_create, bool is_complete); -zend_result phar_split_fname(const char *filename, size_t filename_len, char **arch, size_t *arch_len, zend_string **entry, int executable, int for_create); +zend_string* phar_split_fname_ex(const char *filename, size_t filename_len, zend_string **entry, int executable, int for_create, const char **error); +zend_string* phar_split_fname(const char *filename, size_t filename_len, zend_string **entry, int executable, int for_create); typedef enum { pcr_use_query, diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f97240010d48..07058eefc461 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -403,33 +403,27 @@ static void phar_postprocess_ru_web(char *fname, size_t fname_len, char *entry, */ PHP_METHOD(Phar, running) { - zend_string *fname; - char *arch; - size_t arch_len; bool retphar = true; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) { RETURN_THROWS(); } - fname = zend_get_executed_filename_ex(); + const zend_string *fname = zend_get_executed_filename_ex(); if (!fname) { RETURN_EMPTY_STRING(); } - if ( - zend_string_starts_with_literal_ci(fname, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 2, 0) - ) { - if (retphar) { - RETVAL_STRINGL(ZSTR_VAL(fname), arch_len + 7); - efree(arch); - return; - } else { - // TODO: avoid reallocation ??? - RETVAL_STRINGL(arch, arch_len); - efree(arch); - return; + if (zend_string_starts_with_literal_ci(fname, "phar://")) { + zend_string *arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 2, 0); + if (arch) { + if (retphar) { + RETVAL_STRINGL(ZSTR_VAL(fname), ZSTR_LEN(arch) + 7); + zend_string_release_ex(arch, false); + return; + } else { + RETURN_STR(arch); + } } } @@ -444,8 +438,8 @@ PHP_METHOD(Phar, running) */ PHP_METHOD(Phar, mount) { - char *fname, *arch = NULL, *path, *actual; - size_t fname_len, arch_len; + char *fname, *path, *actual; + size_t fname_len; size_t path_len, actual_len; phar_archive_data *pphar; #ifdef PHP_WIN32 @@ -477,31 +471,29 @@ PHP_METHOD(Phar, mount) #endif zend_string *entry = NULL; - if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, NULL, 2, 0)) { + zend_string *arch = NULL; + if (fname_len > 7 && !memcmp(fname, "phar://", 7) && (arch = phar_split_fname(fname, fname_len, NULL, 2, 0))) { if (path_len > 7 && !memcmp(path, "phar://", 7)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path); - efree(arch); + zend_string_release_ex(arch, false); goto finish; } carry_on2: - if (NULL == (pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), arch, arch_len))) { - if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, arch, arch_len))) { + if (NULL == (pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), arch))) { + if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_find_ptr(&cached_phars, arch))) { if (SUCCESS == phar_copy_on_write(&pphar)) { goto carry_on; } } - zend_throw_exception_ex(phar_ce_PharException, 0, "%s is not a phar archive, cannot mount", arch); - - if (arch) { - efree(arch); - } + zend_throw_exception_ex(phar_ce_PharException, 0, "%s is not a phar archive, cannot mount", ZSTR_VAL(arch)); + zend_string_release_ex(arch, false); goto finish; } carry_on: if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch); + zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, ZSTR_VAL(arch)); } if (entry && path == ZSTR_VAL(entry)) { @@ -509,7 +501,7 @@ PHP_METHOD(Phar, mount) } if (arch) { - efree(arch); + zend_string_release_ex(arch, false); } goto finish; @@ -521,7 +513,7 @@ PHP_METHOD(Phar, mount) } goto carry_on; - } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, 2, 0)) { + } else if ((arch = phar_split_fname(path, path_len, &entry, 2, 0))) { path = ZSTR_VAL(entry); path_len = ZSTR_LEN(entry); goto carry_on2; @@ -1077,9 +1069,8 @@ static const spl_other_handler phar_spl_foreign_handler = { */ PHP_METHOD(Phar, __construct) { - char *fname, *alias = NULL, *error, *arch = NULL, *save_fname; + char *fname, *alias = NULL, *error, *save_fname; size_t fname_len, alias_len = 0; - size_t arch_len; bool is_data; zend_long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS; zend_long format = 0; @@ -1108,27 +1099,19 @@ PHP_METHOD(Phar, __construct) save_fname = fname; zend_string *entry = NULL; - if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, !is_data, 2)) { + /* phar_split_fname() will unixify the path */ + zend_string *arch = phar_split_fname(fname, fname_len, &entry, !is_data, 2); + if (arch) { /* use arch (the basename for the archive) for fname instead of fname */ /* this allows support for RecursiveDirectoryIterator of subdirectories */ -#ifdef PHP_WIN32 - phar_unixify_path_separators(arch, arch_len); -#endif - fname = arch; - fname_len = arch_len; -#ifdef PHP_WIN32 - } else { - arch = estrndup(fname, fname_len); - arch_len = fname_len; - fname = arch; - phar_unixify_path_separators(arch, arch_len); -#endif + fname = ZSTR_VAL(arch); + fname_len = ZSTR_LEN(arch); } if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error) == FAILURE) { - if (fname == arch && fname != save_fname) { - efree(arch); + if (arch && fname == ZSTR_VAL(arch) && fname != save_fname) { + zend_string_release_ex(arch, false); fname = save_fname; } @@ -1153,8 +1136,8 @@ PHP_METHOD(Phar, __construct) phar_data->is_tar = false; } - if (fname == arch) { - efree(arch); + if (arch && fname == ZSTR_VAL(arch)) { + zend_string_release_ex(arch, false); fname = save_fname; } @@ -1260,9 +1243,8 @@ PHP_METHOD(Phar, getSupportedCompression) /* {{{ Completely remove a phar archive from memory and disk */ PHP_METHOD(Phar, unlinkArchive) { - char *fname, *error, *arch; + char *fname, *error; size_t fname_len; - size_t arch_len; phar_archive_data *phar; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) { @@ -1284,19 +1266,17 @@ PHP_METHOD(Phar, unlinkArchive) RETURN_THROWS(); } - zend_string *zend_file_name = zend_get_executed_filename_ex(); - - if ( - zend_file_name - && zend_string_starts_with_literal_ci(zend_file_name, "phar://") - && SUCCESS == phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), &arch, &arch_len, NULL, 2, 0) - ) { - if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname); - efree(arch); - RETURN_THROWS(); + const zend_string *zend_file_name = zend_get_executed_filename_ex(); + if (zend_file_name && zend_string_starts_with_literal_ci(zend_file_name, "phar://")) { + zend_string *arch = phar_split_fname(ZSTR_VAL(zend_file_name), ZSTR_LEN(zend_file_name), NULL, 2, 0); + if (arch) { + if (ZSTR_LEN(arch) == fname_len && !memcmp(ZSTR_VAL(arch), fname, ZSTR_LEN(arch))) { + zend_string_release_ex(arch, false); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname); + RETURN_THROWS(); + } + zend_string_release_ex(arch, false); } - efree(arch); } if (phar->is_persistent) { @@ -4395,9 +4375,8 @@ PHP_METHOD(Phar, extractTo) /* {{{ Construct a Phar entry object */ PHP_METHOD(PharFileInfo, __construct) { - char *fname, *arch, *error; + char *fname, *error; size_t fname_len; - size_t arch_len; phar_entry_object *entry_obj; phar_archive_data *phar_data; zval arg1; @@ -4413,15 +4392,22 @@ PHP_METHOD(PharFileInfo, __construct) RETURN_THROWS(); } + if (fname_len < 7 || memcmp(fname, "phar://", 7)) { + zend_throw_exception_ex(spl_ce_RuntimeException, 0, + "'%s' is not a valid phar archive URL (must have at least phar://filename.phar)", fname); + RETURN_THROWS(); + } + zend_string *entry = NULL; - if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, 2, 0) == FAILURE) { + zend_string *arch = phar_split_fname(fname, fname_len, &entry, 2, 0); + if (!arch) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, "'%s' is not a valid phar archive URL (must have at least phar://filename.phar)", fname); RETURN_THROWS(); } - if (phar_open_from_filename(arch, arch_len, NULL, 0, REPORT_ERRORS, &phar_data, &error) == FAILURE) { - efree(arch); + if (phar_open_from_filename(ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, REPORT_ERRORS, &phar_data, &error) == FAILURE) { + zend_string_release_ex(arch, false); efree(entry); if (error) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, @@ -4437,14 +4423,15 @@ PHP_METHOD(PharFileInfo, __construct) phar_entry_info *entry_info = phar_get_entry_info_dir(phar_data, ZSTR_VAL(entry), ZSTR_LEN(entry), 1, &error, true); if (UNEXPECTED(!entry_info)) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Cannot access phar file entry '%s' in archive '%s'%s%s", ZSTR_VAL(entry), arch, error ? ", " : "", error ? error : ""); + "Cannot access phar file entry '%s' in archive '%s'%s%s", + ZSTR_VAL(entry), ZSTR_VAL(arch), error ? ", " : "", error ? error : ""); zend_string_release_ex(entry, false); - efree(arch); + zend_string_release_ex(arch, false); RETURN_THROWS(); } zend_string_release_ex(entry, false); - efree(arch); + zend_string_release_ex(arch, false); entry_obj->entry = entry_info; if (!entry_info->is_persistent && !entry_info->is_temp_dir) { diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 4b49703b4abe..455f403b597b 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -58,8 +58,7 @@ const php_stream_wrapper php_stream_phar_wrapper = { php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options) /* {{{ */ { php_url *resource; - char *arch = NULL, *error; - size_t arch_len; + char *error; if (strncasecmp(filename, "phar://", 7)) { return NULL; @@ -70,12 +69,14 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const } return NULL; } + zend_string *entry = NULL; - if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, 2, (mode[0] == 'w' ? 2 : 0)) == FAILURE) { + const char *arch_error = NULL; + zend_string *arch = phar_split_fname_ex(filename, strlen(filename), &entry, 2, (mode[0] == 'w' ? 2 : 0), &arch_error); + if (!arch) { if (!(options & PHP_STREAM_URL_STAT_QUIET)) { - if (arch && !entry) { - php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch); - arch = NULL; + if (arch_error && !entry) { + php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch_error); } else { php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url or non-existent phar \"%s\"", filename); } @@ -84,8 +85,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const } resource = ecalloc(1, sizeof(php_url)); resource->scheme = ZSTR_INIT_LITERAL("phar", 0); - resource->host = zend_string_init(arch, arch_len, 0); - efree(arch); + resource->host = arch; resource->path = entry; #ifdef MBO_0 diff --git a/ext/phar/util.c b/ext/phar/util.c index 8af0c488f5ca..ef07460559c9 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -266,8 +266,8 @@ zend_result phar_mount_entry(phar_archive_data *phar, const char *filename, size zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data **pphar) /* {{{ */ { zend_string *ret; - char *path, *arch; - size_t arch_len; + char *path; + zend_string *arch; phar_archive_data *phar; if (pphar) { @@ -294,19 +294,22 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data && ZSTR_LEN(fname) - length_phar_protocol >= PHAR_G(last_phar_name_len) && !memcmp(ZSTR_VAL(fname) + length_phar_protocol, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len)) ) { - arch = estrndup(PHAR_G(last_phar_name), PHAR_G(last_phar_name_len)); - arch_len = PHAR_G(last_phar_name_len); + arch = zend_string_init(PHAR_G(last_phar_name), PHAR_G(last_phar_name_len), false); phar = PHAR_G(last_phar); goto splitted; } - if (!is_file_a_phar_wrapper || SUCCESS != phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), &arch, &arch_len, NULL, 1, 0)) { + if (!is_file_a_phar_wrapper) { + return NULL; + } + arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 1, 0); + if (!arch) { return NULL; } if (*ZSTR_VAL(filename) == '.') { - if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { - efree(arch); + if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(arch), ZSTR_LEN(arch), NULL, 0, NULL)) { + zend_string_release_ex(arch, false); return NULL; } splitted: @@ -319,42 +322,43 @@ zend_string *phar_find_in_include_path(zend_string *filename, phar_archive_data if (zend_hash_str_exists(&(phar->manifest), ZSTR_VAL(test) + 1, ZSTR_LEN(test) - 1)) { ret = zend_string_concat3( "phar://", strlen("phar://"), - arch, arch_len, + ZSTR_VAL(arch), ZSTR_LEN(arch), ZSTR_VAL(test), ZSTR_LEN(test) ); zend_string_release_ex(test, false); - efree(arch); + zend_string_release_ex(arch, false); return ret; } } else { if (zend_hash_exists(&(phar->manifest), test)) { - ret = strpprintf(0, "phar://%s/%s", arch, ZSTR_VAL(test)); + ret = strpprintf(0, "phar://%s/%s", ZSTR_VAL(arch), ZSTR_VAL(test)); zend_string_release_ex(test, false); - efree(arch); + zend_string_release_ex(arch, false); return ret; } } zend_string_release_ex(test, false); } - spprintf(&path, MAXPATHLEN + 1 + strlen(PG(include_path)), "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path)); - efree(arch); + spprintf(&path, MAXPATHLEN + 1 + strlen(PG(include_path)), "phar://%s/%s%c%s", ZSTR_VAL(arch), PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path)); + zend_string_release_ex(arch, false); ret = php_resolve_path(ZSTR_VAL(filename), ZSTR_LEN(filename), path); efree(path); if (ret && zend_string_starts_with_literal_ci(ret, "phar://")) { /* found phar:// */ - if (SUCCESS != phar_split_fname(ZSTR_VAL(ret), ZSTR_LEN(ret), &arch, &arch_len, NULL, 1, 0)) { + arch = phar_split_fname(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, 1, 0); + if (!arch) { return ret; } - *pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), arch, arch_len); + *pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), arch); if (!*pphar && PHAR_G(manifest_cached)) { - *pphar = zend_hash_str_find_ptr(&cached_phars, arch, arch_len); + *pphar = zend_hash_find_ptr(&cached_phars, arch); } - efree(arch); + zend_string_release_ex(arch, false); } return ret; From ce3a2406d80aa8fb75c491b0634c34c0d34abc92 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 17 Apr 2026 19:04:47 +0100 Subject: [PATCH 253/300] ext/phar/utils.c: Change if guard to assertion in phar_get_link_location() This condition is checked before calling it at the unique call site, effectively being dead code. An assertion is clearer. --- ext/phar/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/phar/util.c b/ext/phar/util.c index ef07460559c9..43ed4dd24824 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -41,9 +41,9 @@ static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, ze static char *phar_get_link_location(phar_entry_info *entry) /* {{{ */ { char *p, *ret = NULL; - if (!entry->link) { - return NULL; - } + + ZEND_ASSERT(entry->link); + if (entry->link[0] == '/') { return estrdup(entry->link + 1); } From 4b4ba03b67d8abed9cc4ef1be3cc8b5cf75b8c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 17 Apr 2026 22:39:32 +0200 Subject: [PATCH 254/300] gen_stub: fix invalid C variable name for namespaced types in union/intersection type list (#21717) When generating a union or intersection type list with multiple class types, the variable holding each zend_string* was declared using toVarEscapedName() (backslashes replaced by underscores), but the subsequent ZEND_TYPE_INIT_CLASS() reference used toEscapedName() (backslashes escaped as \\), producing an invalid C identifier. --- build/gen_stub.php | 4 +-- ext/zend_test/test.c | 2 ++ ext/zend_test/test.stub.php | 4 +++ ext/zend_test/test_arginfo.h | 38 ++++++++++++++++++++++- ext/zend_test/test_decl.h | 8 ++--- ext/zend_test/test_legacy_arginfo.h | 24 +++++++++++++- ext/zend_test/tests/gen_stub_test_01.phpt | 8 +++++ 7 files changed, 80 insertions(+), 8 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index ce1a23866610..c189abd03471 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2375,8 +2375,8 @@ protected function getTypeCode(string $variableLikeName, string &$code): string $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n"; foreach ($arginfoType->classTypes as $k => $classType) { - $escapedClassName = $classType->toEscapedName(); - $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$escapedClassName}, 0, 0);\n"; + $varEscapedClassName = $classType->toVarEscapedName(); + $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName}, 0, 0);\n"; } $typeMaskCode = $this->type->toArginfoType()->toTypeMask(); diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 02252a2d43ed..96f8db83c116 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -65,6 +65,7 @@ static zend_class_entry *zend_test_forbid_dynamic_call; static zend_class_entry *zend_test_ns_foo_class; static zend_class_entry *zend_test_ns_unlikely_compile_error_class; static zend_class_entry *zend_test_ns_not_unlikely_compile_error_class; +static zend_class_entry *zend_test_ns_bar_class; static zend_class_entry *zend_test_ns2_foo_class; static zend_class_entry *zend_test_ns2_ns_foo_class; static zend_class_entry *zend_test_unit_enum; @@ -1567,6 +1568,7 @@ PHP_MINIT_FUNCTION(zend_test) zend_test_ns_foo_class = register_class_ZendTestNS_Foo(); zend_test_ns_unlikely_compile_error_class = register_class_ZendTestNS_UnlikelyCompileError(); zend_test_ns_not_unlikely_compile_error_class = register_class_ZendTestNS_NotUnlikelyCompileError(); + zend_test_ns_bar_class = register_class_ZendTestNS_Bar(); zend_test_ns2_foo_class = register_class_ZendTestNS2_Foo(); zend_test_ns2_ns_foo_class = register_class_ZendTestNS2_ZendSubNS_Foo(); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index e102082c6a95..f4844eb0681f 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -363,6 +363,8 @@ class Foo { public function method(): int {} } + interface Bar {} + class UnlikelyCompileError { /* This method signature would create a compile error due to the string * "ZendTestNS\UnlikelyCompileError" in the generated macro call */ @@ -383,6 +385,8 @@ public function method(): ?NotUnlikelyCompileError {} class Foo { public ZendSubNS\Foo $foo; + public ZendSubNS\Foo&\ZendTestNS\Bar $intersectionProp; + public ZendSubNS\Foo|\ZendTestNS\Bar $unionProp; public function method(): void {} } diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 30297234fc87..d2bdbd72db47 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 46178f5fa88681da91d831250f2f00c45e914624 + * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) @@ -1294,6 +1294,16 @@ static zend_class_entry *register_class_ZendTestNS_Foo(void) return class_entry; } +static zend_class_entry *register_class_ZendTestNS_Bar(void) +{ + zend_class_entry ce, *class_entry; + + INIT_NS_CLASS_ENTRY(ce, "ZendTestNS", "Bar", NULL); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + static zend_class_entry *register_class_ZendTestNS_UnlikelyCompileError(void) { zend_class_entry ce, *class_entry; @@ -1340,6 +1350,32 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zend_declare_typed_property(class_entry, property_foo_name, &property_foo_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_foo_class_ZendTestNS2_ZendSubNS_Foo, 0, 0)); zend_string_release_ex(property_foo_name, true); + zval property_intersectionProp_default_value; + ZVAL_UNDEF(&property_intersectionProp_default_value); + zend_string *property_intersectionProp_name = zend_string_init("intersectionProp", sizeof("intersectionProp") - 1, true); + zend_string *property_intersectionProp_class_ZendTestNS2_ZendSubNS_Foo = zend_string_init("ZendTestNS2\\ZendSubNS\\Foo", sizeof("ZendTestNS2\\ZendSubNS\\Foo") - 1, 1); + zend_string *property_intersectionProp_class_ZendTestNS_Bar = zend_string_init("ZendTestNS\\Bar", sizeof("ZendTestNS\\Bar") - 1, 1); + zend_type_list *property_intersectionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); + property_intersectionProp_type_list->num_types = 2; + property_intersectionProp_type_list->types[0] = (zend_type) ZEND_TYPE_INIT_CLASS(property_intersectionProp_class_ZendTestNS2_ZendSubNS_Foo, 0, 0); + property_intersectionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_intersectionProp_class_ZendTestNS_Bar, 0, 0); + zend_type property_intersectionProp_type = ZEND_TYPE_INIT_INTERSECTION(property_intersectionProp_type_list, 0); + zend_declare_typed_property(class_entry, property_intersectionProp_name, &property_intersectionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_intersectionProp_type); + zend_string_release_ex(property_intersectionProp_name, true); + + zval property_unionProp_default_value; + ZVAL_UNDEF(&property_unionProp_default_value); + zend_string *property_unionProp_name = zend_string_init("unionProp", sizeof("unionProp") - 1, true); + zend_string *property_unionProp_class_ZendTestNS2_ZendSubNS_Foo = zend_string_init("ZendTestNS2\\ZendSubNS\\Foo", sizeof("ZendTestNS2\\ZendSubNS\\Foo") - 1, 1); + zend_string *property_unionProp_class_ZendTestNS_Bar = zend_string_init("ZendTestNS\\Bar", sizeof("ZendTestNS\\Bar") - 1, 1); + zend_type_list *property_unionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); + property_unionProp_type_list->num_types = 2; + property_unionProp_type_list->types[0] = (zend_type) ZEND_TYPE_INIT_CLASS(property_unionProp_class_ZendTestNS2_ZendSubNS_Foo, 0, 0); + property_unionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_unionProp_class_ZendTestNS_Bar, 0, 0); + zend_type property_unionProp_type = ZEND_TYPE_INIT_UNION(property_unionProp_type_list, 0); + zend_declare_typed_property(class_entry, property_unionProp_name, &property_unionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_unionProp_type); + zend_string_release_ex(property_unionProp_name, true); + return class_entry; } diff --git a/ext/zend_test/test_decl.h b/ext/zend_test/test_decl.h index ed0874f51e72..816e03919a13 100644 --- a/ext/zend_test/test_decl.h +++ b/ext/zend_test/test_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 46178f5fa88681da91d831250f2f00c45e914624 */ + * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f */ -#ifndef ZEND_TEST_DECL_46178f5fa88681da91d831250f2f00c45e914624_H -#define ZEND_TEST_DECL_46178f5fa88681da91d831250f2f00c45e914624_H +#ifndef ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H +#define ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H typedef enum zend_enum_ZendTestUnitEnum { ZEND_ENUM_ZendTestUnitEnum_Foo = 1, @@ -27,4 +27,4 @@ typedef enum zend_enum_ZendTestEnumWithInterface { ZEND_ENUM_ZendTestEnumWithInterface_Bar = 2, } zend_enum_ZendTestEnumWithInterface; -#endif /* ZEND_TEST_DECL_46178f5fa88681da91d831250f2f00c45e914624_H */ +#endif /* ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H */ diff --git a/ext/zend_test/test_legacy_arginfo.h b/ext/zend_test/test_legacy_arginfo.h index 3dcdad8ff6c7..b4a07503ad0f 100644 --- a/ext/zend_test/test_legacy_arginfo.h +++ b/ext/zend_test/test_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 46178f5fa88681da91d831250f2f00c45e914624 + * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f * Has decl header: yes */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, 0) @@ -1029,6 +1029,16 @@ static zend_class_entry *register_class_ZendTestNS_Foo(void) return class_entry; } +static zend_class_entry *register_class_ZendTestNS_Bar(void) +{ + zend_class_entry ce, *class_entry; + + INIT_NS_CLASS_ENTRY(ce, "ZendTestNS", "Bar", NULL); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + static zend_class_entry *register_class_ZendTestNS_UnlikelyCompileError(void) { zend_class_entry ce, *class_entry; @@ -1074,6 +1084,18 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zend_declare_property_ex(class_entry, property_foo_name, &property_foo_default_value, ZEND_ACC_PUBLIC, NULL); zend_string_release_ex(property_foo_name, true); + zval property_intersectionProp_default_value; + ZVAL_NULL(&property_intersectionProp_default_value); + zend_string *property_intersectionProp_name = zend_string_init("intersectionProp", sizeof("intersectionProp") - 1, true); + zend_declare_property_ex(class_entry, property_intersectionProp_name, &property_intersectionProp_default_value, ZEND_ACC_PUBLIC, NULL); + zend_string_release_ex(property_intersectionProp_name, true); + + zval property_unionProp_default_value; + ZVAL_NULL(&property_unionProp_default_value); + zend_string *property_unionProp_name = zend_string_init("unionProp", sizeof("unionProp") - 1, true); + zend_declare_property_ex(class_entry, property_unionProp_name, &property_unionProp_default_value, ZEND_ACC_PUBLIC, NULL); + zend_string_release_ex(property_unionProp_name, true); + return class_entry; } diff --git a/ext/zend_test/tests/gen_stub_test_01.phpt b/ext/zend_test/tests/gen_stub_test_01.phpt index 0f5d525322d6..3126eb61631f 100644 --- a/ext/zend_test/tests/gen_stub_test_01.phpt +++ b/ext/zend_test/tests/gen_stub_test_01.phpt @@ -18,11 +18,19 @@ var_dump($foo); object(ZendTestNS2\Foo)#%d (%d) { ["foo"]=> uninitialized(ZendTestNS2\ZendSubNS\Foo) + ["intersectionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) + ["unionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) } object(ZendTestNS2\Foo)#%d (%d) { ["foo"]=> object(ZendTestNS2\ZendSubNS\Foo)#%d (%d) { } + ["intersectionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) + ["unionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) } object(ZendTestNS\UnlikelyCompileError)#%d (%d) { } From fa5ab4fcc1c304d45ca188ee7938af85f6e97387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 17 Apr 2026 23:45:34 +0200 Subject: [PATCH 255/300] gen_stub: support use statements in stub files (#21784) Stmt\Use_ and Stmt\GroupUse nodes were not handled in handleStatements(), causing an "Unexpected node" exception when use statements appeared in stub files. Since NameResolver resolves all names to their fully qualified form before handleStatements() runs, these nodes can simply be skipped. --- build/gen_stub.php | 5 +++++ ext/zend_test/test.stub.php | 7 +++++++ ext/zend_test/test_arginfo.h | 23 ++++++++++++++++++++++- ext/zend_test/test_decl.h | 8 ++++---- ext/zend_test/test_legacy_arginfo.h | 20 +++++++++++++++++++- ext/zend_test/tests/gen_stub_test_01.phpt | 12 ++++++++++++ 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index c189abd03471..eca1ab3e8c13 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -4261,6 +4261,11 @@ private function handleStatements(array $stmts, PrettyPrinterAbstract $prettyPri continue; } + if ($stmt instanceof Stmt\Use_ || $stmt instanceof Stmt\GroupUse) { + // use statements are resolved by NameResolver before this point + continue; + } + if ($stmt instanceof Stmt\Const_) { foreach ($stmt->consts as $const) { $this->constInfos[] = parseConstLike( diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index f4844eb0681f..c9d367d5553f 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -380,6 +380,10 @@ public function method(): ?NotUnlikelyCompileError {} namespace ZendTestNS2 { + use ZendTestNS\Foo as FooAlias; + use ZendTestNS\UnlikelyCompileError; + use ZendTestNS\{NotUnlikelyCompileError}; + /** @var string */ const ZEND_CONSTANT_A = "namespaced"; @@ -387,6 +391,9 @@ class Foo { public ZendSubNS\Foo $foo; public ZendSubNS\Foo&\ZendTestNS\Bar $intersectionProp; public ZendSubNS\Foo|\ZendTestNS\Bar $unionProp; + public FooAlias $fooAlias; + public UnlikelyCompileError $unlProp; + public NotUnlikelyCompileError $notUnlProp; public function method(): void {} } diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index d2bdbd72db47..a4da05df2ffb 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f + * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) @@ -1376,6 +1376,27 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zend_declare_typed_property(class_entry, property_unionProp_name, &property_unionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_unionProp_type); zend_string_release_ex(property_unionProp_name, true); + zval property_fooAlias_default_value; + ZVAL_UNDEF(&property_fooAlias_default_value); + zend_string *property_fooAlias_name = zend_string_init("fooAlias", sizeof("fooAlias") - 1, true); + zend_string *property_fooAlias_class_ZendTestNS_Foo = zend_string_init("ZendTestNS\\Foo", sizeof("ZendTestNS\\Foo")-1, 1); + zend_declare_typed_property(class_entry, property_fooAlias_name, &property_fooAlias_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_fooAlias_class_ZendTestNS_Foo, 0, 0)); + zend_string_release_ex(property_fooAlias_name, true); + + zval property_unlProp_default_value; + ZVAL_UNDEF(&property_unlProp_default_value); + zend_string *property_unlProp_name = zend_string_init("unlProp", sizeof("unlProp") - 1, true); + zend_string *property_unlProp_class_ZendTestNS_UnlikelyCompileError = zend_string_init("ZendTestNS\\\125nlikelyCompileError", sizeof("ZendTestNS\\\125nlikelyCompileError")-1, 1); + zend_declare_typed_property(class_entry, property_unlProp_name, &property_unlProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_unlProp_class_ZendTestNS_UnlikelyCompileError, 0, 0)); + zend_string_release_ex(property_unlProp_name, true); + + zval property_notUnlProp_default_value; + ZVAL_UNDEF(&property_notUnlProp_default_value); + zend_string *property_notUnlProp_name = zend_string_init("notUnlProp", sizeof("notUnlProp") - 1, true); + zend_string *property_notUnlProp_class_ZendTestNS_NotUnlikelyCompileError = zend_string_init("ZendTestNS\\\116otUnlikelyCompileError", sizeof("ZendTestNS\\\116otUnlikelyCompileError")-1, 1); + zend_declare_typed_property(class_entry, property_notUnlProp_name, &property_notUnlProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notUnlProp_class_ZendTestNS_NotUnlikelyCompileError, 0, 0)); + zend_string_release_ex(property_notUnlProp_name, true); + return class_entry; } diff --git a/ext/zend_test/test_decl.h b/ext/zend_test/test_decl.h index 816e03919a13..bc2ebaa93c3b 100644 --- a/ext/zend_test/test_decl.h +++ b/ext/zend_test/test_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f */ + * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 */ -#ifndef ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H -#define ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H +#ifndef ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H +#define ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H typedef enum zend_enum_ZendTestUnitEnum { ZEND_ENUM_ZendTestUnitEnum_Foo = 1, @@ -27,4 +27,4 @@ typedef enum zend_enum_ZendTestEnumWithInterface { ZEND_ENUM_ZendTestEnumWithInterface_Bar = 2, } zend_enum_ZendTestEnumWithInterface; -#endif /* ZEND_TEST_DECL_9a23b7d5305982930579428a345ded725ff5145f_H */ +#endif /* ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H */ diff --git a/ext/zend_test/test_legacy_arginfo.h b/ext/zend_test/test_legacy_arginfo.h index b4a07503ad0f..b446a0f9a293 100644 --- a/ext/zend_test/test_legacy_arginfo.h +++ b/ext/zend_test/test_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 9a23b7d5305982930579428a345ded725ff5145f + * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 * Has decl header: yes */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, 0) @@ -1096,6 +1096,24 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zend_declare_property_ex(class_entry, property_unionProp_name, &property_unionProp_default_value, ZEND_ACC_PUBLIC, NULL); zend_string_release_ex(property_unionProp_name, true); + zval property_fooAlias_default_value; + ZVAL_NULL(&property_fooAlias_default_value); + zend_string *property_fooAlias_name = zend_string_init("fooAlias", sizeof("fooAlias") - 1, true); + zend_declare_property_ex(class_entry, property_fooAlias_name, &property_fooAlias_default_value, ZEND_ACC_PUBLIC, NULL); + zend_string_release_ex(property_fooAlias_name, true); + + zval property_unlProp_default_value; + ZVAL_NULL(&property_unlProp_default_value); + zend_string *property_unlProp_name = zend_string_init("unlProp", sizeof("unlProp") - 1, true); + zend_declare_property_ex(class_entry, property_unlProp_name, &property_unlProp_default_value, ZEND_ACC_PUBLIC, NULL); + zend_string_release_ex(property_unlProp_name, true); + + zval property_notUnlProp_default_value; + ZVAL_NULL(&property_notUnlProp_default_value); + zend_string *property_notUnlProp_name = zend_string_init("notUnlProp", sizeof("notUnlProp") - 1, true); + zend_declare_property_ex(class_entry, property_notUnlProp_name, &property_notUnlProp_default_value, ZEND_ACC_PUBLIC, NULL); + zend_string_release_ex(property_notUnlProp_name, true); + return class_entry; } diff --git a/ext/zend_test/tests/gen_stub_test_01.phpt b/ext/zend_test/tests/gen_stub_test_01.phpt index 3126eb61631f..0cda0651bee3 100644 --- a/ext/zend_test/tests/gen_stub_test_01.phpt +++ b/ext/zend_test/tests/gen_stub_test_01.phpt @@ -22,6 +22,12 @@ object(ZendTestNS2\Foo)#%d (%d) { uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) ["unionProp"]=> uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) + ["fooAlias"]=> + uninitialized(ZendTestNS\Foo) + ["unlProp"]=> + uninitialized(ZendTestNS\UnlikelyCompileError) + ["notUnlProp"]=> + uninitialized(ZendTestNS\NotUnlikelyCompileError) } object(ZendTestNS2\Foo)#%d (%d) { ["foo"]=> @@ -31,6 +37,12 @@ object(ZendTestNS2\Foo)#%d (%d) { uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) ["unionProp"]=> uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) + ["fooAlias"]=> + uninitialized(ZendTestNS\Foo) + ["unlProp"]=> + uninitialized(ZendTestNS\UnlikelyCompileError) + ["notUnlProp"]=> + uninitialized(ZendTestNS\NotUnlikelyCompileError) } object(ZendTestNS\UnlikelyCompileError)#%d (%d) { } From ec79850c501b1abd06ea44f3f9feeee84b5ea438 Mon Sep 17 00:00:00 2001 From: Thomas Schiet Date: Thu, 9 Apr 2026 12:18:29 +0200 Subject: [PATCH 256/300] Fix GH-21683: PDOStatement::fetch() throws on empty result With PDO::ATTR_FETCH attribute. close GH-21684. --- NEWS | 4 +++ ext/pdo_pgsql/pgsql_statement.c | 6 ++++ ext/pdo_pgsql/tests/gh21683.phpt | 48 ++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 ext/pdo_pgsql/tests/gh21683.phpt diff --git a/NEWS b/NEWS index b79170b91663..8271d5fe1389 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,10 @@ PHP NEWS . Fix memory leak regression in openssl_pbkdf2(). (ndossche) . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) +- PDO_PGSQL: + . Fixed bug GH-21683 (pdo_pgsql throws with ATTR_PREFETCH=0 + on empty result set). (thomasschiet) + - Random: . Fixed bug GH-21731 (Random\Engine\Xoshiro256StarStar::__unserialize() accepts all-zero state). (iliaal) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index f9320fd86ea8..89f713ffcbff 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -573,6 +573,12 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt, } S->result = PQgetResult(S->H->server); + if (!S->result) { + S->is_running_unbuffered = false; + stmt->row_count = 0; + S->current_row = 0; + return 0; + } status = PQresultStatus(S->result); if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK && status != PGRES_SINGLE_TUPLE) { diff --git a/ext/pdo_pgsql/tests/gh21683.phpt b/ext/pdo_pgsql/tests/gh21683.phpt new file mode 100644 index 000000000000..bd941511767a --- /dev/null +++ b/ext/pdo_pgsql/tests/gh21683.phpt @@ -0,0 +1,48 @@ +--TEST-- +PDO PgSQL single-row mode (ATTR_PREFETCH=0) on empty result set +--EXTENSIONS-- +pdo +pdo_pgsql +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +$pdo->setAttribute(PDO::ATTR_PREFETCH, 0); + +$pdo->exec("CREATE TEMP TABLE empty_t (id int, val text)"); + +echo "=== query / fetch ===\n"; +$stmt = $pdo->query("SELECT * FROM empty_t"); +var_dump($stmt->fetch()); + +echo "=== prepare / fetchAll ===\n"; +$stmt = $pdo->prepare("SELECT * FROM empty_t"); +$stmt->execute(); +var_dump($stmt->fetchAll()); + +echo "=== connection still works ===\n"; +$stmt = $pdo->query("SELECT 1 AS alive"); +var_dump($stmt->fetch(PDO::FETCH_ASSOC)); + +echo "Done\n"; +?> +--EXPECT-- +=== query / fetch === +bool(false) +=== prepare / fetchAll === +array(0) { +} +=== connection still works === +array(1) { + ["alive"]=> + string(1) "1" +} +Done From a28743092398b5f30e3a8973f883d43cbd91f235 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 18 Apr 2026 22:53:02 +0800 Subject: [PATCH 257/300] CONTRIBUTING.md: Update branch status (#21796) --- CONTRIBUTING.md | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f2635e7d4f2..0e13285dd735 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -356,30 +356,21 @@ Having said that, here are the organizational rules: `--enable-zts` switch to ensure your code handles TSRM correctly and doesn't break for those who need that. -Currently, we have the following branches in use: - -| Branch | | -| --------- | --------- | -| master | Active development branch for PHP 8.6, which is open for backwards incompatible changes and major internal API changes. | -| PHP-8.5 | Is used to release the PHP 8.5.x series. This is a current stable version and is open for bugfixes only. | -| PHP-8.4 | Is used to release the PHP 8.4.x series. This is a current stable version and is open for bugfixes only. | -| PHP-8.3 | Is used to release the PHP 8.3.x series. This is a current stable version and is open for bugfixes only. | -| PHP-8.2 | Is used to release the PHP 8.2.x series. This is an old stable version and is open for security fixes only. | -| PHP-8.1 | Is used to release the PHP 8.1.x series. This is an old stable version and is open for security fixes only. | -| PHP-8.0 | This branch is closed. | -| PHP-7.4 | This branch is closed. | -| PHP-7.3 | This branch is closed. | -| PHP-7.2 | This branch is closed. | -| PHP-7.1 | This branch is closed. | -| PHP-7.0 | This branch is closed. | -| PHP-5.6 | This branch is closed. | -| PHP-5.5 | This branch is closed. | -| PHP-5.4 | This branch is closed. | -| PHP-5.3 | This branch is closed. | -| PHP-5.2 | This branch is closed. | -| PHP-5.1 | This branch is closed. | -| PHP-4.4 | This branch is closed. | -| PHP-X.Y.Z | These branches are used for the release managers for tagging the releases, hence they are closed to the general public. | +The master branch is an active development branch for the newest version of PHP, +which is open for backwards incompatible changes and major internal API changes. + +For PHP-X.Y branches, they are used to release the PHP X.Y.z series. Please see +the [supported versions page](https://www.php.net/supported-versions.php) to get +the status of each version. + +If a version is described as "Active support", the corresponding branch is a +current stable version and is open for bugfixes only. If a version is described +as "Security fixes only", the corresponding branch is an old stable version +and is open for security fixes only. If a version is described as "End of life", +the corresponding branch is closed. + +Note that PHP-X.Y.Z branches are used for the release managers for tagging the +releases, hence they are closed to the general public. The next few rules are more of a technical nature: From b33fee51fb7ab5b919faf71507c45e86cf2bd978 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sat, 18 Apr 2026 16:27:22 +0100 Subject: [PATCH 258/300] ext/phar: refactor phar_entry_info.link field (#21790) - Rename field to symlink so that what this field represents is clear - Convert it from a char* to a zend_string* - Refactor the implementation of phar_get_link_location() to always return a "new" zend_string* - Refactor the implementation of phar_get_link_source() to make it more legible --- ext/phar/func_interceptors.c | 6 +-- ext/phar/phar.c | 6 +-- ext/phar/phar_internal.h | 2 +- ext/phar/phar_object.c | 6 +-- ext/phar/stream.c | 7 ++-- ext/phar/tar.c | 14 +++---- ext/phar/util.c | 80 ++++++++++++++++++------------------ 7 files changed, 61 insertions(+), 60 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 20ce0e8d7258..ae52e7189bd1 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -578,7 +578,7 @@ splitted:; if (!data->is_dir) { sb.st_size = data->uncompressed_filesize; sb.st_mode = data->flags & PHAR_ENT_PERM_MASK; - if (data->link) { + if (data->symlink) { sb.st_mode |= S_IFREG|S_IFLNK; /* regular file */ } else { sb.st_mode |= S_IFREG; /* regular file */ @@ -591,7 +591,7 @@ splitted:; sb.st_size = 0; sb.st_mode = data->flags & PHAR_ENT_PERM_MASK; sb.st_mode |= S_IFDIR; /* regular directory */ - if (data->link) { + if (data->symlink) { sb.st_mode |= S_IFLNK; } /* timestamp is just the timestamp when this was added to the phar */ @@ -803,7 +803,7 @@ PHP_FUNCTION(phar_is_link) /* {{{ */ } zend_string_release_ex(entry, false); if (etemp) { - RETURN_BOOL(etemp->link); + RETURN_BOOL(etemp->symlink); } } RETURN_FALSE; diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 3008316f6274..5829d32e615e 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -374,9 +374,9 @@ void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */ zend_string_release_ex(entry->filename, entry->is_persistent); - if (entry->link) { - pefree(entry->link, entry->is_persistent); - entry->link = 0; + if (entry->symlink) { + zend_string_release_ex(entry->symlink, entry->is_persistent); + entry->symlink = NULL; } if (entry->tmp) { diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 34f221f43e0e..db2856309fcb 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -217,7 +217,7 @@ typedef struct _phar_entry_info { unsigned int fileinfo_lock_count; char *tmp; phar_archive_data *phar; - char *link; /* symbolic link to another file */ + zend_string *symlink; char tar_type; /* position in the manifest */ uint32_t manifest_pos; diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 07058eefc461..0af02748407a 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1902,7 +1902,7 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f char *error; zend_off_t offset; - ZEND_ASSERT(!entry->link); + ZEND_ASSERT(!entry->symlink); if (FAILURE == phar_open_entry_fp(entry, &error, true)) { if (error) { @@ -2243,8 +2243,8 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert newentry = *entry; - if (newentry.link) { - newentry.link = estrdup(newentry.link); + if (newentry.symlink) { + zend_string_addref(newentry.symlink); goto no_copy; } diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 455f403b597b..f929aef4fb98 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -368,7 +368,7 @@ static ssize_t phar_stream_read(php_stream *stream, char *buf, size_t count) /* ssize_t got; phar_entry_info *entry; - if (data->internal_file->link) { + if (data->internal_file->symlink) { entry = phar_get_link_source(data->internal_file); } else { entry = data->internal_file; @@ -400,7 +400,7 @@ static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, z int res; zend_ulong temp; - if (data->internal_file->link) { + if (data->internal_file->symlink) { entry = phar_get_link_source(data->internal_file); } else { entry = data->internal_file; @@ -838,7 +838,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from entry->is_deleted = 1; entry->fp = NULL; ZVAL_UNDEF(&entry->metadata_tracker.val); - entry->link = entry->tmp = NULL; + entry->symlink = NULL; + entry->tmp = NULL; source = entry; /* add to the manifest, and then store the pointer to the new guy in entry diff --git a/ext/phar/tar.c b/ext/phar/tar.c index ef356bfc7a28..844f613983f7 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -492,8 +492,8 @@ zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_l entry.is_dir = 0; } - entry.link = NULL; - /* link field is null-terminated unless it has 100 non-null chars. + entry.symlink = NULL; + /* linkname field is null-terminated unless it has 100 non-null chars. * Thus we cannot use strlen. */ linkname_len = zend_strnlen(hdr->linkname, 100); if (entry.tar_type == TAR_LINK) { @@ -506,9 +506,9 @@ zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_l phar_destroy_phar_data(myphar); return FAILURE; } - entry.link = estrndup(hdr->linkname, linkname_len); + entry.symlink = zend_string_init(hdr->linkname, linkname_len, false); } else if (entry.tar_type == TAR_SYMLINK) { - entry.link = estrndup(hdr->linkname, linkname_len); + entry.symlink = zend_string_init(hdr->linkname, linkname_len, false); } phar_set_inode(&entry); @@ -779,10 +779,10 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* /* calc checksum */ header.typeflag = entry->tar_type; - if (entry->link) { - if (strlcpy(header.linkname, entry->link, sizeof(header.linkname)) >= sizeof(header.linkname)) { + if (entry->symlink) { + if (strlcpy(header.linkname, ZSTR_VAL(entry->symlink), sizeof(header.linkname)) >= sizeof(header.linkname)) { if (fp->error) { - spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, link \"%s\" is too long for format", entry->phar->fname, entry->link); + spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, link \"%s\" is too long for format", entry->phar->fname, ZSTR_VAL(entry->symlink)); } return ZEND_HASH_APPLY_STOP; } diff --git a/ext/phar/util.c b/ext/phar/util.c index 43ed4dd24824..bbfcde8d868d 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -38,50 +38,50 @@ static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, ze #endif /* for links to relative location, prepend cwd of the entry */ -static char *phar_get_link_location(phar_entry_info *entry) /* {{{ */ +static zend_string *phar_get_link_location(phar_entry_info *entry) /* {{{ */ { - char *p, *ret = NULL; + ZEND_ASSERT(entry->symlink); - ZEND_ASSERT(entry->link); - - if (entry->link[0] == '/') { - return estrdup(entry->link + 1); + if (ZSTR_VAL(entry->symlink)[0] == '/') { + return zend_string_init(ZSTR_VAL(entry->symlink) + 1, ZSTR_LEN(entry->symlink) - 1, false); } - p = strrchr(ZSTR_VAL(entry->filename), '/'); + const char *p = strrchr(ZSTR_VAL(entry->filename), '/'); if (p) { /* Important: don't modify the original `p` data because it is a shared string. */ zend_string *new_name = zend_string_init(ZSTR_VAL(entry->filename), p - ZSTR_VAL(entry->filename), false); - spprintf(&ret, 0, "%s/%s", ZSTR_VAL(new_name), entry->link); + zend_string *location = zend_string_concat3( + ZSTR_VAL(new_name), ZSTR_LEN(new_name), + ZEND_STRL("/"), + ZSTR_VAL(entry->symlink), ZSTR_LEN(entry->symlink) + ); zend_string_release(entry->filename); entry->filename = new_name; - return ret; + return location; } - return entry->link; + return zend_string_copy(entry->symlink); } /* }}} */ phar_entry_info *phar_get_link_source(phar_entry_info *entry) /* {{{ */ { phar_entry_info *link_entry; - char *link; - if (!entry->link) { + if (!entry->symlink) { return entry; } - link = phar_get_link_location(entry); - if (NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->link, strlen(entry->link))) || - NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), link, strlen(link)))) { - if (link != entry->link) { - efree(link); - } + link_entry = zend_hash_find_ptr(&(entry->phar->manifest), entry->symlink); + if (link_entry) { return phar_get_link_source(link_entry); - } else { - if (link != entry->link) { - efree(link); - } - return NULL; } + + zend_string *link = phar_get_link_location(entry); + link_entry = zend_hash_find_ptr(&(entry->phar->manifest), link); + zend_string_release(link); + if (link_entry) { + return phar_get_link_source(link_entry); + } + return NULL; } /* }}} */ @@ -96,7 +96,7 @@ static php_stream *phar_get_entrypufp(const phar_entry_info *entry) /* retrieve a phar_entry_info's current file pointer for reading contents */ php_stream *phar_get_efp(phar_entry_info *entry, bool follow_links) /* {{{ */ { - if (follow_links && entry->link) { + if (follow_links && entry->symlink) { phar_entry_info *link_entry = phar_get_link_source(entry); if (link_entry && link_entry != entry) { @@ -387,9 +387,9 @@ static ZEND_ATTRIBUTE_NONNULL zend_result phar_create_writeable_entry(phar_archi } /* open a new temp file for writing */ - if (entry->link) { - efree(entry->link); - entry->link = NULL; + if (entry->symlink) { + zend_string_release(entry->symlink); + entry->symlink = NULL; entry->tar_type = (entry->is_tar ? TAR_FILE : '\0'); } @@ -444,9 +444,9 @@ ZEND_ATTRIBUTE_NONNULL static zend_result phar_separate_entry_fp(phar_entry_info return FAILURE; } - if (entry->link) { - efree(entry->link); - entry->link = NULL; + if (entry->symlink) { + zend_string_release(entry->symlink); + entry->symlink = NULL; entry->tar_type = (entry->is_tar ? TAR_FILE : '\0'); } @@ -559,9 +559,9 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, co } } else { if (for_write) { - if (entry->link) { - efree(entry->link); - entry->link = NULL; + if (entry->symlink) { + zend_string_release(entry->symlink); + entry->symlink = NULL; entry->tar_type = (entry->is_tar ? TAR_FILE : '\0'); } @@ -586,7 +586,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, co (*ret)->phar = phar; (*ret)->internal_file = entry; (*ret)->fp = phar_get_efp(entry, true); - if (entry->link) { + if (entry->symlink) { phar_entry_info *link = phar_get_link_source(entry); if(!link) { efree(*ret); @@ -740,9 +740,9 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_copy_entry_fp(phar_entry_info *source, p return FAILURE; } - if (dest->link) { - efree(dest->link); - dest->link = NULL; + if (dest->symlink) { + zend_string_release(dest->symlink); + dest->symlink = NULL; dest->tar_type = (dest->is_tar ? TAR_FILE : '\0'); } @@ -807,7 +807,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_open_entry_fp(phar_entry_info *entry, ch php_stream *ufp; phar_entry_data dummy; - if (follow_links && entry->link) { + if (follow_links && entry->symlink) { phar_entry_info *link_entry = phar_get_link_source(entry); if (link_entry && link_entry != entry) { return phar_open_entry_fp(link_entry, error, true); @@ -1995,8 +1995,8 @@ static int phar_update_cached_entry(zval *data, void *argument) /* {{{ */ entry->phar = (phar_archive_data *)argument; - if (entry->link) { - entry->link = estrdup(entry->link); + if (entry->symlink) { + zend_string_addref(entry->symlink); } if (entry->tmp) { From 2945c72a14508363e0d8588c1e3feedd7e1fdde9 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 18 Apr 2026 16:47:59 +0100 Subject: [PATCH 259/300] build/gen_stub: support asymmetric visibility modifiers. (#21773) Emit ZEND_ACC_PUBLIC_SET / PROTECTED_SET / PRIVATE_SET from the corresponding Modifiers::*_SET flags in generated arginfo, gated to PHP 8.4+ where asymmetric visibility was introduced. Previously private(set) and friends in stubs parsed without error but produced no set-visibility flag. @readonly on DOM property stubs was documentation only and did not translate to any runtime flag, so reflection reported the properties as writable while the write_property handler threw on assignment. Declaring them public private(set) lets the engine reject external writes via the normal visibility check and lets ReflectionProperty:: isWritable() answer honestly. After converting virtual properties from @readonly to private(set), dom_write_property still threw a readonly-modification error. Since the handler replaces zend_std_write_property, the engine's own asymmetric-visibility check is bypassed on the write path, so the DOM handler now raises it explicitly via zend_asymmetric_visibility_property_modification_error() when the caller lacks set access. The readonly error is kept as a fallback. --- build/gen_stub.php | 23 +- ext/dom/php_dom.c | 15 +- ext/dom/php_dom.stub.php | 913 +++++------------- ext/dom/php_dom_arginfo.h | 272 +++--- ext/dom/php_dom_decl.h | 8 +- .../modern/spec/Element_prefix_readonly.phpt | 2 +- ext/dom/tests/property_write_errors.phpt | 10 +- 7 files changed, 439 insertions(+), 804 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index eca1ab3e8c13..e68c0b77c610 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2354,7 +2354,17 @@ protected function getFlagsByPhpVersion(): VersionFlags $flags = "ZEND_ACC_PRIVATE"; } - return new VersionFlags([$flags]); + $versionFlags = new VersionFlags([$flags]); + + if ($this->flags & Modifiers::PUBLIC_SET) { + $versionFlags->addForVersionsAbove("ZEND_ACC_PUBLIC_SET", PHP_84_VERSION_ID); + } elseif ($this->flags & Modifiers::PROTECTED_SET) { + $versionFlags->addForVersionsAbove("ZEND_ACC_PROTECTED_SET", PHP_84_VERSION_ID); + } elseif ($this->flags & Modifiers::PRIVATE_SET) { + $versionFlags->addForVersionsAbove("ZEND_ACC_PRIVATE_SET", PHP_84_VERSION_ID); + } + + return $versionFlags; } protected function getTypeCode(string $variableLikeName, string &$code): string @@ -2450,6 +2460,17 @@ protected function addModifiersToFieldSynopsis(DOMDocument $doc, DOMElement $fie $fieldsynopsisElement->appendChild(new DOMText("\n$indentation")); $fieldsynopsisElement->appendChild($doc->createElement("modifier", "private")); } + + if ($this->flags & Modifiers::PUBLIC_SET) { + $fieldsynopsisElement->appendChild(new DOMText("\n$indentation")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "public(set)")); + } elseif ($this->flags & Modifiers::PROTECTED_SET) { + $fieldsynopsisElement->appendChild(new DOMText("\n$indentation")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "protected(set)")); + } elseif ($this->flags & Modifiers::PRIVATE_SET) { + $fieldsynopsisElement->appendChild(new DOMText("\n$indentation")); + $fieldsynopsisElement->appendChild($doc->createElement("modifier", "private(set)")); + } } } diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 87b359b2dcb6..b188dea6eb49 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -412,11 +412,6 @@ zval *dom_write_property(zend_object *object, zend_string *name, zval *value, vo const dom_prop_handler *hnd = dom_get_prop_handler(obj, name, cache_slot); if (hnd) { - if (UNEXPECTED(!hnd->write_func)) { - zend_readonly_property_modification_error_ex(ZSTR_VAL(object->ce->name), ZSTR_VAL(name)); - return &EG(error_zval); - } - zend_property_info *prop = NULL; if (cache_slot) { ZEND_ASSERT(*cache_slot == obj->prop_handler); @@ -429,6 +424,16 @@ zval *dom_write_property(zend_object *object, zend_string *name, zval *value, vo } } + if (UNEXPECTED(!hnd->write_func)) { + if (prop && (prop->flags & ZEND_ACC_PPP_SET_MASK) && + !zend_asymmetric_property_has_set_access(prop)) { + zend_asymmetric_visibility_property_modification_error(prop, "modify"); + } else { + zend_readonly_property_modification_error_ex(ZSTR_VAL(object->ce->name), ZSTR_VAL(name)); + } + return &EG(error_zval); + } + ZEND_ASSERT(prop && ZEND_TYPE_IS_SET(prop->type)); zval tmp; ZVAL_COPY(&tmp, value); diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 71aa5f4ec0fa..521e3cd99c2e 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -237,41 +237,23 @@ class DOMDocumentType extends DOMNode { - /** - * @readonly - * @virtual - */ - public string $name; + /** @virtual */ + public private(set) string $name; - /** - * @readonly - * @virtual - */ - public DOMNamedNodeMap $entities; + /** @virtual */ + public private(set) DOMNamedNodeMap $entities; - /** - * @readonly - * @virtual - */ - public DOMNamedNodeMap $notations; + /** @virtual */ + public private(set) DOMNamedNodeMap $notations; - /** - * @readonly - * @virtual - */ - public string $publicId; + /** @virtual */ + public private(set) string $publicId; - /** - * @readonly - * @virtual - */ - public string $systemId; + /** @virtual */ + public private(set) string $systemId; - /** - * @readonly - * @virtual - */ - public ?string $internalSubset; + /** @virtual */ + public private(set) ?string $internalSubset; } class DOMCdataSection extends DOMText @@ -319,101 +301,56 @@ class DOMNode public const int DOCUMENT_POSITION_CONTAINED_BY = 0x10; public const int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; - /** - * @readonly - * @virtual - */ - public string $nodeName; + /** @virtual */ + public private(set) string $nodeName; /** @virtual */ public ?string $nodeValue; - /** - * @readonly - * @virtual - */ - public int $nodeType; + /** @virtual */ + public private(set) int $nodeType; - /** - * @readonly - * @virtual - */ - public ?DOMNode $parentNode; + /** @virtual */ + public private(set) ?DOMNode $parentNode; - /** - * @readonly - * @virtual - */ - public ?DOMElement $parentElement; + /** @virtual */ + public private(set) ?DOMElement $parentElement; - /** - * @readonly - * @virtual - */ - public DOMNodeList $childNodes; + /** @virtual */ + public private(set) DOMNodeList $childNodes; - /** - * @readonly - * @virtual - */ - public ?DOMNode $firstChild; + /** @virtual */ + public private(set) ?DOMNode $firstChild; - /** - * @readonly - * @virtual - */ - public ?DOMNode $lastChild; + /** @virtual */ + public private(set) ?DOMNode $lastChild; - /** - * @readonly - * @virtual - */ - public ?DOMNode $previousSibling; + /** @virtual */ + public private(set) ?DOMNode $previousSibling; - /** - * @readonly - * @virtual - */ - public ?DOMNode $nextSibling; + /** @virtual */ + public private(set) ?DOMNode $nextSibling; - /** - * @readonly - * @virtual - */ - public ?DOMNamedNodeMap $attributes; + /** @virtual */ + public private(set) ?DOMNamedNodeMap $attributes; - /** - * @readonly - * @virtual - */ - public bool $isConnected; + /** @virtual */ + public private(set) bool $isConnected; - /** - * @readonly - * @virtual - */ - public ?DOMDocument $ownerDocument; + /** @virtual */ + public private(set) ?DOMDocument $ownerDocument; - /** - * @readonly - * @virtual - */ - public ?string $namespaceURI; + /** @virtual */ + public private(set) ?string $namespaceURI; /** @virtual */ public string $prefix; - /** - * @readonly - * @virtual - */ - public ?string $localName; + /** @virtual */ + public private(set) ?string $localName; - /** - * @readonly - * @virtual - */ - public ?string $baseURI; + /** @virtual */ + public private(set) ?string $baseURI; /** @virtual */ public string $textContent; @@ -484,65 +421,35 @@ public function __wakeup(): void {} class DOMNameSpaceNode { - /** - * @readonly - * @virtual - */ - public string $nodeName; + /** @virtual */ + public private(set) string $nodeName; - /** - * @readonly - * @virtual - */ - public ?string $nodeValue; + /** @virtual */ + public private(set) ?string $nodeValue; - /** - * @readonly - * @virtual - */ - public int $nodeType; + /** @virtual */ + public private(set) int $nodeType; - /** - * @readonly - * @virtual - */ - public string $prefix; + /** @virtual */ + public private(set) string $prefix; - /** - * @readonly - * @virtual - */ - public ?string $localName; + /** @virtual */ + public private(set) ?string $localName; - /** - * @readonly - * @virtual - */ - public ?string $namespaceURI; + /** @virtual */ + public private(set) ?string $namespaceURI; - /** - * @readonly - * @virtual - */ - public bool $isConnected; + /** @virtual */ + public private(set) bool $isConnected; - /** - * @readonly - * @virtual - */ - public ?DOMDocument $ownerDocument; + /** @virtual */ + public private(set) ?DOMDocument $ownerDocument; - /** - * @readonly - * @virtual - */ - public ?DOMNode $parentNode; + /** @virtual */ + public private(set) ?DOMNode $parentNode; - /** - * @readonly - * @virtual - */ - public ?DOMElement $parentElement; + /** @virtual */ + public private(set) ?DOMElement $parentElement; /** @implementation-alias DOMNode::__sleep */ public function __sleep(): array {} @@ -565,23 +472,14 @@ public function createDocument(?string $namespace = null, string $qualifiedName class DOMDocumentFragment extends DOMNode implements DOMParentNode { - /** - * @readonly - * @virtual - */ - public ?DOMElement $firstElementChild; + /** @virtual */ + public private(set) ?DOMElement $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?DOMElement $lastElementChild; + /** @virtual */ + public private(set) ?DOMElement $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; + /** @virtual */ + public private(set) int $childElementCount; public function __construct() {} @@ -609,11 +507,8 @@ public function replaceChildren(...$nodes): void {} class DOMNodeList implements IteratorAggregate, Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @tentative-return-type */ public function count(): int {} @@ -629,23 +524,14 @@ class DOMCharacterData extends DOMNode implements DOMChildNode /** @virtual */ public string $data; - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; - /** - * @readonly - * @virtual - */ - public ?DOMElement $previousElementSibling; + /** @virtual */ + public private(set) ?DOMElement $previousElementSibling; - /** - * @readonly - * @virtual - */ - public ?DOMElement $nextElementSibling; + /** @virtual */ + public private(set) ?DOMElement $nextElementSibling; /** @tentative-return-type */ public function appendData(string $data): true {} @@ -686,32 +572,20 @@ public function after(...$nodes): void {} class DOMAttr extends DOMNode { - /** - * @readonly - * @virtual - */ - public string $name; + /** @virtual */ + public private(set) string $name; - /** - * @readonly - * @virtual - */ - public bool $specified; + /** @virtual */ + public private(set) bool $specified; /** @virtual */ public string $value; - /** - * @readonly - * @virtual - */ - public ?DOMElement $ownerElement; + /** @virtual */ + public private(set) ?DOMElement $ownerElement; - /** - * @readonly - * @virtual - */ - public mixed $schemaTypeInfo; + /** @virtual */ + public private(set) mixed $schemaTypeInfo; public function __construct(string $name, string $value = "") {} @@ -721,11 +595,8 @@ public function isId(): bool {} class DOMElement extends DOMNode implements \DOMParentNode, \DOMChildNode { - /** - * @readonly - * @virtual - */ - public string $tagName; + /** @virtual */ + public private(set) string $tagName; /** @virtual */ public string $className; @@ -733,41 +604,23 @@ class DOMElement extends DOMNode implements \DOMParentNode, \DOMChildNode /** @virtual */ public string $id; - /** - * @readonly - * @virtual - */ - public mixed $schemaTypeInfo; + /** @virtual */ + public private(set) mixed $schemaTypeInfo; - /** - * @readonly - * @virtual - */ - public ?DOMElement $firstElementChild; + /** @virtual */ + public private(set) ?DOMElement $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?DOMElement $lastElementChild; + /** @virtual */ + public private(set) ?DOMElement $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; + /** @virtual */ + public private(set) int $childElementCount; - /** - * @readonly - * @virtual - */ - public ?DOMElement $previousElementSibling; + /** @virtual */ + public private(set) ?DOMElement $previousElementSibling; - /** - * @readonly - * @virtual - */ - public ?DOMElement $nextElementSibling; + /** @virtual */ + public private(set) ?DOMElement $nextElementSibling; public function __construct(string $qualifiedName, ?string $value = null, string $namespace = "") {} @@ -856,39 +709,26 @@ public function insertAdjacentText(string $where, string $data): void {} class DOMDocument extends DOMNode implements DOMParentNode { - /** - * @readonly - * @virtual - */ - public ?DOMDocumentType $doctype; + /** @virtual */ + public private(set) ?DOMDocumentType $doctype; - /** - * @readonly - * @virtual - */ - public DOMImplementation $implementation; + /** @virtual */ + public private(set) DOMImplementation $implementation; - /** - * @readonly - * @virtual - */ - public ?DOMElement $documentElement; + /** @virtual */ + public private(set) ?DOMElement $documentElement; /** - * @readonly * @deprecated * @virtual */ - public ?string $actualEncoding; + public private(set) ?string $actualEncoding; /** @virtual */ public ?string $encoding; - /** - * @readonly - * @virtual - */ - public ?string $xmlEncoding; + /** @virtual */ + public private(set) ?string $xmlEncoding; /** @virtual */ public bool $standalone; @@ -909,11 +749,10 @@ class DOMDocument extends DOMNode implements DOMParentNode public ?string $documentURI; /** - * @readonly * @deprecated * @virtual */ - public mixed $config; + public private(set) mixed $config; /** @virtual */ public bool $formatOutput; @@ -933,23 +772,14 @@ class DOMDocument extends DOMNode implements DOMParentNode /** @virtual */ public bool $substituteEntities; - /** - * @readonly - * @virtual - */ - public ?DOMElement $firstElementChild; + /** @virtual */ + public private(set) ?DOMElement $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?DOMElement $lastElementChild; + /** @virtual */ + public private(set) ?DOMElement $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; + /** @virtual */ + public private(set) int $childElementCount; public function __construct(string $version = "1.0", string $encoding = "") {} @@ -1082,11 +912,8 @@ final class DOMException extends Exception class DOMText extends DOMCharacterData { - /** - * @readonly - * @virtual - */ - public string $wholeText; + /** @virtual */ + public private(set) string $wholeText; public function __construct(string $data = "") {} @@ -1105,11 +932,8 @@ public function splitText(int $offset) {} class DOMNamedNodeMap implements IteratorAggregate, Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @tentative-return-type */ public function getNamedItem(string $qualifiedName): ?DOMNode {} @@ -1128,44 +952,32 @@ public function getIterator(): Iterator {} class DOMEntity extends DOMNode { - /** - * @readonly - * @virtual - */ - public ?string $publicId; + /** @virtual */ + public private(set) ?string $publicId; - /** - * @readonly - * @virtual - */ - public ?string $systemId; + /** @virtual */ + public private(set) ?string $systemId; - /** - * @readonly - * @virtual - */ - public ?string $notationName; + /** @virtual */ + public private(set) ?string $notationName; /** - * @readonly * @deprecated * @virtual */ - public ?string $actualEncoding; + public private(set) ?string $actualEncoding; /** - * @readonly * @deprecated * @virtual */ - public ?string $encoding; + public private(set) ?string $encoding; /** - * @readonly * @deprecated * @virtual */ - public ?string $version; + public private(set) ?string $version; } class DOMEntityReference extends DOMNode @@ -1175,26 +987,17 @@ public function __construct(string $name) {} class DOMNotation extends DOMNode { - /** - * @readonly - * @virtual - */ - public string $publicId; + /** @virtual */ + public private(set) string $publicId; - /** - * @readonly - * @virtual - */ - public string $systemId; + /** @virtual */ + public private(set) string $systemId; } class DOMProcessingInstruction extends DOMNode - { - /** - * @readonly - * @virtual - */ - public string $target; + { + /** @virtual */ + public private(set) string $target; /** @virtual */ public string $data; @@ -1206,11 +1009,8 @@ public function __construct(string $name, string $value = "") {} /** @not-serializable */ class DOMXPath { - /** - * @readonly - * @virtual - */ - public DOMDocument $document; + /** @virtual */ + public private(set) DOMDocument $document; /** @virtual */ public bool $registerNodeNamespaces; @@ -1358,73 +1158,37 @@ class Node { private final function __construct() {} - /** - * @readonly - * @virtual - */ - public int $nodeType; - /** - * @readonly - * @virtual - */ - public string $nodeName; + /** @virtual */ + public private(set) int $nodeType; + /** @virtual */ + public private(set) string $nodeName; - /** - * @readonly - * @virtual - */ - public string $baseURI; + /** @virtual */ + public private(set) string $baseURI; - /** - * @readonly - * @virtual - */ - public bool $isConnected; - /** - * @readonly - * @virtual - */ - public ?Document $ownerDocument; + /** @virtual */ + public private(set) bool $isConnected; + /** @virtual */ + public private(set) ?Document $ownerDocument; /** @implementation-alias DOMNode::getRootNode */ public function getRootNode(array $options = []): Node {} - /** - * @readonly - * @virtual - */ - public ?Node $parentNode; - /** - * @readonly - * @virtual - */ - public ?Element $parentElement; + /** @virtual */ + public private(set) ?Node $parentNode; + /** @virtual */ + public private(set) ?Element $parentElement; /** @implementation-alias DOMNode::hasChildNodes */ public function hasChildNodes(): bool {} - /** - * @readonly - * @virtual - */ - public NodeList $childNodes; - /** - * @readonly - * @virtual - */ - public ?Node $firstChild; - /** - * @readonly - * @virtual - */ - public ?Node $lastChild; - /** - * @readonly - * @virtual - */ - public ?Node $previousSibling; - /** - * @readonly - * @virtual - */ - public ?Node $nextSibling; + /** @virtual */ + public private(set) NodeList $childNodes; + /** @virtual */ + public private(set) ?Node $firstChild; + /** @virtual */ + public private(set) ?Node $lastChild; + /** @virtual */ + public private(set) ?Node $previousSibling; + /** @virtual */ + public private(set) ?Node $nextSibling; /** @virtual */ public ?string $nodeValue; @@ -1474,11 +1238,8 @@ public function __wakeup(): void {} class NodeList implements \IteratorAggregate, \Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @implementation-alias DOMNodeList::count */ public function count(): int {} @@ -1492,11 +1253,8 @@ public function item(int $index): ?Node {} class NamedNodeMap implements \IteratorAggregate, \Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @implementation-alias DOMNamedNodeMap::item */ public function item(int $index): ?Attr {} @@ -1514,11 +1272,8 @@ public function getIterator(): \Iterator {} class DtdNamedNodeMap implements \IteratorAggregate, \Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @implementation-alias DOMNamedNodeMap::item */ public function item(int $index): Entity|Notation|null {} @@ -1536,11 +1291,8 @@ public function getIterator(): \Iterator {} class HTMLCollection implements \IteratorAggregate, \Countable { - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @implementation-alias DOMNodeList::item */ public function item(int $index): ?Element {} @@ -1564,71 +1316,37 @@ enum AdjacentPosition : string class Element extends Node implements ParentNode, ChildNode { - /** - * @readonly - * @virtual - */ - public ?string $namespaceURI; - /** - * @readonly - * @virtual - */ - public ?string $prefix; - /** - * @readonly - * @virtual - */ - public string $localName; - /** - * @readonly - * @virtual - */ - public string $tagName; + /** @virtual */ + public private(set) ?string $namespaceURI; + /** @virtual */ + public private(set) ?string $prefix; + /** @virtual */ + public private(set) string $localName; + /** @virtual */ + public private(set) string $tagName; - /** - * @readonly - */ - public HTMLCollection $children; - /** - * @readonly - * @virtual - */ - public ?Element $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?Element $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; - /** - * @readonly - * @virtual - */ - public ?Element $previousElementSibling; - /** - * @readonly - * @virtual - */ - public ?Element $nextElementSibling; + public private(set) HTMLCollection $children; + /** @virtual */ + public private(set) ?Element $firstElementChild; + /** @virtual */ + public private(set) ?Element $lastElementChild; + /** @virtual */ + public private(set) int $childElementCount; + /** @virtual */ + public private(set) ?Element $previousElementSibling; + /** @virtual */ + public private(set) ?Element $nextElementSibling; /** @virtual */ public string $id; /** @virtual */ public string $className; - /** @readonly */ - public TokenList $classList; + public private(set) TokenList $classList; /** @implementation-alias DOMNode::hasAttributes */ public function hasAttributes(): bool {} - /** - * @readonly - * @virtual - */ - public NamedNodeMap $attributes; + /** @virtual */ + public private(set) NamedNodeMap $attributes; /** @implementation-alias DOMElement::getAttributeNames */ public function getAttributeNames(): array {} /** @implementation-alias DOMElement::getAttribute */ @@ -1716,40 +1434,22 @@ class HTMLElement extends Element class Attr extends Node { - /** - * @readonly - * @virtual - */ - public ?string $namespaceURI; - /** - * @readonly - * @virtual - */ - public ?string $prefix; - /** - * @readonly - * @virtual - */ - public string $localName; - /** - * @readonly - * @virtual - */ - public string $name; + /** @virtual */ + public private(set) ?string $namespaceURI; + /** @virtual */ + public private(set) ?string $prefix; + /** @virtual */ + public private(set) string $localName; + /** @virtual */ + public private(set) string $name; /** @virtual */ public string $value; - /** - * @readonly - * @virtual - */ - public ?Element $ownerElement; + /** @virtual */ + public private(set) ?Element $ownerElement; - /** - * @readonly - * @virtual - */ - public bool $specified; + /** @virtual */ + public private(set) bool $specified; /** @implementation-alias DOMAttr::isId */ public function isId(): bool {} @@ -1760,24 +1460,15 @@ public function rename(?string $namespaceURI, string $qualifiedName): void {} class CharacterData extends Node implements ChildNode { - /** - * @readonly - * @virtual - */ - public ?Element $previousElementSibling; - /** - * @readonly - * @virtual - */ - public ?Element $nextElementSibling; + /** @virtual */ + public private(set) ?Element $previousElementSibling; + /** @virtual */ + public private(set) ?Element $nextElementSibling; /** @virtual */ public string $data; - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; /** @implementation-alias DOMCharacterData::substringData */ public function substringData(int $offset, int $count): string {} public function appendData(string $data): void {} @@ -1801,22 +1492,16 @@ class Text extends CharacterData /** @implementation-alias DOMText::splitText */ public function splitText(int $offset): Text {} - /** - * @readonly - * @virtual - */ - public string $wholeText; + /** @virtual */ + public private(set) string $wholeText; } class CDATASection extends Text {} class ProcessingInstruction extends CharacterData { - /** - * @readonly - * @virtual - */ - public string $target; + /** @virtual */ + public private(set) string $target; } class Comment extends CharacterData @@ -1826,36 +1511,18 @@ class Comment extends CharacterData class DocumentType extends Node implements ChildNode { - /** - * @readonly - * @virtual - */ - public string $name; - /** - * @readonly - * @virtual - */ - public DtdNamedNodeMap $entities; - /** - * @readonly - * @virtual - */ - public DtdNamedNodeMap $notations; - /** - * @readonly - * @virtual - */ - public string $publicId; - /** - * @readonly - * @virtual - */ - public string $systemId; - /** - * @readonly - * @virtual - */ - public ?string $internalSubset; + /** @virtual */ + public private(set) string $name; + /** @virtual */ + public private(set) DtdNamedNodeMap $entities; + /** @virtual */ + public private(set) DtdNamedNodeMap $notations; + /** @virtual */ + public private(set) string $publicId; + /** @virtual */ + public private(set) string $systemId; + /** @virtual */ + public private(set) ?string $internalSubset; /** @implementation-alias DOMElement::remove */ public function remove(): void {} @@ -1869,25 +1536,13 @@ public function replaceWith(Node|string ...$nodes): void {} class DocumentFragment extends Node implements ParentNode { - /** - * @readonly - */ - public HTMLCollection $children; - /** - * @readonly - * @virtual - */ - public ?Element $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?Element $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; + public private(set) HTMLCollection $children; + /** @virtual */ + public private(set) ?Element $firstElementChild; + /** @virtual */ + public private(set) ?Element $lastElementChild; + /** @virtual */ + public private(set) int $childElementCount; /** @implementation-alias DOMDocumentFragment::appendXML */ public function appendXml(string $data): bool {} @@ -1906,63 +1561,35 @@ public function querySelectorAll(string $selectors): NodeList {} class Entity extends Node { - /** - * @readonly - * @virtual - */ - public ?string $publicId; - /** - * @readonly - * @virtual - */ - public ?string $systemId; - /** - * @readonly - * @virtual - */ - public ?string $notationName; + /** @virtual */ + public private(set) ?string $publicId; + /** @virtual */ + public private(set) ?string $systemId; + /** @virtual */ + public private(set) ?string $notationName; } class EntityReference extends Node {} class Notation extends Node { - /** - * @readonly - * @virtual - */ - public string $publicId; - /** - * @readonly - * @virtual - */ - public string $systemId; + /** @virtual */ + public private(set) string $publicId; + /** @virtual */ + public private(set) string $systemId; } abstract class Document extends Node implements ParentNode { - /** - * @readonly - */ - public HTMLCollection $children; - /** - * @readonly - * @virtual - */ - public ?Element $firstElementChild; - /** - * @readonly - * @virtual - */ - public ?Element $lastElementChild; - /** - * @readonly - * @virtual - */ - public int $childElementCount; + public private(set) HTMLCollection $children; + /** @virtual */ + public private(set) ?Element $firstElementChild; + /** @virtual */ + public private(set) ?Element $lastElementChild; + /** @virtual */ + public private(set) int $childElementCount; - /** @readonly */ - public Implementation $implementation; + public private(set) Implementation $implementation; /** @virtual */ public string $URL; /** @virtual */ @@ -1974,16 +1601,10 @@ abstract class Document extends Node implements ParentNode /** @virtual */ public string $inputEncoding; - /** - * @readonly - * @virtual - */ - public ?DocumentType $doctype; - /** - * @readonly - * @virtual - */ - public ?Element $documentElement; + /** @virtual */ + public private(set) ?DocumentType $doctype; + /** @virtual */ + public private(set) ?Element $documentElement; /** @implementation-alias Dom\Element::getElementsByTagName */ public function getElementsByTagName(string $qualifiedName): HTMLCollection {} /** @implementation-alias Dom\Element::getElementsByTagNameNS */ @@ -2043,11 +1664,8 @@ public function querySelectorAll(string $selectors): NodeList {} /** @virtual */ public ?HTMLElement $body; - /** - * @readonly - * @virtual - */ - public ?HTMLElement $head; + /** @virtual */ + public private(set) ?HTMLElement $head; /** @virtual */ public string $title; } @@ -2083,11 +1701,8 @@ public static function createFromFile(string $path, int $options = 0, ?string $o public static function createFromString(string $source, int $options = 0, ?string $overrideEncoding = null): XMLDocument {} - /** - * @readonly - * @virtual - */ - public string $xmlEncoding; + /** @virtual */ + public private(set) string $xmlEncoding; /** @virtual */ public bool $xmlStandalone; @@ -2121,11 +1736,8 @@ final class TokenList implements \IteratorAggregate, \Countable /** @implementation-alias Dom\Node::__construct */ private function __construct() {} - /** - * @readonly - * @virtual - */ - public int $length; + /** @virtual */ + public private(set) int $length; public function item(int $index): ?string {} public function contains(string $token): bool {} public function add(string ...$tokens): void {} @@ -2159,11 +1771,8 @@ private function __construct() {} /** @not-serializable */ final class XPath { - /** - * @readonly - * @virtual - */ - public Document $document; + /** @virtual */ + public private(set) Document $document; /** @virtual */ public bool $registerNodeNamespaces; diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 1c90f920cdd8..0274186380dc 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit php_dom.stub.php instead. - * Stub hash: e00668999f4fe9afee1f78f6986467a315f831a5 + * Stub hash: 8d7713834c924709155ed7acc554c9efc55e96c1 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_dom_import_simplexml, 0, 1, DOMAttr|DOMElement, 0) @@ -1887,38 +1887,38 @@ static zend_class_entry *register_class_DOMDocumentType(zend_class_entry *class_ zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); - zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zval property_entities_default_value; ZVAL_UNDEF(&property_entities_default_value); zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, true); zend_string *property_entities_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_DOMNamedNodeMap, 0, 0)); + zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_DOMNamedNodeMap, 0, 0)); zend_string_release_ex(property_entities_name, true); zval property_notations_default_value; ZVAL_UNDEF(&property_notations_default_value); zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, true); zend_string *property_notations_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_DOMNamedNodeMap, 0, 0)); + zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_DOMNamedNodeMap, 0, 0)); zend_string_release_ex(property_notations_name, true); zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_systemId_name, true); zval property_internalSubset_default_value; ZVAL_UNDEF(&property_internalSubset_default_value); zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, true); - zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_internalSubset_name, true); return class_entry; @@ -2010,7 +2010,7 @@ static zend_class_entry *register_class_DOMNode(void) zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); - zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_nodeName_name, true); zval property_nodeValue_default_value; @@ -2022,82 +2022,82 @@ static zend_class_entry *register_class_DOMNode(void) zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); - zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_nodeType_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentElement_name, true); zval property_childNodes_default_value; ZVAL_UNDEF(&property_childNodes_default_value); zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, true); zend_string *property_childNodes_class_DOMNodeList = zend_string_init("DOMNodeList", sizeof("DOMNodeList")-1, 1); - zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_DOMNodeList, 0, 0)); + zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_DOMNodeList, 0, 0)); zend_string_release_ex(property_childNodes_name, true); zval property_firstChild_default_value; ZVAL_UNDEF(&property_firstChild_default_value); zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, true); zend_string *property_firstChild_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstChild_name, true); zval property_lastChild_default_value; ZVAL_UNDEF(&property_lastChild_default_value); zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, true); zend_string *property_lastChild_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastChild_name, true); zval property_previousSibling_default_value; ZVAL_UNDEF(&property_previousSibling_default_value); zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, true); zend_string *property_previousSibling_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousSibling_name, true); zval property_nextSibling_default_value; ZVAL_UNDEF(&property_nextSibling_default_value); zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, true); zend_string *property_nextSibling_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextSibling_name, true); zval property_attributes_default_value; ZVAL_UNDEF(&property_attributes_default_value); zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, true); zend_string *property_attributes_class_DOMNamedNodeMap = zend_string_init("DOMNamedNodeMap", sizeof("DOMNamedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_DOMNamedNodeMap, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_DOMNamedNodeMap, 0, MAY_BE_NULL)); zend_string_release_ex(property_attributes_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); - zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); + zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); - zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); zend_string_release_ex(property_ownerDocument_name, true); zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); - zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; @@ -2109,13 +2109,13 @@ static zend_class_entry *register_class_DOMNode(void) zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); - zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_localName_name, true); zval property_baseURI_default_value; ZVAL_UNDEF(&property_baseURI_default_value); zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, true); - zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_baseURI_name, true); zval property_textContent_default_value; @@ -2137,64 +2137,64 @@ static zend_class_entry *register_class_DOMNameSpaceNode(void) zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); - zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_nodeName_name, true); zval property_nodeValue_default_value; ZVAL_UNDEF(&property_nodeValue_default_value); zend_string *property_nodeValue_name = zend_string_init("nodeValue", sizeof("nodeValue") - 1, true); - zend_declare_typed_property(class_entry, property_nodeValue_name, &property_nodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nodeValue_name, &property_nodeValue_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_nodeValue_name, true); zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); - zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_nodeType_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); - zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); - zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_localName_name, true); zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); - zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_namespaceURI_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); - zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); + zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); - zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_DOMDocument, 0, MAY_BE_NULL)); zend_string_release_ex(property_ownerDocument_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_DOMNode = zend_string_init("DOMNode", sizeof("DOMNode")-1, 1); - zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_DOMNode, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentElement_name, true); return class_entry; @@ -2222,20 +2222,20 @@ static zend_class_entry *register_class_DOMDocumentFragment(zend_class_entry *cl ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); return class_entry; @@ -2252,7 +2252,7 @@ static zend_class_entry *register_class_DOMNodeList(zend_class_entry *class_entr zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2275,21 +2275,21 @@ static zend_class_entry *register_class_DOMCharacterData(zend_class_entry *class zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextElementSibling_name, true); return class_entry; @@ -2304,12 +2304,12 @@ static zend_class_entry *register_class_DOMAttr(zend_class_entry *class_entry_DO zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); - zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zval property_specified_default_value; ZVAL_UNDEF(&property_specified_default_value); zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, true); - zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); + zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); zend_string_release_ex(property_specified_name, true); zval property_value_default_value; @@ -2320,13 +2320,13 @@ static zend_class_entry *register_class_DOMAttr(zend_class_entry *class_entry_DO ZVAL_UNDEF(&property_ownerElement_default_value); zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, true); zend_string *property_ownerElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_ownerElement_name, true); zval property_schemaTypeInfo_default_value; ZVAL_UNDEF(&property_schemaTypeInfo_default_value); zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, true); - zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); zend_string_release_ex(property_schemaTypeInfo_name, true); return class_entry; @@ -2343,7 +2343,7 @@ static zend_class_entry *register_class_DOMElement(zend_class_entry *class_entry zval property_tagName_default_value; ZVAL_UNDEF(&property_tagName_default_value); zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, true); - zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_tagName_name, true); zval property_className_default_value; @@ -2361,41 +2361,41 @@ static zend_class_entry *register_class_DOMElement(zend_class_entry *class_entry zval property_schemaTypeInfo_default_value; ZVAL_UNDEF(&property_schemaTypeInfo_default_value); zend_string *property_schemaTypeInfo_name = zend_string_init("schemaTypeInfo", sizeof("schemaTypeInfo") - 1, true); - zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_declare_typed_property(class_entry, property_schemaTypeInfo_name, &property_schemaTypeInfo_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); zend_string_release_ex(property_schemaTypeInfo_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextElementSibling_name, true); return class_entry; @@ -2413,27 +2413,27 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr ZVAL_UNDEF(&property_doctype_default_value); zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, true); zend_string *property_doctype_class_DOMDocumentType = zend_string_init("DOMDocumentType", sizeof("DOMDocumentType")-1, 1); - zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_DOMDocumentType, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_DOMDocumentType, 0, MAY_BE_NULL)); zend_string_release_ex(property_doctype_name, true); zval property_implementation_default_value; ZVAL_UNDEF(&property_implementation_default_value); zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, true); zend_string *property_implementation_class_DOMImplementation = zend_string_init("DOMImplementation", sizeof("DOMImplementation")-1, 1); - zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_DOMImplementation, 0, 0)); + zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_DOMImplementation, 0, 0)); zend_string_release_ex(property_implementation_name, true); zval property_documentElement_default_value; ZVAL_UNDEF(&property_documentElement_default_value); zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, true); zend_string *property_documentElement_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_documentElement_name, true); zval property_actualEncoding_default_value; ZVAL_UNDEF(&property_actualEncoding_default_value); zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, true); - zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_actualEncoding_name, true); zval property_encoding_default_value; @@ -2445,7 +2445,7 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr zval property_xmlEncoding_default_value; ZVAL_UNDEF(&property_xmlEncoding_default_value); zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, true); - zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_xmlEncoding_name, true); zval property_standalone_default_value; @@ -2487,7 +2487,7 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr zval property_config_default_value; ZVAL_UNDEF(&property_config_default_value); zend_string *property_config_name = zend_string_init("config", sizeof("config") - 1, true); - zend_declare_typed_property(class_entry, property_config_name, &property_config_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); + zend_declare_typed_property(class_entry, property_config_name, &property_config_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY)); zend_string_release_ex(property_config_name, true); zval property_formatOutput_default_value; @@ -2530,20 +2530,20 @@ static zend_class_entry *register_class_DOMDocument(zend_class_entry *class_entr ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_DOMElement = zend_string_init("DOMElement", sizeof("DOMElement")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_DOMElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); return class_entry; @@ -2574,7 +2574,7 @@ static zend_class_entry *register_class_DOMText(zend_class_entry *class_entry_DO zval property_wholeText_default_value; ZVAL_UNDEF(&property_wholeText_default_value); zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, true); - zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_wholeText_name, true); return class_entry; @@ -2591,7 +2591,7 @@ static zend_class_entry *register_class_DOMNamedNodeMap(zend_class_entry *class_ zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2607,37 +2607,37 @@ static zend_class_entry *register_class_DOMEntity(zend_class_entry *class_entry_ zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_systemId_name, true); zval property_notationName_default_value; ZVAL_UNDEF(&property_notationName_default_value); zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, true); - zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_notationName_name, true); zval property_actualEncoding_default_value; ZVAL_UNDEF(&property_actualEncoding_default_value); zend_string *property_actualEncoding_name = zend_string_init("actualEncoding", sizeof("actualEncoding") - 1, true); - zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_actualEncoding_name, &property_actualEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_actualEncoding_name, true); zval property_encoding_default_value; ZVAL_UNDEF(&property_encoding_default_value); zend_string *property_encoding_name = zend_string_init("encoding", sizeof("encoding") - 1, true); - zend_declare_typed_property(class_entry, property_encoding_name, &property_encoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_encoding_name, &property_encoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_encoding_name, true); zval property_version_default_value; ZVAL_UNDEF(&property_version_default_value); zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, true); - zend_declare_typed_property(class_entry, property_version_name, &property_version_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_version_name, &property_version_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_version_name, true); return class_entry; @@ -2663,13 +2663,13 @@ static zend_class_entry *register_class_DOMNotation(zend_class_entry *class_entr zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_systemId_name, true); return class_entry; @@ -2685,7 +2685,7 @@ static zend_class_entry *register_class_DOMProcessingInstruction(zend_class_entr zval property_target_default_value; ZVAL_UNDEF(&property_target_default_value); zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, true); - zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_target_name, true); zval property_data_default_value; @@ -2709,7 +2709,7 @@ static zend_class_entry *register_class_DOMXPath(void) ZVAL_UNDEF(&property_document_default_value); zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, true); zend_string *property_document_class_DOMDocument = zend_string_init("DOMDocument", sizeof("DOMDocument")-1, 1); - zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_DOMDocument, 0, 0)); + zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_DOMDocument, 0, 0)); zend_string_release_ex(property_document_name, true); zval property_registerNodeNamespaces_default_value; @@ -2798,81 +2798,81 @@ static zend_class_entry *register_class_Dom_Node(void) zval property_nodeType_default_value; ZVAL_UNDEF(&property_nodeType_default_value); zend_string *property_nodeType_name = zend_string_init("nodeType", sizeof("nodeType") - 1, true); - zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_nodeType_name, &property_nodeType_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_nodeType_name, true); zval property_nodeName_default_value; ZVAL_UNDEF(&property_nodeName_default_value); zend_string *property_nodeName_name = zend_string_init("nodeName", sizeof("nodeName") - 1, true); - zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_nodeName_name, &property_nodeName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_nodeName_name, true); zval property_baseURI_default_value; ZVAL_UNDEF(&property_baseURI_default_value); zend_string *property_baseURI_name = zend_string_init("baseURI", sizeof("baseURI") - 1, true); - zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_baseURI_name, &property_baseURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_baseURI_name, true); zval property_isConnected_default_value; ZVAL_UNDEF(&property_isConnected_default_value); zend_string *property_isConnected_name = zend_string_init("isConnected", sizeof("isConnected") - 1, true); - zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); + zend_declare_typed_property(class_entry, property_isConnected_name, &property_isConnected_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); zend_string_release_ex(property_isConnected_name, true); zval property_ownerDocument_default_value; ZVAL_UNDEF(&property_ownerDocument_default_value); zend_string *property_ownerDocument_name = zend_string_init("ownerDocument", sizeof("ownerDocument") - 1, true); zend_string *property_ownerDocument_class_Dom_Document = zend_string_init("Dom\\Document", sizeof("Dom\\Document")-1, 1); - zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_Dom_Document, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_ownerDocument_name, &property_ownerDocument_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerDocument_class_Dom_Document, 0, MAY_BE_NULL)); zend_string_release_ex(property_ownerDocument_name, true); zval property_parentNode_default_value; ZVAL_UNDEF(&property_parentNode_default_value); zend_string *property_parentNode_name = zend_string_init("parentNode", sizeof("parentNode") - 1, true); zend_string *property_parentNode_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); - zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_Dom_Node, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentNode_name, &property_parentNode_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentNode_class_Dom_Node, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentNode_name, true); zval property_parentElement_default_value; ZVAL_UNDEF(&property_parentElement_default_value); zend_string *property_parentElement_name = zend_string_init("parentElement", sizeof("parentElement") - 1, true); zend_string *property_parentElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_parentElement_name, &property_parentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_parentElement_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_parentElement_name, true); zval property_childNodes_default_value; ZVAL_UNDEF(&property_childNodes_default_value); zend_string *property_childNodes_name = zend_string_init("childNodes", sizeof("childNodes") - 1, true); zend_string *property_childNodes_class_Dom_NodeList = zend_string_init("Dom\\\116odeList", sizeof("Dom\\\116odeList")-1, 1); - zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_Dom_NodeList, 0, 0)); + zend_declare_typed_property(class_entry, property_childNodes_name, &property_childNodes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_childNodes_class_Dom_NodeList, 0, 0)); zend_string_release_ex(property_childNodes_name, true); zval property_firstChild_default_value; ZVAL_UNDEF(&property_firstChild_default_value); zend_string *property_firstChild_name = zend_string_init("firstChild", sizeof("firstChild") - 1, true); zend_string *property_firstChild_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); - zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_Dom_Node, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstChild_name, &property_firstChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstChild_class_Dom_Node, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstChild_name, true); zval property_lastChild_default_value; ZVAL_UNDEF(&property_lastChild_default_value); zend_string *property_lastChild_name = zend_string_init("lastChild", sizeof("lastChild") - 1, true); zend_string *property_lastChild_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); - zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_Dom_Node, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastChild_name, &property_lastChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastChild_class_Dom_Node, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastChild_name, true); zval property_previousSibling_default_value; ZVAL_UNDEF(&property_previousSibling_default_value); zend_string *property_previousSibling_name = zend_string_init("previousSibling", sizeof("previousSibling") - 1, true); zend_string *property_previousSibling_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); - zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_Dom_Node, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousSibling_name, &property_previousSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousSibling_class_Dom_Node, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousSibling_name, true); zval property_nextSibling_default_value; ZVAL_UNDEF(&property_nextSibling_default_value); zend_string *property_nextSibling_name = zend_string_init("nextSibling", sizeof("nextSibling") - 1, true); zend_string *property_nextSibling_class_Dom_Node = zend_string_init("Dom\\\116ode", sizeof("Dom\\\116ode")-1, 1); - zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_Dom_Node, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextSibling_name, &property_nextSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextSibling_class_Dom_Node, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextSibling_name, true); zval property_nodeValue_default_value; @@ -2901,7 +2901,7 @@ static zend_class_entry *register_class_Dom_NodeList(zend_class_entry *class_ent zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2918,7 +2918,7 @@ static zend_class_entry *register_class_Dom_NamedNodeMap(zend_class_entry *class zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2935,7 +2935,7 @@ static zend_class_entry *register_class_Dom_DtdNamedNodeMap(zend_class_entry *cl zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2952,7 +2952,7 @@ static zend_class_entry *register_class_Dom_HTMLCollection(zend_class_entry *cla zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -2996,66 +2996,66 @@ static zend_class_entry *register_class_Dom_Element(zend_class_entry *class_entr zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); - zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); - zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); - zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_localName_name, true); zval property_tagName_default_value; ZVAL_UNDEF(&property_tagName_default_value); zend_string *property_tagName_name = zend_string_init("tagName", sizeof("tagName") - 1, true); - zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_tagName_name, &property_tagName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_tagName_name, true); zval property_children_default_value; ZVAL_UNDEF(&property_children_default_value); zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); - zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); + zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); zval property_previousElementSibling_default_value; ZVAL_UNDEF(&property_previousElementSibling_default_value); zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextElementSibling_name, true); zval property_id_default_value; @@ -3074,14 +3074,14 @@ static zend_class_entry *register_class_Dom_Element(zend_class_entry *class_entr ZVAL_UNDEF(&property_classList_default_value); zend_string *property_classList_name = zend_string_init("classList", sizeof("classList") - 1, true); zend_string *property_classList_class_Dom_TokenList = zend_string_init("Dom\\TokenList", sizeof("Dom\\TokenList")-1, 1); - zend_declare_typed_property(class_entry, property_classList_name, &property_classList_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classList_class_Dom_TokenList, 0, 0)); + zend_declare_typed_property(class_entry, property_classList_name, &property_classList_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classList_class_Dom_TokenList, 0, 0)); zend_string_release_ex(property_classList_name, true); zval property_attributes_default_value; ZVAL_UNDEF(&property_attributes_default_value); zend_string *property_attributes_name = zend_string_init("attributes", sizeof("attributes") - 1, true); zend_string *property_attributes_class_Dom_NamedNodeMap = zend_string_init("Dom\\\116amedNodeMap", sizeof("Dom\\\116amedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_Dom_NamedNodeMap, 0, 0)); + zend_declare_typed_property(class_entry, property_attributes_name, &property_attributes_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_attributes_class_Dom_NamedNodeMap, 0, 0)); zend_string_release_ex(property_attributes_name, true); zval property_innerHTML_default_value; @@ -3125,24 +3125,24 @@ static zend_class_entry *register_class_Dom_Attr(zend_class_entry *class_entry_D zval property_namespaceURI_default_value; ZVAL_UNDEF(&property_namespaceURI_default_value); zend_string *property_namespaceURI_name = zend_string_init("namespaceURI", sizeof("namespaceURI") - 1, true); - zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_namespaceURI_name, &property_namespaceURI_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_namespaceURI_name, true); zval property_prefix_default_value; ZVAL_UNDEF(&property_prefix_default_value); zend_string *property_prefix_name = zend_string_init("prefix", sizeof("prefix") - 1, true); - zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_prefix_name, &property_prefix_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_prefix_name, true); zval property_localName_default_value; ZVAL_UNDEF(&property_localName_default_value); zend_string *property_localName_name = zend_string_init("localName", sizeof("localName") - 1, true); - zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_localName_name, &property_localName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_localName_name, true); zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); - zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zval property_value_default_value; ZVAL_UNDEF(&property_value_default_value); @@ -3152,13 +3152,13 @@ static zend_class_entry *register_class_Dom_Attr(zend_class_entry *class_entry_D ZVAL_UNDEF(&property_ownerElement_default_value); zend_string *property_ownerElement_name = zend_string_init("ownerElement", sizeof("ownerElement") - 1, true); zend_string *property_ownerElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_ownerElement_name, &property_ownerElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_ownerElement_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_ownerElement_name, true); zval property_specified_default_value; ZVAL_UNDEF(&property_specified_default_value); zend_string *property_specified_name = zend_string_init("specified", sizeof("specified") - 1, true); - zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); + zend_declare_typed_property(class_entry, property_specified_name, &property_specified_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_BOOL)); zend_string_release_ex(property_specified_name, true); return class_entry; @@ -3176,14 +3176,14 @@ static zend_class_entry *register_class_Dom_CharacterData(zend_class_entry *clas ZVAL_UNDEF(&property_previousElementSibling_default_value); zend_string *property_previousElementSibling_name = zend_string_init("previousElementSibling", sizeof("previousElementSibling") - 1, true); zend_string *property_previousElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_previousElementSibling_name, &property_previousElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previousElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_previousElementSibling_name, true); zval property_nextElementSibling_default_value; ZVAL_UNDEF(&property_nextElementSibling_default_value); zend_string *property_nextElementSibling_name = zend_string_init("nextElementSibling", sizeof("nextElementSibling") - 1, true); zend_string *property_nextElementSibling_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_nextElementSibling_name, &property_nextElementSibling_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_nextElementSibling_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_nextElementSibling_name, true); zval property_data_default_value; @@ -3195,7 +3195,7 @@ static zend_class_entry *register_class_Dom_CharacterData(zend_class_entry *clas zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); return class_entry; @@ -3211,7 +3211,7 @@ static zend_class_entry *register_class_Dom_Text(zend_class_entry *class_entry_D zval property_wholeText_default_value; ZVAL_UNDEF(&property_wholeText_default_value); zend_string *property_wholeText_name = zend_string_init("wholeText", sizeof("wholeText") - 1, true); - zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_wholeText_name, &property_wholeText_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_wholeText_name, true); return class_entry; @@ -3237,7 +3237,7 @@ static zend_class_entry *register_class_Dom_ProcessingInstruction(zend_class_ent zval property_target_default_value; ZVAL_UNDEF(&property_target_default_value); zend_string *property_target_name = zend_string_init("target", sizeof("target") - 1, true); - zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_target_name, &property_target_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_target_name, true); return class_entry; @@ -3263,38 +3263,38 @@ static zend_class_entry *register_class_Dom_DocumentType(zend_class_entry *class zval property_name_default_value; ZVAL_UNDEF(&property_name_default_value); - zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, ZSTR_KNOWN(ZEND_STR_NAME), &property_name_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zval property_entities_default_value; ZVAL_UNDEF(&property_entities_default_value); zend_string *property_entities_name = zend_string_init("entities", sizeof("entities") - 1, true); zend_string *property_entities_class_Dom_DtdNamedNodeMap = zend_string_init("Dom\\DtdNamedNodeMap", sizeof("Dom\\DtdNamedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_Dom_DtdNamedNodeMap, 0, 0)); + zend_declare_typed_property(class_entry, property_entities_name, &property_entities_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_entities_class_Dom_DtdNamedNodeMap, 0, 0)); zend_string_release_ex(property_entities_name, true); zval property_notations_default_value; ZVAL_UNDEF(&property_notations_default_value); zend_string *property_notations_name = zend_string_init("notations", sizeof("notations") - 1, true); zend_string *property_notations_class_Dom_DtdNamedNodeMap = zend_string_init("Dom\\DtdNamedNodeMap", sizeof("Dom\\DtdNamedNodeMap")-1, 1); - zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_Dom_DtdNamedNodeMap, 0, 0)); + zend_declare_typed_property(class_entry, property_notations_name, &property_notations_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_notations_class_Dom_DtdNamedNodeMap, 0, 0)); zend_string_release_ex(property_notations_name, true); zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_systemId_name, true); zval property_internalSubset_default_value; ZVAL_UNDEF(&property_internalSubset_default_value); zend_string *property_internalSubset_name = zend_string_init("internalSubset", sizeof("internalSubset") - 1, true); - zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_internalSubset_name, &property_internalSubset_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_internalSubset_name, true); return class_entry; @@ -3312,27 +3312,27 @@ static zend_class_entry *register_class_Dom_DocumentFragment(zend_class_entry *c ZVAL_UNDEF(&property_children_default_value); zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); - zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); + zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); return class_entry; @@ -3348,19 +3348,19 @@ static zend_class_entry *register_class_Dom_Entity(zend_class_entry *class_entry zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_systemId_name, true); zval property_notationName_default_value; ZVAL_UNDEF(&property_notationName_default_value); zend_string *property_notationName_name = zend_string_init("notationName", sizeof("notationName") - 1, true); - zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_notationName_name, &property_notationName_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL)); zend_string_release_ex(property_notationName_name, true); return class_entry; @@ -3386,13 +3386,13 @@ static zend_class_entry *register_class_Dom_Notation(zend_class_entry *class_ent zval property_publicId_default_value; ZVAL_UNDEF(&property_publicId_default_value); zend_string *property_publicId_name = zend_string_init("publicId", sizeof("publicId") - 1, true); - zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_publicId_name, &property_publicId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_publicId_name, true); zval property_systemId_default_value; ZVAL_UNDEF(&property_systemId_default_value); zend_string *property_systemId_name = zend_string_init("systemId", sizeof("systemId") - 1, true); - zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_systemId_name, &property_systemId_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_systemId_name, true); return class_entry; @@ -3410,34 +3410,34 @@ static zend_class_entry *register_class_Dom_Document(zend_class_entry *class_ent ZVAL_UNDEF(&property_children_default_value); zend_string *property_children_name = zend_string_init("children", sizeof("children") - 1, true); zend_string *property_children_class_Dom_HTMLCollection = zend_string_init("Dom\\HTMLCollection", sizeof("Dom\\HTMLCollection")-1, 1); - zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); + zend_declare_typed_property(class_entry, property_children_name, &property_children_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_children_class_Dom_HTMLCollection, 0, 0)); zend_string_release_ex(property_children_name, true); zval property_firstElementChild_default_value; ZVAL_UNDEF(&property_firstElementChild_default_value); zend_string *property_firstElementChild_name = zend_string_init("firstElementChild", sizeof("firstElementChild") - 1, true); zend_string *property_firstElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_firstElementChild_name, &property_firstElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_firstElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_firstElementChild_name, true); zval property_lastElementChild_default_value; ZVAL_UNDEF(&property_lastElementChild_default_value); zend_string *property_lastElementChild_name = zend_string_init("lastElementChild", sizeof("lastElementChild") - 1, true); zend_string *property_lastElementChild_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_lastElementChild_name, &property_lastElementChild_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_lastElementChild_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_lastElementChild_name, true); zval property_childElementCount_default_value; ZVAL_UNDEF(&property_childElementCount_default_value); zend_string *property_childElementCount_name = zend_string_init("childElementCount", sizeof("childElementCount") - 1, true); - zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_childElementCount_name, &property_childElementCount_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_childElementCount_name, true); zval property_implementation_default_value; ZVAL_UNDEF(&property_implementation_default_value); zend_string *property_implementation_name = zend_string_init("implementation", sizeof("implementation") - 1, true); zend_string *property_implementation_class_Dom_Implementation = zend_string_init("Dom\\Implementation", sizeof("Dom\\Implementation")-1, 1); - zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_Dom_Implementation, 0, 0)); + zend_declare_typed_property(class_entry, property_implementation_name, &property_implementation_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_implementation_class_Dom_Implementation, 0, 0)); zend_string_release_ex(property_implementation_name, true); zval property_URL_default_value; @@ -3474,14 +3474,14 @@ static zend_class_entry *register_class_Dom_Document(zend_class_entry *class_ent ZVAL_UNDEF(&property_doctype_default_value); zend_string *property_doctype_name = zend_string_init("doctype", sizeof("doctype") - 1, true); zend_string *property_doctype_class_Dom_DocumentType = zend_string_init("Dom\\DocumentType", sizeof("Dom\\DocumentType")-1, 1); - zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_Dom_DocumentType, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_doctype_name, &property_doctype_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_doctype_class_Dom_DocumentType, 0, MAY_BE_NULL)); zend_string_release_ex(property_doctype_name, true); zval property_documentElement_default_value; ZVAL_UNDEF(&property_documentElement_default_value); zend_string *property_documentElement_name = zend_string_init("documentElement", sizeof("documentElement") - 1, true); zend_string *property_documentElement_class_Dom_Element = zend_string_init("Dom\\Element", sizeof("Dom\\Element")-1, 1); - zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_Dom_Element, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_documentElement_name, &property_documentElement_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_documentElement_class_Dom_Element, 0, MAY_BE_NULL)); zend_string_release_ex(property_documentElement_name, true); zval property_body_default_value; @@ -3495,7 +3495,7 @@ static zend_class_entry *register_class_Dom_Document(zend_class_entry *class_ent ZVAL_UNDEF(&property_head_default_value); zend_string *property_head_name = zend_string_init("head", sizeof("head") - 1, true); zend_string *property_head_class_Dom_HTMLElement = zend_string_init("Dom\\HTMLElement", sizeof("Dom\\HTMLElement")-1, 1); - zend_declare_typed_property(class_entry, property_head_name, &property_head_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_head_class_Dom_HTMLElement, 0, MAY_BE_NULL)); + zend_declare_typed_property(class_entry, property_head_name, &property_head_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_head_class_Dom_HTMLElement, 0, MAY_BE_NULL)); zend_string_release_ex(property_head_name, true); zval property_title_default_value; @@ -3527,7 +3527,7 @@ static zend_class_entry *register_class_Dom_XMLDocument(zend_class_entry *class_ zval property_xmlEncoding_default_value; ZVAL_UNDEF(&property_xmlEncoding_default_value); zend_string *property_xmlEncoding_name = zend_string_init("xmlEncoding", sizeof("xmlEncoding") - 1, true); - zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); + zend_declare_typed_property(class_entry, property_xmlEncoding_name, &property_xmlEncoding_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING)); zend_string_release_ex(property_xmlEncoding_name, true); zval property_xmlStandalone_default_value; @@ -3562,7 +3562,7 @@ static zend_class_entry *register_class_Dom_TokenList(zend_class_entry *class_en zval property_length_default_value; ZVAL_UNDEF(&property_length_default_value); zend_string *property_length_name = zend_string_init("length", sizeof("length") - 1, true); - zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); + zend_declare_typed_property(class_entry, property_length_name, &property_length_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(property_length_name, true); zval property_value_default_value; @@ -3613,7 +3613,7 @@ static zend_class_entry *register_class_Dom_XPath(void) ZVAL_UNDEF(&property_document_default_value); zend_string *property_document_name = zend_string_init("document", sizeof("document") - 1, true); zend_string *property_document_class_Dom_Document = zend_string_init("Dom\\Document", sizeof("Dom\\Document")-1, 1); - zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_Dom_Document, 0, 0)); + zend_declare_typed_property(class_entry, property_document_name, &property_document_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_PRIVATE_SET|ZEND_ACC_VIRTUAL, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_document_class_Dom_Document, 0, 0)); zend_string_release_ex(property_document_name, true); zval property_registerNodeNamespaces_default_value; diff --git a/ext/dom/php_dom_decl.h b/ext/dom/php_dom_decl.h index f918637ab52d..e42fe5969595 100644 --- a/ext/dom/php_dom_decl.h +++ b/ext/dom/php_dom_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit php_dom.stub.php instead. - * Stub hash: e00668999f4fe9afee1f78f6986467a315f831a5 */ + * Stub hash: 8d7713834c924709155ed7acc554c9efc55e96c1 */ -#ifndef ZEND_PHP_DOM_DECL_e00668999f4fe9afee1f78f6986467a315f831a5_H -#define ZEND_PHP_DOM_DECL_e00668999f4fe9afee1f78f6986467a315f831a5_H +#ifndef ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H +#define ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H typedef enum zend_enum_Dom_AdjacentPosition { ZEND_ENUM_Dom_AdjacentPosition_BeforeBegin = 1, @@ -11,4 +11,4 @@ typedef enum zend_enum_Dom_AdjacentPosition { ZEND_ENUM_Dom_AdjacentPosition_AfterEnd = 4, } zend_enum_Dom_AdjacentPosition; -#endif /* ZEND_PHP_DOM_DECL_e00668999f4fe9afee1f78f6986467a315f831a5_H */ +#endif /* ZEND_PHP_DOM_DECL_8d7713834c924709155ed7acc554c9efc55e96c1_H */ diff --git a/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt b/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt index 78625fcb6f7d..cb623f702983 100644 --- a/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt +++ b/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt @@ -14,5 +14,5 @@ try { echo $dom->saveXml(); ?> --EXPECT-- -Cannot modify readonly property Dom\HTMLElement::$prefix +Cannot modify private(set) property Dom\Element::$prefix from global scope diff --git a/ext/dom/tests/property_write_errors.phpt b/ext/dom/tests/property_write_errors.phpt index 58cf800728a6..7d2af3b10555 100644 --- a/ext/dom/tests/property_write_errors.phpt +++ b/ext/dom/tests/property_write_errors.phpt @@ -49,8 +49,8 @@ try { ?> --EXPECT-- Cannot assign array to property DOMNode::$nodeValue of type ?string -Cannot modify readonly property DOMDocument::$nodeType -Cannot modify readonly property DOMDocument::$xmlEncoding -Cannot modify readonly property DOMEntity::$actualEncoding -Cannot modify readonly property DOMEntity::$encoding -Cannot modify readonly property DOMEntity::$version +Cannot modify private(set) property DOMNode::$nodeType from global scope +Cannot modify private(set) property DOMDocument::$xmlEncoding from global scope +Cannot modify private(set) property DOMEntity::$actualEncoding from global scope +Cannot modify private(set) property DOMEntity::$encoding from global scope +Cannot modify private(set) property DOMEntity::$version from global scope From 0236667bd941bec856ffb95e39f8f95b80c68edd Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 18 Apr 2026 07:17:48 +0100 Subject: [PATCH 260/300] ext/gmp: gmp_fact() reject values larger than unsigned long. close GH-21794 --- NEWS | 3 +++ UPGRADING | 4 ++++ ext/gmp/gmp.c | 6 ++++-- ext/gmp/tests/gmp_fact_overflow.phpt | 25 +++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 ext/gmp/tests/gmp_fact_overflow.phpt diff --git a/NEWS b/NEWS index f5c9cfa75502..2000d5b4710e 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,9 @@ PHP NEWS . imagesetstyle()/imagefilter()/imagecrop() check array argument entries types. (David Carlier) +- GMP: + . gmp_fact() reject values larger than unsigned long. (David Carlier) + - Hash: . Upgrade xxHash to 0.8.2. (timwolla) diff --git a/UPGRADING b/UPGRADING index 5e32a5418b52..10a63f6b03ad 100644 --- a/UPGRADING +++ b/UPGRADING @@ -141,6 +141,10 @@ PHP 8.6 UPGRADE NOTES 5. Changed Functions ======================================== +- GMP: + . gmp_fact() now throws a ValueError() if $num does not fit into + a unsigned long. + - mysqli: . The return structure of mysqli_get_charset() no longer contains the undocumented "comment" element. The value of "charsetnr" is diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index cf6580e95e9b..a20974580904 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1092,8 +1092,10 @@ ZEND_FUNCTION(gmp_fact) RETURN_THROWS(); } - // TODO: Check that we don't an int that is larger than an unsigned long? - // Could use mpz_fits_slong_p() if we revert to using mpz_get_si() + if (!mpz_fits_ulong_p(gmpnum)) { + zend_argument_value_error(1, "must be between 0 and %lu", ULONG_MAX); + RETURN_THROWS(); + } INIT_GMP_RETVAL(gmpnum_result); mpz_fac_ui(gmpnum_result, mpz_get_ui(gmpnum)); diff --git a/ext/gmp/tests/gmp_fact_overflow.phpt b/ext/gmp/tests/gmp_fact_overflow.phpt new file mode 100644 index 000000000000..2d22005818c5 --- /dev/null +++ b/ext/gmp/tests/gmp_fact_overflow.phpt @@ -0,0 +1,25 @@ +--TEST-- +gmp_fact() rejects values larger than unsigned long +--EXTENSIONS-- +gmp +--FILE-- +getMessage() . \PHP_EOL; +} + +try { + var_dump(gmp_fact(gmp_init("18446744073709551616"))); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +echo "Done\n"; +?> +--EXPECTF-- +gmp_fact(): Argument #1 ($num) must be between 0 and %d +gmp_fact(): Argument #1 ($num) must be between 0 and %d +Done From efecd1306b4ed40718f7171c8f2f9855249d0e08 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 18 Apr 2026 13:28:00 -0700 Subject: [PATCH 261/300] gen_stub: set up PHP 8.6 support (#21792) Add the new known string from #20951 --- build/gen_stub.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index e68c0b77c610..db7f4d400ed7 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -26,6 +26,7 @@ const PHP_83_VERSION_ID = 80300; const PHP_84_VERSION_ID = 80400; const PHP_85_VERSION_ID = 80500; +const PHP_86_VERSION_ID = 80600; const ALL_PHP_VERSION_IDS = [ PHP_70_VERSION_ID, PHP_80_VERSION_ID, @@ -34,6 +35,7 @@ PHP_83_VERSION_ID, PHP_84_VERSION_ID, PHP_85_VERSION_ID, + PHP_86_VERSION_ID, ]; // file_put_contents() but with a success message printed after saving @@ -2921,6 +2923,11 @@ class StringBuilder { '8.5' => 'ZEND_STR_8_DOT_5', ]; + // NEW in 8.6 + private const PHP_86_KNOWN = [ + "arguments" => "ZEND_STR_ARGUMENTS", + ]; + /** * Get an array of three strings: * - declaration of zend_string, if needed, or empty otherwise @@ -2959,6 +2966,10 @@ public static function getString( } $include = self::PHP_80_KNOWN; switch ($minPhp) { + case PHP_86_VERSION_ID: + $include = array_merge($include, self::PHP_86_KNOWN); + // Intentional fall through + case PHP_85_VERSION_ID: $include = array_merge($include, self::PHP_85_KNOWN); // Intentional fall through @@ -4148,7 +4159,8 @@ public function __construct(array $fileTags) { throw new Exception( "Legacy PHP version must be one of: \"" . PHP_70_VERSION_ID . "\" (PHP 7.0), \"" . PHP_80_VERSION_ID . "\" (PHP 8.0), " . "\"" . PHP_81_VERSION_ID . "\" (PHP 8.1), \"" . PHP_82_VERSION_ID . "\" (PHP 8.2), \"" . PHP_83_VERSION_ID . "\" (PHP 8.3), " . - "\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . $tag->value . "\" provided" + "\"" . PHP_84_VERSION_ID . "\" (PHP 8.4), \"" . PHP_85_VERSION_ID . "\" (PHP 8.5), \"" . PHP_86_VERSION_ID . "\" (PHP 8.6), " . + $tag->value . "\" provided" ); } From b40cae2b1f5979bc3a838fa425880fde1d5ac070 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 18 Apr 2026 22:47:41 +0100 Subject: [PATCH 262/300] [ci skip] ext/dom: NEWS/UPGRADING notes for asymmetric visibility on readonly properties. (#21809) --- NEWS | 5 +++++ UPGRADING | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/NEWS b/NEWS index 2000d5b4710e..8c2b185d328f 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,11 @@ PHP NEWS - DOM: . Removed LIBXML_XINCLUDE from valid options for XMLDocument, as it was a no-op. (ndossche) + . Readonly DOM properties are now declared with asymmetric visibility + (public private(set)). ReflectionProperty::isWritable() reports them + correctly, and external writes raise "Cannot modify private(set) + property" instead of the previous readonly modification error. + (David Carlier) - Fileinfo: . Fixed bug GH-20679 (finfo_file() doesn't work on remote resources). diff --git a/UPGRADING b/UPGRADING index 10a63f6b03ad..f7874c2d3472 100644 --- a/UPGRADING +++ b/UPGRADING @@ -19,6 +19,16 @@ PHP 8.6 UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- DOM: + . Properties previously documented as @readonly (e.g. DOMNode::$nodeType, + DOMDocument::$xmlEncoding, DOMEntity::$actualEncoding, ::$encoding, + ::$version) are now declared with asymmetric visibility + (public private(set)). Attempts to write to them from outside the + class now raise "Cannot modify private(set) property ::$ + from global scope" instead of the prior readonly modification error. + ReflectionProperty::isWritable() also reports these properties + accurately. + - GD: . imagesetstyle(), imagefilter() and imagecrop() filter their array arguments types/values and raise a TypeError/ValueError From fad432363485a1f6e47bc20e3929b50d892cd2c9 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 19 Apr 2026 11:31:47 +0200 Subject: [PATCH 263/300] Replace google.com with example.com in URI test fixtures (#21807) --- ext/uri/tests/008.phpt | 12 ++++++------ ext/uri/tests/031.phpt | 12 ++++++------ ext/uri/tests/032.phpt | 4 ++-- ext/uri/tests/033.phpt | 4 ++-- ext/uri/tests/034.phpt | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ext/uri/tests/008.phpt b/ext/uri/tests/008.phpt index e13130bb4c46..133f225aabf4 100644 --- a/ext/uri/tests/008.phpt +++ b/ext/uri/tests/008.phpt @@ -39,12 +39,12 @@ function callWhatWgGetters($url) var_dump($url->getFragment()); } -$uri = Uri\Rfc3986\Uri::parse("https://username:password@www.google.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); +$uri = Uri\Rfc3986\Uri::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); callRfc3986Getters($uri); echo "\n"; -$url = Uri\WhatWg\Url::parse("https://username:password@www.google.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); +$url = Uri\WhatWg\Url::parse("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); callWhatWgGetters($url); ?> @@ -57,8 +57,8 @@ string(8) "password" string(8) "password" string(17) "username:password" string(17) "username:password" -string(14) "www.google.com" -string(14) "www.google.com" +string(15) "www.example.com" +string(15) "www.example.com" int(8080) string(30) "/pathname1/pathname2/pathname3" string(30) "/pathname1/pathname2/pathname3" @@ -70,8 +70,8 @@ string(11) "hash-exists" string(5) "https" string(8) "username" string(8) "password" -string(14) "www.google.com" -string(14) "www.google.com" +string(15) "www.example.com" +string(15) "www.example.com" int(8080) string(30) "/pathname1/pathname2/pathname3" string(10) "query=true" diff --git a/ext/uri/tests/031.phpt b/ext/uri/tests/031.phpt index a761cf8a4d99..ae84596b54e0 100644 --- a/ext/uri/tests/031.phpt +++ b/ext/uri/tests/031.phpt @@ -5,7 +5,7 @@ uri --FILE-- getMessage() . "\n"; } -$url1 = new Uri\WhatWg\Url("https://username:password@www.google.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); +$url1 = new Uri\WhatWg\Url("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); $serializedUrl1 = serialize($url1); $url2 = unserialize($serializedUrl1); @@ -123,7 +123,7 @@ try { ?> --EXPECTF-- -string(163) "O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:98:"https://username:password@www.google.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}" +string(164) "O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:99:"https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}" object(Uri\Rfc3986\Uri)#%d (%d) { ["scheme"]=> string(5) "https" @@ -132,7 +132,7 @@ object(Uri\Rfc3986\Uri)#%d (%d) { ["password"]=> string(8) "password" ["host"]=> - string(14) "www.google.com" + string(15) "www.example.com" ["port"]=> int(8080) ["path"]=> @@ -150,7 +150,7 @@ Invalid serialization data for Uri\Rfc3986\Uri object Invalid serialization data for Uri\Rfc3986\Uri object Invalid serialization data for Uri\Rfc3986\Uri object Invalid serialization data for Uri\Rfc3986\Uri object -string(162) "O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:98:"https://username:password@www.google.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}" +string(163) "O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:99:"https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}" object(Uri\WhatWg\Url)#%d (%d) { ["scheme"]=> string(5) "https" @@ -159,7 +159,7 @@ object(Uri\WhatWg\Url)#%d (%d) { ["password"]=> string(8) "password" ["host"]=> - string(14) "www.google.com" + string(15) "www.example.com" ["port"]=> int(8080) ["path"]=> diff --git a/ext/uri/tests/032.phpt b/ext/uri/tests/032.phpt index b3e670223883..070d9dd01893 100644 --- a/ext/uri/tests/032.phpt +++ b/ext/uri/tests/032.phpt @@ -5,10 +5,10 @@ uri --FILE-- diff --git a/ext/uri/tests/033.phpt b/ext/uri/tests/033.phpt index 65e8ab26a2dd..dcfaa31c07ba 100644 --- a/ext/uri/tests/033.phpt +++ b/ext/uri/tests/033.phpt @@ -5,11 +5,11 @@ uri --FILE-- From 2d651e203dbce8b7c89a7039c0447ccc0469be93 Mon Sep 17 00:00:00 2001 From: Pratik Bhujel Date: Mon, 20 Apr 2026 13:34:42 +0545 Subject: [PATCH 264/300] zend_inheritance: Fix enum case conflict in trait binding (#21771) Fixes GH-21760. --- NEWS | 2 ++ Zend/tests/enum/gh21760.phpt | 19 +++++++++++++++++++ Zend/zend_inheritance.c | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 Zend/tests/enum/gh21760.phpt diff --git a/NEWS b/NEWS index 2790d81dccf9..97cbd684a76e 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS . Fixed bug GH-21699 (Assertion failure in shutdown_executor when resolving self::/parent::/static:: callables if the error handler throws). (macoaure) . Fixed bug GH-21603 (Missing addref for __unset). (ilutov) + . Fixed bug GH-21760 (Trait with class constant name conflict against + enum case causes SEGV). (Pratik Bhujel) - CLI: . Fixed bug GH-21754 (`--rf` command line option with a method triggers diff --git a/Zend/tests/enum/gh21760.phpt b/Zend/tests/enum/gh21760.phpt new file mode 100644 index 000000000000..0835e3ca937d --- /dev/null +++ b/Zend/tests/enum/gh21760.phpt @@ -0,0 +1,19 @@ +--TEST-- +GH-21760 (Trait with class constant name conflict against enum case causes SEGV) +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use trait X, because X::Up conflicts with enum case Direction::Up in %s on line %d diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 56e5bdb9295a..eba21dd8e82a 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -2757,6 +2757,19 @@ static void emit_incompatible_trait_constant_error( ); } +static void emit_trait_constant_enum_case_conflict_error( + const zend_class_entry *ce, const zend_class_constant *trait_constant, zend_string *name +) { + zend_error_noreturn(E_COMPILE_ERROR, + "Cannot use trait %s, because %s::%s conflicts with enum case %s::%s", + ZSTR_VAL(trait_constant->ce->name), + ZSTR_VAL(trait_constant->ce->name), + ZSTR_VAL(name), + ZSTR_VAL(ce->name), + ZSTR_VAL(name) + ); +} + static bool do_trait_constant_check( zend_class_entry *ce, zend_class_constant *trait_constant, zend_string *name, zend_class_entry **traits, size_t current_trait ) { @@ -2770,6 +2783,11 @@ static bool do_trait_constant_check( zend_class_constant *existing_constant = Z_PTR_P(zv); + if (UNEXPECTED(ZEND_CLASS_CONST_FLAGS(existing_constant) & ZEND_CLASS_CONST_IS_CASE)) { + emit_trait_constant_enum_case_conflict_error(ce, trait_constant, name); + return false; + } + if ((ZEND_CLASS_CONST_FLAGS(trait_constant) & flags_mask) != (ZEND_CLASS_CONST_FLAGS(existing_constant) & flags_mask)) { emit_incompatible_trait_constant_error(ce, existing_constant, trait_constant, name, traits, current_trait); return false; From 46286fbf22a05f0cb146961859f2bb62b82b4ae6 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 20 Apr 2026 08:55:24 +0000 Subject: [PATCH 265/300] Accept HY000 in pdo_firebird autocommit test (#21789) --- ext/pdo_firebird/tests/autocommit.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_firebird/tests/autocommit.phpt b/ext/pdo_firebird/tests/autocommit.phpt index 5b431859bf85..89685e020198 100644 --- a/ext/pdo_firebird/tests/autocommit.phpt +++ b/ext/pdo_firebird/tests/autocommit.phpt @@ -74,9 +74,9 @@ array(1) { ========== not in auto commit mode ========== auto commit mode OFF insert, expect error -SQLSTATE[08003]: Connection does not exist: %s +%r(SQLSTATE\[08003\]: Connection does not exist|SQLSTATE\[HY000\]: General error)%r: %s select, expect error -SQLSTATE[08003]: Connection does not exist: %s +%r(SQLSTATE\[08003\]: Connection does not exist|SQLSTATE\[HY000\]: General error)%r: %s done! From 2bd6579e56b59883189b1df6ba411c734104502d Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 20 Apr 2026 20:32:04 +0700 Subject: [PATCH 266/300] Check for __has_attribute(x) and/or clang instead of only basing existence on ZEND_GCC_VERSION (#21622) --- Zend/zend_cpuinfo.h | 9 +++++---- Zend/zend_portability.h | 14 +++++++------- ext/opcache/jit/zend_jit_ir.c | 3 ++- ext/opcache/zend_shared_alloc.h | 6 +++++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index 2290a702475d..513dacfd08f5 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -271,8 +271,8 @@ static zend_always_inline int zend_cpu_supports_avx512_vbmi(void) { } #endif -/* __builtin_cpu_supports has pclmul from gcc9 */ -#if defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) +/* __builtin_cpu_supports has pclmul from gcc9 and clang 19 */ +#if defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && (!defined(__GNUC__) || (defined(__clang__) && __clang_major__ >= 19) || (ZEND_GCC_VERSION >= 9000)) ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_pclmul(void) { #ifdef PHP_HAVE_BUILTIN_CPU_INIT @@ -286,8 +286,9 @@ static inline int zend_cpu_supports_pclmul(void) { } #endif -/* __builtin_cpu_supports has cldemote from gcc11 */ -#if defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && defined(__GNUC__) && (ZEND_GCC_VERSION >= 11000) +/* __builtin_cpu_supports has cldemote from gcc11 and clang 19 */ +#if defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && ((defined(__clang__) && (__clang_major__ >= 19)) || (!defined(__clang__) && defined(__GNUC__) && (ZEND_GCC_VERSION >= 11000))) +#define HAVE_ZEND_CPU_SUPPORTS_CLDEMOTE 1 ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_cldemote(void) { #ifdef PHP_HAVE_BUILTIN_CPU_INIT diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index e4d90058a699..6801131e41da 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -270,7 +270,7 @@ char *alloca(); # define ZEND_ATTRIBUTE_NODISCARD #endif -#if ZEND_GCC_VERSION >= 3000 +#if ZEND_GCC_VERSION >= 3000 || __has_attribute(const) # define ZEND_ATTRIBUTE_CONST __attribute__((const)) #else # define ZEND_ATTRIBUTE_CONST @@ -312,7 +312,7 @@ char *alloca(); # define ZEND_ATTRIBUTE_NONNULL_ARGS(...) #endif -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003 +#if (defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(cold) # define ZEND_COLD __attribute__((cold)) # ifdef __OPTIMIZE__ # define ZEND_OPT_SIZE __attribute__((optimize("Os"))) @@ -327,7 +327,7 @@ char *alloca(); # define ZEND_OPT_SPEED #endif -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 5000 +#if (defined(__GNUC__) && ZEND_GCC_VERSION >= 5000) # define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((unused)); # define ZEND_ATTRIBUTE_COLD_LABEL __attribute__((cold)); #else @@ -651,8 +651,8 @@ extern "C++" { #endif /* Do not use for conditional declaration of API functions! */ -#if defined(ZEND_INTRIN_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) -/* __builtin_cpu_supports has pclmul from gcc9 */ +#if defined(ZEND_INTRIN_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (defined(__clang__) && __clang_major__ >= 19) || (ZEND_GCC_VERSION >= 9000)) +/* __builtin_cpu_supports has pclmul from gcc9 and clang 19 */ # define ZEND_INTRIN_PCLMUL_FUNC_PROTO 1 #elif defined(ZEND_INTRIN_PCLMUL_RESOLVER) # define ZEND_INTRIN_PCLMUL_FUNC_PTR 1 @@ -677,8 +677,8 @@ extern "C++" { #endif /* Do not use for conditional declaration of API functions! */ -#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (ZEND_GCC_VERSION >= 9000)) -/* __builtin_cpu_supports has pclmul from gcc9 */ +#if defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) && defined(ZEND_INTRIN_HAVE_IFUNC_TARGET) && (!defined(__GNUC__) || (defined(__clang__) && __clang_major__ >= 19) || (ZEND_GCC_VERSION >= 9000)) +/* __builtin_cpu_supports has pclmul from gcc9 and clang 19 */ # define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PROTO 1 #elif defined(ZEND_INTRIN_SSE4_2_PCLMUL_RESOLVER) # define ZEND_INTRIN_SSE4_2_PCLMUL_FUNC_PTR 1 diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 2461d024dd6a..c4b88b74f64d 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -14,6 +14,7 @@ +----------------------------------------------------------------------+ */ +#include "Zend/zend_cpuinfo.h" #include "Zend/zend_types.h" #include "Zend/zend_type_info.h" #include "jit/ir/ir.h" @@ -3394,7 +3395,7 @@ static void zend_jit_setup(bool reattached) if (zend_cpu_supports_avx()) { allowed_opt_flags |= ZEND_JIT_CPU_AVX; } -# if defined(PHP_HAVE_BUILTIN_CPU_SUPPORTS) && defined(__GNUC__) && (ZEND_GCC_VERSION >= 11000) +# ifdef HAVE_ZEND_CPU_SUPPORTS_CLDEMOTE if (zend_cpu_supports_cldemote()) { default_mflags |= IR_X86_CLDEMOTE; } diff --git a/ext/opcache/zend_shared_alloc.h b/ext/opcache/zend_shared_alloc.h index 23d515f5b9f2..cf0bb10d8932 100644 --- a/ext/opcache/zend_shared_alloc.h +++ b/ext/opcache/zend_shared_alloc.h @@ -164,7 +164,11 @@ typedef union _align_test { zend_long lng; } align_test; -#if ZEND_GCC_VERSION >= 2000 +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define PLATFORM_ALIGNMENT (alignof(align_test) < 8 ? 8 : alignof(align_test)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define PLATFORM_ALIGNMENT (_Alignof(align_test) < 8 ? 8 : _Alignof(align_test)) +#elif ZEND_GCC_VERSION >= 2000 || defined(__clang__) # define PLATFORM_ALIGNMENT (__alignof__(align_test) < 8 ? 8 : __alignof__(align_test)) #else # define PLATFORM_ALIGNMENT (sizeof(align_test)) From 7cd8a0a0a471b12bd2940fbb3b1406d9d77ec911 Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 20 Apr 2026 21:20:59 +0700 Subject: [PATCH 267/300] [Windows] Improve clang-cl support (#21618) * fix compiling (intl) C++ extensions --with-toolset=clang * guard the double extern "C" { ... } for clang-only * don't error on warnings with clang * enable compiler intrinsics for clang too * make --enable-compiler-intrinsics=no same as disabled * add clang windows x64 ZTS test * remove check if it's clang * debloat logs from common warning * @shivammathur feedback * remove CI changes * rebase on https://github.com/php/php-src/pull/21630 * fix default to asan => false * bring back explicit error * fix typo --- .github/matrix.php | 15 ++-- .github/scripts/windows/build_task.bat | 8 +- .github/workflows/test-suite.yml | 3 +- TSRM/TSRM.h | 7 +- win32/build/confutils.js | 116 ++++++++++++++----------- 5 files changed, 90 insertions(+), 59 deletions(-) diff --git a/.github/matrix.php b/.github/matrix.php index dec8c7d249c6..18c2ef1269b7 100644 --- a/.github/matrix.php +++ b/.github/matrix.php @@ -144,12 +144,15 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re $jobs['SOLARIS'] = true; } if ($all_jobs || !$no_jobs || $test_windows) { - $jobs['WINDOWS']['matrix'] = $all_variations - ? ['include' => [ - ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true], - ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false], - ]] - : ['include' => [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]]; + $matrix = [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]; + if ($all_variations) { + $matrix[] = ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]; + $matrix[] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; + if (version_compare($php_version, '8.5', '>=')) { + $matrix[] = ['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true, 'clang' => true]; + } + } + $jobs['WINDOWS']['matrix'] = ['include' => $matrix]; $jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=') ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index b65479451849..1177cef3be4d 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -26,12 +26,18 @@ if %errorlevel% neq 0 exit /b 3 if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS% if "%ASAN%" equ "1" set ADD_CONF=%ADD_CONF% --enable-sanitizer --enable-debug-pack +if "%CLANG_TOOLSET%" equ "1" set ADD_CONF=%ADD_CONF% --with-toolset=clang rem C4018: comparison: signed/unsigned mismatch rem C4146: unary minus operator applied to unsigned type rem C4244: type conversion, possible loss of data rem C4267: 'size_t' type conversion, possible loss of data -set CFLAGS=/W3 /WX /wd4018 /wd4146 /wd4244 /wd4267 +if "%CLANG_TOOLSET%" equ "1" ( + rem Clang is much stricter than MSVC, produces too many warnings that would fail the build with /WX + set CFLAGS=/W3 /wd4018 /wd4146 /wd4244 /wd4267 +) else ( + set CFLAGS=/W3 /WX /wd4018 /wd4146 /wd4244 /wd4267 +) cmd /c configure.bat ^ --enable-snapshot-build ^ diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 90bcafd16307..4905dcb9ccbc 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -940,7 +940,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(inputs.branch).jobs.WINDOWS.matrix }} - name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}" + name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}${{ matrix.clang && '_CLANG' || ''}}" runs-on: windows-2022 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache @@ -954,6 +954,7 @@ jobs: PARALLEL: -j2 OPCACHE: "${{ matrix.opcache && '1' || '0' }}" ASAN: "${{ matrix.asan && '1' || '0' }}" + CLANG_TOOLSET: "${{ matrix.clang && '1' || '0' }}" steps: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 80d6cbad0443..ea13552c8374 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -175,9 +175,14 @@ TSRM_API bool tsrm_is_managed_thread(void); #define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)]) #define TSRMG_FAST_STATIC(offset, type, element) (TSRMG_FAST_BULK_STATIC(offset, type)->element) #define TSRMG_FAST_BULK_STATIC(offset, type) ((type) (((char*) TSRMLS_CACHE)+(offset))) +#ifdef __cplusplus +#define TSRMLS_MAIN_CACHE_EXTERN() extern "C" { extern TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR; } +#define TSRMLS_CACHE_EXTERN() extern "C" { extern TSRM_TLS void *TSRMLS_CACHE; } +#else #define TSRMLS_MAIN_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR; -#define TSRMLS_MAIN_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR = NULL; #define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE; +#endif +#define TSRMLS_MAIN_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE TSRM_TLS_MODEL_ATTR = NULL; #define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL; #define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache() #define TSRMLS_CACHE _tsrm_ls_cache diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 36484e71f8fb..fd1e9ce0be10 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3361,7 +3361,7 @@ function toolset_setup_common_cflags() ADD_FLAG("CFLAGS", "/Zc:wchar_t"); } else if (CLANG_TOOLSET) { - ADD_FLAG("CFLAGS", "-Wno-deprecated-declarations"); + ADD_FLAG("CFLAGS", "-Wno-deprecated-declarations -Wno-microsoft-enum-forward-reference"); if (TARGET_ARCH == 'x86') { ADD_FLAG('CFLAGS', '-m32'); } else { @@ -3395,24 +3395,25 @@ function toolset_setup_intrinsic_cflags() /* From oldest to newest. */ var scale = new Array("sse", "sse2", "sse3", "ssse3", "sse4.1", "sse4.2", "avx", "avx2", "avx512"); - if (VS_TOOLSET) { - if ("disabled" == PHP_NATIVE_INTRINSICS) { - ERROR("Can't enable intrinsics, --with-codegen-arch passed with an incompatible option. ") - } + if ("disabled" == PHP_NATIVE_INTRINSICS) { + ERROR("Can't enable intrinsics, --with-codegen-arch passed with an incompatible option. ") + } - if (TARGET_ARCH == 'arm64') { - /* arm64 supports neon */ - configure_subst.Add("PHP_SIMD_SCALE", 'NEON'); - /* all officially supported arm64 cpu supports crc32 (TODO: to be confirmed) */ - AC_DEFINE('HAVE_ARCH64_CRC32', 1); - return; - } + if (TARGET_ARCH == 'arm64') { + /* arm64 supports neon */ + configure_subst.Add("PHP_SIMD_SCALE", 'NEON'); + /* all officially supported arm64 cpu supports crc32 (TODO: to be confirmed) */ + AC_DEFINE('HAVE_ARCH64_CRC32', 1); + return; + } - if ("no" == PHP_NATIVE_INTRINSICS || "yes" == PHP_NATIVE_INTRINSICS) { - PHP_NATIVE_INTRINSICS = default_enabled; - } + // if --enable-native-intrisics is not specified, it's "no" - enable default + if ("no" == PHP_NATIVE_INTRINSICS || "yes" == PHP_NATIVE_INTRINSICS) { + PHP_NATIVE_INTRINSICS = default_enabled; + } - if ("all" == PHP_NATIVE_INTRINSICS) { + if ("all" == PHP_NATIVE_INTRINSICS) { + if (VS_TOOLSET) { var list = (new VBArray(avail.Keys())).toArray(); for (var i in list) { @@ -3421,46 +3422,61 @@ function toolset_setup_intrinsic_cflags() /* All means all. __AVX__, __AVX2__, and __AVX512*__ are defined by compiler. */ ADD_FLAG("CFLAGS","/arch:AVX512"); - configure_subst.Add("PHP_SIMD_SCALE", "AVX512"); - } else { - var list = PHP_NATIVE_INTRINSICS.split(","); - var j = 0; - for (var k = 0; k < scale.length; k++) { - for (var i = 0; i < list.length; i++) { - var it = list[i].toLowerCase(); - if (scale[k] == it) { - j = k > j ? k : j; - } else if (!avail.Exists(it) && "avx512" != it && "avx2" != it && "avx" != it) { - WARNING("Unknown intrinsic name '" + it + "' ignored"); - } - } - } - if (TARGET_ARCH == 'x86') { - /* SSE2 is currently the default on 32-bit. It could change later, - for now no need to pass it. But, if SSE only was chosen, - /arch:SSE is required. */ - if ("sse" == scale[j]) { - ADD_FLAG("CFLAGS","/arch:SSE"); + } else if (CLANG_TOOLSET) { + ADD_FLAG("CFLAGS","-mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl"); + } + configure_subst.Add("PHP_SIMD_SCALE", "AVX512"); + } else { + var list = PHP_NATIVE_INTRINSICS.split(","); + var j = 0; + for (var k = 0; k < scale.length; k++) { + for (var i = 0; i < list.length; i++) { + var it = list[i].toLowerCase(); + if (scale[k] == it) { + j = k > j ? k : j; + } else if (!avail.Exists(it) && "avx512" != it && "avx2" != it && "avx" != it) { + WARNING("Unknown intrinsic name '" + it + "' ignored"); } } - configure_subst.Add("PHP_SIMD_SCALE", scale[j].toUpperCase()); - /* There is no explicit way to enable intrinsics between SSE3 and SSE4.2. - The declared macros therefore won't affect the code generation, - but will enable the guarded code parts. */ - if ("avx512" == scale[j]) { - ADD_FLAG("CFLAGS","/arch:AVX512"); - j -= 3; - } else if ("avx2" == scale[j]) { - ADD_FLAG("CFLAGS","/arch:AVX2"); - j -= 2; - } else if ("avx" == scale[j]) { - ADD_FLAG("CFLAGS","/arch:AVX"); - j -= 1; - } + } + if (TARGET_ARCH == 'x86') { + /* SSE2 is currently the default on 32-bit. It could change later, + for now no need to pass it. But, if SSE only was chosen, + /arch:SSE is required. */ + if ("sse" == scale[j]) { + ADD_FLAG("CFLAGS", VS_TOOLSET ? "/arch:SSE" : "-msse"); + } + } + configure_subst.Add("PHP_SIMD_SCALE", scale[j].toUpperCase()); + if ("avx512" == scale[j]) { + ADD_FLAG("CFLAGS", VS_TOOLSET ? "/arch:AVX512" : "-mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl"); + j -= 3; + } else if ("avx2" == scale[j]) { + ADD_FLAG("CFLAGS", VS_TOOLSET ? "/arch:AVX2" : "-mavx2"); + j -= 2; + } else if ("avx" == scale[j]) { + ADD_FLAG("CFLAGS", VS_TOOLSET ? "/arch:AVX" : "-mavx"); + j -= 1; + } + if (VS_TOOLSET) { + /* MSVC has no explicit way to enable intrinsics between SSE3 and SSE4.2. + The declared macros won't affect code generation, but will enable + the guarded code parts. */ for (var i = 0; i <= j; i++) { var it = scale[i]; AC_DEFINE(avail.Item(it), 1); } + } else if (CLANG_TOOLSET) { + /* clang supports -m flags for each SSE level and auto-defines + the corresponding __SSE*__ macros. Pass the highest requested + level; clang implicitly enables all lower levels. */ + var clang_flag_map = { + "sse": "-msse", "sse2": "-msse2", "sse3": "-msse3", + "ssse3": "-mssse3", "sse4.1": "-msse4.1", "sse4.2": "-msse4.2" + }; + if (clang_flag_map[scale[j]]) { + ADD_FLAG("CFLAGS", clang_flag_map[scale[j]]); + } } } } From 3afd6d3e7569a54fb830f09f868ff914a35d1b14 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Mon, 20 Apr 2026 22:57:07 +0800 Subject: [PATCH 268/300] /ext/standard: Check for empty string in linkinfo() (#21793) --- NEWS | 2 ++ UPGRADING | 1 + ext/standard/link.c | 6 +++++- .../file/symlink_link_linkinfo_is_link_error1.phpt | 14 ++++++-------- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 8c2b185d328f..481c4ea2c385 100644 --- a/NEWS +++ b/NEWS @@ -166,6 +166,8 @@ PHP NEWS throw a ValueError. (alexandre-daubois) . array_change_key_case() now raises a ValueError when an invalid $case argument value is passed. (Girgias) + . linkinfo() now raises a ValueError when the argument is an empty string. + (Weilin Du) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index f7874c2d3472..0e66a96909f5 100644 --- a/UPGRADING +++ b/UPGRADING @@ -88,6 +88,7 @@ PHP 8.6 UPGRADE NOTES argument value is passed. . array_change_key_case() now raises a ValueError when an invalid $case argument value is passed. + . linkinfo() now raises a ValueError when the $path argument is empty. . pathinfo() now raises a ValueError when an invalid $flag argument value is passed. . scandir() now raises a ValueError when an invalid $sorting_order diff --git a/ext/standard/link.c b/ext/standard/link.c index d92e74bb6743..dfd92a0a8709 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -84,7 +84,11 @@ PHP_FUNCTION(linkinfo) Z_PARAM_PATH(link, link_len) ZEND_PARSE_PARAMETERS_END(); - // TODO Check for empty string + if (UNEXPECTED(link_len == 0)) { + zend_argument_must_not_be_empty_error(1); + RETURN_THROWS(); + } + dirname = estrndup(link, link_len); zend_dirname(dirname, link_len); diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index f4035f8f40a2..c8420ea86fb2 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -27,8 +27,11 @@ var_dump( symlink($filename, false) ); // false as linkname echo "\n*** Testing linkinfo() for error conditions ***\n"; //invalid arguments -var_dump( linkinfo('') ); // empty string as linkname -var_dump( linkinfo(false) ); // boolean false as linkname +try { + var_dump(linkinfo('')); // empty string as linkname +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} echo "Done\n"; ?> @@ -53,10 +56,5 @@ Warning: symlink(): %s in %s on line %d bool(false) *** Testing linkinfo() for error conditions *** - -Warning: linkinfo(): %s in %s on line %d -int(-1) - -Warning: linkinfo(): %s in %s on line %d -int(-1) +linkinfo(): Argument #1 ($path) must not be empty Done From 383ff8c63f3bfc3b28704dd75055ca8f7a105e50 Mon Sep 17 00:00:00 2001 From: Jorg Adam Sowa Date: Mon, 20 Apr 2026 17:45:06 +0200 Subject: [PATCH 269/300] ext/session: improve parsing of session.cookie_lifetime (#21704) When session.cookie_lifetime was set to a value larger than maxcookie, OnUpdateCookieLifetime returned SUCCESS without updating the internal long value, causing ini_get() string and PS(cookie_lifetime) to go out of sync. We now properly parse the string value of the ini setting and fail when it is not an integer string or is not within the expected range. --- ext/session/session.c | 18 ++++-- ext/session/tests/gh16290.phpt | 5 +- .../session_cookie_lifetime_invalid.phpt | 55 +++++++++++++++++++ .../session_get_cookie_params_basic.phpt | 6 +- .../session_set_cookie_params_basic.phpt | 2 +- .../session_set_cookie_params_variation1.phpt | 4 +- .../session_set_cookie_params_variation8.phpt | 2 +- 7 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 ext/session/tests/session_cookie_lifetime_invalid.phpt diff --git a/ext/session/session.c b/ext/session/session.c index 14b443bf4c6e..96e32ea7043f 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -704,12 +704,20 @@ static PHP_INI_MH(OnUpdateCookieLifetime) #else const zend_long maxcookie = ZEND_LONG_MAX / 2 - 1; #endif - zend_long v = (zend_long)atol(ZSTR_VAL(new_value)); - if (v < 0) { - php_error_docref(NULL, E_WARNING, "CookieLifetime cannot be negative"); + zend_long lval = 0; + int oflow = 0; + uint8_t type = is_numeric_string_ex(ZSTR_VAL(new_value), ZSTR_LEN(new_value), &lval, NULL, false, &oflow, NULL); + if (UNEXPECTED(type != IS_LONG)) { + if (oflow != 0) { + php_error_docref(NULL, E_WARNING, "session.cookie_lifetime must be between 0 and " ZEND_LONG_FMT, maxcookie); + } else { + php_error_docref(NULL, E_WARNING, "session.cookie_lifetime must be of type int"); + } + return FAILURE; + } + if (lval < 0 || lval > maxcookie) { + php_error_docref(NULL, E_WARNING, "session.cookie_lifetime must be between 0 and " ZEND_LONG_FMT, maxcookie); return FAILURE; - } else if (v > maxcookie) { - return SUCCESS; } return OnUpdateLongGEZero(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); diff --git a/ext/session/tests/gh16290.phpt b/ext/session/tests/gh16290.phpt index d341eb47471b..df57b129649d 100644 --- a/ext/session/tests/gh16290.phpt +++ b/ext/session/tests/gh16290.phpt @@ -6,8 +6,11 @@ session --FILE-- ---EXPECT-- +--EXPECTF-- +Warning: session_set_cookie_params(): session.cookie_lifetime must be between 0 and %d in %s on line %d DONE diff --git a/ext/session/tests/session_cookie_lifetime_invalid.phpt b/ext/session/tests/session_cookie_lifetime_invalid.phpt new file mode 100644 index 000000000000..8665a53447b9 --- /dev/null +++ b/ext/session/tests/session_cookie_lifetime_invalid.phpt @@ -0,0 +1,55 @@ +--TEST-- +session.cookie_lifetime rejects invalid values +--EXTENSIONS-- +session +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: ini_set(): session.cookie_lifetime must be of type int in %s on line %d +string(3) "100" + +Warning: ini_set(): session.cookie_lifetime must be of type int in %s on line %d +string(3) "100" + +Warning: ini_set(): session.cookie_lifetime must be between 0 and %d in %s on line %d +string(3) "100" + +Warning: ini_set(): session.cookie_lifetime must be between 0 and %d in %s on line %d +string(3) "100" + +Warning: ini_set(): session.cookie_lifetime must be between 0 and %d in %s on line %d +string(3) "100" +string(3) "200" diff --git a/ext/session/tests/session_get_cookie_params_basic.phpt b/ext/session/tests/session_get_cookie_params_basic.phpt index 1c7cdf189fc9..73ffd4c94d1e 100644 --- a/ext/session/tests/session_get_cookie_params_basic.phpt +++ b/ext/session/tests/session_get_cookie_params_basic.phpt @@ -22,7 +22,7 @@ echo "*** Testing session_get_cookie_params() : basic functionality ***\n"; var_dump(session_get_cookie_params()); var_dump(session_set_cookie_params(3600, "/path", "blah", FALSE, FALSE)); var_dump(session_get_cookie_params()); -var_dump(session_set_cookie_params(1234567890, "/guff", "foo", TRUE, TRUE)); +var_dump(session_set_cookie_params(1000000000, "/guff", "foo", TRUE, TRUE)); var_dump(session_get_cookie_params()); var_dump(session_set_cookie_params([ "lifetime" => 123, @@ -40,7 +40,7 @@ var_dump(session_get_cookie_params()); echo "Done"; ob_end_flush(); ?> ---EXPECTF-- +--EXPECT-- *** Testing session_get_cookie_params() : basic functionality *** array(7) { ["lifetime"]=> @@ -78,7 +78,7 @@ array(7) { bool(true) array(7) { ["lifetime"]=> - int(%d) + int(1000000000) ["path"]=> string(5) "/guff" ["domain"]=> diff --git a/ext/session/tests/session_set_cookie_params_basic.phpt b/ext/session/tests/session_set_cookie_params_basic.phpt index 386280d17861..27cfd59b183e 100644 --- a/ext/session/tests/session_set_cookie_params_basic.phpt +++ b/ext/session/tests/session_set_cookie_params_basic.phpt @@ -15,7 +15,7 @@ var_dump(session_set_cookie_params(3600)); var_dump(session_start()); var_dump(session_set_cookie_params(1800)); var_dump(session_destroy()); -var_dump(session_set_cookie_params(1234567890)); +var_dump(session_set_cookie_params(1000000000)); echo "Done"; ob_end_flush(); diff --git a/ext/session/tests/session_set_cookie_params_variation1.phpt b/ext/session/tests/session_set_cookie_params_variation1.phpt index ed0b8dc9755d..ce4b98457bea 100644 --- a/ext/session/tests/session_set_cookie_params_variation1.phpt +++ b/ext/session/tests/session_set_cookie_params_variation1.phpt @@ -24,7 +24,7 @@ var_dump(ini_get("session.cookie_lifetime")); var_dump(session_destroy()); var_dump(ini_get("session.cookie_lifetime")); -var_dump(session_set_cookie_params(1234567890)); +var_dump(session_set_cookie_params(1000000000)); var_dump(ini_get("session.cookie_lifetime")); echo "Done"; @@ -44,5 +44,5 @@ string(4) "3600" bool(true) string(4) "3600" bool(true) -string(10) "1234567890" +string(10) "1000000000" Done diff --git a/ext/session/tests/session_set_cookie_params_variation8.phpt b/ext/session/tests/session_set_cookie_params_variation8.phpt index 891133b5b01e..1497ded69d5f 100644 --- a/ext/session/tests/session_set_cookie_params_variation8.phpt +++ b/ext/session/tests/session_set_cookie_params_variation8.phpt @@ -25,7 +25,7 @@ bool(true) string(1) "0" string(1) "0" -Warning: session_set_cookie_params(): CookieLifetime cannot be negative in %s on line %d +Warning: session_set_cookie_params(): session.cookie_lifetime must be between 0 and %d in %s on line %d bool(false) string(1) "0" Done From b77b50508bb606c686ea3e902f96de26054258a0 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 18 Apr 2026 08:10:44 -0400 Subject: [PATCH 270/300] phar: restore is_link handler in phar_intercept_functions_shutdown phar_intercept_functions_init hooks 22 built-in functions via PHAR_INTERCEPT. phar_intercept_functions_shutdown restores all of them via PHAR_RELEASE except is_link, which was simply missing from the list. On MSHUTDOWN the is_link entry in CG(function_table) retains the phar intercept handler. In a persistent SAPI, if the module is reloaded, the second MINIT saves PHP_FN(phar_is_link) as orig_is_link, and any subsequent is_link() call recurses infinitely. Closes GH-21800 --- ext/phar/func_interceptors.c | 1 + ext/phar/tests/phar-is-link-intercept.phpt | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ext/phar/tests/phar-is-link-intercept.phpt diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index f1b2b0eba1e6..9d83f740d501 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -932,6 +932,7 @@ void phar_intercept_functions_shutdown(void) PHAR_RELEASE(fopen); PHAR_RELEASE(file_get_contents); PHAR_RELEASE(is_file); + PHAR_RELEASE(is_link); PHAR_RELEASE(is_dir); PHAR_RELEASE(opendir); PHAR_RELEASE(file_exists); diff --git a/ext/phar/tests/phar-is-link-intercept.phpt b/ext/phar/tests/phar-is-link-intercept.phpt new file mode 100644 index 000000000000..f81f1ae425d7 --- /dev/null +++ b/ext/phar/tests/phar-is-link-intercept.phpt @@ -0,0 +1,29 @@ +--TEST-- +phar: is_link() intercept correctly delegates for non-symlink phar entries +--EXTENSIONS-- +phar +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +addFromString('file.txt', 'hello'); +$phar->setStub(''); +include $fname; +?> +--CLEAN-- + +--EXPECT-- +regular entry (not a symlink): bool(false) +missing entry: bool(false) +absolute phar:// path (bypasses intercept): bool(false) From 36c4195a2e56814263bb62ad9849aebd8ebd69bf Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 18 Apr 2026 08:46:43 -0400 Subject: [PATCH 271/300] phar: fix NULL dereference in Phar::webPhar() when SCRIPT_NAME is absent In the CGI/FastCGI branch of webPhar(), sapi_getenv("SCRIPT_NAME") can return NULL when the upstream server doesn't forward SCRIPT_NAME in the FastCGI params block. The return value was passed directly to strstr() without a NULL check, causing a segfault. Add a NULL guard that jumps to the finish: label, which is already used for the "SCRIPT_NAME doesn't match the phar basename" case. The fix matches the intent of the existing strstr check and requires no new cleanup. Closes GH-21797 Closes GH-21802 --- ext/phar/phar_object.c | 3 +++ ext/phar/tests/gh21797.phpt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ext/phar/tests/gh21797.phpt diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 18db3190bb03..cd888adc41e6 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -649,6 +649,9 @@ PHP_METHOD(Phar, webPhar) char *testit; testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1); + if (!testit) { + goto finish; + } if (!(pt = strstr(testit, basename))) { efree(testit); goto finish; diff --git a/ext/phar/tests/gh21797.phpt b/ext/phar/tests/gh21797.phpt new file mode 100644 index 000000000000..b24e30b7829a --- /dev/null +++ b/ext/phar/tests/gh21797.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-21797: Phar::webPhar() NULL dereference when SCRIPT_NAME absent from SAPI environment +--CGI-- +--EXTENSIONS-- +phar +--INI-- +phar.readonly=0 +phar.require_hash=0 +variables_order=EGPC +register_argc_argv=0 +cgi.fix_pathinfo=0 +--ENV-- +REQUEST_METHOD=GET +PATH_INFO=/gh21797.phar +--FILE-- +addFromString('index.php', ''); +$phar->setStub(''); +unset($phar); +include $fname; +?> +--CLEAN-- + +--EXPECT-- +no crash From b9aaa050985c110e3a5b23741106d3c094d1e86b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 18 Apr 2026 09:17:43 -0400 Subject: [PATCH 272/300] phar: free is_temp_dir entry before rejecting .phar/* paths in offsetGet Phar::offsetGet() calls phar_get_entry_info_dir with allow_dir=1, which may return a heap-allocated temporary directory entry (is_temp_dir=1) for paths that resolve to a virtual directory in the manifest. Three early-exit paths for .phar/stub.php, .phar/alias.txt, and the generic .phar/* prefix all called RETURN_THROWS() before the is_temp_dir cleanup block, leaking the entry and its filename buffer on every rejection. Move the is_temp_dir cleanup before the .phar/* guards so all exit paths release the temporary entry regardless of which rejection fires. Closes GH-21798 --- ext/phar/phar_object.c | 10 ++--- .../tests/gh21798-offsetget-temp-entry.phpt | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 ext/phar/tests/gh21798-offsetget-temp-entry.phpt diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index cd888adc41e6..e9d49567c822 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3594,6 +3594,11 @@ PHP_METHOD(Phar, offsetGet) if (!(entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, 0))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", ZSTR_VAL(file_name), error?", ":"", error?error:""); } else { + if (entry->is_temp_dir) { + efree(entry->filename); + efree(entry); + } + if (zend_string_equals_literal(file_name, ".phar/stub.php")) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname); RETURN_THROWS(); @@ -3609,11 +3614,6 @@ PHP_METHOD(Phar, offsetGet) RETURN_THROWS(); } - if (entry->is_temp_dir) { - efree(entry->filename); - efree(entry); - } - zend_string *sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, ZSTR_VAL(file_name)); zval zfname; ZVAL_NEW_STR(&zfname, sfname); diff --git a/ext/phar/tests/gh21798-offsetget-temp-entry.phpt b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt new file mode 100644 index 000000000000..b5b11ad43634 --- /dev/null +++ b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt @@ -0,0 +1,39 @@ +--TEST-- +GH-21798: Phar::offsetGet() must free is_temp_dir entry before rejecting .phar/* paths +--EXTENSIONS-- +phar +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +addFromString('index.php', ''); +unset($phar); + +$phar = new Phar($fname); +try { + $phar->offsetGet('.phar/stub.php'); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} +try { + $phar->offsetGet('.phar/alias.txt'); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} +try { + $phar->offsetGet('.phar/internal'); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} +echo "no crash\n"; +?> +--CLEAN-- + +--EXPECT-- +Entry .phar/stub.php does not exist +Entry .phar/alias.txt does not exist +Entry .phar/internal does not exist +no crash From 0c99bd76b10b2d983e2cb801722a5d811eea0d79 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 18 Apr 2026 09:17:51 -0400 Subject: [PATCH 273/300] phar: call phar_entry_delref before goto finish in phar_add_file error paths phar_add_file opens or creates an entry via phar_get_or_create_entry_data_rw, which increments the entry's reference count and must be balanced by a phar_entry_delref call. Two error paths inside the content-write block jumped to finish: with goto, skipping the phar_entry_delref at line 3714. The finish: label comes after the delref, so both paths leaked the entry reference. Add phar_entry_delref(data) before each goto finish in the short-write and missing-resource branches. Closes GH-21798 Closes GH-21803 --- ext/phar/phar_object.c | 2 ++ ext/phar/tests/gh21798-add-file-delref.phpt | 29 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 ext/phar/tests/gh21798-add-file-delref.phpt diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index e9d49567c822..bb96c783e931 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3684,11 +3684,13 @@ static void phar_add_file(phar_archive_data **pphar, zend_string *file_name, con size_t written_len = php_stream_write(data->fp, ZSTR_VAL(content), ZSTR_LEN(content)); if (written_len != contents_len) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename); + phar_entry_delref(data); goto finish; } } else { if (!(php_stream_from_zval_no_verify(contents_file, zresource))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename); + phar_entry_delref(data); goto finish; } php_stream_copy_to_stream_ex(contents_file, data->fp, PHP_STREAM_COPY_ALL, &contents_len); diff --git a/ext/phar/tests/gh21798-add-file-delref.phpt b/ext/phar/tests/gh21798-add-file-delref.phpt new file mode 100644 index 000000000000..fa893a1975e3 --- /dev/null +++ b/ext/phar/tests/gh21798-add-file-delref.phpt @@ -0,0 +1,29 @@ +--TEST-- +GH-21798: phar_add_file must call phar_entry_delref on write error paths +--EXTENSIONS-- +phar +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +addFromString('hello.txt', 'hello world'); +$phar->addFromString('empty.txt', ''); +unset($phar); + +$phar = new Phar($fname); +echo $phar['hello.txt']->getContent() . "\n"; +echo ($phar->offsetExists('empty.txt') ? 'empty exists' : 'missing') . "\n"; +echo "no crash\n"; +?> +--CLEAN-- + +--EXPECT-- +hello world +empty exists +no crash From 30f368567b4d57a9d171c9c80b5ec5225b054552 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 18 Apr 2026 09:22:15 -0400 Subject: [PATCH 274/300] phar: propagate phar_stream_flush return value from phar_stream_close phar_stream_close called phar_stream_flush but discarded its int return value, always returning 0 from the stream close operation. On a write- modified phar entry, a flush failure (e.g. disk full during archive commit) was silently ignored. Capture the flush result and return it so the stream layer gets an accurate close status. Closes GH-21799 Closes GH-21804 --- ext/phar/stream.c | 4 +-- .../tests/gh21799-stream-close-flush.phpt | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 ext/phar/tests/gh21799-stream-close-flush.phpt diff --git a/ext/phar/stream.c b/ext/phar/stream.c index bfa826542d34..19ba48f87500 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -357,11 +357,11 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha static int phar_stream_close(php_stream *stream, int close_handle) /* {{{ */ { /* for some reasons phar needs to be flushed even if there is no write going on */ - phar_stream_flush(stream); + int ret = phar_stream_flush(stream); phar_entry_delref((phar_entry_data *)stream->abstract); - return 0; + return ret; } /* }}} */ diff --git a/ext/phar/tests/gh21799-stream-close-flush.phpt b/ext/phar/tests/gh21799-stream-close-flush.phpt new file mode 100644 index 000000000000..aaa6c17fac38 --- /dev/null +++ b/ext/phar/tests/gh21799-stream-close-flush.phpt @@ -0,0 +1,32 @@ +--TEST-- +GH-21799: phar_stream_close propagates phar_stream_flush return value +--EXTENSIONS-- +phar +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +addFromString('hello.txt', 'hello'); +unset($phar); + +$fp = fopen('phar://' . $fname . '/hello.txt', 'rb'); +$content = fread($fp, 1024); +$result = fclose($fp); + +echo $content . "\n"; +var_dump($result); +echo "no crash\n"; +?> +--CLEAN-- + +--EXPECT-- +hello +bool(true) +no crash From 2fe85279a0f7b333ff99fc16b55d736d4583560b Mon Sep 17 00:00:00 2001 From: Jarne Clauw <67628242+JarneClauw@users.noreply.github.com> Date: Mon, 13 Apr 2026 18:11:49 +0200 Subject: [PATCH 275/300] ext/phar: Fix memory leak in phar_verify_signature() when md_ctx is invalid Closes GH-21750 --- ext/phar/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/phar/util.c b/ext/phar/util.c index a1f9863ae3a9..fe177f964443 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1640,6 +1640,7 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s if (md_ctx) { EVP_MD_CTX_destroy(md_ctx); } + EVP_PKEY_free(key); if (error) { spprintf(error, 0, "openssl signature could not be verified"); } From 3df1fa7a431136a8963fc569542a3d411fe9b776 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 20 Apr 2026 16:57:39 +0100 Subject: [PATCH 276/300] Update NEWS for recent bug fixes --- NEWS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 97cbd684a76e..881a1765b883 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,17 @@ PHP NEWS - OpenSSL: . Fix a bunch of memory leaks and crashes on edge cases. (ndossche) +- Phar: + . Restore is_link handler in phar_intercept_functions_shutdown. (iliaal) + . Fixed bug GH-21797 (phar: NULL dereference in Phar::webPhar() when + SCRIPT_NAME is absent from SAPI environment). (iliaal) + . Fix memory leak in Phar::offsetGet(). (iliaal) + . Fix memory leak in phar_add_file(). (iliaal) + . Fixed bug GH-21799 (phar: propagate phar_stream_flush return value from + phar_stream_close). (iliaal) + . Fix memory leak in phar_verify_signature() when md_ctx is invalid. + (JarneClauw) + - Random: . Fixed bug GH-21731 (Random\Engine\Xoshiro256StarStar::__unserialize() accepts all-zero state). (iliaal) From 617e4c38e0df927a6500f037970a62ca2951e703 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 19 Apr 2026 08:44:55 +0100 Subject: [PATCH 277/300] ext/gmp: reject values larger than unsigned long in gmp_pow/binomial/root/rootrem and shift/pow operators. Applies the gmp_fact() pattern (0236667bd94) to the remaining zend_long -> gmp_ulong casts that could silently overflow on LLP64 platforms. gmp_powm() switches to zend_argument_error() with the correct argument index ($modulus) for modulo-by-zero. close GH-21812 --- NEWS | 2 + UPGRADING | 7 ++++ ext/gmp/gmp.c | 29 ++++++-------- ext/gmp/tests/gmp_binomial.phpt | 4 +- ext/gmp/tests/gmp_fact.phpt | 8 ++-- ext/gmp/tests/gmp_overflow_llp64.phpt | 58 +++++++++++++++++++++++++++ ext/gmp/tests/gmp_pow.phpt | 6 +-- ext/gmp/tests/gmp_pow2.phpt | 4 +- ext/gmp/tests/gmp_pown.phpt | 6 +-- ext/gmp/tests/gmp_remroot.phpt | 4 +- ext/gmp/tests/gmp_root.phpt | 4 +- ext/gmp/tests/overloading.phpt | 6 +-- 12 files changed, 100 insertions(+), 38 deletions(-) create mode 100644 ext/gmp/tests/gmp_overflow_llp64.phpt diff --git a/NEWS b/NEWS index 481c4ea2c385..73a2b3d6637c 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,8 @@ PHP NEWS - GMP: . gmp_fact() reject values larger than unsigned long. (David Carlier) + . gmp_pow/binomial/root/rootrem and shift/pow operators reject values + larger than unsigned long. (David Carlier) - Hash: . Upgrade xxHash to 0.8.2. (timwolla) diff --git a/UPGRADING b/UPGRADING index 0e66a96909f5..9c3d5a2b29a7 100644 --- a/UPGRADING +++ b/UPGRADING @@ -155,6 +155,13 @@ PHP 8.6 UPGRADE NOTES - GMP: . gmp_fact() now throws a ValueError() if $num does not fit into a unsigned long. + . gmp_pow(), gmp_binomial(), gmp_root() and gmp_rootrem() now throw a + ValueError if their second argument does not fit into an unsigned long. + . The shift (<<, >>) and exponentiation (**) operators on GMP objects + now throw a ValueError if the right operand does not fit into an + unsigned long. + . gmp_powm() modulo-by-zero now raises a DivisionByZeroError whose + message includes the function name and argument index ($modulus). - mysqli: . The return structure of mysqli_get_charset() no longer contains diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index a20974580904..b04fc9f5c1ba 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -356,10 +356,10 @@ static zend_result shift_operator_helper(gmp_binary_ui_op_t op, zval *return_val shift = Z_LVAL_P(op2); } - if (shift < 0) { + if (shift < 0 || shift > ULONG_MAX) { zend_throw_error( - zend_ce_value_error, "%s must be greater than or equal to 0", - opcode == ZEND_POW ? "Exponent" : "Shift" + zend_ce_value_error, "%s must be between 0 and %lu", + opcode == ZEND_POW ? "Exponent" : "Shift", ULONG_MAX ); ZVAL_UNDEF(return_value); return FAILURE; @@ -1087,11 +1087,6 @@ ZEND_FUNCTION(gmp_fact) GMP_Z_PARAM_INTO_MPZ_PTR(gmpnum) ZEND_PARSE_PARAMETERS_END(); - if (mpz_sgn(gmpnum) < 0) { - zend_argument_value_error(1, "must be greater than or equal to 0"); - RETURN_THROWS(); - } - if (!mpz_fits_ulong_p(gmpnum)) { zend_argument_value_error(1, "must be between 0 and %lu", ULONG_MAX); RETURN_THROWS(); @@ -1114,8 +1109,8 @@ ZEND_FUNCTION(gmp_binomial) Z_PARAM_LONG(k) ZEND_PARSE_PARAMETERS_END(); - if (k < 0) { - zend_argument_value_error(2, "must be greater than or equal to 0"); + if (k < 0 || k > ULONG_MAX) { + zend_argument_value_error(2, "must be between 0 and %lu", ULONG_MAX); RETURN_THROWS(); } @@ -1136,8 +1131,8 @@ ZEND_FUNCTION(gmp_pow) Z_PARAM_LONG(exp) ZEND_PARSE_PARAMETERS_END(); - if (exp < 0) { - zend_argument_value_error(2, "must be greater than or equal to 0"); + if (exp < 0 || exp > ULONG_MAX) { + zend_argument_value_error(2, "must be between 0 and %lu", ULONG_MAX); RETURN_THROWS(); } @@ -1163,7 +1158,7 @@ ZEND_FUNCTION(gmp_powm) } if (!mpz_cmp_ui(gmpnum_mod, 0)) { - zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero"); + zend_argument_error(zend_ce_division_by_zero_error, 3, "Modulo by zero"); RETURN_THROWS(); } @@ -1226,8 +1221,8 @@ ZEND_FUNCTION(gmp_root) Z_PARAM_LONG(nth) ZEND_PARSE_PARAMETERS_END(); - if (nth <= 0) { - zend_argument_value_error(2, "must be greater than 0"); + if (nth <= 0 || nth > ULONG_MAX) { + zend_argument_value_error(2, "must be between 1 and %lu", ULONG_MAX); RETURN_THROWS(); } @@ -1253,8 +1248,8 @@ ZEND_FUNCTION(gmp_rootrem) Z_PARAM_LONG(nth) ZEND_PARSE_PARAMETERS_END(); - if (nth <= 0) { - zend_argument_value_error(2, "must be greater than or equal to 1"); + if (nth <= 0 || nth > ULONG_MAX) { + zend_argument_value_error(2, "must be between 1 and %lu", ULONG_MAX); RETURN_THROWS(); } diff --git a/ext/gmp/tests/gmp_binomial.phpt b/ext/gmp/tests/gmp_binomial.phpt index 4598a4c47ee8..1bf371e68a14 100644 --- a/ext/gmp/tests/gmp_binomial.phpt +++ b/ext/gmp/tests/gmp_binomial.phpt @@ -26,7 +26,7 @@ try { echo $e->getMessage() . \PHP_EOL; } ?> ---EXPECT-- +--EXPECTF-- object(GMP)#1 (1) { ["num"]=> string(3) "252" @@ -67,4 +67,4 @@ object(GMP)#2 (1) { ["num"]=> string(1) "7" } -gmp_binomial(): Argument #2 ($k) must be greater than or equal to 0 +gmp_binomial(): Argument #2 ($k) must be between 0 and %d diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt index e03931454940..b28f572c6975 100644 --- a/ext/gmp/tests/gmp_fact.phpt +++ b/ext/gmp/tests/gmp_fact.phpt @@ -45,17 +45,17 @@ try { echo "Done\n"; ?> ---EXPECT-- +--EXPECTF-- string(1) "1" gmp_fact(): Argument #1 ($num) is not an integer string string(1) "1" -gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 -gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 +gmp_fact(): Argument #1 ($num) must be between 0 and %d +gmp_fact(): Argument #1 ($num) must be between 0 and %d string(19) "2432902008176640000" string(65) "30414093201713378043612608166064768844377641568960512000000000000" string(7) "3628800" string(1) "1" string(9) "479001600" -gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 +gmp_fact(): Argument #1 ($num) must be between 0 and %d gmp_fact(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_overflow_llp64.phpt b/ext/gmp/tests/gmp_overflow_llp64.phpt new file mode 100644 index 000000000000..ea242bc52155 --- /dev/null +++ b/ext/gmp/tests/gmp_overflow_llp64.phpt @@ -0,0 +1,58 @@ +--TEST-- +GMP functions reject values larger than unsigned long on LLP64 +--EXTENSIONS-- +gmp +--SKIPIF-- + +--FILE-- +getMessage() . PHP_EOL; +} + +try { + gmp_binomial(10, PHP_INT_MAX); +} catch (ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +try { + gmp_root(10, PHP_INT_MAX); +} catch (ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +try { + gmp_rootrem(10, PHP_INT_MAX); +} catch (ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +$n = gmp_init(2); +try { + $n << PHP_INT_MAX; +} catch (ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +try { + $n ** PHP_INT_MAX; +} catch (ValueError $e) { + echo $e->getMessage() . PHP_EOL; +} + +echo "Done\n"; +?> +--EXPECTF-- +gmp_pow(): Argument #2 ($exponent) must be between 0 and %d +gmp_binomial(): Argument #2 ($k) must be between 0 and %d +gmp_root(): Argument #2 ($nth) must be between 1 and %d +gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d +Shift must be between 0 and %d +Exponent must be between 0 and %d +Done diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index f42e44e31abe..36d0d16d8ccc 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -43,17 +43,17 @@ try { echo "Done\n"; ?> ---EXPECT-- +--EXPECTF-- string(4) "1024" string(4) "1024" string(5) "-2048" string(4) "1024" string(1) "1" -gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 +gmp_pow(): Argument #2 ($exponent) must be between 0 and %d string(4) "1024" string(14) "10240000000000" string(17) "97656250000000000" -gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 +gmp_pow(): Argument #2 ($exponent) must be between 0 and %d string(14) "10240000000000" string(14) "10240000000000" gmp_pow(): Argument #2 ($exponent) must be of type int, array given diff --git a/ext/gmp/tests/gmp_pow2.phpt b/ext/gmp/tests/gmp_pow2.phpt index 43bf9bb5aaa5..96f33e8c25ca 100644 --- a/ext/gmp/tests/gmp_pow2.phpt +++ b/ext/gmp/tests/gmp_pow2.phpt @@ -31,5 +31,5 @@ object(GMP)#%d (1) { ["num"]=> string(4) "1024" } -Exponent must be greater than or equal to 0 -Exponent must be greater than or equal to 0 +Exponent must be between 0 and %d +Exponent must be between 0 and %d diff --git a/ext/gmp/tests/gmp_pown.phpt b/ext/gmp/tests/gmp_pown.phpt index 0e7b3bd1fa5d..79709f272715 100644 --- a/ext/gmp/tests/gmp_pown.phpt +++ b/ext/gmp/tests/gmp_pown.phpt @@ -63,7 +63,7 @@ var_dump(gmp_powm(10, $n, 10)); echo "Done\n"; ?> ---EXPECT-- +--EXPECTF-- string(1) "0" string(1) "5" string(1) "5" @@ -73,8 +73,8 @@ string(3) "533" string(3) "331" string(3) "171" string(3) "371" -Modulo by zero -Modulo by zero +gmp_powm(): Argument #3 ($modulus) Modulo by zero +gmp_powm(): Argument #3 ($modulus) Modulo by zero gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, array given gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, TypeError given diff --git a/ext/gmp/tests/gmp_remroot.phpt b/ext/gmp/tests/gmp_remroot.phpt index 8e53858c6047..de54d0e91c3e 100644 --- a/ext/gmp/tests/gmp_remroot.phpt +++ b/ext/gmp/tests/gmp_remroot.phpt @@ -105,5 +105,5 @@ array(2) { string(1) "0" } } -gmp_rootrem(): Argument #2 ($nth) must be greater than or equal to 1 -gmp_rootrem(): Argument #2 ($nth) must be greater than or equal to 1 +gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d +gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d diff --git a/ext/gmp/tests/gmp_root.phpt b/ext/gmp/tests/gmp_root.phpt index 2313b207cc8d..36793e249721 100644 --- a/ext/gmp/tests/gmp_root.phpt +++ b/ext/gmp/tests/gmp_root.phpt @@ -58,5 +58,5 @@ object(GMP)#%d (1) { ["num"]=> string(1) "0" } -gmp_root(): Argument #2 ($nth) must be greater than 0 -gmp_root(): Argument #2 ($nth) must be greater than 0 +gmp_root(): Argument #2 ($nth) must be between 1 and %d +gmp_root(): Argument #2 ($nth) must be between 1 and %d diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt index 14c35ea8470c..f55a83f0bd5f 100644 --- a/ext/gmp/tests/overloading.phpt +++ b/ext/gmp/tests/overloading.phpt @@ -123,7 +123,7 @@ $a .= '17'; var_dump($a); ?> ---EXPECT-- +--EXPECTF-- object(GMP)#3 (1) { ["num"]=> string(2) "59" @@ -254,8 +254,8 @@ object(GMP)#5 (1) { ["num"]=> string(3) "-11" } -Shift must be greater than or equal to 0 -Shift must be greater than or equal to 0 +Shift must be between 0 and %d +Shift must be between 0 and %d object(GMP)#5 (1) { ["num"]=> string(3) "-43" From c380bd576fd640fa15e9849533c8e085bec0e768 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 20 Apr 2026 19:19:59 +0200 Subject: [PATCH 278/300] [skip ci] Backport CI changes --- .github/matrix.php | 15 +++++++++------ .github/workflows/test-suite.yml | 8 +++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/matrix.php b/.github/matrix.php index dec8c7d249c6..18c2ef1269b7 100644 --- a/.github/matrix.php +++ b/.github/matrix.php @@ -144,12 +144,15 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re $jobs['SOLARIS'] = true; } if ($all_jobs || !$no_jobs || $test_windows) { - $jobs['WINDOWS']['matrix'] = $all_variations - ? ['include' => [ - ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true], - ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false], - ]] - : ['include' => [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]]; + $matrix = [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]; + if ($all_variations) { + $matrix[] = ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]; + $matrix[] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; + if (version_compare($php_version, '8.5', '>=')) { + $matrix[] = ['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true, 'clang' => true]; + } + } + $jobs['WINDOWS']['matrix'] = ['include' => $matrix]; $jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=') ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index cf0ad1df647a..4905dcb9ccbc 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -413,10 +413,15 @@ jobs: with: enableOpcache: true jitType: tracing + - name: Generate coverage report + if: ${{ !cancelled() }} + run: make gcovr-xml - uses: codecov/codecov-action@v6 if: ${{ !cancelled() }} with: + disable_search: true fail_ci_if_error: true + files: gcovr.xml token: ${{ secrets.CODECOV_TOKEN }} verbose: true COMMUNITY: @@ -935,7 +940,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(inputs.branch).jobs.WINDOWS.matrix }} - name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}" + name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}${{ matrix.clang && '_CLANG' || ''}}" runs-on: windows-2022 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache @@ -949,6 +954,7 @@ jobs: PARALLEL: -j2 OPCACHE: "${{ matrix.opcache && '1' || '0' }}" ASAN: "${{ matrix.asan && '1' || '0' }}" + CLANG_TOOLSET: "${{ matrix.clang && '1' || '0' }}" steps: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf From d96579371fdef2c0358fba670926772180573d89 Mon Sep 17 00:00:00 2001 From: Jorg Sowa Date: Tue, 14 Apr 2026 08:36:04 +0200 Subject: [PATCH 279/300] ext/session: fix missing zval_ptr_dtor for retval in PS_GC_FUNC(user) PS_GC_FUNC(user) did not call zval_ptr_dtor() on the return value of the user GC callback, leaking memory when the callback returned a reference-counted value. All other user handlers (write, destroy, validate_sid, update_timestamp) already free retval correctly. Closes GH-21747 --- NEWS | 4 +++ ext/session/mod_user.c | 1 + .../gh_gc_retval_leak.phpt | 33 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 ext/session/tests/user_session_module/gh_gc_retval_leak.phpt diff --git a/NEWS b/NEWS index 881a1765b883..d3031f011961 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,10 @@ PHP NEWS . Fixed bug GH-21731 (Random\Engine\Xoshiro256StarStar::__unserialize() accepts all-zero state). (iliaal) +- Session: + . Fixed memory leak when session GC callback return a refcounted value. + (jorgsowa) + - SPL: . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent free). (Girgias) diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 168c5c7f1d44..78fb6260540a 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -218,6 +218,7 @@ PS_GC_FUNC(user) /* Anything else is some kind of error */ *nrdels = -1; // Error } + zval_ptr_dtor(&retval); return *nrdels; } diff --git a/ext/session/tests/user_session_module/gh_gc_retval_leak.phpt b/ext/session/tests/user_session_module/gh_gc_retval_leak.phpt new file mode 100644 index 000000000000..f04f36c2276b --- /dev/null +++ b/ext/session/tests/user_session_module/gh_gc_retval_leak.phpt @@ -0,0 +1,33 @@ +--TEST-- +session_gc(): user handler returning non-bool/non-int does not leak memory +--INI-- +session.gc_probability=0 +session.save_handler=files +--EXTENSIONS-- +session +--FILE-- + +--EXPECTF-- + +Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d +bool(false) From 701d8a66d327beae2b83d6c7d53711717bec14fb Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Tue, 21 Apr 2026 20:37:59 +0800 Subject: [PATCH 280/300] ext/standard: Throw a ValueError when the parameter includes NUL bytes in `putenv` and `getenv` (#21817) --- NEWS | 2 ++ UPGRADING | 2 ++ ext/standard/basic_functions.c | 4 +-- .../putenv_and_getenv_reject_null_bytes.phpt | 35 +++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt diff --git a/NEWS b/NEWS index 73a2b3d6637c..22762f98c2ca 100644 --- a/NEWS +++ b/NEWS @@ -170,6 +170,8 @@ PHP NEWS argument value is passed. (Girgias) . linkinfo() now raises a ValueError when the argument is an empty string. (Weilin Du) + . getenv() and putenv() now raises a ValueError when the first argument + contains null bytes. (Weilin Du) - Streams: . Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream diff --git a/UPGRADING b/UPGRADING index 9c3d5a2b29a7..869e265af8a2 100644 --- a/UPGRADING +++ b/UPGRADING @@ -88,6 +88,8 @@ PHP 8.6 UPGRADE NOTES argument value is passed. . array_change_key_case() now raises a ValueError when an invalid $case argument value is passed. + . getenv() and putenv() now raises a ValueError when the first argument + contains null bytes. . linkinfo() now raises a ValueError when the $path argument is empty. . pathinfo() now raises a ValueError when an invalid $flag argument value is passed. diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ece7f1278f7e..5c6b1ce1d1d1 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -696,7 +696,7 @@ PHP_FUNCTION(getenv) ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL - Z_PARAM_STRING_OR_NULL(str, str_len) + Z_PARAM_PATH_OR_NULL(str, str_len) Z_PARAM_BOOL(local_only) ZEND_PARSE_PARAMETERS_END(); @@ -739,7 +739,7 @@ PHP_FUNCTION(putenv) #endif ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STRING(setting, setting_len) + Z_PARAM_PATH(setting, setting_len) ZEND_PARSE_PARAMETERS_END(); if (setting_len == 0 || setting[0] == '=') { diff --git a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt new file mode 100644 index 000000000000..28a346237338 --- /dev/null +++ b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt @@ -0,0 +1,35 @@ +--TEST-- +getenv() and putenv() reject null bytes +--FILE-- +getMessage() . "\n"; + } +} + +$var_name = 'PHP_PUTENV_NUL_TEST'; + +foreach ([ + $var_name . "\0SUFFIX=value", + $var_name . "=va\0lue", +] as $assignment) { + try { + putenv($assignment); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } +} + +var_dump(getenv($var_name)); + +?> +--EXPECT-- +getenv(): Argument #1 ($name) must not contain any null bytes +getenv(): Argument #1 ($name) must not contain any null bytes +putenv(): Argument #1 ($assignment) must not contain any null bytes +putenv(): Argument #1 ($assignment) must not contain any null bytes +bool(false) From 8b6b4a6f4b6b2bb48a5643c947c0043abfd38860 Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Mon, 20 Apr 2026 09:38:28 +0800 Subject: [PATCH 281/300] [skip ci] Tweak paths-ignore Closes GH-21813 --- .github/workflows/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69ba4c0e4865..1c2943c5502c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,12 +3,15 @@ on: push: paths-ignore: &ignore_paths - docs/** + - EXTENSIONS + - LICENSE - NEWS - UPGRADING - UPGRADING.INTERNALS - - '**/README.*' - - CONTRIBUTING.md - - CODING_STANDARDS.md + - '**/*.md' + - '**/*.rst' + - .github/CODEOWNERS + - .github/ISSUE_TEMPLATE/** - .cirrus.yml - .circleci/** branches: From 19598f3a6a3dcb5747ca40324d4ca6730eb49a88 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 21 Apr 2026 14:45:28 +0200 Subject: [PATCH 282/300] [skip ci] Sort paths-ignore and remove cirrus --- .github/workflows/test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c2943c5502c..eafedec5eafa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,18 +2,17 @@ name: Test on: push: paths-ignore: &ignore_paths + - .circleci/** + - .github/CODEOWNERS + - .github/ISSUE_TEMPLATE/** + - '**/*.md' + - '**/*.rst' - docs/** - EXTENSIONS - LICENSE - NEWS - UPGRADING - UPGRADING.INTERNALS - - '**/*.md' - - '**/*.rst' - - .github/CODEOWNERS - - .github/ISSUE_TEMPLATE/** - - .cirrus.yml - - .circleci/** branches: - PHP-8.2 - PHP-8.3 From d60e7a18eda1127e22bc430c1accfe07d8cdfc1e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 21 Apr 2026 15:07:24 +0200 Subject: [PATCH 283/300] [skip ci] Mark curl/bug71523.phpt as online test --- ext/curl/tests/bug71523.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/curl/tests/bug71523.phpt b/ext/curl/tests/bug71523.phpt index 2cf2477409da..1a01209dbb8b 100644 --- a/ext/curl/tests/bug71523.phpt +++ b/ext/curl/tests/bug71523.phpt @@ -4,6 +4,7 @@ Bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes while curl_ curl --SKIPIF-- Date: Tue, 21 Apr 2026 16:53:18 +0100 Subject: [PATCH 284/300] ext/phar: remove `phar_archive_data->alias == phar_archive_data->fname` checks (#21820) The phar_archive_data->alias field is only ever assigned a newly allocated char* or NULL, as such it can never be equal to the phar_archive_data->fname field, thus those comparisons are just confusing. --- ext/phar/phar.c | 2 +- ext/phar/phar_object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 5829d32e615e..4855517dd627 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -192,7 +192,7 @@ PHP_INI_END() */ void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */ { - if (phar->alias && phar->alias != phar->fname) { + if (phar->alias) { pefree(phar->alias, phar->is_persistent); phar->alias = NULL; } diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 377f35832910..2e309d9a9831 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2631,7 +2631,7 @@ PHP_METHOD(Phar, getAlias) PHAR_ARCHIVE_OBJECT(); - if (phar_obj->archive->alias && phar_obj->archive->alias != phar_obj->archive->fname) { + if (phar_obj->archive->alias) { RETURN_STRINGL(phar_obj->archive->alias, phar_obj->archive->alias_len); } } From aeb56711ea8bcd2f1ac55d3aa02753b2a19ed132 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Tue, 21 Apr 2026 12:59:51 -0300 Subject: [PATCH 285/300] PHP 8.4 is now for PHP 8.4.22-dev --- NEWS | 5 ++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index d3031f011961..b32f6d5e1ddb 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.4.21 +?? ??? ????, PHP 8.4.22 + + +07 May 2026, PHP 8.4.21 - Core: . Fixed bug GH-19983 (GC assertion failure with fibers, generators and diff --git a/Zend/zend.h b/Zend/zend.h index c3323e4c4bfa..fd624675e7b6 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.4.21-dev" +#define ZEND_VERSION "4.4.22-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 4666a90da93f..fcc66c48858f 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.4.21-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.4.22-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index e891ea65d147..d4530cf0a3dd 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 21 +#define PHP_RELEASE_VERSION 22 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.4.21-dev" -#define PHP_VERSION_ID 80421 +#define PHP_VERSION "8.4.22-dev" +#define PHP_VERSION_ID 80422 From 355571cefdf4263bc668cb8f1e71ad00ce890c43 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 21 Apr 2026 18:08:01 +0200 Subject: [PATCH 286/300] Fix usage of optimize attribute on unsupported compilers (GH-21819) Clang supports __has_attribute(cold) but not __attribute__((optimize(...))). The cold and optimize branches need to be split. --- Zend/zend_portability.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 6801131e41da..cd26aa174712 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -314,15 +314,14 @@ char *alloca(); #if (defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(cold) # define ZEND_COLD __attribute__((cold)) -# ifdef __OPTIMIZE__ -# define ZEND_OPT_SIZE __attribute__((optimize("Os"))) -# define ZEND_OPT_SPEED __attribute__((optimize("Ofast"))) -# else -# define ZEND_OPT_SIZE -# define ZEND_OPT_SPEED -# endif #else # define ZEND_COLD +#endif + +#if ((defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(optimize)) && defined(__OPTIMIZE__) +# define ZEND_OPT_SIZE __attribute__((optimize("Os"))) +# define ZEND_OPT_SPEED __attribute__((optimize("Ofast"))) +#else # define ZEND_OPT_SIZE # define ZEND_OPT_SPEED #endif From 637c1163cc7869d971833545f9ffe7aa9272c822 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 21 Apr 2026 18:49:40 +0100 Subject: [PATCH 287/300] ext/mysqli: Throw error when mysql_stmt_data_seek cannot be executed (#10419) --- ext/mysqli/mysqli_api.c | 9 +++++++++ ext/mysqli/tests/mysqli_stmt_data_seek.phpt | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index ccb1da6af738..c667712f85fe 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1488,6 +1488,15 @@ PHP_FUNCTION(mysqli_stmt_data_seek) MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); + if (!stmt->stmt->data || !stmt->stmt->data->result || !stmt->stmt->data->result->stored_data) { + if (hasThis()) { + zend_throw_error(NULL, "mysqli_stmt::data_seek(): No result set associated with the statement"); + } else { + zend_throw_error(NULL, "mysqli_stmt_data_seek(): No result set associated with the statement"); + } + RETURN_THROWS(); + } + mysql_stmt_data_seek(stmt->stmt, offset); } /* }}} */ diff --git a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt index a36daebc7951..e4b913229cd0 100644 --- a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt +++ b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt @@ -25,6 +25,11 @@ require_once 'skipifconnectfailure.inc'; if (true !== ($tmp = mysqli_stmt_execute($stmt))) printf("[006] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + try { + mysqli_stmt_data_seek($stmt, 1); + } catch (Error $exception) { + echo $exception->getMessage() . "\n"; + } $id = null; if (!mysqli_stmt_bind_result($stmt, $id)) @@ -82,6 +87,7 @@ require_once 'skipifconnectfailure.inc'; ?> --EXPECT-- mysqli_stmt object is not fully initialized +mysqli_stmt_data_seek(): No result set associated with the statement int(3) int(1) int(1) From 9cf418231ea3e47753a35ccc7b8dca1cd3a3adcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 17 Apr 2026 22:39:32 +0200 Subject: [PATCH 288/300] gen_stub: fix invalid C variable name for namespaced types in union/intersection type list (#21717) When generating a union or intersection type list with multiple class types, the variable holding each zend_string* was declared using toVarEscapedName() (backslashes replaced by underscores), but the subsequent ZEND_TYPE_INIT_CLASS() reference used toEscapedName() (backslashes escaped as \\), producing an invalid C identifier. Backported to PHP 8.5. --- build/gen_stub.php | 4 +-- ext/zend_test/test.c | 2 ++ ext/zend_test/test.stub.php | 4 +++ ext/zend_test/test_arginfo.h | 38 ++++++++++++++++++++++- ext/zend_test/tests/gen_stub_test_01.phpt | 8 +++++ 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 67be5c2f7b94..52ddb4d36f86 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2511,8 +2511,8 @@ protected function getTypeCode(string $variableLikeName, string &$code): string $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n"; foreach ($arginfoType->classTypes as $k => $classType) { - $escapedClassName = $classType->toEscapedName(); - $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$escapedClassName}, 0, 0);\n"; + $varEscapedClassName = $classType->toVarEscapedName(); + $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName}, 0, 0);\n"; } $typeMaskCode = $this->type->toArginfoType()->toTypeMask(); diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index bcacc85caa1b..310386dd42dd 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -67,6 +67,7 @@ static zend_class_entry *zend_test_forbid_dynamic_call; static zend_class_entry *zend_test_ns_foo_class; static zend_class_entry *zend_test_ns_unlikely_compile_error_class; static zend_class_entry *zend_test_ns_not_unlikely_compile_error_class; +static zend_class_entry *zend_test_ns_bar_class; static zend_class_entry *zend_test_ns2_foo_class; static zend_class_entry *zend_test_ns2_ns_foo_class; static zend_class_entry *zend_test_unit_enum; @@ -1488,6 +1489,7 @@ PHP_MINIT_FUNCTION(zend_test) zend_test_ns_foo_class = register_class_ZendTestNS_Foo(); zend_test_ns_unlikely_compile_error_class = register_class_ZendTestNS_UnlikelyCompileError(); zend_test_ns_not_unlikely_compile_error_class = register_class_ZendTestNS_NotUnlikelyCompileError(); + zend_test_ns_bar_class = register_class_ZendTestNS_Bar(); zend_test_ns2_foo_class = register_class_ZendTestNS2_Foo(); zend_test_ns2_ns_foo_class = register_class_ZendTestNS2_ZendSubNS_Foo(); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index b0fca4cc2b9f..472ba9f3ddf1 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -361,6 +361,8 @@ class Foo { public function method(): int {} } + interface Bar {} + class UnlikelyCompileError { /* This method signature would create a compile error due to the string * "ZendTestNS\UnlikelyCompileError" in the generated macro call */ @@ -381,6 +383,8 @@ public function method(): ?NotUnlikelyCompileError {} class Foo { public ZendSubNS\Foo $foo; + public ZendSubNS\Foo&\ZendTestNS\Bar $intersectionProp; + public ZendSubNS\Foo|\ZendTestNS\Bar $unionProp; public function method(): void {} } diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index eca1b91f6bf3..3834ae1fc21d 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b70af6d65c3d9a7242bc885d2262e0ebfee2473f */ + * Stub hash: a3b22072c3b653cba5dab9feeb6b11ed9ab7114c */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) ZEND_END_ARG_INFO() @@ -1289,6 +1289,16 @@ static zend_class_entry *register_class_ZendTestNS_Foo(void) return class_entry; } +static zend_class_entry *register_class_ZendTestNS_Bar(void) +{ + zend_class_entry ce, *class_entry; + + INIT_NS_CLASS_ENTRY(ce, "ZendTestNS", "Bar", NULL); + class_entry = zend_register_internal_interface(&ce); + + return class_entry; +} + static zend_class_entry *register_class_ZendTestNS_UnlikelyCompileError(void) { zend_class_entry ce, *class_entry; @@ -1335,6 +1345,32 @@ static zend_class_entry *register_class_ZendTestNS2_Foo(void) zend_declare_typed_property(class_entry, property_foo_name, &property_foo_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_foo_class_ZendTestNS2_ZendSubNS_Foo, 0, 0)); zend_string_release(property_foo_name); + zval property_intersectionProp_default_value; + ZVAL_UNDEF(&property_intersectionProp_default_value); + zend_string *property_intersectionProp_name = zend_string_init("intersectionProp", sizeof("intersectionProp") - 1, 1); + zend_string *property_intersectionProp_class_ZendTestNS2_ZendSubNS_Foo = zend_string_init("ZendTestNS2\\ZendSubNS\\Foo", sizeof("ZendTestNS2\\ZendSubNS\\Foo") - 1, 1); + zend_string *property_intersectionProp_class_ZendTestNS_Bar = zend_string_init("ZendTestNS\\Bar", sizeof("ZendTestNS\\Bar") - 1, 1); + zend_type_list *property_intersectionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); + property_intersectionProp_type_list->num_types = 2; + property_intersectionProp_type_list->types[0] = (zend_type) ZEND_TYPE_INIT_CLASS(property_intersectionProp_class_ZendTestNS2_ZendSubNS_Foo, 0, 0); + property_intersectionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_intersectionProp_class_ZendTestNS_Bar, 0, 0); + zend_type property_intersectionProp_type = ZEND_TYPE_INIT_INTERSECTION(property_intersectionProp_type_list, 0); + zend_declare_typed_property(class_entry, property_intersectionProp_name, &property_intersectionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_intersectionProp_type); + zend_string_release(property_intersectionProp_name); + + zval property_unionProp_default_value; + ZVAL_UNDEF(&property_unionProp_default_value); + zend_string *property_unionProp_name = zend_string_init("unionProp", sizeof("unionProp") - 1, 1); + zend_string *property_unionProp_class_ZendTestNS2_ZendSubNS_Foo = zend_string_init("ZendTestNS2\\ZendSubNS\\Foo", sizeof("ZendTestNS2\\ZendSubNS\\Foo") - 1, 1); + zend_string *property_unionProp_class_ZendTestNS_Bar = zend_string_init("ZendTestNS\\Bar", sizeof("ZendTestNS\\Bar") - 1, 1); + zend_type_list *property_unionProp_type_list = malloc(ZEND_TYPE_LIST_SIZE(2)); + property_unionProp_type_list->num_types = 2; + property_unionProp_type_list->types[0] = (zend_type) ZEND_TYPE_INIT_CLASS(property_unionProp_class_ZendTestNS2_ZendSubNS_Foo, 0, 0); + property_unionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_unionProp_class_ZendTestNS_Bar, 0, 0); + zend_type property_unionProp_type = ZEND_TYPE_INIT_UNION(property_unionProp_type_list, 0); + zend_declare_typed_property(class_entry, property_unionProp_name, &property_unionProp_default_value, ZEND_ACC_PUBLIC, NULL, property_unionProp_type); + zend_string_release(property_unionProp_name); + return class_entry; } diff --git a/ext/zend_test/tests/gen_stub_test_01.phpt b/ext/zend_test/tests/gen_stub_test_01.phpt index 0f5d525322d6..3126eb61631f 100644 --- a/ext/zend_test/tests/gen_stub_test_01.phpt +++ b/ext/zend_test/tests/gen_stub_test_01.phpt @@ -18,11 +18,19 @@ var_dump($foo); object(ZendTestNS2\Foo)#%d (%d) { ["foo"]=> uninitialized(ZendTestNS2\ZendSubNS\Foo) + ["intersectionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) + ["unionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) } object(ZendTestNS2\Foo)#%d (%d) { ["foo"]=> object(ZendTestNS2\ZendSubNS\Foo)#%d (%d) { } + ["intersectionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar) + ["unionProp"]=> + uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar) } object(ZendTestNS\UnlikelyCompileError)#%d (%d) { } From c6ef11409508ab7b17abf74e894dc6327974441f Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Tue, 21 Apr 2026 14:14:06 -0700 Subject: [PATCH 289/300] PHP-8.5 is now for PHP 8.5.7-dev --- NEWS | 6 +++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index de66b35b1857..42cbe1c875cd 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.5.6 +?? ??? ????, PHP 8.5.7 + + + +07 May 2026, PHP 8.5.6 - Core: . Fixed bug GH-19983 (GC assertion failure with fibers, generators and diff --git a/Zend/zend.h b/Zend/zend.h index a26be7bc980b..3b00d9ce4b99 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.5.6-dev" +#define ZEND_VERSION "4.5.7-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 07e64e74887c..eca5bcf5a0e6 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.5.6-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.5.7-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index cea66d0c7fb6..df9ac7aa74b8 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 5 -#define PHP_RELEASE_VERSION 6 +#define PHP_RELEASE_VERSION 7 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.5.6-dev" -#define PHP_VERSION_ID 80506 +#define PHP_VERSION "8.5.7-dev" +#define PHP_VERSION_ID 80507 From 9d5337117da719d1fa9e12741d6a9338dc1eb87f Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 21 Apr 2026 22:34:56 +0100 Subject: [PATCH 290/300] ext/phar: reduce scope of variables and clean up CS --- ext/phar/func_interceptors.c | 15 ++++++--------- ext/phar/phar.c | 4 ++-- ext/phar/phar_object.c | 5 ++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 297de62231fd..129714e2f877 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -337,15 +337,12 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value) wmask=S_IWGRP; xmask=S_IXGRP; } else { - int groups, n, i; - gid_t *gids; - - groups = getgroups(0, NULL); - if(groups > 0) { - gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0); - n=getgroups(groups, gids); - for(i=0;ist_gid==gids[i]) { + int groups = getgroups(0, NULL); + if (groups > 0) { + gid_t *gids = safe_emalloc(groups, sizeof(gid_t), 0); + int n = getgroups(groups, gids); + for(int i = 0; i < n; ++i){ + if (stat_sb->st_gid==gids[i]) { rmask=S_IRGRP; wmask=S_IWGRP; xmask=S_IXGRP; diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 4855517dd627..639ada54e94d 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -91,7 +91,7 @@ HashTable cached_alias; static void phar_split_cache_list(void) /* {{{ */ { char *tmp; - char *key, *lasts, *end; + char *key, *lasts; char ds[2]; phar_archive_data *phar; uint32_t i = 0; @@ -124,7 +124,7 @@ static void phar_split_cache_list(void) /* {{{ */ key; key = php_strtok_r(NULL, ds, &lasts)) { size_t len; - end = strchr(key, DEFAULT_DIR_SEPARATOR); + const char *end = strchr(key, DEFAULT_DIR_SEPARATOR); if (end) { len = end - key; } else { diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 2e309d9a9831..54fb674d0e60 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -319,10 +319,9 @@ static void phar_do_403(void) /* {{{ */ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, zend_string *f404) /* {{{ */ { sapi_header_line ctr = {0}; - phar_entry_info *info; if (phar && f404 && ZSTR_LEN(f404)) { - info = phar_get_entry_info(phar, ZSTR_VAL(f404), ZSTR_LEN(f404), NULL, true); + phar_entry_info *info = phar_get_entry_info(phar, ZSTR_VAL(f404), ZSTR_LEN(f404), NULL, true); if (info) { /* Status doesn't matter, we're exiting anyway. */ @@ -344,7 +343,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len, /* post-process REQUEST_URI and retrieve the actual request URI. This is for cases like http://localhost/blah.phar/path/to/file.php/extra/stuff which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */ -static void phar_postprocess_ru_web(char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ +static void phar_postprocess_ru_web(const char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */ { char *e = entry + 1, *u1 = NULL, *u = NULL, *saveu = NULL; size_t e_len = *entry_len - 1, u_len = 0; From 4195fc4ea066c6020b5cb8b50e8ad5b531bc24fd Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 21 Apr 2026 22:33:22 +0100 Subject: [PATCH 291/300] ext/phar: no longer assign to variables in if conditions To increase legibility --- ext/phar/dirstream.c | 20 ++++--- ext/phar/func_interceptors.c | 6 +- ext/phar/phar.c | 27 +++++---- ext/phar/phar_object.c | 111 ++++++++++++++++++++--------------- ext/phar/stream.c | 33 ++++++----- ext/phar/tar.c | 26 ++++---- ext/phar/util.c | 46 ++++++++++----- ext/phar/zip.c | 9 ++- 8 files changed, 158 insertions(+), 120 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 64cace889922..097272a97842 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -247,11 +247,11 @@ static php_stream *phar_make_dirstream(const char *dir, size_t dirlen, const Has */ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */ { - php_url *resource = NULL; char *error; phar_archive_data *phar; - if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { + php_url *resource = phar_parse_url(wrapper, path, mode, options); + if (!resource) { php_stream_wrapper_log_error(wrapper, options, "phar url \"%s\" is unknown", path); return NULL; } @@ -343,7 +343,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, */ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context) /* {{{ */ { - phar_entry_info entry, *e; + phar_entry_info entry; phar_archive_data *phar = NULL; char *error; php_url *resource = NULL; @@ -390,7 +390,8 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo return 0; } - if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 2, &error, true))) { + phar_entry_info *e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 2, &error, true); + if (e) { /* directory exists, or is a subdirectory of an existing file */ if (e->is_temp_dir) { zend_string_efree(e->filename); @@ -444,7 +445,8 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo entry.flags = PHAR_ENT_PERM_DEF_DIR; entry.old_flags = PHAR_ENT_PERM_DEF_DIR; - if (NULL == zend_hash_add_mem(&phar->manifest, entry.filename, &entry, sizeof(phar_entry_info))) { + void *had_been_added = zend_hash_add_mem(&phar->manifest, entry.filename, &entry, sizeof(phar_entry_info)); + if (!had_been_added) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", ZSTR_VAL(entry.filename), phar->fname); zend_string_efree(entry.filename); return 0; @@ -469,10 +471,8 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo */ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */ { - phar_entry_info *entry; phar_archive_data *phar = NULL; char *error; - php_url *resource = NULL; /* pre-readonly check, we need to know if this is a data phar */ zend_string *arch = phar_split_fname(url, strlen(url), NULL, 2, 2); @@ -492,7 +492,8 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options return 0; } - if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) { + php_url *resource = phar_parse_url(wrapper, url, "w", options); + if (!resource) { return 0; } @@ -518,7 +519,8 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options size_t path_len = ZSTR_LEN(resource->path) - 1; - if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, true))) { + phar_entry_info *entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, true); + if (!entry) { if (error) { php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error); efree(error); diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 129714e2f877..a3a0590f94c5 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -106,7 +106,8 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool zend_string *name = NULL; if (using_include_path) { - if (!(name = phar_find_in_include_path(filename, NULL))) { + name = phar_find_in_include_path(filename, NULL); + if (!name) { /* this file is not in the phar, use the original path */ zend_string_release_ex(arch, false); return NULL; @@ -841,7 +842,8 @@ void phar_release_functions(void) /* {{{ void phar_intercept_functions_init(void) */ #define PHAR_INTERCEPT(func) \ PHAR_G(orig_##func) = NULL; \ - if (NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \ + orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1); \ + if (orig) { \ PHAR_G(orig_##func) = orig->internal_function.handler; \ orig->internal_function.handler = PHP_FN(phar_##func); \ } diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 639ada54e94d..b0d56c8067e8 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1263,7 +1263,8 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname MAPPHAR_FAIL("Cannot open archive \"%s\", invalid alias"); } - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { + fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len); + if (fd_ptr) { if (SUCCESS != phar_free_alias(fd_ptr)) { signature = NULL; fp = NULL; @@ -1460,10 +1461,9 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 7, 8) zend_result phar_create_or_parse_filename(c /* assume tar format, PharData can specify other */ mydata->is_tar = 1; } else { - phar_archive_data *fd_ptr; - - if (alias && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { - if (SUCCESS != phar_free_alias(fd_ptr)) { + if (alias) { + const phar_archive_data *fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len); + if (fd_ptr && SUCCESS != phar_free_alias(fd_ptr)) { spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias); zend_hash_str_del(&(PHAR_G(phar_fname_map)), mydata->fname, fname_len); @@ -1669,14 +1669,14 @@ static zend_result phar_open_from_fp(php_stream* fp, char *fname, size_t fname_l continue; } else if (!memcmp(pos, bz_magic, 3)) { php_stream_filter *filter; - php_stream *temp; if (!PHAR_G(has_bz2)) { MAPPHAR_ALLOC_FAIL("unable to decompress bzipped phar archive \"%s\" to temporary file, enable bz2 extension in php.ini") } /* entire file is bzip-compressed, uncompress to temporary file */ - if (!(temp = php_stream_fopen_tmpfile())) { + php_stream *temp = php_stream_fopen_tmpfile(); + if (!temp) { MAPPHAR_ALLOC_FAIL("unable to create temporary file for decompression of bzipped phar archive \"%s\"") } @@ -1750,10 +1750,10 @@ static zend_result phar_open_from_fp(php_stream* fp, char *fname, size_t fname_l static zend_result phar_analyze_path(const char *fname, const char *ext, size_t ext_len, int for_create) /* {{{ */ { php_stream_statbuf ssb; - char *realpath; char *filename = estrndup(fname, (ext - fname) + ext_len); - if ((realpath = expand_filepath(filename, NULL))) { + char *realpath = expand_filepath(filename, NULL); + if (realpath) { #ifdef PHP_WIN32 phar_unixify_path_separators(realpath, strlen(realpath)); #endif @@ -1800,7 +1800,8 @@ static zend_result phar_analyze_path(const char *fname, const char *ext, size_t if (SUCCESS != php_stream_stat_path((char *) filename, &ssb)) { if (!slash) { - if (!(realpath = expand_filepath(filename, NULL))) { + realpath = expand_filepath(filename, NULL); + if (!realpath) { efree(filename); return FAILURE; } @@ -1943,7 +1944,8 @@ zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len phar_archive_data *pphar; if (is_complete) { - if (NULL != (pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), (char *) filename, filename_len))) { + pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), filename, filename_len); + if (pphar) { *ext_str = filename + (filename_len - pphar->ext_len); woohoo: *ext_len = pphar->ext_len; @@ -1963,7 +1965,8 @@ zend_result phar_detect_phar_fname_ext(const char *filename, size_t filename_len return FAILURE; } - if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, (char *) filename, filename_len))) { + pphar = PHAR_G(manifest_cached) ? zend_hash_str_find_ptr(&cached_phars, filename, filename_len) : NULL; + if (pphar) { *ext_str = filename + (filename_len - pphar->ext_len); goto woohoo; } diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 54fb674d0e60..811a27e7931c 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -44,7 +44,6 @@ static zend_class_entry *phar_ce_entry; static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */ { - phar_mime_type *mime; const char *ext = strrchr(file, '.'); if (!ext) { *mime_type = "text/plain"; @@ -52,7 +51,9 @@ static int phar_file_type(const HashTable *mimes, const char *file, char **mime_ return PHAR_MIME_OTHER; } ++ext; - if (NULL == (mime = zend_hash_str_find_ptr(mimes, ext, strlen(ext)))) { + + phar_mime_type *mime = zend_hash_str_find_ptr(mimes, ext, strlen(ext)); + if (!mime) { *mime_type = "application/octet-stream"; return PHAR_MIME_OTHER; } @@ -64,7 +65,6 @@ static int phar_file_type(const HashTable *mimes, const char *file, char **mime_ static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, const char *basename, size_t request_uri_len) /* {{{ */ { HashTable *_SERVER; - zval *stuff; char *path_info; size_t basename_len = strlen(basename); size_t code; @@ -78,23 +78,25 @@ static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, co _SERVER = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]); /* PATH_INFO and PATH_TRANSLATED should always be munged */ - if (NULL != (stuff = zend_hash_str_find(_SERVER, "PATH_INFO", sizeof("PATH_INFO")-1))) { + zval *stuff = zend_hash_str_find(_SERVER, ZEND_STRL("PATH_INFO")); + if (stuff) { path_info = Z_STRVAL_P(stuff); code = Z_STRLEN_P(stuff); if (code > (size_t)entry_len && !memcmp(path_info, entry, entry_len)) { ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_STRINGL(stuff, path_info + entry_len, request_uri_len); - zend_hash_str_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_PATH_INFO"), &temp); } } - if (NULL != (stuff = zend_hash_str_find(_SERVER, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")-1))) { + stuff = zend_hash_str_find(_SERVER, ZEND_STRL("PATH_TRANSLATED")); + if (stuff) { zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry); ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_NEW_STR(stuff, str); - zend_hash_str_update(_SERVER, "PHAR_PATH_TRANSLATED", sizeof("PHAR_PATH_TRANSLATED")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_PATH_TRANSLATED"), &temp); } if (!PHAR_G(phar_SERVER_mung_list)) { @@ -102,46 +104,50 @@ static void phar_mung_server_vars(char *fname, char *entry, size_t entry_len, co } if (PHAR_G(phar_SERVER_mung_list) & PHAR_MUNG_REQUEST_URI) { - if (NULL != (stuff = zend_hash_str_find(_SERVER, "REQUEST_URI", sizeof("REQUEST_URI")-1))) { + stuff = zend_hash_str_find(_SERVER, ZEND_STRL("REQUEST_URI")); + if (stuff) { path_info = Z_STRVAL_P(stuff); code = Z_STRLEN_P(stuff); if (code > basename_len && !memcmp(path_info, basename, basename_len)) { ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_STRINGL(stuff, path_info + basename_len, code - basename_len); - zend_hash_str_update(_SERVER, "PHAR_REQUEST_URI", sizeof("PHAR_REQUEST_URI")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_REQUEST_URI"), &temp); } } } if (PHAR_G(phar_SERVER_mung_list) & PHAR_MUNG_PHP_SELF) { - if (NULL != (stuff = zend_hash_str_find(_SERVER, "PHP_SELF", sizeof("PHP_SELF")-1))) { + stuff = zend_hash_str_find(_SERVER, ZEND_STRL("PHP_SELF")); + if (stuff) { path_info = Z_STRVAL_P(stuff); code = Z_STRLEN_P(stuff); if (code > basename_len && !memcmp(path_info, basename, basename_len)) { ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_STRINGL(stuff, path_info + basename_len, code - basename_len); - zend_hash_str_update(_SERVER, "PHAR_PHP_SELF", sizeof("PHAR_PHP_SELF")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_PHP_SELF"), &temp); } } } if (PHAR_G(phar_SERVER_mung_list) & PHAR_MUNG_SCRIPT_NAME) { - if (NULL != (stuff = zend_hash_str_find(_SERVER, "SCRIPT_NAME", sizeof("SCRIPT_NAME")-1))) { + stuff = zend_hash_str_find(_SERVER, ZEND_STRL("SCRIPT_NAME")); + if (stuff) { ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_STRINGL(stuff, entry, entry_len); - zend_hash_str_update(_SERVER, "PHAR_SCRIPT_NAME", sizeof("PHAR_SCRIPT_NAME")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_SCRIPT_NAME"), &temp); } } if (PHAR_G(phar_SERVER_mung_list) & PHAR_MUNG_SCRIPT_FILENAME) { - if (NULL != (stuff = zend_hash_str_find(_SERVER, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1))) { + stuff = zend_hash_str_find(_SERVER, ZEND_STRL("SCRIPT_FILENAME")); + if (stuff) { zend_string *str = strpprintf(4096, "phar://%s%s", fname, entry); ZVAL_STR(&temp, Z_STR_P(stuff)); ZVAL_NEW_STR(stuff, str); - zend_hash_str_update(_SERVER, "PHAR_SCRIPT_FILENAME", sizeof("PHAR_SCRIPT_FILENAME")-1, &temp); + zend_hash_str_update(_SERVER, ZEND_STRL("PHAR_SCRIPT_FILENAME"), &temp); } } } @@ -478,7 +484,8 @@ PHP_METHOD(Phar, mount) goto finish; } carry_on2: - if (NULL == (pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), arch))) { + pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), arch); + if (!pphar) { if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_find_ptr(&cached_phars, arch))) { if (SUCCESS == phar_copy_on_write(&pphar)) { goto carry_on; @@ -641,7 +648,9 @@ PHP_METHOD(Phar, webPhar) if (!testit) { goto finish; } - if (!(pt = strstr(testit, basename))) { + + pt = strstr(testit, basename); + if (!pt) { efree(testit); goto finish; } @@ -667,7 +676,8 @@ PHP_METHOD(Phar, webPhar) } else { path_info = SG(request_info).request_uri; - if (!(pt = strstr(path_info, basename))) { + pt = strstr(path_info, basename); + if (!pt) { /* this can happen with rewrite rules - and we have no idea what to do then, so return */ goto finish; } @@ -1625,7 +1635,8 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ return ZEND_HASH_APPLY_KEEP; } - if (!(data = phar_build_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, &error, value))) { + data = phar_build_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, &error, value); + if (!data) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s cannot be created: %s", str_key, error); efree(error); @@ -1936,7 +1947,6 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* {{{ */ { - const char *oldname = NULL; phar_archive_data *phar = *sphar; char *oldpath = NULL; char *basename = NULL, *basepath = NULL; @@ -1946,7 +1956,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* char *error = NULL; const char *pcr_error; size_t ext_len = ext ? strlen(ext) : 0; - size_t new_len, oldname_len, phar_ext_len; + size_t new_len, phar_ext_len; phar_archive_data *pphar = NULL; php_stream_statbuf ssb; @@ -2027,25 +2037,27 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* oldpath = estrndup(phar->fname, phar->fname_len); - if ((oldname = zend_memrchr(phar->fname, '/', phar->fname_len))) { - ++oldname; + + const char *old_name = zend_memrchr(phar->fname, '/', phar->fname_len); + if (old_name) { + ++old_name; } else { - oldname = phar->fname; + old_name = phar->fname; } - oldname_len = strlen(oldname); + size_t old_name_len = strlen(old_name); /* Copy the old name to create base for the new name */ - basename = estrndup(oldname, oldname_len); + basename = estrndup(old_name, old_name_len); phar_ext_list_len = sizeof(phar_ext_list)/sizeof(phar_ext_list[0]); /* Remove possible PHAR extensions */ /* phar_ext_list must be in order of longest extension to shortest */ for (i=0; i < phar_ext_list_len; i++) { phar_ext_len = strlen(phar_ext_list[i]); - if (phar_ext_len && oldname_len > phar_ext_len) { + if (phar_ext_len && old_name_len > phar_ext_len) { /* Check if the basename strings ends with the extension */ - if (memcmp(phar_ext_list[i], basename + (oldname_len - phar_ext_len), phar_ext_len) == 0) { - ext_pos = basename + (oldname_len - phar_ext_len); + if (memcmp(phar_ext_list[i], basename + (old_name_len - phar_ext_len), phar_ext_len) == 0) { + ext_pos = basename + (old_name_len - phar_ext_len); ext_pos[0] = '\0'; break; } @@ -2069,7 +2081,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* spprintf(&newname, 0, "%s.%s", basename, ext); efree(basename); - basepath = estrndup(oldpath, (strlen(oldpath) - oldname_len)); + basepath = estrndup(oldpath, (strlen(oldpath) - old_name_len)); new_len = spprintf(&newpath, 0, "%s%s", basepath, newname); phar->fname_len = new_len; phar->fname = newpath; @@ -3379,7 +3391,7 @@ PHP_METHOD(Phar, copy) { char *error; const char *pcr_error; - phar_entry_info *oldentry, newentry = {0}, *temp; + phar_entry_info newentry = {0}; zend_string *new_file = NULL; zend_string *old_file = NULL; @@ -3409,13 +3421,15 @@ PHP_METHOD(Phar, copy) RETURN_THROWS(); } - if (NULL == (oldentry = zend_hash_find_ptr(&phar_obj->archive->manifest, old_file)) || oldentry->is_deleted) { + phar_entry_info *oldentry = zend_hash_find_ptr(&phar_obj->archive->manifest, old_file); + if (!oldentry || oldentry->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "file \"%s\" cannot be copied to file \"%s\", file does not exist in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); RETURN_THROWS(); } - if (NULL != (temp = zend_hash_find_ptr(&phar_obj->archive->manifest, new_file)) && !temp->is_deleted) { + const phar_entry_info *temp = zend_hash_find_ptr(&phar_obj->archive->manifest, new_file); + if (temp && !temp->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "file \"%s\" cannot be copied to file \"%s\", file must not already exist in phar %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); RETURN_THROWS(); @@ -3502,7 +3516,6 @@ PHP_METHOD(Phar, offsetExists) PHP_METHOD(Phar, offsetGet) { char *error; - phar_entry_info *entry; zend_string *file_name = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &file_name) == FAILURE) { @@ -3512,7 +3525,8 @@ PHP_METHOD(Phar, offsetGet) PHAR_ARCHIVE_OBJECT(); /* security is 0 here so that we can get a better error message than "entry doesn't exist" */ - if (!(entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, false))) { + phar_entry_info *entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, false); + if (!entry) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", ZSTR_VAL(file_name), error?", ":"", error?error:""); } else { if (entry->is_temp_dir) { @@ -3553,7 +3567,6 @@ PHP_METHOD(Phar, offsetGet) static void phar_add_file(phar_archive_data **pphar, zend_string *file_name, const zend_string *content, zval *zresource) { char *error; - phar_entry_data *data; php_stream *contents_file = NULL; php_stream_statbuf ssb; #ifdef PHP_WIN32 @@ -3585,7 +3598,8 @@ static void phar_add_file(phar_archive_data **pphar, zend_string *file_name, con } #endif - if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, true, time(NULL)))) { + phar_entry_data *data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, true, time(NULL)); + if (!data) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created: %s", filename, error); efree(error); @@ -3657,9 +3671,9 @@ finish: ; static void phar_mkdir(phar_archive_data **pphar, zend_string *dir_name) { char *error; - phar_entry_data *data; + phar_entry_data *data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, ZSTR_VAL(dir_name), ZSTR_LEN(dir_name), "w+b", 2, &error, true, time(NULL)); - if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, ZSTR_VAL(dir_name), ZSTR_LEN(dir_name), "w+b", 2, &error, true, time(NULL)))) { + if (!data) { if (error) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", ZSTR_VAL(dir_name), error); efree(error); @@ -3731,7 +3745,6 @@ PHP_METHOD(Phar, offsetUnset) { char *error; zend_string *file_name; - phar_entry_info *entry; if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &file_name) == FAILURE) { RETURN_THROWS(); @@ -3745,7 +3758,8 @@ PHP_METHOD(Phar, offsetUnset) } if (zend_hash_exists(&phar_obj->archive->manifest, file_name)) { - if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { + phar_entry_info *entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name); + if (entry) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ return; @@ -3798,7 +3812,6 @@ PHP_METHOD(Phar, addFile) { zend_string *file_name; zend_string *local_name = NULL; - php_stream *resource; zval zresource; if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|S!", &file_name, &local_name) == FAILURE) { @@ -3812,7 +3825,8 @@ PHP_METHOD(Phar, addFile) RETURN_THROWS(); } - if (!(resource = php_stream_open_wrapper(ZSTR_VAL(file_name), "rb", 0, NULL))) { + php_stream *resource = php_stream_open_wrapper(ZSTR_VAL(file_name), "rb", 0, NULL); + if (!resource) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive", ZSTR_VAL(file_name)); RETURN_THROWS(); } @@ -3850,19 +3864,20 @@ PHP_METHOD(Phar, getStub) zend_string *buf; php_stream *fp; php_stream_filter *filter = NULL; - phar_entry_info *stub; ZEND_PARSE_PARAMETERS_NONE(); PHAR_ARCHIVE_OBJECT(); if (phar_obj->archive->is_tar || phar_obj->archive->is_zip) { + const phar_entry_info *stub = zend_hash_str_find_ptr(&(phar_obj->archive->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1); - if (NULL != (stub = zend_hash_str_find_ptr(&(phar_obj->archive->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) { + if (stub) { if (phar_obj->archive->fp && !phar_obj->archive->is_brandnew && !(stub->flags & PHAR_ENT_COMPRESSION_MASK)) { fp = phar_obj->archive->fp; } else { - if (!(fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL))) { + fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL); + if (!fp) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname); RETURN_THROWS(); } @@ -4777,7 +4792,6 @@ PHP_METHOD(PharFileInfo, delMetadata) PHP_METHOD(PharFileInfo, getContent) { char *error; - php_stream *fp; phar_entry_info *link; zend_string *str; @@ -4804,7 +4818,8 @@ PHP_METHOD(PharFileInfo, getContent) RETURN_THROWS(); } - if (!(fp = phar_get_efp(link, false))) { + php_stream *fp = phar_get_efp(link, false); + if (!fp) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", ZSTR_VAL(entry_obj->entry->filename), entry_obj->entry->phar->fname); RETURN_THROWS(); diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 7abb7e6422ea..ea5f652dd566 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -163,11 +163,11 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha char *internal_file; char *error; HashTable *pharcontext; - php_url *resource = NULL; php_stream *fpf; zval *pzoption, *metadata; - if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { + php_url *resource = phar_parse_url(wrapper, path, mode, options); + if (!resource) { return NULL; } @@ -320,7 +320,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha } if (!PHAR_G(cwd_init) && (options & STREAM_OPEN_FOR_INCLUDE)) { - char *entry = ZSTR_VAL(idata->internal_file->filename), *cwd; + const char *entry = ZSTR_VAL(idata->internal_file->filename), *cwd; PHAR_G(cwd_init) = 1; if ((idata->phar->is_tar || idata->phar->is_zip) && zend_string_equals_literal(idata->internal_file->filename, ".phar/stub.php")) { @@ -556,13 +556,12 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context) /* {{{ */ { - php_url *resource = NULL; char *internal_file; phar_archive_data *phar; - phar_entry_info *entry; size_t internal_file_len; - if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) { + php_url *resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET); + if (!resource) { return FAILURE; } @@ -597,7 +596,8 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f } internal_file_len = strlen(internal_file); /* search through the manifest of files, and if we have an exact match, it's a file */ - if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) { + phar_entry_info *entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len); + if (entry) { phar_dostat(phar, entry, ssb, false); php_url_free(resource); return SUCCESS; @@ -636,7 +636,9 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f goto free_resource; } efree(test); - if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) { + + entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len); + if (!entry) { goto free_resource; } phar_dostat(phar, entry, ssb, false); @@ -656,13 +658,13 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f */ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */ { - php_url *resource; char *internal_file, *error; size_t internal_file_len; phar_entry_data *idata; phar_archive_data *pphar; - if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) { + php_url *resource = phar_parse_url(wrapper, url, "rb", options); + if (!resource) { php_stream_wrapper_log_error(wrapper, options, "phar error: unlink failed"); return 0; } @@ -728,16 +730,15 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context) /* {{{ */ { - php_url *resource_from, *resource_to; char *error; phar_archive_data *phar, *pfrom, *pto; - phar_entry_info *entry; bool is_dir = false; bool is_modified = false; error = NULL; - if ((resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) { + php_url *resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET); + if (!resource_from) { php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from); return 0; } @@ -753,7 +754,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from return 0; } - if ((resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) { + php_url *resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET); + if (!resource_to) { php_url_free(resource_from); php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to); return 0; @@ -822,7 +824,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from return 0; } - if (NULL != (entry = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(resource_from->path)+1, ZSTR_LEN(resource_from->path)-1))) { + phar_entry_info *entry = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(resource_from->path)+1, ZSTR_LEN(resource_from->path)-1); + if (entry) { phar_entry_info new, *source; /* perform rename magic */ diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 844f613983f7..0c042517125c 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -658,11 +658,9 @@ zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_l myphar = actual; if (actual_alias) { - phar_archive_data *fd_ptr; - myphar->is_temporary_alias = 0; - - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, myphar->alias_len))) { + phar_archive_data *fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, myphar->alias_len); + if (fd_ptr) { if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname); @@ -674,10 +672,9 @@ zend_result phar_parse_tarfile(php_stream* fp, const char *fname, size_t fname_l zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), actual_alias, myphar->alias_len, myphar); } else { - phar_archive_data *fd_ptr; - if (alias_len) { - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { + phar_archive_data *fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len); + if (fd_ptr) { if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname); @@ -909,7 +906,7 @@ ZEND_ATTRIBUTE_NONNULL static int phar_tar_setupmetadata(zval *zv, void *argumen { struct _phar_pass_tar_info *i = (struct _phar_pass_tar_info *)argument; char **error = i->error; - phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv), *metadata, newentry = {0}; + phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv), newentry = {0}; if (zend_string_starts_with_literal(entry->filename, ".phar/.metadata")) { if (zend_string_equals_literal(entry->filename, ".phar/.metadata.bin")) { @@ -937,7 +934,8 @@ ZEND_ATTRIBUTE_NONNULL static int phar_tar_setupmetadata(zval *zv, void *argumen return ZEND_HASH_APPLY_KEEP; } - if (NULL != (metadata = zend_hash_find_ptr(&entry->phar->manifest, lookfor))) { + phar_entry_info *metadata = zend_hash_find_ptr(&entry->phar->manifest, lookfor); + if (metadata) { int ret; ret = phar_tar_setmetadata(&entry->metadata_tracker, metadata, error); zend_string_efree(lookfor); @@ -949,7 +947,8 @@ ZEND_ATTRIBUTE_NONNULL static int phar_tar_setupmetadata(zval *zv, void *argumen newentry.tar_type = TAR_FILE; newentry.is_tar = 1; - if (NULL == (metadata = zend_hash_add_mem(&entry->phar->manifest, lookfor, &newentry, sizeof(phar_entry_info)))) { + metadata = zend_hash_add_mem(&entry->phar->manifest, lookfor, &newentry, sizeof(phar_entry_info)); + if (!metadata) { zend_string_efree(lookfor); spprintf(error, 0, "phar tar error: unable to add magic metadata file to manifest for file \"%s\"", ZSTR_VAL(entry->filename)); return ZEND_HASH_APPLY_STOP; @@ -1104,8 +1103,8 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_tar_flush(phar_archive_data *phar, ze pass.free_ufp = true; if (phar_metadata_tracker_has_data(&phar->metadata_tracker, phar->is_persistent)) { - phar_entry_info *mentry; - if (NULL != (mentry = zend_hash_str_find_ptr(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1))) { + phar_entry_info *mentry = zend_hash_str_find_ptr(&(phar->manifest), ZEND_STRL(".phar/.metadata.bin")); + if (mentry) { if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata_tracker, mentry, error)) { if (must_close_old_file) { php_stream_close(oldfile); @@ -1120,7 +1119,8 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 4) int phar_tar_flush(phar_archive_data *phar, ze newentry.tar_type = TAR_FILE; newentry.is_tar = 1; - if (NULL == (mentry = zend_hash_add_mem(&phar->manifest, newentry.filename, &newentry, sizeof(phar_entry_info)))) { + mentry = zend_hash_add_mem(&phar->manifest, newentry.filename, &newentry, sizeof(phar_entry_info)); + if (!mentry) { zend_string_efree(newentry.filename); spprintf(error, 0, "phar tar error: unable to add magic metadata file to manifest for phar archive \"%s\"", phar->fname); if (must_close_old_file) { diff --git a/ext/phar/util.c b/ext/phar/util.c index e0f4dc3da6c7..5cd51c65ba94 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -493,14 +493,16 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, co } really_get_entry: if (allow_dir) { - if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) { + entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security); + if (!entry) { if (for_create && (!PHAR_G(readonly) || phar->is_data)) { return SUCCESS; } return FAILURE; } } else { - if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) { + entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security); + if (!entry) { if (for_create && (!PHAR_G(readonly) || phar->is_data)) { return SUCCESS; } @@ -612,7 +614,7 @@ ZEND_ATTRIBUTE_NONNULL zend_result phar_get_entry_data(phar_entry_data **ret, co ZEND_ATTRIBUTE_NONNULL phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, char *path, size_t path_len, const char *mode, char allow_dir, char **error, bool security, uint32_t timestamp) /* {{{ */ { phar_archive_data *phar; - phar_entry_info *entry, etemp; + phar_entry_info etemp; phar_entry_data *ret; const char *pcr_error; char is_dir; @@ -682,7 +684,8 @@ ZEND_ATTRIBUTE_NONNULL phar_entry_data *phar_get_or_create_entry_data(char *fnam etemp.tar_type = etemp.is_dir ? TAR_DIR : TAR_FILE; } - if (NULL == (entry = zend_hash_add_mem(&phar->manifest, etemp.filename, &etemp, sizeof(phar_entry_info)))) { + phar_entry_info *entry = zend_hash_add_mem(&phar->manifest, etemp.filename, &etemp, sizeof(phar_entry_info)); + if (!entry) { php_stream_close(etemp.fp); spprintf(error, 0, "phar error: unable to add new entry \"%s\" to phar \"%s\"", ZSTR_VAL(etemp.filename), phar->fname); @@ -1001,7 +1004,8 @@ zend_result phar_get_archive(phar_archive_data **archive, const char *fname, siz } if (alias && alias_len) { - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { + fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len); + if (fd_ptr) { alias_success: if (fname && (fname_len != fd_ptr->fname_len || strncmp(fname, fd_ptr->fname, fname_len))) { if (error) { @@ -1037,7 +1041,8 @@ zend_result phar_get_archive(phar_archive_data **archive, const char *fname, siz size_t save_len = fname_len; if (fname && fname_len) { - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len))) { + fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len); + if (fd_ptr) { *archive = fd_ptr; fd = fd_ptr; @@ -1089,7 +1094,8 @@ zend_result phar_get_archive(phar_archive_data **archive, const char *fname, siz return SUCCESS; } - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), save, save_len))) { + fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), save, save_len); + if (fd_ptr) { fd = *archive = fd_ptr; PHAR_G(last_phar) = fd; @@ -1127,7 +1133,8 @@ zend_result phar_get_archive(phar_archive_data **archive, const char *fname, siz return FAILURE; } - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len))) { + fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), fname, fname_len); + if (fd_ptr) { realpath_success: *archive = fd_ptr; fd = fd_ptr; @@ -1215,7 +1222,6 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, size_t phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, size_t path_len, char dir, char **error, bool security) /* {{{ */ { const char *pcr_error; - phar_entry_info *entry; bool is_dir; #ifdef PHP_WIN32 @@ -1260,7 +1266,8 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si path_len--; } - if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) { + phar_entry_info *entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len); + if (entry) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ return NULL; @@ -1304,7 +1311,8 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si size_t test_len; php_stream_statbuf ssb; - if (NULL == (entry = zend_hash_find_ptr(&phar->manifest, str_key))) { + entry = zend_hash_find_ptr(&phar->manifest, str_key); + if (!entry) { if (error) { spprintf(error, 4096, "phar internal error: mounted path \"%s\" could not be retrieved from manifest", ZSTR_VAL(str_key)); } @@ -1353,7 +1361,8 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si efree(test); - if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) { + entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len); + if (!entry) { if (error) { spprintf(error, 4096, "phar error: path \"%s\" exists as file \"%s\" and could not be retrieved after being mounted", path, test); } @@ -1522,17 +1531,22 @@ zend_result phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t s pfp = php_stream_open_wrapper(pfile, "rb", 0, NULL); efree(pfile); - if (!pfp || !(pubkey = php_stream_copy_to_mem(pfp, PHP_STREAM_COPY_ALL, 0)) || !ZSTR_LEN(pubkey)) { - if (pfp) { - php_stream_close(pfp); - } + if (!pfp) { if (error) { *error = estrdup("openssl public key could not be read"); } return FAILURE; } + pubkey = php_stream_copy_to_mem(pfp, PHP_STREAM_COPY_ALL, 0); php_stream_close(pfp); + if (!pubkey || !ZSTR_LEN(pubkey)) { + if (error) { + *error = estrdup("openssl public key could not be read"); + } + return FAILURE; + } + #ifndef PHAR_HAVE_OPENSSL tempsig = sig_len; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index f757adc90c88..ec23603d9be9 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -726,7 +726,6 @@ zend_result phar_parse_zipfile(php_stream *fp, const char *fname, size_t fname_l zend_hash_str_add_ptr(&(PHAR_G(phar_fname_map)), mydata->fname, fname_len, mydata); if (actual_alias) { - phar_archive_data *fd_ptr; if (!phar_validate_alias(actual_alias, mydata->alias_len)) { if (error) { @@ -739,7 +738,8 @@ zend_result phar_parse_zipfile(php_stream *fp, const char *fname, size_t fname_l mydata->is_temporary_alias = 0; - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, mydata->alias_len))) { + phar_archive_data *fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), actual_alias, mydata->alias_len); + if (fd_ptr) { if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with implicit alias, alias is already in use", fname); @@ -758,10 +758,9 @@ zend_result phar_parse_zipfile(php_stream *fp, const char *fname, size_t fname_l zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), mydata->alias, mydata->alias_len, mydata); } else { - phar_archive_data *fd_ptr; - if (alias_len) { - if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { + phar_archive_data *fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len); + if (fd_ptr) { if (SUCCESS != phar_free_alias(fd_ptr)) { if (error) { spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with explicit alias, alias is already in use", fname); From c5a3f46bb18636ef8b36e827c800ce6989f4a054 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 21 Apr 2026 22:13:40 +0100 Subject: [PATCH 292/300] ext/phar: mark _phar_archive_data.ext field as const This char* is derived from the fname char* field. --- ext/phar/phar_internal.h | 4 ++-- ext/phar/phar_object.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index db2856309fcb..a79a1df0202d 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -245,9 +245,9 @@ typedef struct _phar_entry_info { struct _phar_archive_data { char *fname; uint32_t fname_len; - /* for phar_detect_fname_ext, this stores the location of the file extension within fname */ + /* The ext field stores the location of the file extension from the fname field, and thus should never be freed. */ uint32_t ext_len; - char *ext; + const char *ext; char *alias; uint32_t alias_len; char version[12]; diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 811a27e7931c..0cde5704c2d0 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2124,7 +2124,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* goto err_reused_oldpath; } if (!phar->is_data) { - if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 1, 1, true)) { + if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, &(phar->ext), &ext_len, 1, 1, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } @@ -2147,7 +2147,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } else { - if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &ext_len, 0, 1, true)) { + if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, &(phar->ext), &ext_len, 0, 1, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } From 60b2d0d0b9d75553d50deeca6e2d9b058f7b1f91 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Tue, 21 Apr 2026 22:21:37 +0100 Subject: [PATCH 293/300] ext/phar: mark last_phar_name global cache field as const As this is derived from a live char* pointer where we don't have the ownership. --- ext/phar/phar_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index a79a1df0202d..8d7632fbb4dd 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -146,7 +146,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phar) char *openssl_privatekey; uint32_t openssl_privatekey_len; /* phar_get_archive cache */ - char* last_phar_name; + const char *last_phar_name; uint32_t last_phar_name_len; uint32_t last_alias_len; const char* last_alias; From d43c523c48960e9ca0bf9c747e9bad8e5121edff Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 28 Mar 2026 09:41:19 +0000 Subject: [PATCH 294/300] Fix GH-21544: Dom\XMLDocument::C14N() drops namespace declarations on DOM-built documents. For programmatically built documents (e.g. createElementNS), namespaces live on node->ns without corresponding xmlns attributes. Create temporary synthetic nsDef entries so C14N can find them, complementing the existing xmlns attribute to nsDef conversion. close GH-21561 --- NEWS | 2 + ext/dom/node.c | 89 +++++++++++++++++++++------ ext/dom/tests/modern/xml/gh21544.phpt | 28 +++++++++ 3 files changed, 99 insertions(+), 20 deletions(-) create mode 100644 ext/dom/tests/modern/xml/gh21544.phpt diff --git a/NEWS b/NEWS index b32f6d5e1ddb..b110b17bef21 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,8 @@ PHP NEWS . Fixed bug GH-21688 (segmentation fault on empty HTMLDocument). (David Carlier) . Upgrade to lexbor v2.7.0. (ndossche, ilutov) + . Fixed bug GH-21544 (Dom\XMLDocument::C14N*( drops namespace declarations + on DOM-built documents). (David Carlier, ndossche) - Iconv: . Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal) diff --git a/ext/dom/node.c b/ext/dom/node.c index bbe8311147f9..505f6ee452c3 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2103,33 +2103,72 @@ PHP_METHOD(DOMNode, lookupNamespaceURI) } /* }}} end dom_node_lookup_namespace_uri */ +/* Allocate, track and prepend a temporary nsDef entry for C14N. + * Returns the new xmlNsPtr for the caller to fill in href/prefix/_private, + * or NULL on allocation failure. */ +static xmlNsPtr dom_alloc_ns_decl(HashTable *links, xmlNodePtr node) +{ + xmlNsPtr ns = xmlMalloc(sizeof(*ns)); + if (!ns) { + return NULL; + } + + zval *zv = zend_hash_index_lookup(links, (zend_ulong) node); + if (Z_ISNULL_P(zv)) { + ZVAL_LONG(zv, 1); + } else { + Z_LVAL_P(zv)++; + } + + memset(ns, 0, sizeof(*ns)); + ns->type = XML_LOCAL_NAMESPACE; + ns->next = node->nsDef; + node->nsDef = ns; + + return ns; +} + +/* Mint a temporary nsDef entry so C14N finds namespaces that live on node->ns + * but have no matching xmlns attribute (typical for createElementNS). */ +static void dom_add_synthetic_ns_decl(HashTable *links, xmlNodePtr node, xmlNsPtr src_ns) +{ + xmlNsPtr ns = dom_alloc_ns_decl(links, node); + if (!ns) { + return; + } + + ns->href = xmlStrdup(src_ns->href); + ns->prefix = src_ns->prefix ? xmlStrdup(src_ns->prefix) : NULL; +} + +/* Same, but for attribute namespaces, which may collide by prefix with the + * element's own ns or with a sibling attribute's ns. */ +static void dom_add_synthetic_ns_decl_for_attr(HashTable *links, xmlNodePtr node, xmlNsPtr src_ns) +{ + for (xmlNsPtr existing = node->nsDef; existing; existing = existing->next) { + if (xmlStrEqual(existing->prefix, src_ns->prefix)) { + return; + } + } + + dom_add_synthetic_ns_decl(links, node, src_ns); +} + static void dom_relink_ns_decls_element(HashTable *links, xmlNodePtr node) { if (node->type == XML_ELEMENT_NODE) { for (xmlAttrPtr attr = node->properties; attr; attr = attr->next) { if (php_dom_ns_is_fast((const xmlNode *) attr, php_dom_ns_is_xmlns_magic_token)) { - xmlNsPtr ns = xmlMalloc(sizeof(*ns)); + xmlNsPtr ns = dom_alloc_ns_decl(links, node); if (!ns) { return; } - zval *zv = zend_hash_index_lookup(links, (zend_ulong) node); - if (Z_ISNULL_P(zv)) { - ZVAL_LONG(zv, 1); - } else { - Z_LVAL_P(zv)++; - } - bool should_free; xmlChar *attr_value = php_libxml_attr_value(attr, &should_free); - memset(ns, 0, sizeof(*ns)); - ns->type = XML_LOCAL_NAMESPACE; ns->href = should_free ? attr_value : xmlStrdup(attr_value); ns->prefix = attr->ns->prefix ? xmlStrdup(attr->name) : NULL; - ns->next = node->nsDef; - node->nsDef = ns; - ns->_private = attr; if (attr->prev) { attr->prev->next = attr->next; @@ -2150,6 +2189,14 @@ static void dom_relink_ns_decls_element(HashTable *links, xmlNodePtr node) * can return the current namespace. */ zend_hash_index_add_new_ptr(links, (zend_ulong) node | 1, node->ns); node->ns = xmlSearchNs(node->doc, node, NULL); + } else if (node->ns) { + dom_add_synthetic_ns_decl(links, node, node->ns); + } + + for (xmlAttrPtr attr = node->properties; attr; attr = attr->next) { + if (attr->ns && !php_dom_ns_is_fast((const xmlNode *) attr, php_dom_ns_is_xmlns_magic_token)) { + dom_add_synthetic_ns_decl_for_attr(links, node, attr->ns); + } } } } @@ -2179,13 +2226,15 @@ static void dom_unlink_ns_decls(HashTable *links) node->nsDef = ns->next; xmlAttrPtr attr = ns->_private; - if (attr->prev) { - attr->prev->next = attr; - } else { - node->properties = attr; - } - if (attr->next) { - attr->next->prev = attr; + if (attr) { + if (attr->prev) { + attr->prev->next = attr; + } else { + node->properties = attr; + } + if (attr->next) { + attr->next->prev = attr; + } } xmlFreeNs(ns); diff --git a/ext/dom/tests/modern/xml/gh21544.phpt b/ext/dom/tests/modern/xml/gh21544.phpt new file mode 100644 index 000000000000..b76742ae84a5 --- /dev/null +++ b/ext/dom/tests/modern/xml/gh21544.phpt @@ -0,0 +1,28 @@ +--TEST-- +GH-21544 (Dom\XMLDocument::C14N() drops namespace declarations on DOM-built documents) +--CREDITS-- +Toon Verwerft (veewee) +--EXTENSIONS-- +dom +--FILE-- +createElementNS("urn:envelope", "env:Root"); +$doc->appendChild($root); +$child = $doc->createElementNS("urn:child", "x:Child"); +$root->appendChild($child); + +$parsed = Dom\XMLDocument::createFromString( + '' +); + +echo "DOM-built C14N: " . $doc->C14N() . PHP_EOL; +echo "Parsed C14N: " . $parsed->C14N() . PHP_EOL; +var_dump($doc->C14N() === $parsed->C14N()); + +?> +--EXPECT-- +DOM-built C14N: +Parsed C14N: +bool(true) From da58c655198f787b1e7f100cc537561fab64d98a Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 21 Apr 2026 10:43:10 +0200 Subject: [PATCH 295/300] gen_stub: Support fn_flags2 flags Change zend_function_entry.flags to a uint64_t to that both ZEND_ACC_ and ZEND_ACC2_ flags can be represented. Introduce ZEND_FENTRY_FLAGS(flags, flags2) to pass ZEND_ACC2_ flags to ZEND_RAW_FENTRY(), ZEND_FENTRY(). Source-level backwards compatibility is maintained, as passing raw ZEND_ACC_ flags to ZEND_RAW_FENTRY(), ZEND_FENTRY() still works. --- Zend/zend_API.c | 4 ++-- Zend/zend_API.h | 4 +++- build/gen_stub.php | 32 +++++++++++++++++++++++--- ext/standard/basic_functions.stub.php | 5 +++- ext/standard/basic_functions_arginfo.h | 2 +- ext/standard/basic_functions_decl.h | 8 +++---- 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 2541486c492a..c97d9308e208 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3045,7 +3045,6 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend internal_function->prop_info = NULL; internal_function->attributes = NULL; internal_function->frameless_function_infos = ptr->frameless_function_infos; - internal_function->fn_flags2 = 0; if (EG(active)) { // at run-time: this ought to only happen if registered with dl() or somehow temporarily at runtime ZEND_MAP_PTR_INIT(internal_function->run_time_cache, zend_arena_calloc(&CG(arena), 1, zend_internal_run_time_cache_reserved_size())); } else { @@ -3055,7 +3054,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend ZEND_MAP_PTR_INIT(internal_function->run_time_cache, NULL); #endif } - if (ptr->flags) { + if (ptr->flags & UINT32_MAX) { if (!(ptr->flags & ZEND_ACC_PPP_MASK)) { if (ptr->flags != ZEND_ACC_DEPRECATED && scope) { zend_error(error_type, "Invalid access level for %s::%s() - access must be exactly one of public, protected or private", ZSTR_VAL(scope->name), ptr->fname); @@ -3067,6 +3066,7 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend } else { internal_function->fn_flags = ZEND_ACC_PUBLIC; } + internal_function->fn_flags2 = ptr->flags >> 32; if (ptr->arg_info) { zend_internal_function_info *info = (zend_internal_function_info*)ptr->arg_info; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 17f7ce3263f8..aff6a5bba220 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -36,7 +36,7 @@ typedef struct _zend_function_entry { zif_handler handler; const struct _zend_internal_arg_info *arg_info; uint32_t num_args; - uint32_t flags; + uint64_t flags; const zend_frameless_function_info *frameless_function_infos; const char *doc_comment; } zend_function_entry; @@ -74,6 +74,8 @@ typedef struct _zend_fcall_info_cache { #define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zif_##name) #define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(zim_##classname##_##name) +#define ZEND_FENTRY_FLAGS(flags, flags2) (((uint64_t)flags) | ((uint64_t)flags2 << 32)) + #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags, NULL, NULL }, #define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags, frameless_function_infos, doc_comment) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags, frameless_function_infos, doc_comment }, diff --git a/build/gen_stub.php b/build/gen_stub.php index db7f4d400ed7..857c6cb7087b 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -1184,6 +1184,32 @@ public function isEmpty(): bool { ); } + /** + * If we have ZEND_ACC2_ flags, represent as 'ZEND_FENTRY_FLAGS(flags1, flags2)'. + * Otherwise, represent as just 'flags1' (backwards compatible). + */ + private function formatFlags(array $flags): string { + $flags1 = []; + $flags2 = []; + foreach ($flags as $flag) { + if (str_starts_with($flag, 'ZEND_ACC2_')) { + $flags2[] = $flag; + } else { + $flags1[] = $flag; + } + } + + if ($flags2 !== []) { + return sprintf( + 'ZEND_FENTRY_FLAGS(%s, %s)', + $flags1 === [] ? 0 : implode("|", $flags1), + implode("|", $flags2), + ); + } + + return implode("|", $flags1); + } + public function generateVersionDependentFlagCode( string $codeTemplate, ?int $phpVersionIdMinimumCompatibility, @@ -1199,7 +1225,7 @@ public function generateVersionDependentFlagCode( if (empty($flagsByPhpVersions[$currentPhpVersion])) { return ''; } - return sprintf($codeTemplate, implode("|", $flagsByPhpVersions[$currentPhpVersion])); + return sprintf($codeTemplate, $this->formatFlags($flagsByPhpVersions[$currentPhpVersion])); } ksort($flagsByPhpVersions); @@ -1240,7 +1266,7 @@ public function generateVersionDependentFlagCode( reset($flagsByPhpVersions); $firstVersion = key($flagsByPhpVersions); if ($firstVersion === $phpVersionIdMinimumCompatibility) { - return sprintf($codeTemplate, implode("|", reset($flagsByPhpVersions))); + return sprintf($codeTemplate, $this->formatFlags(reset($flagsByPhpVersions))); } } @@ -1253,7 +1279,7 @@ public function generateVersionDependentFlagCode( $code .= "$if (PHP_VERSION_ID >= $version)\n"; - $code .= sprintf($codeTemplate, implode("|", $versionFlags)); + $code .= sprintf($codeTemplate, $this->formatFlags($versionFlags)); $code .= $endif; $i++; diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index c437f0d7f6c2..0f04cc036d4d 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1641,7 +1641,10 @@ function in_array(mixed $needle, array $haystack, bool $strict = false): bool {} */ function array_search(mixed $needle, array $haystack, bool $strict = false): int|string|false {} -/** @prefer-ref $array */ +/** + * @prefer-ref $array + * @forbid-dynamic-calls + */ function extract(array &$array, int $flags = EXTR_OVERWRITE, string $prefix = ""): int {} /** diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 1ba20c6b26cc..7ad59cfc6897 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: a846d7e3dd1f1cebd8c6257132c97b3758067127 + * Stub hash: 85603c0acd3b8580cbff782a53c9b1453943684f * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index ab27bb64f0c7..0dda2f894f15 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: a846d7e3dd1f1cebd8c6257132c97b3758067127 */ + * Stub hash: 85603c0acd3b8580cbff782a53c9b1453943684f */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H -#define ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H +#define ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H typedef enum zend_enum_SortDirection { ZEND_ENUM_SortDirection_Ascending = 1, @@ -20,4 +20,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_a846d7e3dd1f1cebd8c6257132c97b3758067127_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H */ From 2c5dc5d8b1f9c77b706b7e48801a8acd0cdfffb1 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 21 Apr 2026 11:04:32 +0200 Subject: [PATCH 296/300] Add ZEND_ACC2_FORBID_DYN_CALLS Functions that use zend_forbid_dynamic_call() must be flagged with ZEND_ACC2_FORBID_DYN_CALLS. In stubs, this is done by using @forbid-dynamic-calls. To ensure consistency, we assert that the flag exists in zend_forbid_dynamic_call(), and we assert that flagged functions thrown after a dynamic call. Closes GH-21818 --- UPGRADING.INTERNALS | 3 ++ Zend/zend_API.h | 2 ++ Zend/zend_builtin_functions.c | 1 + Zend/zend_builtin_functions.stub.php | 8 ++++- Zend/zend_builtin_functions_arginfo.h | 26 ++++++++++++--- Zend/zend_closures.c | 1 + Zend/zend_compile.h | 5 +-- Zend/zend_execute_API.c | 1 + Zend/zend_vm_def.h | 8 +++++ Zend/zend_vm_execute.h | 44 ++++++++++++++++++++++++++ build/gen_stub.php | 8 +++++ ext/standard/basic_functions.stub.php | 1 + ext/standard/basic_functions_arginfo.h | 14 ++++++-- ext/standard/basic_functions_decl.h | 8 ++--- ext/zend_test/test.stub.php | 2 ++ ext/zend_test/test_arginfo.h | 10 +++++- ext/zend_test/test_decl.h | 8 ++--- ext/zend_test/test_legacy_arginfo.h | 10 +++++- 18 files changed, 139 insertions(+), 21 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 3a24fcce4772..1d53df7e4a33 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -88,6 +88,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES ZEND_AST_TRAIT_METHOD_REFERENCE. . The EMPTY_SWITCH_DEFAULT_CASE() macro has been removed. Use default: ZEND_UNREACHABLE(); instead. + . Functions using zend_forbid_dynamic_call() *must* be flagged with + ZEND_ACC2_FORBID_DYN_CALLS (@forbid-dynamic-calls in stubs). In debug + builds, failing to include that flag will lead to assertion failures. ======================== 2. Build system changes diff --git a/Zend/zend_API.h b/Zend/zend_API.h index aff6a5bba220..9eaa1ec7b3c8 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -896,6 +896,8 @@ static zend_always_inline zend_result zend_forbid_dynamic_call(void) const zend_execute_data *ex = EG(current_execute_data); ZEND_ASSERT(ex != NULL && ex->func != NULL); + ZEND_ASSERT(ex->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS); + if (ZEND_CALL_INFO(ex) & ZEND_CALL_DYNAMIC) { zend_string *function_or_method_name = get_active_function_or_method_name(); zend_throw_error(NULL, "Cannot call %.*s() dynamically", diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1fe4bcf3ee50..c19bf2779fbf 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -16,6 +16,7 @@ +----------------------------------------------------------------------+ */ +#include "php_version.h" #include "zend.h" #include "zend_API.h" #include "zend_attributes.h" diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index 9b2267b531eb..1d405587145d 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -18,11 +18,16 @@ function die(string|int $status = 0): never {} /** @refcount 1 */ function zend_version(): string {} +/** @forbid-dynamic-calls */ function func_num_args(): int {} +/** @forbid-dynamic-calls */ function func_get_arg(int $position): mixed {} -/** @return array */ +/** + * @return array + * @forbid-dynamic-calls + */ function func_get_args(): array {} function strlen(string $string): int {} @@ -156,6 +161,7 @@ function get_defined_functions(bool $exclude_disabled = true): array {} /** * @return array * @refcount 1 + * @forbid-dynamic-calls */ function get_defined_vars(): array {} diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index cb626ff430e6..b3af43fef340 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit zend_builtin_functions.stub.php instead. - * Stub hash: 9b49f527064695c812cd204d9efc63c13681d942 */ + * Stub hash: 64c61862de86d9968930893bf21b516119724064 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_clone, 0, 1, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) @@ -316,9 +316,21 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(exit, arginfo_exit) ZEND_RAW_FENTRY("die", zif_exit, arginfo_die, 0, NULL, NULL) ZEND_FE(zend_version, arginfo_zend_version) - ZEND_FE(func_num_args, arginfo_func_num_args) - ZEND_FE(func_get_arg, arginfo_func_get_arg) - ZEND_FE(func_get_args, arginfo_func_get_args) +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("func_num_args", zif_func_num_args, arginfo_func_num_args, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("func_num_args", zif_func_num_args, arginfo_func_num_args, 0, NULL, NULL) +#endif +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("func_get_arg", zif_func_get_arg, arginfo_func_get_arg, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("func_get_arg", zif_func_get_arg, arginfo_func_get_arg, 0, NULL, NULL) +#endif +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("func_get_args", zif_func_get_args, arginfo_func_get_args, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("func_get_args", zif_func_get_args, arginfo_func_get_args, 0, NULL, NULL) +#endif ZEND_FE(strlen, arginfo_strlen) ZEND_RAW_FENTRY("strcmp", zif_strcmp, arginfo_strcmp, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL) ZEND_RAW_FENTRY("strncmp", zif_strncmp, arginfo_strncmp, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL) @@ -358,7 +370,11 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(get_declared_traits, arginfo_get_declared_traits) ZEND_FE(get_declared_interfaces, arginfo_get_declared_interfaces) ZEND_FE(get_defined_functions, arginfo_get_defined_functions) - ZEND_FE(get_defined_vars, arginfo_get_defined_vars) +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("get_defined_vars", zif_get_defined_vars, arginfo_get_defined_vars, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("get_defined_vars", zif_get_defined_vars, arginfo_get_defined_vars, 0, NULL, NULL) +#endif ZEND_FE(get_resource_type, arginfo_get_resource_type) ZEND_FE(get_resource_id, arginfo_get_resource_id) ZEND_FE(get_resources, arginfo_get_resources) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 56090cddcafb..314abede4063 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -749,6 +749,7 @@ static ZEND_NAMED_FUNCTION(zend_closure_internal_handler) /* {{{ */ { zend_closure *closure = (zend_closure*)ZEND_CLOSURE_OBJECT(EX(func)); closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); + ZEND_ASSERT(!(closure->func.common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS) || EG(exception)); // Assign to EX(this) so that it is released after observer checks etc. ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_RELEASE_THIS); Z_OBJ(EX(This)) = &closure->std; diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 3b85d52c1870..8f67fee2a52b 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -412,10 +412,11 @@ typedef struct _zend_oparray_context { /* op_array uses strict mode types | | | */ #define ZEND_ACC_STRICT_TYPES (1U << 31) /* | X | | */ /* | | | */ -/* Function Flags 2 (fn_flags2) (unused: 0-31) | | | */ +/* Function Flags 2 (fn_flags2) (unused: 1-31) | | | */ /* ============================ | | | */ /* | | | */ -/* #define ZEND_ACC2_EXAMPLE (1 << 0) | X | | */ +/* Function forbids dynamic calls | | | */ +#define ZEND_ACC2_FORBID_DYN_CALLS (1 << 0) /* | X | | */ #define ZEND_ACC_PPP_MASK (ZEND_ACC_PUBLIC | ZEND_ACC_PROTECTED | ZEND_ACC_PRIVATE) #define ZEND_ACC_PPP_SET_MASK (ZEND_ACC_PUBLIC_SET | ZEND_ACC_PROTECTED_SET | ZEND_ACC_PRIVATE_SET) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 5bead7034b9a..0022eb4a1df8 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1030,6 +1030,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ } ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(fci->retval) : !Z_ISREF_P(fci->retval)); + ZEND_ASSERT(!(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif ZEND_OBSERVER_FCALL_END(call, fci->retval); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 391b82241e47..1f7e09d1be35 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4160,6 +4160,8 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); @@ -4291,6 +4293,8 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER)) ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -4422,6 +4426,8 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -9131,6 +9137,8 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY, SPEC(OBSERVER)) ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif ZEND_OBSERVER_FCALL_END(call, EG(exception) ? NULL : ret); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a2e5eac491dc..d5860da23b4c 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1328,6 +1328,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -1396,6 +1398,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -1464,6 +1468,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif zend_observer_fcall_end(call, EG(exception) ? NULL : ret); @@ -1648,6 +1654,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -1764,6 +1772,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -1879,6 +1889,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -2013,6 +2025,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -2146,6 +2160,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_D ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -2276,6 +2292,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_ ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -3663,6 +3681,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALL_TRAMPOLI ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -3809,6 +3829,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALL_TRAMPOLI ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif zend_observer_fcall_end(call, EG(exception) ? NULL : ret); @@ -54080,6 +54102,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_ICA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -54148,6 +54172,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_ICA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -54216,6 +54242,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_IC ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif zend_observer_fcall_end(call, EG(exception) ? NULL : ret); @@ -54400,6 +54428,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -54516,6 +54546,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -54631,6 +54663,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FC ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -54765,6 +54799,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -54898,6 +54934,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FCA ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -55028,6 +55066,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_DO_FC ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } ZEND_ASSERT(opline->result_type != IS_TMP_VAR || !Z_ISREF_P(ret)); #endif @@ -56299,6 +56339,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALL_TRAMPOLINE_SP ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif @@ -56445,6 +56487,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALL_TRAMPOLINE_SP ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); zend_verify_internal_func_info(call->func, ret); + ZEND_ASSERT(!(ZEND_CALL_INFO(call) & ZEND_CALL_DYNAMIC) + || !(call->func->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)); } #endif zend_observer_fcall_end(call, EG(exception) ? NULL : ret); diff --git a/build/gen_stub.php b/build/gen_stub.php index 857c6cb7087b..619c4c905b60 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -1304,6 +1304,7 @@ public function __construct( public ?FunctionOrMethodName $alias, private readonly bool $isDeprecated, private bool $supportsCompileTimeEval, + private bool $forbidDynamicCalls, public readonly bool $verify, public /* readonly */ array $args, public /* readonly */ ReturnInfo $return, @@ -1611,6 +1612,10 @@ private function getArginfoFlagsByPhpVersions(): VersionFlags $flags->addForVersionsAbove("ZEND_ACC_NODISCARD", PHP_85_VERSION_ID); } + if ($this->forbidDynamicCalls) { + $flags->addForVersionsAbove("ZEND_ACC2_FORBID_DYN_CALLS", PHP_86_VERSION_ID); + } + return $flags; } @@ -4797,6 +4802,7 @@ function parseFunctionLike( $alias = null; $isDeprecated = false; $supportsCompileTimeEval = false; + $forbidDynamicCalls = false; $verify = true; $docReturnType = null; $tentativeReturnType = false; @@ -4812,6 +4818,7 @@ function parseFunctionLike( $verify = !array_key_exists('no-verify', $tagMap); $tentativeReturnType = array_key_exists('tentative-return-type', $tagMap); $supportsCompileTimeEval = array_key_exists('compile-time-eval', $tagMap); + $forbidDynamicCalls = array_key_exists('forbid-dynamic-calls', $tagMap); $isUndocumentable = $isUndocumentable || array_key_exists('undocumentable', $tagMap); foreach ($tags as $tag) { @@ -4944,6 +4951,7 @@ function parseFunctionLike( $alias, $isDeprecated, $supportsCompileTimeEval, + $forbidDynamicCalls, $verify, $args, $return, diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 0f04cc036d4d..1999c9b92be1 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1652,6 +1652,7 @@ function extract(array &$array, int $flags = EXTR_OVERWRITE, string $prefix = "" * @param array|string $var_names * @return array * @refcount 1 + * @forbid-dynamic-calls */ function compact($var_name, ...$var_names): array {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 7ad59cfc6897..e51a837ffa4d 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 85603c0acd3b8580cbff782a53c9b1453943684f + * Stub hash: 36b71aa7bbfe478a5e4af400b2822a77067efa2f * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -2944,8 +2944,16 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(array_walk_recursive, arginfo_array_walk_recursive) ZEND_RAW_FENTRY("in_array", zif_in_array, arginfo_in_array, ZEND_ACC_COMPILE_TIME_EVAL, frameless_function_infos_in_array, NULL) ZEND_RAW_FENTRY("array_search", zif_array_search, arginfo_array_search, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL) - ZEND_FE(extract, arginfo_extract) - ZEND_FE(compact, arginfo_compact) +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("extract", zif_extract, arginfo_extract, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("extract", zif_extract, arginfo_extract, 0, NULL, NULL) +#endif +#if (PHP_VERSION_ID >= 80600) + ZEND_RAW_FENTRY("compact", zif_compact, arginfo_compact, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) +#elif (PHP_VERSION_ID >= 80400) + ZEND_RAW_FENTRY("compact", zif_compact, arginfo_compact, 0, NULL, NULL) +#endif ZEND_FE(array_fill, arginfo_array_fill) ZEND_FE(array_fill_keys, arginfo_array_fill_keys) ZEND_FE(range, arginfo_range) diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index 0dda2f894f15..b3eb25c5d988 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 85603c0acd3b8580cbff782a53c9b1453943684f */ + * Stub hash: 36b71aa7bbfe478a5e4af400b2822a77067efa2f */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H -#define ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_36b71aa7bbfe478a5e4af400b2822a77067efa2f_H +#define ZEND_BASIC_FUNCTIONS_DECL_36b71aa7bbfe478a5e4af400b2822a77067efa2f_H typedef enum zend_enum_SortDirection { ZEND_ENUM_SortDirection_Ascending = 1, @@ -20,4 +20,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_85603c0acd3b8580cbff782a53c9b1453943684f_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_36b71aa7bbfe478a5e4af400b2822a77067efa2f_H */ diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index c9d367d5553f..653630ed73b7 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -187,7 +187,9 @@ class ZendTestClassWithPropertyAttribute { } final class ZendTestForbidDynamicCall { + /** @forbid-dynamic-calls */ public function call(): void {} + /** @forbid-dynamic-calls */ public static function callStatic(): void {} } diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index a4da05df2ffb..adcae16cdf61 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 + * Stub hash: e1fb73f5a5f455a3a1eb871e670f26b671da0407 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) @@ -590,8 +590,16 @@ static const zend_function_entry class_ZendTestChildClassWithMethodWithParameter }; static const zend_function_entry class_ZendTestForbidDynamicCall_methods[] = { +#if (PHP_VERSION_ID >= 80600) + ZEND_ME(ZendTestForbidDynamicCall, call, arginfo_class_ZendTestForbidDynamicCall_call, ZEND_FENTRY_FLAGS(ZEND_ACC_PUBLIC, ZEND_ACC2_FORBID_DYN_CALLS)) +#elif (PHP_VERSION_ID >= 80000) ZEND_ME(ZendTestForbidDynamicCall, call, arginfo_class_ZendTestForbidDynamicCall_call, ZEND_ACC_PUBLIC) +#endif +#if (PHP_VERSION_ID >= 80600) + ZEND_ME(ZendTestForbidDynamicCall, callStatic, arginfo_class_ZendTestForbidDynamicCall_callStatic, ZEND_FENTRY_FLAGS(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, ZEND_ACC2_FORBID_DYN_CALLS)) +#elif (PHP_VERSION_ID >= 80000) ZEND_ME(ZendTestForbidDynamicCall, callStatic, arginfo_class_ZendTestForbidDynamicCall_callStatic, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#endif ZEND_FE_END }; diff --git a/ext/zend_test/test_decl.h b/ext/zend_test/test_decl.h index bc2ebaa93c3b..ba6aab902280 100644 --- a/ext/zend_test/test_decl.h +++ b/ext/zend_test/test_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 */ + * Stub hash: e1fb73f5a5f455a3a1eb871e670f26b671da0407 */ -#ifndef ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H -#define ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H +#ifndef ZEND_TEST_DECL_e1fb73f5a5f455a3a1eb871e670f26b671da0407_H +#define ZEND_TEST_DECL_e1fb73f5a5f455a3a1eb871e670f26b671da0407_H typedef enum zend_enum_ZendTestUnitEnum { ZEND_ENUM_ZendTestUnitEnum_Foo = 1, @@ -27,4 +27,4 @@ typedef enum zend_enum_ZendTestEnumWithInterface { ZEND_ENUM_ZendTestEnumWithInterface_Bar = 2, } zend_enum_ZendTestEnumWithInterface; -#endif /* ZEND_TEST_DECL_dcb089a336c6c3e6c685762057dcedcb393508a7_H */ +#endif /* ZEND_TEST_DECL_e1fb73f5a5f455a3a1eb871e670f26b671da0407_H */ diff --git a/ext/zend_test/test_legacy_arginfo.h b/ext/zend_test/test_legacy_arginfo.h index b446a0f9a293..b42d524d7a8a 100644 --- a/ext/zend_test/test_legacy_arginfo.h +++ b/ext/zend_test/test_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: dcb089a336c6c3e6c685762057dcedcb393508a7 + * Stub hash: e1fb73f5a5f455a3a1eb871e670f26b671da0407 * Has decl header: yes */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, 0) @@ -517,8 +517,16 @@ static const zend_function_entry class_ZendTestChildClassWithMethodWithParameter }; static const zend_function_entry class_ZendTestForbidDynamicCall_methods[] = { +#if (PHP_VERSION_ID >= 80600) + ZEND_ME(ZendTestForbidDynamicCall, call, arginfo_class_ZendTestForbidDynamicCall_call, ZEND_FENTRY_FLAGS(ZEND_ACC_PUBLIC, ZEND_ACC2_FORBID_DYN_CALLS)) +#elif (PHP_VERSION_ID >= 70000) ZEND_ME(ZendTestForbidDynamicCall, call, arginfo_class_ZendTestForbidDynamicCall_call, ZEND_ACC_PUBLIC) +#endif +#if (PHP_VERSION_ID >= 80600) + ZEND_ME(ZendTestForbidDynamicCall, callStatic, arginfo_class_ZendTestForbidDynamicCall_callStatic, ZEND_FENTRY_FLAGS(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, ZEND_ACC2_FORBID_DYN_CALLS)) +#elif (PHP_VERSION_ID >= 70000) ZEND_ME(ZendTestForbidDynamicCall, callStatic, arginfo_class_ZendTestForbidDynamicCall_callStatic, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) +#endif ZEND_FE_END }; From 0bbb3ce2a0814321606d9508d1cef123084bdbf0 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 5 Aug 2025 10:14:06 +0200 Subject: [PATCH 297/300] Partial application RFC: https://wiki.php.net/rfc/partial_function_application_v2 Co-authored-by: Joe Watkins --- Zend/Optimizer/compact_literals.c | 5 + Zend/Optimizer/optimize_func_calls.c | 6 +- Zend/Optimizer/zend_call_graph.c | 6 + Zend/Optimizer/zend_inference.c | 1 + .../first_class_callable_non_unary_error.phpt | 10 - ...rst_class_callable_non_variadic_error.phpt | 10 - Zend/tests/partial_application/assert.phpt | 35 + .../partial_application/attributes_001.phpt | 88 ++ .../partial_application/attributes_002.phpt | 19 + .../partial_application/attributes_003.phpt | 16 + Zend/tests/partial_application/clone.phpt | 50 + .../compile_errors_001.phpt | 8 + .../compile_errors_002.phpt | 8 + .../compile_errors_003.phpt | 8 + .../compile_errors_004.phpt | 8 + .../compile_errors_005.phpt | 8 + .../compile_errors_006.phpt | 8 + .../tests/partial_application/errors_001.phpt | 62 + .../tests/partial_application/errors_002.phpt | 15 + .../tests/partial_application/errors_003.phpt | 77 ++ .../tests/partial_application/errors_004.phpt | 16 + .../tests/partial_application/errors_005.phpt | 15 + .../tests/partial_application/errors_006.phpt | 23 + .../tests/partial_application/export_001.phpt | 14 + .../partial_application/extra_named.phpt | 49 + .../partial_application/function_name.phpt | 19 + Zend/tests/partial_application/fuzz_001.phpt | 21 + Zend/tests/partial_application/fuzz_002.phpt | 13 + Zend/tests/partial_application/fuzz_003.phpt | 20 + Zend/tests/partial_application/fuzz_004.phpt | 19 + Zend/tests/partial_application/fuzz_005.phpt | 16 + Zend/tests/partial_application/fuzz_006.phpt | 16 + Zend/tests/partial_application/fuzz_007.phpt | 19 + Zend/tests/partial_application/hook.phpt | 25 + Zend/tests/partial_application/invokable.phpt | 51 + Zend/tests/partial_application/jit_001.phpt | 9 + Zend/tests/partial_application/magic_001.phpt | 82 ++ Zend/tests/partial_application/magic_002.phpt | 65 + Zend/tests/partial_application/magic_003.phpt | 13 + Zend/tests/partial_application/magic_004.phpt | 13 + Zend/tests/partial_application/magic_005.phpt | 30 + Zend/tests/partial_application/magic_006.phpt | 20 + .../named_placeholders.phpt | 117 ++ .../non_dynamic_call_funcs.phpt | 46 + Zend/tests/partial_application/observers.phpt | 34 + .../partial_application/param_reorder.phpt | 202 +++ .../pipe_optimization_001.phpt | 47 + .../pipe_optimization_002.phpt | 51 + .../pipe_optimization_003.phpt | 51 + .../pipe_optimization_004.phpt | 85 ++ .../pipe_optimization_005.phpt | 51 + .../pipe_optimization_006.phpt | 55 + .../pipe_optimization_007.phpt | 85 ++ .../pipe_optimization_008.phpt | 99 ++ .../pipe_optimization_009.phpt | 103 ++ .../pipe_optimization_010.phpt | 58 + .../pipe_optimization_011.phpt | 110 ++ Zend/tests/partial_application/preloading.inc | 13 + .../tests/partial_application/preloading.phpt | 15 + .../partial_application/rebinding_001.phpt | 63 + .../partial_application/rebinding_002.phpt | 45 + .../partial_application/rebinding_003.phpt | 65 + .../recorded_warnings.phpt | 14 + .../partial_application/references_001.phpt | 24 + .../partial_application/references_002.phpt | 24 + .../partial_application/references_003.phpt | 20 + .../partial_application/references_004.phpt | 42 + .../partial_application/references_005.phpt | 26 + .../partial_application/reflection_001.phpt | 48 + .../partial_application/reflection_002.phpt | 57 + .../partial_application/reflection_003.phpt | 43 + .../partial_application/reflection_004.phpt | 16 + .../partial_application/reflection_005.phpt | 16 + .../relative_return_types.phpt | 133 ++ .../partial_application/return_type.phpt | 20 + .../partial_application/rfc_examples.inc | 75 ++ .../rfc_examples_const_expr.phpt | 25 + .../rfc_examples_debug.phpt | 25 + .../rfc_examples_errors.phpt | 34 + .../rfc_examples_eval_order.phpt | 30 + .../rfc_examples_extra_args.phpt | 54 + .../rfc_examples_incompatible_functions.phpt | 14 + .../rfc_examples_magic_methods.phpt | 47 + .../rfc_examples_overview.phpt | 44 + .../rfc_examples_scoping.phpt | 113 ++ .../rfc_examples_semantics.phpt | 30 + .../rfc_examples_semantics_examples.phpt | 217 ++++ .../static_method_001.phpt | 18 + .../partial_application/statics_001.phpt | 22 + .../partial_application/statics_002.phpt | 23 + .../partial_application/statics_003.phpt | 26 + .../superfluous_args_are_forwarded.phpt | 44 + Zend/tests/partial_application/this.phpt | 20 + .../variation_call_001.phpt | 31 + .../variation_closure_001.phpt | 23 + .../variation_closure_002.phpt | 28 + .../variation_closure_003.phpt | 46 + .../variation_debug_001.phpt | 40 + .../variation_debug_002.phpt | 49 + .../partial_application/variation_ex_001.phpt | 14 + .../partial_application/variation_gc_001.phpt | 19 + .../partial_application/variation_gc_002.phpt | 11 + .../partial_application/variation_gc_003.phpt | 15 + .../variation_invoke_001.phpt | 21 + .../variation_nocall_001.phpt | 12 + .../variation_nocall_002.phpt | 30 + .../variation_parent_001.phpt | 75 ++ .../variation_scope_001.phpt | 18 + .../variation_strict_001.phpt | 20 + .../variation_variadics_001.phpt | 31 + .../variation_variadics_002.phpt | 25 + .../variation_variadics_004.phpt | 65 + .../variation_variadics_006.phpt | 17 + .../variation_variadics_007.phpt | 14 + .../variation_variadics_008.phpt | 16 + Zend/zend_ast.c | 10 + Zend/zend_ast.h | 1 + Zend/zend_closures.c | 72 +- Zend/zend_closures.h | 1 + Zend/zend_compile.c | 288 ++++- Zend/zend_compile.h | 4 +- Zend/zend_execute.c | 17 +- Zend/zend_execute.h | 3 + Zend/zend_execute_API.c | 4 + Zend/zend_globals.h | 1 + Zend/zend_language_scanner.l | 83 +- Zend/zend_partial.c | 1146 +++++++++++++++++ Zend/zend_partial.h | 34 + Zend/zend_string.h | 8 + Zend/zend_types.h | 2 + Zend/zend_vm_def.h | 63 + Zend/zend_vm_execute.h | 486 +++++-- Zend/zend_vm_handlers.h | 940 +++++++------- Zend/zend_vm_opcodes.c | 8 +- Zend/zend_vm_opcodes.h | 4 +- configure.ac | 1 + ext/opcache/ZendAccelerator.c | 216 ++++ ext/opcache/ZendAccelerator.h | 10 + ext/opcache/jit/zend_jit.c | 3 + ext/opcache/jit/zend_jit_ir.c | 2 +- ext/opcache/jit/zend_jit_vm_helpers.c | 3 +- win32/build/config.w32 | 2 +- 142 files changed, 7119 insertions(+), 668 deletions(-) delete mode 100644 Zend/tests/first_class_callable/first_class_callable_non_unary_error.phpt delete mode 100644 Zend/tests/first_class_callable/first_class_callable_non_variadic_error.phpt create mode 100644 Zend/tests/partial_application/assert.phpt create mode 100644 Zend/tests/partial_application/attributes_001.phpt create mode 100644 Zend/tests/partial_application/attributes_002.phpt create mode 100644 Zend/tests/partial_application/attributes_003.phpt create mode 100644 Zend/tests/partial_application/clone.phpt create mode 100644 Zend/tests/partial_application/compile_errors_001.phpt create mode 100644 Zend/tests/partial_application/compile_errors_002.phpt create mode 100644 Zend/tests/partial_application/compile_errors_003.phpt create mode 100644 Zend/tests/partial_application/compile_errors_004.phpt create mode 100644 Zend/tests/partial_application/compile_errors_005.phpt create mode 100644 Zend/tests/partial_application/compile_errors_006.phpt create mode 100644 Zend/tests/partial_application/errors_001.phpt create mode 100644 Zend/tests/partial_application/errors_002.phpt create mode 100644 Zend/tests/partial_application/errors_003.phpt create mode 100644 Zend/tests/partial_application/errors_004.phpt create mode 100644 Zend/tests/partial_application/errors_005.phpt create mode 100644 Zend/tests/partial_application/errors_006.phpt create mode 100644 Zend/tests/partial_application/export_001.phpt create mode 100644 Zend/tests/partial_application/extra_named.phpt create mode 100644 Zend/tests/partial_application/function_name.phpt create mode 100644 Zend/tests/partial_application/fuzz_001.phpt create mode 100644 Zend/tests/partial_application/fuzz_002.phpt create mode 100644 Zend/tests/partial_application/fuzz_003.phpt create mode 100644 Zend/tests/partial_application/fuzz_004.phpt create mode 100644 Zend/tests/partial_application/fuzz_005.phpt create mode 100644 Zend/tests/partial_application/fuzz_006.phpt create mode 100644 Zend/tests/partial_application/fuzz_007.phpt create mode 100644 Zend/tests/partial_application/hook.phpt create mode 100644 Zend/tests/partial_application/invokable.phpt create mode 100644 Zend/tests/partial_application/jit_001.phpt create mode 100644 Zend/tests/partial_application/magic_001.phpt create mode 100644 Zend/tests/partial_application/magic_002.phpt create mode 100644 Zend/tests/partial_application/magic_003.phpt create mode 100644 Zend/tests/partial_application/magic_004.phpt create mode 100644 Zend/tests/partial_application/magic_005.phpt create mode 100644 Zend/tests/partial_application/magic_006.phpt create mode 100644 Zend/tests/partial_application/named_placeholders.phpt create mode 100644 Zend/tests/partial_application/non_dynamic_call_funcs.phpt create mode 100644 Zend/tests/partial_application/observers.phpt create mode 100644 Zend/tests/partial_application/param_reorder.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_001.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_002.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_003.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_004.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_005.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_006.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_007.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_008.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_009.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_010.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_011.phpt create mode 100644 Zend/tests/partial_application/preloading.inc create mode 100644 Zend/tests/partial_application/preloading.phpt create mode 100644 Zend/tests/partial_application/rebinding_001.phpt create mode 100644 Zend/tests/partial_application/rebinding_002.phpt create mode 100644 Zend/tests/partial_application/rebinding_003.phpt create mode 100644 Zend/tests/partial_application/recorded_warnings.phpt create mode 100644 Zend/tests/partial_application/references_001.phpt create mode 100644 Zend/tests/partial_application/references_002.phpt create mode 100644 Zend/tests/partial_application/references_003.phpt create mode 100644 Zend/tests/partial_application/references_004.phpt create mode 100644 Zend/tests/partial_application/references_005.phpt create mode 100644 Zend/tests/partial_application/reflection_001.phpt create mode 100644 Zend/tests/partial_application/reflection_002.phpt create mode 100644 Zend/tests/partial_application/reflection_003.phpt create mode 100644 Zend/tests/partial_application/reflection_004.phpt create mode 100644 Zend/tests/partial_application/reflection_005.phpt create mode 100644 Zend/tests/partial_application/relative_return_types.phpt create mode 100644 Zend/tests/partial_application/return_type.phpt create mode 100644 Zend/tests/partial_application/rfc_examples.inc create mode 100644 Zend/tests/partial_application/rfc_examples_const_expr.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_debug.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_errors.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_eval_order.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_extra_args.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_magic_methods.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_overview.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_scoping.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_semantics.phpt create mode 100644 Zend/tests/partial_application/rfc_examples_semantics_examples.phpt create mode 100644 Zend/tests/partial_application/static_method_001.phpt create mode 100644 Zend/tests/partial_application/statics_001.phpt create mode 100644 Zend/tests/partial_application/statics_002.phpt create mode 100644 Zend/tests/partial_application/statics_003.phpt create mode 100644 Zend/tests/partial_application/superfluous_args_are_forwarded.phpt create mode 100644 Zend/tests/partial_application/this.phpt create mode 100644 Zend/tests/partial_application/variation_call_001.phpt create mode 100644 Zend/tests/partial_application/variation_closure_001.phpt create mode 100644 Zend/tests/partial_application/variation_closure_002.phpt create mode 100644 Zend/tests/partial_application/variation_closure_003.phpt create mode 100644 Zend/tests/partial_application/variation_debug_001.phpt create mode 100644 Zend/tests/partial_application/variation_debug_002.phpt create mode 100644 Zend/tests/partial_application/variation_ex_001.phpt create mode 100644 Zend/tests/partial_application/variation_gc_001.phpt create mode 100644 Zend/tests/partial_application/variation_gc_002.phpt create mode 100644 Zend/tests/partial_application/variation_gc_003.phpt create mode 100644 Zend/tests/partial_application/variation_invoke_001.phpt create mode 100644 Zend/tests/partial_application/variation_nocall_001.phpt create mode 100644 Zend/tests/partial_application/variation_nocall_002.phpt create mode 100644 Zend/tests/partial_application/variation_parent_001.phpt create mode 100644 Zend/tests/partial_application/variation_scope_001.phpt create mode 100644 Zend/tests/partial_application/variation_strict_001.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_001.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_002.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_004.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_006.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_007.phpt create mode 100644 Zend/tests/partial_application/variation_variadics_008.phpt create mode 100644 Zend/zend_partial.c create mode 100644 Zend/zend_partial.h diff --git a/Zend/Optimizer/compact_literals.c b/Zend/Optimizer/compact_literals.c index cf74dd8fc147..a4ecb19c85ef 100644 --- a/Zend/Optimizer/compact_literals.c +++ b/Zend/Optimizer/compact_literals.c @@ -733,6 +733,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx case ZEND_SEND_VAR_NO_REF_EX: case ZEND_SEND_REF: case ZEND_SEND_FUNC_ARG: + case ZEND_SEND_PLACEHOLDER: case ZEND_CHECK_FUNC_ARG: if (opline->op2_type == IS_CONST) { opline->result.num = cache_size; @@ -745,6 +746,10 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx cache_size += sizeof(void *); } break; + case ZEND_CALLABLE_CONVERT_PARTIAL: + opline->op1.num = cache_size; + cache_size += 2 * sizeof(void *); + break; } opline++; } diff --git a/Zend/Optimizer/optimize_func_calls.c b/Zend/Optimizer/optimize_func_calls.c index 69c371207ddc..05cdce4fc4cf 100644 --- a/Zend/Optimizer/optimize_func_calls.c +++ b/Zend/Optimizer/optimize_func_calls.c @@ -191,6 +191,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: call--; if (call_stack[call].func && call_stack[call].opline) { zend_op *fcall = call_stack[call].opline; @@ -223,13 +224,14 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) * At this point we also know whether or not the result of * the DO opcode is used, allowing to optimize calls to * ZEND_ACC_NODISCARD functions. */ - if (opline->opcode != ZEND_CALLABLE_CONVERT) { + if (opline->opcode != ZEND_CALLABLE_CONVERT && opline->opcode != ZEND_CALLABLE_CONVERT_PARTIAL) { opline->opcode = zend_get_call_op(fcall, call_stack[call].func, !RESULT_UNUSED(opline)); } if ((ZEND_OPTIMIZER_PASS_16 & ctx->optimization_level) && call_stack[call].try_inline - && opline->opcode != ZEND_CALLABLE_CONVERT) { + && opline->opcode != ZEND_CALLABLE_CONVERT + && opline->opcode != ZEND_CALLABLE_CONVERT_PARTIAL) { zend_try_inline_call(op_array, fcall, opline, call_stack[call].func); } } diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index bb80e21a2465..56f326e100b5 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -124,6 +124,7 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: func_info->flags |= ZEND_FUNC_HAS_CALLS; if (call_info) { call_info->caller_call_opline = opline; @@ -140,11 +141,16 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 case ZEND_SEND_VAR_NO_REF: case ZEND_SEND_VAR_NO_REF_EX: case ZEND_SEND_USER: + case ZEND_SEND_PLACEHOLDER: if (call_info) { if (opline->op2_type == IS_CONST) { call_info->named_args = true; break; } + if (opline->opcode == ZEND_SEND_PLACEHOLDER + && opline->op1.num == ZEND_PLACEHOLDER_VARIADIC) { + break; + } uint32_t num = opline->op2.num; if (num > 0) { diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 05d33d3d75fb..2e6cc70ec254 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -3903,6 +3903,7 @@ static zend_always_inline zend_result _zend_update_type_info( } break; case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: UPDATE_SSA_TYPE(MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN, ssa_op->result_def); UPDATE_SSA_OBJ_TYPE(zend_ce_closure, /* is_instanceof */ false, ssa_op->result_def); break; diff --git a/Zend/tests/first_class_callable/first_class_callable_non_unary_error.phpt b/Zend/tests/first_class_callable/first_class_callable_non_unary_error.phpt deleted file mode 100644 index 74e36a9ad0df..000000000000 --- a/Zend/tests/first_class_callable/first_class_callable_non_unary_error.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -First class callable error: more than one argument ---FILE-- - ---EXPECTF-- -Fatal error: Cannot create a Closure for call expression with more than one argument, or non-variadic placeholders in %s on line %d diff --git a/Zend/tests/first_class_callable/first_class_callable_non_variadic_error.phpt b/Zend/tests/first_class_callable/first_class_callable_non_variadic_error.phpt deleted file mode 100644 index efbd13b7593b..000000000000 --- a/Zend/tests/first_class_callable/first_class_callable_non_variadic_error.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -First class callable error: non-variadic placeholder ---FILE-- - ---EXPECTF-- -Fatal error: Cannot create a Closure for call expression with more than one argument, or non-variadic placeholders in %s on line %d diff --git a/Zend/tests/partial_application/assert.phpt b/Zend/tests/partial_application/assert.phpt new file mode 100644 index 000000000000..fe36e687f8d5 --- /dev/null +++ b/Zend/tests/partial_application/assert.phpt @@ -0,0 +1,35 @@ +--TEST-- +PFA of assert() behaves like a dynamic call to assert() +--FILE-- +getMessage(), "\n"; +} + +try { + echo "# Dynamic call:\n"; + (function ($f) { $f(false); })('assert'); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage() ?: '(no message)', "\n"; +} + +try { + echo "# PFA call:\n"; + $f = assert(?); + $f(false); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage() ?: '(no message)', "\n"; +} + +?> +--EXPECT-- +# Static call: +AssertionError: assert(false) +# Dynamic call: +AssertionError: (no message) +# PFA call: +AssertionError: (no message) diff --git a/Zend/tests/partial_application/attributes_001.phpt b/Zend/tests/partial_application/attributes_001.phpt new file mode 100644 index 000000000000..827ad41321ec --- /dev/null +++ b/Zend/tests/partial_application/attributes_001.phpt @@ -0,0 +1,88 @@ +--TEST-- +PFA inherits NoDiscard and SensitiveParameter attributes +--FILE-- +getAttributes()); + + foreach ($r->getParameters() as $i => $p) { + echo "Parameter $i:\n"; + var_dump($p->getAttributes()); + } +} + +echo "# Orig attributes:\n"; + +dump_attributes('f'); + +$f = f(1, ?, ?, ...); + +echo "# PFA attributes:\n"; + +dump_attributes($f); + +?> +--EXPECTF-- +# Orig attributes: +array(2) { + [0]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(9) "NoDiscard" + } + [1]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(4) "Test" + } +} +Parameter 0: +array(0) { +} +Parameter 1: +array(1) { + [0]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(18) "SensitiveParameter" + } +} +Parameter 2: +array(1) { + [0]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(4) "Test" + } +} +# PFA attributes: +array(1) { + [0]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(9) "NoDiscard" + } +} +Parameter 0: +array(1) { + [0]=> + object(ReflectionAttribute)#%d (1) { + ["name"]=> + string(18) "SensitiveParameter" + } +} +Parameter 1: +array(0) { +} +Parameter 2: +array(0) { +} diff --git a/Zend/tests/partial_application/attributes_002.phpt b/Zend/tests/partial_application/attributes_002.phpt new file mode 100644 index 000000000000..be1f1612f938 --- /dev/null +++ b/Zend/tests/partial_application/attributes_002.phpt @@ -0,0 +1,19 @@ +--TEST-- +PFA preserves #[SensitiveParameter] +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught Exception in %s:%d +Stack trace: +#0 %s(%d): f(1, Object(SensitiveParameterValue), 3, Object(SensitiveParameterValue), Object(SensitiveParameterValue)) +#1 %s(%d): {closure:pfa:%s:7}(Object(SensitiveParameterValue), 3, Object(SensitiveParameterValue), Object(SensitiveParameterValue)) +#2 {main} + thrown in %s on line %d diff --git a/Zend/tests/partial_application/attributes_003.phpt b/Zend/tests/partial_application/attributes_003.phpt new file mode 100644 index 000000000000..d113d02eb8f7 --- /dev/null +++ b/Zend/tests/partial_application/attributes_003.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA preserves #[NoDiscard] +--FILE-- + +--EXPECTF-- +Warning: The return value of function {closure:%s}() should either be used or intentionally ignored by casting it as (void) in %s on line 7 diff --git a/Zend/tests/partial_application/clone.phpt b/Zend/tests/partial_application/clone.phpt new file mode 100644 index 000000000000..f778d776b717 --- /dev/null +++ b/Zend/tests/partial_application/clone.phpt @@ -0,0 +1,50 @@ +--TEST-- +clone() can be partially applied +--FILE-- + 7])); + +$clone = clone(?, ['a' => 8]); +var_dump($clone(new C(9, 10))); + +?> +--EXPECTF-- +object(C)#%d (2) { + ["a"]=> + int(1) + ["b"]=> + int(2) +} +object(C)#%d (2) { + ["a"]=> + int(3) + ["b"]=> + int(4) +} +object(C)#%d (2) { + ["a"]=> + int(7) + ["b"]=> + int(6) +} +object(C)#%d (2) { + ["a"]=> + int(8) + ["b"]=> + int(10) +} diff --git a/Zend/tests/partial_application/compile_errors_001.phpt b/Zend/tests/partial_application/compile_errors_001.phpt new file mode 100644 index 000000000000..f08495a1f1e5 --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_001.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: multiple variadic placeholders +--FILE-- + +--EXPECTF-- +Fatal error: Variadic placeholder may only appear once in %s on line %d diff --git a/Zend/tests/partial_application/compile_errors_002.phpt b/Zend/tests/partial_application/compile_errors_002.phpt new file mode 100644 index 000000000000..b6a2073a8363 --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_002.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: variadic placeholder must be last +--FILE-- + +--EXPECTF-- +Fatal error: Variadic placeholder must be last in %s on line %d diff --git a/Zend/tests/partial_application/compile_errors_003.phpt b/Zend/tests/partial_application/compile_errors_003.phpt new file mode 100644 index 000000000000..26ff8435111b --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_003.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: placeholders can not appear after named args +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use positional argument after named argument in %s on line %d diff --git a/Zend/tests/partial_application/compile_errors_004.phpt b/Zend/tests/partial_application/compile_errors_004.phpt new file mode 100644 index 000000000000..ac7ec163c5da --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_004.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: variadic placeholder must be last, including after named args +--FILE-- + +--EXPECTF-- +Fatal error: Variadic placeholder must be last in %s on line %d diff --git a/Zend/tests/partial_application/compile_errors_005.phpt b/Zend/tests/partial_application/compile_errors_005.phpt new file mode 100644 index 000000000000..30e4aa12b488 --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_005.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: variadic placeholder must be last, including after positional args +--FILE-- + +--EXPECTF-- +Fatal error: Variadic placeholder must be last in %s on line %d diff --git a/Zend/tests/partial_application/compile_errors_006.phpt b/Zend/tests/partial_application/compile_errors_006.phpt new file mode 100644 index 000000000000..90210be6acae --- /dev/null +++ b/Zend/tests/partial_application/compile_errors_006.phpt @@ -0,0 +1,8 @@ +--TEST-- +PFA compile errors: can not use unpacking in PFA, including with variadic placeholdres +--FILE-- + "bar"], ...); +?> +--EXPECTF-- +Fatal error: Cannot combine partial application and unpacking in %s on line %d diff --git a/Zend/tests/partial_application/errors_001.phpt b/Zend/tests/partial_application/errors_001.phpt new file mode 100644 index 000000000000..2d5348cb28af --- /dev/null +++ b/Zend/tests/partial_application/errors_001.phpt @@ -0,0 +1,62 @@ +--TEST-- +PFA errors: PFA instantiation follows the usual argument count validation +--FILE-- +getMessage()); +} + +try { + foo(?, ?, ?, ?); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + $c = new C(); + $c->f(?); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + property_exists(?); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + usleep(?, ?); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + foo(?, ?, ?, ?, ...); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +/* It is allowed to specify less than the number of required params, when there + * is a variadic placeholder */ +foo(?, ...); + +?> +--EXPECT-- +ArgumentCountError: Partial application of foo() expects exactly 3 arguments, 1 given +ArgumentCountError: Partial application of foo() expects at most 3 arguments, 4 given +ArgumentCountError: Partial application of C::f() expects exactly 3 arguments, 1 given +ArgumentCountError: Partial application of property_exists() expects exactly 2 arguments, 1 given +ArgumentCountError: Partial application of usleep() expects at most 1 arguments, 2 given +ArgumentCountError: Partial application of foo() expects at most 3 arguments, 4 given diff --git a/Zend/tests/partial_application/errors_002.phpt b/Zend/tests/partial_application/errors_002.phpt new file mode 100644 index 000000000000..0132d8873e2a --- /dev/null +++ b/Zend/tests/partial_application/errors_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +PFA errors: named parameter that resolve to the position of a placeholder is an error +--FILE-- +getMessage()); +} +?> +--EXPECT-- +Error: Named parameter $a overwrites previous placeholder diff --git a/Zend/tests/partial_application/errors_003.phpt b/Zend/tests/partial_application/errors_003.phpt new file mode 100644 index 000000000000..bc1c16e64f9b --- /dev/null +++ b/Zend/tests/partial_application/errors_003.phpt @@ -0,0 +1,77 @@ +--TEST-- +PFA errors: PFA call follows the usual argument count validation +--FILE-- +getMessage()); +} + +$foo = foo(?, ?); + +try { + $foo(1); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +$bar = bar(?, ?, ...); + +try { + $bar(1); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +class Foo { + public function bar($a, ...$b) {} +} + +$foo = new Foo; + +$bar = $foo->bar(?); + +try { + $bar(); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +$repeat = str_repeat('a', ...); + +try { + $repeat(); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +$usleep = usleep(?); + +try { + $usleep(); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + $usleep(1, 2); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} +?> +--EXPECTF-- +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 3 expected +ArgumentCountError: Too few arguments to function Foo::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected diff --git a/Zend/tests/partial_application/errors_004.phpt b/Zend/tests/partial_application/errors_004.phpt new file mode 100644 index 000000000000..e5e1432753b2 --- /dev/null +++ b/Zend/tests/partial_application/errors_004.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA errors: not specifying a required param is an error +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught ArgumentCountError: f(): Argument #2 ($b) not passed in %s:6 +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/partial_application/errors_005.phpt b/Zend/tests/partial_application/errors_005.phpt new file mode 100644 index 000000000000..2c28f0565e2d --- /dev/null +++ b/Zend/tests/partial_application/errors_005.phpt @@ -0,0 +1,15 @@ +--TEST-- +PFA errors: Can not fetch default parameter value for Closure::__invoke() +--FILE-- +__invoke(0, 0, ?); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +ArgumentCountError: Closure::__invoke(): Argument #3 ($c) must be passed explicitly, because the default value is not known diff --git a/Zend/tests/partial_application/errors_006.phpt b/Zend/tests/partial_application/errors_006.phpt new file mode 100644 index 000000000000..aec2fc5dc073 --- /dev/null +++ b/Zend/tests/partial_application/errors_006.phpt @@ -0,0 +1,23 @@ +--TEST-- +PFA errors: Some internal function parameters have UNKNOWN default value +--FILE-- + array_keys($array, ???, true) + $f = array_keys(?, strict: true); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +try { + // fn (array $array, mixed $filter_value = ???) => array_keys($array, $filter_value, true) + $f = array_keys(?, strict: true, ...); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known +ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known diff --git a/Zend/tests/partial_application/export_001.phpt b/Zend/tests/partial_application/export_001.phpt new file mode 100644 index 000000000000..b48146bcc65a --- /dev/null +++ b/Zend/tests/partial_application/export_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFA AST export +--INI-- +assert.exception=1 +--FILE-- +getMessage()); +} +?> +--EXPECT-- +AssertionError: assert(0 && foo(?) && foo(new stdClass(), bar: 1, ...)) diff --git a/Zend/tests/partial_application/extra_named.phpt b/Zend/tests/partial_application/extra_named.phpt new file mode 100644 index 000000000000..4dd80cfa0127 --- /dev/null +++ b/Zend/tests/partial_application/extra_named.phpt @@ -0,0 +1,49 @@ +--TEST-- +PFA extra named parameters are forwarded to the actual function +--FILE-- + +--EXPECT-- +array(3) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" + ["baz"]=> + string(3) "baz" +} +array(2) { + ["bar"]=> + string(3) "bar" + ["baz"]=> + string(3) "baz" +} +array(2) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" +} diff --git a/Zend/tests/partial_application/function_name.phpt b/Zend/tests/partial_application/function_name.phpt new file mode 100644 index 000000000000..5ed0c5869640 --- /dev/null +++ b/Zend/tests/partial_application/function_name.phpt @@ -0,0 +1,19 @@ +--TEST-- +Partial application function name +--FILE-- +getName()); +} + +f(); + +var_dump((new ReflectionFunction(g(?)))->getName()); + +?> +--EXPECTF-- +string(%d) "{closure:pfa:f():6}" +string(%d) "{closure:pfa:%sfunction_name.php:11}" diff --git a/Zend/tests/partial_application/fuzz_001.phpt b/Zend/tests/partial_application/fuzz_001.phpt new file mode 100644 index 000000000000..f6544105a435 --- /dev/null +++ b/Zend/tests/partial_application/fuzz_001.phpt @@ -0,0 +1,21 @@ +--TEST-- +Closure application fuzz 001 +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %s 4 - 4 + + - Bound Variables [2] { + Variable #0 [ $fn ] + Variable #1 [ $a ] + } + + - Parameters [1] { + Parameter #0 [ $b ] + } +} diff --git a/Zend/tests/partial_application/fuzz_002.phpt b/Zend/tests/partial_application/fuzz_002.phpt new file mode 100644 index 000000000000..685cb706e69b --- /dev/null +++ b/Zend/tests/partial_application/fuzz_002.phpt @@ -0,0 +1,13 @@ +--TEST-- +Closure application fuzz 002 +--FILE-- + +--EXPECTF-- +OK diff --git a/Zend/tests/partial_application/fuzz_003.phpt b/Zend/tests/partial_application/fuzz_003.phpt new file mode 100644 index 000000000000..6e9d583fda99 --- /dev/null +++ b/Zend/tests/partial_application/fuzz_003.phpt @@ -0,0 +1,20 @@ +--TEST-- +Closure application fuzz 003 +--FILE-- +method(1, ...); +$bar(2); +?> +--EXPECT-- +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} diff --git a/Zend/tests/partial_application/fuzz_004.phpt b/Zend/tests/partial_application/fuzz_004.phpt new file mode 100644 index 000000000000..ea005304a3af --- /dev/null +++ b/Zend/tests/partial_application/fuzz_004.phpt @@ -0,0 +1,19 @@ +--TEST-- +Closure application fuzz 004 +--FILE-- +__invoke(UNDEFINED); +} catch (\Throwable $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +Error: Undefined constant "UNDEFINED" diff --git a/Zend/tests/partial_application/fuzz_005.phpt b/Zend/tests/partial_application/fuzz_005.phpt new file mode 100644 index 000000000000..ea04862d8399 --- /dev/null +++ b/Zend/tests/partial_application/fuzz_005.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA fuzz 005 +--FILE-- + +==DONE== +--EXPECT-- +==DONE== diff --git a/Zend/tests/partial_application/fuzz_006.phpt b/Zend/tests/partial_application/fuzz_006.phpt new file mode 100644 index 000000000000..26ec6e3e4dd1 --- /dev/null +++ b/Zend/tests/partial_application/fuzz_006.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA fuzz 006 +--FILE-- + +--EXPECT-- +int(1) diff --git a/Zend/tests/partial_application/fuzz_007.phpt b/Zend/tests/partial_application/fuzz_007.phpt new file mode 100644 index 000000000000..123ce29d8b18 --- /dev/null +++ b/Zend/tests/partial_application/fuzz_007.phpt @@ -0,0 +1,19 @@ +--TEST-- +PFA fuzz 007 +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +Undefined constant "UNDEFINED" diff --git a/Zend/tests/partial_application/hook.phpt b/Zend/tests/partial_application/hook.phpt new file mode 100644 index 000000000000..6402c5d01e74 --- /dev/null +++ b/Zend/tests/partial_application/hook.phpt @@ -0,0 +1,25 @@ +--TEST-- +Parent property hook call can not be partially applied +--FILE-- +a = 1; + +?> +--EXPECTF-- +Fatal error: Cannot create Closure for parent property hook call in %s on line %d diff --git a/Zend/tests/partial_application/invokable.phpt b/Zend/tests/partial_application/invokable.phpt new file mode 100644 index 000000000000..c21030e7733a --- /dev/null +++ b/Zend/tests/partial_application/invokable.phpt @@ -0,0 +1,51 @@ +--TEST-- +__invoke() can be partially applied +--FILE-- + +--EXPECTF-- +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 11 - 11 + + - Parameters [2] { + Parameter #0 [ int $a ] + Parameter #1 [ object $b ] + } + - Return [ C ] +} + +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 15 - 15 + + - Bound Variables [1] { + Variable #0 [ $b ] + } + + - Parameters [1] { + Parameter #0 [ int $a ] + } + - Return [ C ] +} + +int(1) +object(stdClass)#%d (0) { +} diff --git a/Zend/tests/partial_application/jit_001.phpt b/Zend/tests/partial_application/jit_001.phpt new file mode 100644 index 000000000000..84aefa05ab28 --- /dev/null +++ b/Zend/tests/partial_application/jit_001.phpt @@ -0,0 +1,9 @@ +--TEST-- +PFA JIT 001 +--FILE-- + +--EXPECT-- +int(1) +int(2) diff --git a/Zend/tests/partial_application/magic_001.phpt b/Zend/tests/partial_application/magic_001.phpt new file mode 100644 index 000000000000..60f5a3f20dfb --- /dev/null +++ b/Zend/tests/partial_application/magic_001.phpt @@ -0,0 +1,82 @@ +--TEST-- +__call() can be partially applied +--FILE-- +method(?); + +echo (string) new ReflectionFunction($bar); + +try { + $bar(); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +try { + $bar(1, 2); +} catch (Error $ex) { + printf("%s: %s\n", $ex::class, $ex->getMessage()); +} + +$bar(1); + +$bar = $foo->method(?, ...); + +echo (string) new ReflectionFunction($bar); + +$bar(10); + +$bar = $foo->method(new Foo, ...); + +echo (string) new ReflectionFunction($bar); + +$bar(100); +?> +--EXPECTF-- +Closure [ public method {closure:%s:%d} ] { + @@ %s 12 - 12 + + - Parameters [1] { + Parameter #0 [ $args0 ] + } +} +ArgumentCountError: Too few arguments to function Foo::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +Foo::method +int(1) +Foo::method +int(1) +Closure [ public method {closure:%s:%d} ] { + @@ %s 30 - 30 + + - Parameters [2] { + Parameter #0 [ $args0 ] + Parameter #1 [ ...$args ] + } +} +Foo::method +int(10) +Closure [ public method {closure:%s:%d} ] { + @@ %s 36 - 36 + + - Bound Variables [1] { + Variable #0 [ $args0 ] + } + + - Parameters [1] { + Parameter #0 [ ...$args ] + } +} +Foo::method +object(Foo)#%d (0) { +} +int(100) diff --git a/Zend/tests/partial_application/magic_002.phpt b/Zend/tests/partial_application/magic_002.phpt new file mode 100644 index 000000000000..d4baf7afc18f --- /dev/null +++ b/Zend/tests/partial_application/magic_002.phpt @@ -0,0 +1,65 @@ +--TEST-- +__callStatic() can be partially applied +--FILE-- + +--EXPECTF-- +Closure [ static public method {closure:%s:%d} ] { + @@ %s 10 - 10 + + - Parameters [1] { + Parameter #0 [ $args0 ] + } +} +Foo::method +int(1) +Closure [ static public method {closure:%s:%d} ] { + @@ %s 16 - 16 + + - Parameters [2] { + Parameter #0 [ $args0 ] + Parameter #1 [ ...$args ] + } +} +Foo::method +int(10) +Closure [ static public method {closure:%s:%d} ] { + @@ %s 22 - 22 + + - Bound Variables [1] { + Variable #0 [ $args0 ] + } + + - Parameters [1] { + Parameter #0 [ ...$args ] + } +} +Foo::method +object(Foo)#%d (0) { +} +int(100) diff --git a/Zend/tests/partial_application/magic_003.phpt b/Zend/tests/partial_application/magic_003.phpt new file mode 100644 index 000000000000..75e26c70b1a3 --- /dev/null +++ b/Zend/tests/partial_application/magic_003.phpt @@ -0,0 +1,13 @@ +--TEST-- +PFA magic trampoline release unused +--FILE-- + +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/magic_004.phpt b/Zend/tests/partial_application/magic_004.phpt new file mode 100644 index 000000000000..2a340b085f62 --- /dev/null +++ b/Zend/tests/partial_application/magic_004.phpt @@ -0,0 +1,13 @@ +--TEST-- +PFA magic trampoline release used +--FILE-- + +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/magic_005.phpt b/Zend/tests/partial_application/magic_005.phpt new file mode 100644 index 000000000000..8c4e878196fc --- /dev/null +++ b/Zend/tests/partial_application/magic_005.phpt @@ -0,0 +1,30 @@ +--TEST-- +PFA magic null ptr deref in arginfo +--FILE-- +method(?); +var_dump($bar); +?> +--EXPECTF-- +object(Closure)#%d (%d) { + ["name"]=> + string(%d) "{closure:%s}" + ["file"]=> + string(%d) "%smagic_005.php" + ["line"]=> + int(8) + ["this"]=> + object(Foo)#%d (0) { + } + ["parameter"]=> + array(1) { + ["$args0"]=> + string(10) "" + } +} diff --git a/Zend/tests/partial_application/magic_006.phpt b/Zend/tests/partial_application/magic_006.phpt new file mode 100644 index 000000000000..29564d8b615a --- /dev/null +++ b/Zend/tests/partial_application/magic_006.phpt @@ -0,0 +1,20 @@ +--TEST-- +PFA magic varargs +--FILE-- +method(1,...); +$bar(2); +?> +--EXPECT-- +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} diff --git a/Zend/tests/partial_application/named_placeholders.phpt b/Zend/tests/partial_application/named_placeholders.phpt new file mode 100644 index 000000000000..6517a8946d36 --- /dev/null +++ b/Zend/tests/partial_application/named_placeholders.phpt @@ -0,0 +1,117 @@ +--TEST-- +PFA supports named placeholders +--FILE-- +getMessage(), "\n"; +} + +try { + $bar = bar(c: ?, ...); +} catch (\Throwable $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %snamed_placeholders.php 11 - 11 + + - Parameters [1] { + Parameter #0 [ $b = 2 ] + } +} +int(1) +object(B)#%d (0) { +} +int(3) +Closure [ static function {closure:%s:%d} ] { + @@ %snamed_placeholders.php 17 - 17 + + - Bound Variables [1] { + Variable #0 [ $fn ] + } + + - Parameters [1] { + Parameter #0 [ $b = 2 ] + } +} +int(1) +object(B)#%d (0) { +} +int(3) +Closure [ static function {closure:%s:%d} ] { + @@ %snamed_placeholders.php 24 - 24 + + - Bound Variables [1] { + Variable #0 [ $fn ] + } + + - Parameters [1] { + Parameter #0 [ $b = 2 ] + } +} +int(1) +object(B)#%d (0) { +} +int(3) +Closure [ static function {closure:%s:%d} ] { + @@ %snamed_placeholders.php 34 - 34 + + - Parameters [3] { + Parameter #0 [ $b = 2 ] + Parameter #1 [ $a = 1 ] + Parameter #2 [ ...$c ] + } +} +object(A)#%d (0) { +} +object(B)#%d (0) { +} +array(1) { + [0]=> + object(C)#%d (0) { + } +} +Named parameter $a overwrites previous placeholder +Cannot use named placeholder for unknown or variadic parameter $c diff --git a/Zend/tests/partial_application/non_dynamic_call_funcs.phpt b/Zend/tests/partial_application/non_dynamic_call_funcs.phpt new file mode 100644 index 000000000000..0430986be2ac --- /dev/null +++ b/Zend/tests/partial_application/non_dynamic_call_funcs.phpt @@ -0,0 +1,46 @@ +--TEST-- +Functions that can not be called dynamically, can not be partially applied +--FILE-- +getMessage(), "\n"; + } +} + +?> +--EXPECT-- +Error: Cannot call func_get_arg() dynamically +Error: Cannot call compact() dynamically +Error: Cannot call extract() dynamically +ArgumentCountError: Partial application of func_get_args() expects at most 0 arguments, 1 given +ArgumentCountError: Partial application of func_num_args() expects at most 0 arguments, 1 given +ArgumentCountError: Partial application of get_defined_vars() expects at most 0 arguments, 1 given diff --git a/Zend/tests/partial_application/observers.phpt b/Zend/tests/partial_application/observers.phpt new file mode 100644 index 000000000000..8717b38ca326 --- /dev/null +++ b/Zend/tests/partial_application/observers.phpt @@ -0,0 +1,34 @@ +--TEST-- +PFA support observers +--EXTENSIONS-- +zend_test +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.show_output=1 +zend_test.observer.observe_all=1 +--FILE-- + +--EXPECTF-- + + + + <{closure:%s}> + + + + +int(1) +int(2) + + + + diff --git a/Zend/tests/partial_application/param_reorder.phpt b/Zend/tests/partial_application/param_reorder.phpt new file mode 100644 index 000000000000..3ade1beb0af7 --- /dev/null +++ b/Zend/tests/partial_application/param_reorder.phpt @@ -0,0 +1,202 @@ +--TEST-- +Named parameters define the order of parameters in a PFA +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECTF-- +# All named +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 13 - 13 + + - Parameters [4] { + Parameter #0 [ $d ] + Parameter #1 [ $c ] + Parameter #2 [ $b ] + Parameter #3 [ $a ] + } +} + +array(4) { + [0]=> + int(4) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + int(1) +} +# Some named: Positional first, then named in specified order +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 19 - 19 + + - Parameters [4] { + Parameter #0 [ $a ] + Parameter #1 [ $b ] + Parameter #2 [ $d ] + Parameter #3 [ $c ] + } +} + +array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(4) + [3]=> + int(3) +} +# Some named, one unspecified +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 25 - 25 + + - Parameters [3] { + Parameter #0 [ $a ] + Parameter #1 [ $c ] + Parameter #2 [ $b ] + } +} + +array(4) { + [0]=> + int(1) + [1]=> + int(3) + [2]=> + int(2) + [3]=> + NULL +} +# Some named, some implicit added by '...' +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 31 - 31 + + - Parameters [4] { + Parameter #0 [ $c ] + Parameter #1 [ $b ] + Parameter #2 [ $a ] + Parameter #3 [ $d = NULL ] + } +} + +array(4) { + [0]=> + int(3) + [1]=> + int(2) + [2]=> + int(1) + [3]=> + int(4) +} +# Some named, some implicit added by '...' on variadic function +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 37 - 37 + + - Parameters [4] { + Parameter #0 [ $c ] + Parameter #1 [ $b ] + Parameter #2 [ $a ] + Parameter #3 [ ...$d ] + } +} + +array(4) { + [0]=> + int(3) + [1]=> + int(2) + [2]=> + int(1) + [3]=> + array(3) { + [0]=> + int(4) + [1]=> + int(5) + [2]=> + int(6) + } +} +# Some prebound, some named +Closure [ static function {closure:%s:%d} ] { + @@ %sparam_reorder.php 43 - 43 + + - Bound Variables [2] { + Variable #0 [ $a ] + Variable #1 [ $d ] + } + + - Parameters [2] { + Parameter #0 [ $c ] + Parameter #1 [ $b ] + } +} + +array(4) { + [0]=> + int(-1) + [1]=> + int(2) + [2]=> + int(1) + [3]=> + int(-2) +} +# Some named, some required missing +ArgumentCountError: f(): Argument #1 ($a) not passed diff --git a/Zend/tests/partial_application/pipe_optimization_001.phpt b/Zend/tests/partial_application/pipe_optimization_001.phpt new file mode 100644 index 000000000000..71bfee5dba44 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_001.phpt @@ -0,0 +1,47 @@ +--TEST-- +PFA optimization: PFA with single placeholder arg can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a) { + var_dump($a); + } +} + +1 |> foo(?); + +?> +--EXPECTF-- +$_main: + ; (lines=9, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_001.php:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 1 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 DO_FCALL_BY_NAME +0008 RETURN int(1) + +foo: + ; (lines=5, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %spipe_optimization_001.php:4-6 +0000 CV0($a) = RECV 1 +0001 INIT_FCALL 1 %d string("var_dump") +0002 SEND_VAR CV0($a) 1 +0003 DO_ICALL +0004 RETURN null +int(1) diff --git a/Zend/tests/partial_application/pipe_optimization_002.phpt b/Zend/tests/partial_application/pipe_optimization_002.phpt new file mode 100644 index 000000000000..ae5992e405a0 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_002.phpt @@ -0,0 +1,51 @@ +--TEST-- +PFA pipe optimization: PFA with only one placeholder can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +2 |> foo(1, ?); + +?> +--EXPECTF-- +$_main: + ; (lines=10, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_002.php:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 2 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(2) 2 +0008 DO_FCALL_BY_NAME +0009 RETURN int(1) + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_002.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_003.phpt b/Zend/tests/partial_application/pipe_optimization_003.phpt new file mode 100644 index 000000000000..4f45eb5555e2 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_003.phpt @@ -0,0 +1,51 @@ +--TEST-- +PFA pipe optimization: PFA with only one placeholder can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +2 |> foo(?, 1); + +?> +--EXPECTF-- +$_main: + ; (lines=10, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_003.php:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 2 string("foo") +0006 SEND_VAL_EX int(2) 1 +0007 SEND_VAL_EX int(1) 2 +0008 DO_FCALL_BY_NAME +0009 RETURN int(1) + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_003.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null +int(2) +int(1) diff --git a/Zend/tests/partial_application/pipe_optimization_004.phpt b/Zend/tests/partial_application/pipe_optimization_004.phpt new file mode 100644 index 000000000000..a2ad5f72ed58 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_004.phpt @@ -0,0 +1,85 @@ +--TEST-- +PFA pipe optimization: PFA with multiple placeholders can not be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +try { +2 |> foo(?, ?); +} catch (\Throwable $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +$_main: + ; (lines=19, args=0, vars=1, tmps=2) + ; (after optimizer) + ; %spipe_optimization_004.php:1-16 +0000 INIT_FCALL 0 %d string("time") +0001 V2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) V2 +0003 JMPZ T1 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 2 string("foo") +0006 SEND_PLACEHOLDER +0007 SEND_PLACEHOLDER +0008 T1 = CALLABLE_CONVERT_PARTIAL %d +0009 INIT_DYNAMIC_CALL 1 T1 +0010 SEND_VAL_EX int(2) 1 +0011 DO_FCALL +0012 RETURN int(1) +0013 CV0($e) = CATCH string("Throwable") +0014 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0015 V1 = DO_FCALL +0016 ECHO V1 +0017 ECHO string("\n") +0018 RETURN int(1) +EXCEPTION TABLE: + 0005, 0013, -, - + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_004.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null + +$_main: + ; (lines=3, args=0, vars=0, tmps=1) + ; (after optimizer) + ; %s:1-10 +0000 T0 = DECLARE_LAMBDA_FUNCTION 0 +0001 FREE T0 +0002 RETURN int(1) + +{closure:%s:%d}: + ; (lines=7, args=2, vars=2, tmps=1) + ; (after optimizer) + ; %s:10-10 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("foo") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 V2 = DO_UCALL +0006 RETURN V2 +Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected diff --git a/Zend/tests/partial_application/pipe_optimization_005.phpt b/Zend/tests/partial_application/pipe_optimization_005.phpt new file mode 100644 index 000000000000..3844e09aa8ad --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_005.phpt @@ -0,0 +1,51 @@ +--TEST-- +PFA pipe optimization: PFA with only one placeholder can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +2 |> foo(1, ...); + +?> +--EXPECTF-- +$_main: + ; (lines=10, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_005.php:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 2 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(2) 2 +0008 DO_FCALL_BY_NAME +0009 RETURN int(1) + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_005.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_006.phpt b/Zend/tests/partial_application/pipe_optimization_006.phpt new file mode 100644 index 000000000000..2a83f2b83fe9 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_006.phpt @@ -0,0 +1,55 @@ +--TEST-- +PFA pipe optimization: PFA with only one placeholder can be optimized (named) +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b = null, $c = null) { + var_dump($a, $b, $c); + } +} + +2 |> foo(1, c: ?); + +?> +--EXPECTF-- +$_main: + ; (lines=11, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_006.php:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 1 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(2) string("c") +0008 CHECK_UNDEF_ARGS +0009 DO_FCALL_BY_NAME +0010 RETURN int(1) + +foo: + ; (lines=9, args=3, vars=3, tmps=0) + ; (after optimizer) + ; %spipe_optimization_006.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV_INIT 2 null +0002 CV2($c) = RECV_INIT 3 null +0003 INIT_FCALL 3 %d string("var_dump") +0004 SEND_VAR CV0($a) 1 +0005 SEND_VAR CV1($b) 2 +0006 SEND_VAR CV2($c) 3 +0007 DO_ICALL +0008 RETURN null +int(1) +NULL +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_007.phpt b/Zend/tests/partial_application/pipe_optimization_007.phpt new file mode 100644 index 000000000000..39dd48b632e4 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_007.phpt @@ -0,0 +1,85 @@ +--TEST-- +PFA pipe optimization: PFA with multiple placeholders can not be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +try { +2 |> foo(a: ?, b: ?); +} catch (\Throwable $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +$_main: + ; (lines=19, args=0, vars=1, tmps=2) + ; (after optimizer) + ; %spipe_optimization_007.php:1-16 +0000 INIT_FCALL 0 %d string("time") +0001 V2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) V2 +0003 JMPZ T1 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 0 string("foo") +0006 SEND_PLACEHOLDER string("a") +0007 SEND_PLACEHOLDER string("b") +0008 T1 = CALLABLE_CONVERT_PARTIAL %d array(...) +0009 INIT_DYNAMIC_CALL 1 T1 +0010 SEND_VAL_EX int(2) 1 +0011 DO_FCALL +0012 RETURN int(1) +0013 CV0($e) = CATCH string("Throwable") +0014 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0015 V1 = DO_FCALL +0016 ECHO V1 +0017 ECHO string("\n") +0018 RETURN int(1) +EXCEPTION TABLE: + 0005, 0013, -, - + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_007.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null + +$_main: + ; (lines=3, args=0, vars=0, tmps=1) + ; (after optimizer) + ; %s:1-10 +0000 T0 = DECLARE_LAMBDA_FUNCTION 0 +0001 FREE T0 +0002 RETURN int(1) + +{closure:%s:%d}: + ; (lines=7, args=2, vars=2, tmps=1) + ; (after optimizer) + ; %s:10-10 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("foo") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 V2 = DO_UCALL +0006 RETURN V2 +Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected diff --git a/Zend/tests/partial_application/pipe_optimization_008.phpt b/Zend/tests/partial_application/pipe_optimization_008.phpt new file mode 100644 index 000000000000..6293f782d4d4 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_008.phpt @@ -0,0 +1,99 @@ +--TEST-- +PFA pipe optimization: PFA with both a variadic placeholder and named arg can not be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +try { + 2 |> foo(a: 1, ...); +} catch (\Throwable $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +$_main: + ; (lines=18, args=0, vars=1, tmps=2) + ; (after optimizer) + ; %spipe_optimization_008.php:1-16 +0000 INIT_FCALL 0 %d string("time") +0001 V2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) V2 +0003 JMPZ T1 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 0 string("foo") +0006 SEND_VAL_EX int(1) string("a") +0007 T1 = CALLABLE_CONVERT_PARTIAL %d +0008 INIT_DYNAMIC_CALL 1 T1 +0009 SEND_VAL_EX int(2) 1 +0010 DO_FCALL +0011 RETURN int(1) +0012 CV0($e) = CATCH string("Throwable") +0013 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0014 V1 = DO_FCALL +0015 ECHO V1 +0016 ECHO string("\n") +0017 RETURN int(1) +EXCEPTION TABLE: + 0005, 0012, -, - + +foo: + ; (lines=7, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_008.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null + +$_main: + ; (lines=4, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %s:1-10 +0000 T1 = DECLARE_LAMBDA_FUNCTION 0 +0001 BIND_LEXICAL T1 CV0($a) +0002 FREE T1 +0003 RETURN int(1) +LIVE RANGES: + 1: 0001 - 0002 (tmp/var) + +{closure:%s:%d}: + ; (lines=18, args=1, vars=2, tmps=2) + ; (after optimizer) + ; %s:10-10 +0000 CV0($b) = RECV 1 +0001 BIND_STATIC CV1($a) +0002 T3 = FUNC_NUM_ARGS +0003 T2 = IS_SMALLER_OR_EQUAL T3 int(1) +0004 JMPZ T2 0010 +0005 INIT_FCALL 2 %d string("foo") +0006 SEND_VAR CV1($a) 1 +0007 SEND_VAR CV0($b) 2 +0008 V2 = DO_UCALL +0009 RETURN V2 +0010 INIT_FCALL 2 %d string("foo") +0011 SEND_VAR CV1($a) 1 +0012 SEND_VAR CV0($b) 2 +0013 T2 = FUNC_GET_ARGS int(1) +0014 SEND_UNPACK T2 +0015 CHECK_UNDEF_ARGS +0016 V2 = DO_UCALL +0017 RETURN V2 +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_009.phpt b/Zend/tests/partial_application/pipe_optimization_009.phpt new file mode 100644 index 000000000000..090278661637 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_009.phpt @@ -0,0 +1,103 @@ +--TEST-- +PFA pipe optimization: Evaluation order +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b, $c) { + var_dump($a, $b, $c); + } + function lhs() { + echo __FUNCTION__, "\n"; + return 0; + } + function arg1() { + echo __FUNCTION__, "\n"; + return 1; + } + function arg2() { + echo __FUNCTION__, "\n"; + return 2; + } +} + +lhs() |> foo(arg1(), ?, arg2()); + +?> +--EXPECTF-- +$_main: + ; (lines=21, args=0, vars=0, tmps=2) + ; (after optimizer) + ; %spipe_optimization_009.php:1-24 +0000 INIT_FCALL 0 %d string("time") +0001 V1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) V1 +0003 JMPZ T0 0008 +0004 DECLARE_FUNCTION string("foo") 0 +0005 DECLARE_FUNCTION string("lhs") 1 +0006 DECLARE_FUNCTION string("arg1") 2 +0007 DECLARE_FUNCTION string("arg2") 3 +0008 INIT_FCALL_BY_NAME 0 string("lhs") +0009 V1 = DO_FCALL_BY_NAME +0010 T0 = QM_ASSIGN V1 +0011 INIT_FCALL_BY_NAME 3 string("foo") +0012 INIT_FCALL_BY_NAME 0 string("arg1") +0013 V1 = DO_FCALL_BY_NAME +0014 SEND_VAR_NO_REF_EX V1 1 +0015 SEND_VAL_EX T0 2 +0016 INIT_FCALL_BY_NAME 0 string("arg2") +0017 V0 = DO_FCALL_BY_NAME +0018 SEND_VAR_NO_REF_EX V0 3 +0019 DO_FCALL_BY_NAME +0020 RETURN int(1) +LIVE RANGES: + 0: 0011 - 0015 (tmp/var) + +foo: + ; (lines=9, args=3, vars=3, tmps=0) + ; (after optimizer) + ; %spipe_optimization_009.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 CV2($c) = RECV 3 +0003 INIT_FCALL 3 %d string("var_dump") +0004 SEND_VAR CV0($a) 1 +0005 SEND_VAR CV1($b) 2 +0006 SEND_VAR CV2($c) 3 +0007 DO_ICALL +0008 RETURN null + +lhs: + ; (lines=2, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %spipe_optimization_009.php:7-10 +0000 ECHO string("lhs\n") +0001 RETURN int(0) + +arg1: + ; (lines=2, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %spipe_optimization_009.php:11-14 +0000 ECHO string("arg1\n") +0001 RETURN int(1) + +arg2: + ; (lines=2, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %spipe_optimization_009.php:15-18 +0000 ECHO string("arg2\n") +0001 RETURN int(2) +lhs +arg1 +arg2 +int(1) +int(0) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_010.phpt b/Zend/tests/partial_application/pipe_optimization_010.phpt new file mode 100644 index 000000000000..60202e72cfd1 --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_010.phpt @@ -0,0 +1,58 @@ +--TEST-- +PFA pipe optimization: References +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo(&$a, $b) { + var_dump($a, $b); + $a = 2; + } +} + +1 |> foo($a, ?); +var_dump($a); + +?> +--EXPECTF-- +$_main: + ; (lines=13, args=0, vars=1, tmps=2) + ; (after optimizer) + ; %spipe_optimization_010.php:1-14 +0000 INIT_FCALL 0 %d string("time") +0001 V2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) V2 +0003 JMPZ T1 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 2 string("foo") +0006 SEND_VAR_EX CV0($a) 1 +0007 SEND_VAL_EX int(1) 2 +0008 DO_FCALL_BY_NAME +0009 INIT_FCALL 1 %d string("var_dump") +0010 SEND_VAR CV0($a) 1 +0011 DO_ICALL +0012 RETURN int(1) + +foo: + ; (lines=8, args=2, vars=2, tmps=0) + ; (after optimizer) + ; %spipe_optimization_010.php:4-7 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 ASSIGN CV0($a) int(2) +0007 RETURN null +NULL +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_011.phpt b/Zend/tests/partial_application/pipe_optimization_011.phpt new file mode 100644 index 000000000000..1a39e4ff2f0d --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_011.phpt @@ -0,0 +1,110 @@ +--TEST-- +PFA pipe optimization: Evaluation order +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b, $c) { + var_dump($a, $b, $c); + } + function lhs() { + echo __FUNCTION__, "\n"; + return 0; + } + function arg1() { + global $a; + $a = 2; + echo __FUNCTION__, "\n"; + return 1; + } + function arg2() { + global $a; + $a = 3; + echo __FUNCTION__, "\n"; + return 2; + } +} + +$a = 0; +$a |> foo(arg1(), ?, arg2()); + +?> +--EXPECTF-- +$_main: + ; (lines=20, args=0, vars=1, tmps=2) + ; (after optimizer) + ; %spipe_optimization_011.php:1-29 +0000 INIT_FCALL 0 %d string("time") +0001 V2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) V2 +0003 JMPZ T1 0008 +0004 DECLARE_FUNCTION string("foo") 0 +0005 DECLARE_FUNCTION string("lhs") 1 +0006 DECLARE_FUNCTION string("arg1") 2 +0007 DECLARE_FUNCTION string("arg2") 3 +0008 ASSIGN CV0($a) int(0) +0009 T1 = QM_ASSIGN CV0($a) +0010 INIT_FCALL_BY_NAME 3 string("foo") +0011 INIT_FCALL_BY_NAME 0 string("arg1") +0012 V2 = DO_FCALL_BY_NAME +0013 SEND_VAR_NO_REF_EX V2 1 +0014 SEND_VAL_EX T1 2 +0015 INIT_FCALL_BY_NAME 0 string("arg2") +0016 V1 = DO_FCALL_BY_NAME +0017 SEND_VAR_NO_REF_EX V1 3 +0018 DO_FCALL_BY_NAME +0019 RETURN int(1) +LIVE RANGES: + 1: 0010 - 0014 (tmp/var) + +foo: + ; (lines=9, args=3, vars=3, tmps=0) + ; (after optimizer) + ; %spipe_optimization_011.php:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 CV2($c) = RECV 3 +0003 INIT_FCALL 3 %d string("var_dump") +0004 SEND_VAR CV0($a) 1 +0005 SEND_VAR CV1($b) 2 +0006 SEND_VAR CV2($c) 3 +0007 DO_ICALL +0008 RETURN null + +lhs: + ; (lines=2, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %spipe_optimization_011.php:7-10 +0000 ECHO string("lhs\n") +0001 RETURN int(0) + +arg1: + ; (lines=4, args=0, vars=1, tmps=0) + ; (after optimizer) + ; %spipe_optimization_011.php:11-16 +0000 BIND_GLOBAL CV0($a) string("a") +0001 ASSIGN CV0($a) int(2) +0002 ECHO string("arg1\n") +0003 RETURN int(1) + +arg2: + ; (lines=4, args=0, vars=1, tmps=0) + ; (after optimizer) + ; %spipe_optimization_011.php:17-22 +0000 BIND_GLOBAL CV0($a) string("a") +0001 ASSIGN CV0($a) int(3) +0002 ECHO string("arg2\n") +0003 RETURN int(2) +arg1 +arg2 +int(1) +int(0) +int(2) diff --git a/Zend/tests/partial_application/preloading.inc b/Zend/tests/partial_application/preloading.inc new file mode 100644 index 000000000000..885ed0c5b0f1 --- /dev/null +++ b/Zend/tests/partial_application/preloading.inc @@ -0,0 +1,13 @@ + diff --git a/Zend/tests/partial_application/preloading.phpt b/Zend/tests/partial_application/preloading.phpt new file mode 100644 index 000000000000..5e3069c271a6 --- /dev/null +++ b/Zend/tests/partial_application/preloading.phpt @@ -0,0 +1,15 @@ +--TEST-- +PFA preloading +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.preload={PWD}/preloading.inc +--FILE-- + +--EXPECT-- +int(2) +int(2) diff --git a/Zend/tests/partial_application/rebinding_001.phpt b/Zend/tests/partial_application/rebinding_001.phpt new file mode 100644 index 000000000000..012de02c5536 --- /dev/null +++ b/Zend/tests/partial_application/rebinding_001.phpt @@ -0,0 +1,63 @@ +--TEST-- +PFA can only be rebound to an instanceof $this +--FILE-- +f(?); +$g = $c->g(?); + +echo "# Can be rebound to \$this of the same class:\n"; +$f->bindTo(new C)(1); + +echo "# Can be rebound to \$this of a sub-class:\n"; +$f->bindTo(new SubClass)(1); + +echo "# Cannot be rebound to an unrelated class:\n"; +try { + $f->bindTo(new Unrelated)(1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "# Cannot unbind \$this on instance method:\n"; +try { + $f->bindTo(null)(1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "# Can unbind \$this on static method:\n"; +try { + $g->bindTo(null)(1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +# Can be rebound to $this of the same class: +object(C)#%d (0) { +} +# Can be rebound to $this of a sub-class: +object(SubClass)#%d (0) { +} +# Cannot be rebound to an unrelated class: + +Warning: Cannot bind method C::{closure:%s:%d}() to object of class Unrelated, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable +# Cannot unbind $this on instance method: + +Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable +# Can unbind $this on static method: +string(1) "C" diff --git a/Zend/tests/partial_application/rebinding_002.phpt b/Zend/tests/partial_application/rebinding_002.phpt new file mode 100644 index 000000000000..fca6db08500f --- /dev/null +++ b/Zend/tests/partial_application/rebinding_002.phpt @@ -0,0 +1,45 @@ +--TEST-- +PFA scope cannot be rebound +--FILE-- +f(?); +$g = g(?); + +echo "# Can be rebound to the same scope:\n"; +$f->bindTo($c, C::class)(1); + +echo "# Method cannot be rebound to a different scope:\n"; +try { + $f->bindTo($c, SubClass::class)(1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "# Function cannot be refound to a different scope:\n"; +try { + $g->bindTo($c, SubClass::class)(1); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +?> +--EXPECTF-- +# Can be rebound to the same scope: +string(1) "C" +# Method cannot be rebound to a different scope: + +Warning: Cannot rebind scope of closure created from method, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable +# Function cannot be refound to a different scope: + +Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable diff --git a/Zend/tests/partial_application/rebinding_003.phpt b/Zend/tests/partial_application/rebinding_003.phpt new file mode 100644 index 000000000000..7b8a29231c32 --- /dev/null +++ b/Zend/tests/partial_application/rebinding_003.phpt @@ -0,0 +1,65 @@ +--TEST-- +Rebinding PFA of Closure rebinds inner Closure +--FILE-- +f(?); +$g = $c->g(?); + +echo "# Can be rebound to \$this of the same class:\n"; +$f->bindTo(new C)($c); + +echo "# Can be rebound to \$this of a sub-class:\n"; +$f->bindTo(new SubClass)($c); + +echo "# Cannot be rebound to an unrelated class:\n"; +try { + $f->bindTo(new Unrelated)($c); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "# Cannot unbind \$this on instance method:\n"; +try { + $f->bindTo(null)($c); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "# Can unbind \$this on static method:\n"; +try { + $g->bindTo(null)($c); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +# Can be rebound to $this of the same class: +object(C)#%d (0) { +} +bool(false) +# Can be rebound to $this of a sub-class: +object(SubClass)#%d (0) { +} +bool(false) +# Cannot be rebound to an unrelated class: + +Warning: Cannot bind method C::{closure:%s:%d}() to object of class Unrelated, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable +# Cannot unbind $this on instance method: + +Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d +Value of type null is not callable +# Can unbind $this on static method: +string(1) "C" diff --git a/Zend/tests/partial_application/recorded_warnings.phpt b/Zend/tests/partial_application/recorded_warnings.phpt new file mode 100644 index 000000000000..f25be826f525 --- /dev/null +++ b/Zend/tests/partial_application/recorded_warnings.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFA compilation warnings are recorded and replayed +--FILE-- + +--EXPECTF-- +Deprecated: Using "_" as a type name is deprecated since 8.4 in %s on line 3 + +Deprecated: Using "_" as a type name is deprecated since 8.4 in %s on line 5 diff --git a/Zend/tests/partial_application/references_001.phpt b/Zend/tests/partial_application/references_001.phpt new file mode 100644 index 000000000000..4a6a8663d870 --- /dev/null +++ b/Zend/tests/partial_application/references_001.phpt @@ -0,0 +1,24 @@ +--TEST-- +PFA returns by val if the actual function does +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + &string(49) "unchanged because foo() doesn't take by reference" +} +string(49) "unchanged because foo() doesn't take by reference" diff --git a/Zend/tests/partial_application/references_002.phpt b/Zend/tests/partial_application/references_002.phpt new file mode 100644 index 000000000000..c203b4fb907a --- /dev/null +++ b/Zend/tests/partial_application/references_002.phpt @@ -0,0 +1,24 @@ +--TEST-- +PFA receives by ref if the actual function does +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + &int(2) +} +int(2) diff --git a/Zend/tests/partial_application/references_003.phpt b/Zend/tests/partial_application/references_003.phpt new file mode 100644 index 000000000000..be116b06c79f --- /dev/null +++ b/Zend/tests/partial_application/references_003.phpt @@ -0,0 +1,20 @@ +--TEST-- +PFA receives by ref if the actual function does +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECTF-- +{closure:%s}(): Argument #1 ($b) could not be passed by reference diff --git a/Zend/tests/partial_application/references_004.phpt b/Zend/tests/partial_application/references_004.phpt new file mode 100644 index 000000000000..d3b85856b37e --- /dev/null +++ b/Zend/tests/partial_application/references_004.phpt @@ -0,0 +1,42 @@ +--TEST-- +PFA receives variadic param by ref if the actual function does +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %sreferences_004.php 13 - 13 + + - Bound Variables [2] { + Variable #0 [ $a ] + Variable #1 [ $args0 ] + } + + - Parameters [2] { + Parameter #0 [ &$args1 ] + Parameter #1 [ &...$args ] + } +} + +int(-2) +int(-3) +int(-4) diff --git a/Zend/tests/partial_application/references_005.phpt b/Zend/tests/partial_application/references_005.phpt new file mode 100644 index 000000000000..e8c7c27a07be --- /dev/null +++ b/Zend/tests/partial_application/references_005.phpt @@ -0,0 +1,26 @@ +--TEST-- +PFA inherits return by ref +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + int(1) +} +array(1) { + [0]=> + int(1) +} diff --git a/Zend/tests/partial_application/reflection_001.phpt b/Zend/tests/partial_application/reflection_001.phpt new file mode 100644 index 000000000000..4ee997f562db --- /dev/null +++ b/Zend/tests/partial_application/reflection_001.phpt @@ -0,0 +1,48 @@ +--TEST-- +PFA reflection: required parameters +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_001.php 6 - 6 + + - Parameters [3] { + Parameter #0 [ $a = 1 ] + Parameter #1 [ $b = 5 ] + Parameter #2 [ $c = 10 ] + } +} +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_001.php 10 - 10 + + - Parameters [3] { + Parameter #0 [ $a = 1 ] + Parameter #1 [ $b = 5 ] + Parameter #2 [ $c = 10 ] + } +} +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_001.php 14 - 14 + + - Parameters [3] { + Parameter #0 [ $a = 1 ] + Parameter #1 [ $b = 5 ] + Parameter #2 [ $c = 10 ] + } +} diff --git a/Zend/tests/partial_application/reflection_002.phpt b/Zend/tests/partial_application/reflection_002.phpt new file mode 100644 index 000000000000..da91a7af50cf --- /dev/null +++ b/Zend/tests/partial_application/reflection_002.phpt @@ -0,0 +1,57 @@ +--TEST-- +PFA reflection: variadics +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %s 6 - 6 + + - Parameters [1] { + Parameter #0 [ $a ] + } +} +Closure [ static function {closure:%s:%d} ] { + @@ %s 10 - 10 + + - Parameters [2] { + Parameter #0 [ $a ] + Parameter #1 [ ...$b ] + } +} +Closure [ static function {closure:%s:%d} ] { + @@ %s 14 - 14 + + - Parameters [2] { + Parameter #0 [ $a ] + Parameter #1 [ $b0 ] + } +} +Closure [ static function {closure:%s:%d} ] { + @@ %s 18 - 18 + + - Parameters [3] { + Parameter #0 [ $a ] + Parameter #1 [ $b0 ] + Parameter #2 [ $b1 ] + } +} diff --git a/Zend/tests/partial_application/reflection_003.phpt b/Zend/tests/partial_application/reflection_003.phpt new file mode 100644 index 000000000000..90506d38a778 --- /dev/null +++ b/Zend/tests/partial_application/reflection_003.phpt @@ -0,0 +1,43 @@ +--TEST-- +PFA reflection: internal with variadics +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_003.php 2 - 2 + + - Parameters [1] { + Parameter #0 [ string $format ] + } + - Return [ string ] +} +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_003.php 6 - 6 + + - Parameters [2] { + Parameter #0 [ string $format ] + Parameter #1 [ mixed ...$values ] + } + - Return [ string ] +} +Closure [ static function {closure:%s:%d} ] { + @@ %sreflection_003.php 10 - 10 + + - Parameters [2] { + Parameter #0 [ string $format ] + Parameter #1 [ mixed $values0 ] + } + - Return [ string ] +} diff --git a/Zend/tests/partial_application/reflection_004.phpt b/Zend/tests/partial_application/reflection_004.phpt new file mode 100644 index 000000000000..7226383f5afa --- /dev/null +++ b/Zend/tests/partial_application/reflection_004.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA reflection: ReflectionFunction::isAnonymous() is true for partials +--FILE-- +isAnonymous()); + +var_dump((new ReflectionFunction(function () {}))->isAnonymous()); + +var_dump((new ReflectionFunction(sprintf(?)))->isAnonymous()); + +?> +--EXPECT-- +bool(false) +bool(true) +bool(true) diff --git a/Zend/tests/partial_application/reflection_005.phpt b/Zend/tests/partial_application/reflection_005.phpt new file mode 100644 index 000000000000..be86270c004c --- /dev/null +++ b/Zend/tests/partial_application/reflection_005.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA reflection: ReflectionFunction::isClosure() is true for partials +--FILE-- +isClosure()); + +var_dump((new ReflectionFunction(function () {}))->isClosure()); + +var_dump((new ReflectionFunction(sprintf(?)))->isClosure()); + +?> +--EXPECT-- +bool(false) +bool(true) +bool(true) diff --git a/Zend/tests/partial_application/relative_return_types.phpt b/Zend/tests/partial_application/relative_return_types.phpt new file mode 100644 index 000000000000..f34e1889d394 --- /dev/null +++ b/Zend/tests/partial_application/relative_return_types.phpt @@ -0,0 +1,133 @@ +--TEST-- +PFA supports relative return types +--FILE-- + 0) { + trait T { + public function getSelf(object $o): self { + return $o; + } + public function getStatic(object $o): static { + return $o; + } + } +} + +class C { + use T; +} + +class D extends C { +} + +$c = new C; + +$self = $c->getSelf(?); + +echo (string) new ReflectionFunction($self), "\n"; + +var_dump($self($c)); +var_dump($self(new D)); +try { + $self(new stdClass); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +$static = $c->getStatic(?); + +echo (string) new ReflectionFunction($static), "\n"; + +var_dump($static($c)); +var_dump($static(new D)); +try { + $static(new stdClass); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +$d = new D; + +$self = $d->getSelf(?); + +echo (string) new ReflectionFunction($self), "\n"; + +var_dump($self($d)); +var_dump($self(new D)); +try { + $self(new stdClass); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +$static = $d->getStatic(?); + +echo (string) new ReflectionFunction($static), "\n"; + +var_dump($static($d)); +var_dump($static(new D)); +try { + $static(new stdClass); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 23 - 23 + + - Parameters [1] { + Parameter #0 [ object $o ] + } + - Return [ self ] +} + +object(C)#%d (0) { +} +object(D)#%d (0) { +} +C::getSelf(): Return value must be of type C, stdClass returned +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 35 - 35 + + - Parameters [1] { + Parameter #0 [ object $o ] + } + - Return [ static ] +} + +object(C)#%d (0) { +} +object(D)#%d (0) { +} +C::getStatic(): Return value must be of type C, stdClass returned +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 49 - 49 + + - Parameters [1] { + Parameter #0 [ object $o ] + } + - Return [ self ] +} + +object(D)#%d (0) { +} +object(D)#%d (0) { +} +C::getSelf(): Return value must be of type C, stdClass returned +Closure [ public method {closure:%s:%d} ] { + @@ %s.php 61 - 61 + + - Parameters [1] { + Parameter #0 [ object $o ] + } + - Return [ static ] +} + +object(D)#%d (0) { +} +object(D)#%d (0) { +} +C::getStatic(): Return value must be of type D, stdClass returned diff --git a/Zend/tests/partial_application/return_type.phpt b/Zend/tests/partial_application/return_type.phpt new file mode 100644 index 000000000000..ae3738e2c660 --- /dev/null +++ b/Zend/tests/partial_application/return_type.phpt @@ -0,0 +1,20 @@ +--TEST-- +PFA inherits return type +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %s 4 - 4 + + - Bound Variables [1] { + Variable #0 [ $a ] + } + + - Parameters [0] { + } + - Return [ array ] +} diff --git a/Zend/tests/partial_application/rfc_examples.inc b/Zend/tests/partial_application/rfc_examples.inc new file mode 100644 index 000000000000..f6e7d9f6266d --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples.inc @@ -0,0 +1,75 @@ + [$pfa, $closure]) { + echo "# ", $test, ": "; + $pfaReflector = new ReflectionFunction($pfa); + $closureReflector = new ReflectionFunction($closure); + + try { + if (count($pfaReflector->getParameters()) !== count($closureReflector->getParameters())) { + throw new Exception(sprintf( + "Arity does not match: expected %d, got %d", + count($closureReflector->getParameters()), + count($pfaReflector->getParameters()), + )); + } + + $it = new MultipleIterator(); + $it->attachIterator(new ArrayIterator($pfaReflector->getParameters())); + $it->attachIterator(new ArrayIterator($closureReflector->getParameters())); + foreach ($it as $i => [$pfaParam, $closureParam]) { + [$i] = $i; + if ($pfaParam->getName() !== $closureParam->getName()) { + throw new Exception(sprintf("Name of param %d does not match: %s vs %s", + $i, + $pfaParam->getName(), + $closureParam->getName(), + )); + } + if ((string)$pfaParam->getType() !== (string)$closureParam->getType()) { + throw new Exception(sprintf("Type of param %d does not match: %s vs %s", + $i, + $pfaParam->getType(), + $closureParam->getType(), + )); + } + if ($pfaParam->isOptional() !== $closureParam->isOptional()) { + throw new Exception(sprintf("Optionalness of param %d does not match: %d vs %d", + $i, + $pfaParam->isOptional(), + $closureParam->isOptional(), + )); + } + } + + $args = []; + foreach ($pfaReflector->getParameters() as $i => $p) { + $args[] = match ((string) $p->getType()) { + 'int' => 100 + $i, + 'float' => 100.5 + $i, + '?float' => 100.5 + $i, + 'string' => (string) (100 + $i), + 'Point' => new Point, + '' => "mixed($i)", + }; + } + + if ($pfaReflector->getClosureThis() !== $closureReflector->getClosureThis()) { + throw new Exception("\$this differs"); + } + + if ($pfa(...$args) !== $closure(...$args)) { + throw new Exception("PFA is not equivalent to closure"); + } + } catch (Exception $e) { + echo $e->getMessage(), "\n"; + echo $pfaReflector; + echo $closureReflector; + return; + } + + echo "Ok\n"; + } +} diff --git a/Zend/tests/partial_application/rfc_examples_const_expr.phpt b/Zend/tests/partial_application/rfc_examples_const_expr.phpt new file mode 100644 index 000000000000..e2fc57440256 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_const_expr.phpt @@ -0,0 +1,25 @@ +--TEST-- +PFA RFC examples: "Constant expressions" section +--XFAIL-- +PFA in constant expressions not implemented yet +--FILE-- + +==DONE== +--EXPECTF-- +==DONE== diff --git a/Zend/tests/partial_application/rfc_examples_debug.phpt b/Zend/tests/partial_application/rfc_examples_debug.phpt new file mode 100644 index 000000000000..be06e24229f7 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_debug.phpt @@ -0,0 +1,25 @@ +--TEST-- +PFA RFC examples: "Debug output" section +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught Exception in %s:%d +Stack trace: +#0 %s(%d): g() +#1 %s(%d): f(1, Object(SensitiveParameterValue), 3) +#2 %s(%d): {closure:pfa:%s}(1, Object(SensitiveParameterValue)) +#3 {main} + thrown in %s on line %d diff --git a/Zend/tests/partial_application/rfc_examples_errors.phpt b/Zend/tests/partial_application/rfc_examples_errors.phpt new file mode 100644 index 000000000000..21818d7446e3 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_errors.phpt @@ -0,0 +1,34 @@ +--TEST-- +PFA RFC examples: "Error examples" section +--FILE-- +getMessage(), "\n"; +} + +try { + stuff(?, ?, ?, ?, ?, ?); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +try { + stuff(?, ?, 3.5, $point, i: 5); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +ArgumentCountError: Partial application of stuff() expects at least 4 arguments, 1 given +ArgumentCountError: Partial application of stuff() expects at most 5 arguments, 6 given +Error: Named parameter $i overwrites previous placeholder diff --git a/Zend/tests/partial_application/rfc_examples_eval_order.phpt b/Zend/tests/partial_application/rfc_examples_eval_order.phpt new file mode 100644 index 000000000000..b54ce0ce15e4 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_eval_order.phpt @@ -0,0 +1,30 @@ +--TEST-- +PFA RFC examples: "Evaluation order" section +--FILE-- + speak($who, getArg()); +print "Arnaud\n"; +$arrow('Larry'); + +$partial = speak(?, getArg()); +print "Arnaud\n"; +$partial('Larry'); + +?> +--EXPECT-- +Arnaud +getArg +Larry: hi +getArg +Arnaud +Larry: hi diff --git a/Zend/tests/partial_application/rfc_examples_extra_args.phpt b/Zend/tests/partial_application/rfc_examples_extra_args.phpt new file mode 100644 index 000000000000..f6a24df8cc71 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_extra_args.phpt @@ -0,0 +1,54 @@ +--TEST-- +PFA RFC examples: "Variadics, func_get_args(), and extraneous arguments" section +--FILE-- + [ + foo(1, ?), + static function (int $j) { return foo(1, $j); }, + ], + 'If a PFA call has a ... placeholder, then any extraneous arguments will be passed through to the underlying function' => [ + foo(1, ?, ...), + static function (int $j) { return foo(1, $j, ...array_slice(func_get_args(), 1)); }, + ], + 'If a PFA call has a ... placeholder and the underlying function is variadic, then the trailing arguments will be forwarded directly but will get “collected” by the variadic parameter as normal' => [ + foo2(1, ?, ...), + static function (int $j, ...$extra) { return foo2(1, $j, ...$extra); }, + ], +]; + +check_equivalence($tests); + +echo "# The extra parameter here will be passed to the closure object, which will simply ignore it:\n"; +var_dump(foo(1, ?)(4, 'ignore me')); + +echo "# The extra parameter here will be passed to the closure object, which will forward it directly to the underlying function. It will be accessible only via ''func_get_args()'' et al:\n"; +var_dump(foo(1, ?, ...)(4, 'ignore me')); + +echo "# The extra parameter here will be passed to the closure object, which will forward it directly to the underlying function. It will show up as part of the \$extra array:\n"; +var_dump(foo2(1, ?, ...)(4, 'ignore me')); + +?> +==DONE== +--EXPECT-- +# If a PFA call has no ... placeholder, then any extraneous arguments to the resulting closure will be ignored. That is consistent with how manually writing the equivalent closure would behave, and is the same regardless of whether the underlying function is variadic: Ok +# If a PFA call has a ... placeholder, then any extraneous arguments will be passed through to the underlying function: Ok +# If a PFA call has a ... placeholder and the underlying function is variadic, then the trailing arguments will be forwarded directly but will get “collected” by the variadic parameter as normal: Ok +# The extra parameter here will be passed to the closure object, which will simply ignore it: +int(2) +# The extra parameter here will be passed to the closure object, which will forward it directly to the underlying function. It will be accessible only via ''func_get_args()'' et al: +int(3) +# The extra parameter here will be passed to the closure object, which will forward it directly to the underlying function. It will show up as part of the $extra array: +int(3) +==DONE== diff --git a/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt b/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt new file mode 100644 index 000000000000..2455252b3eba --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFA RFC examples: "Incompatible functions" section +--FILE-- +getMessage(), "\n"; +} + +?> +--EXPECT-- +Error: Cannot call func_get_args() dynamically diff --git a/Zend/tests/partial_application/rfc_examples_magic_methods.phpt b/Zend/tests/partial_application/rfc_examples_magic_methods.phpt new file mode 100644 index 000000000000..bf3ce3404e66 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_magic_methods.phpt @@ -0,0 +1,47 @@ +--TEST-- +PFA RFC examples: "Magic methods" section +--FILE-- + [ + $f->method(?, ?), + (function ($f) { + return fn($args0, $args1) => $f->method($args0, $args1); + })($f)->bindTo($f), + ], +]); + +try { + $f->method(?, ?)(a: 1, b: 2); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +# Test 1: Foo::method +Array +( + [0] => mixed(0) + [1] => mixed(1) +) +Foo::method +Array +( + [0] => mixed(0) + [1] => mixed(1) +) +Ok +Error: Unknown named parameter $a diff --git a/Zend/tests/partial_application/rfc_examples_overview.phpt b/Zend/tests/partial_application/rfc_examples_overview.phpt new file mode 100644 index 000000000000..b6fc8c0586c2 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_overview.phpt @@ -0,0 +1,44 @@ +--TEST-- +PFA RFC examples: "Overview" section +--FILE-- + [ + foo(1, ?, 3, 4), + static fn(int $b): int => foo(1, $b, 3, 4), + ], + 'Test 2' => [ + foo(1, ?, 3, ?), + static fn(int $b, int $d): int => foo(1, $b, 3, $d), + ], + 'Test 3' => [ + foo(1, ...), + static fn(int $b, int $c, int $d): int => foo(1, $b, $c, $d), + ], + 'Test 4' => [ + foo(1, 2, ...), + static fn(int $c, int $d): int => foo(1, 2, $c, $d), + ], + 'Test 5' => [ + foo(1, ?, 3, ...), + static fn(int $b, int $d): int => foo(1, $b, 3, $d), + ], +]; + +check_equivalence($tests); + +?> +--EXPECT-- +# Test 1: Ok +# Test 2: Ok +# Test 3: Ok +# Test 4: Ok +# Test 5: Ok diff --git a/Zend/tests/partial_application/rfc_examples_scoping.phpt b/Zend/tests/partial_application/rfc_examples_scoping.phpt new file mode 100644 index 000000000000..071b4a5a5a39 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_scoping.phpt @@ -0,0 +1,113 @@ +--TEST-- +PFA RFC examples: "Scoping" section +--FILE-- + [ + foo(?, ?), + static fn(int $i, int $j = 0): string => foo($i, $j), + ], + 'Static closure 2' => [ + Foo::bar(?, ?), + static fn(int $i, int $j): string => Foo::bar($i, $j), + ], + 'Static closure 3' => [ + foo(?, ?)(1, ?), + static fn(int $j = 0): string => foo(1, $j), + ], + 'Static closure 4' => [ + foo(...)(?), + static fn(int $i): string => foo($i, 0), + ], +]; + +check_equivalence($tests); + +$c = new C(); +$f = $c->f(?); + +echo "# Cannot unbind \$this:\n"; +var_dump($f->bindTo(null, C::class)); // Warning: Cannot unbind $this of method, this will be an error in PHP 9 (returns null) + +echo "# Cannot rebind scope:\n"; +var_dump($f->bindTo($c, CSubClass::class)); // Warning: Cannot rebind scope of closure created from method, this will be an error in PHP 9 (returns null) + +echo "# Can rebind \$this with subclass:\n"; +var_dump($f->bindTo(new CSubClass, C::class)); // Allowed + +echo "# Cannot rebind \$this with unrelated class:\n"; +$f = $f->bindTo(new Unrelated, C::class); // Warning: Cannot bind method C::{closure:/path/to/test.php:11}() to object of class Unrelated, this will be an error in PHP 9 (returns null) + +echo "# self resolution:\n"; +$c = new CSubClass(); +var_dump($c->f(?)(1)); // string(1) "C" +var_dump($c->g(?)(1)); // string(9) "CSubClass" +var_dump($c->h(1)(1)); // string(1) "C" + +?> +--EXPECTF-- +# Static closure 1: Ok +# Static closure 2: Ok +# Static closure 3: Ok +# Static closure 4: Ok +# Cannot unbind $this: + +Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d +NULL +# Cannot rebind scope: + +Warning: Cannot rebind scope of closure created from method, this will be an error in PHP 9 in %s on line %d +NULL +# Can rebind $this with subclass: +object(Closure)#%d (5) { + ["name"]=> + string(%d) "{closure:pfa:%s}" + ["file"]=> + string(%d) "%s" + ["line"]=> + int(53) + ["this"]=> + object(CSubClass)#%d (0) { + } + ["parameter"]=> + array(1) { + ["$a"]=> + string(10) "" + } +} +# Cannot rebind $this with unrelated class: + +Warning: Cannot bind method C::{closure:pfa:%s}() to object of class Unrelated, this will be an error in PHP 9 in %s on line %d +# self resolution: +string(1) "C" +string(9) "CSubClass" +string(1) "C" diff --git a/Zend/tests/partial_application/rfc_examples_semantics.phpt b/Zend/tests/partial_application/rfc_examples_semantics.phpt new file mode 100644 index 000000000000..a3ea25c30d6d --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_semantics.phpt @@ -0,0 +1,30 @@ +--TEST-- +PFA RFC examples: "Placeholder Semantics" section +--FILE-- + [ + foo(?, ?, ?, ?), + static fn(int $a, int $b, string $c0, string $c1) => foo($a, $b, $c0, $c1), + ], + 'Test 2' => [ + stuff(1, ?, p: ?, f: 3.14, ...), + static fn(string $s, Point $p, int $m = 0) => stuff(1, $s, 3.14, $p, $m), + ], +]; + +check_equivalence($tests); + +?> +--EXPECT-- +# Test 1: Ok +# Test 2: Ok diff --git a/Zend/tests/partial_application/rfc_examples_semantics_examples.phpt b/Zend/tests/partial_application/rfc_examples_semantics_examples.phpt new file mode 100644 index 000000000000..9ee52d278689 --- /dev/null +++ b/Zend/tests/partial_application/rfc_examples_semantics_examples.phpt @@ -0,0 +1,217 @@ +--TEST-- +PFA RFC examples: "Placeholder Semantics: Examples" section +--FILE-- + [ + stuff(?, ?, ...), + static fn(int $i1, string $s2, float $f3, Point $p4, int $m5 = 0): array + => stuff($i1, $s2, $f3, $p4, $m5), + ], + 'The degenerate "first class callables" case. (Supported since 8.1)' => [ + stuff(...), + static fn(int $i1, string $s2, float $f3, Point $p4, int $m5 = 0): array + => stuff($i1, $s2, $f3, $p4, $m5), + ], + 'Provide some values, require the rest to be provided later (1)' => [ + stuff(1, 'hi', ?, ?, ?), + static fn(float $f3, Point $p4, int $m5 = 0): array => stuff(1, 'hi', $f3, $p4, $m5), + ], + 'Provide some values, require the rest to be provided later (2)' => [ + stuff(1, 'hi', ...), + static fn(float $f3, Point $p4, int $m5 = 0): array => stuff(1, 'hi', $f3, $p4, $m5), + ], + 'Provide some values, but not just from the left (1)' => [ + stuff(1, ?, 3.5, ?, ?), + static fn(string $s2, Point $p4, int $m5 = 0): array => stuff(1, $s2, 3.5, $p4, $m5), + ], + 'Provide some values, but not just from the left (2)' => [ + stuff(1, ?, 3.5, ...), + static fn(string $s2, Point $p4, int $m5 = 0): array => stuff(1, $s2, 3.5, $p4, $m5), + ], + 'Provide just the last value' => [ + stuff(?, ?, ?, ?, 5), + static fn(int $i1, string $s2, float $f3, Point $p4): array + => stuff($i1, $s2, $f3, $p4, 5), + ], + 'Not accounting for an optional argument means it will always get its default value' => [ + stuff(?, ?, ?, ?), + static fn(int $i1, string $s2, float $f3, Point $p4): array + => stuff($i1, $s2, $f3, $p4), + ], + 'Named arguments can be pulled "out of order", and still work (1)' => [ + stuff(?, ?, f3: 3.5, p4: $point), + static fn(int $i1, string $s2): array => stuff($i1, $s2, 3.5, $point), + ], + 'Named arguments can be pulled "out of order", and still work (2)' => [ + stuff(?, ?, p4: $point, f3: 3.5), + static fn(int $i1, string $s2): array => stuff($i1, $s2, 3.5, $point), + ], + + 'But named placeholders adopt the order listed' => [ + stuff(s2: ?, i1: ?, p4: ?, f3: 3.5), + static fn(string $s2, int $i1, Point $p4): array => stuff($i1, $s2, 3.5, $p4), + ], + 'The ... "everything else" placeholder respects named arguments' => [ + stuff(?, ?, f3: 3.5, p4: $point, ...), + static fn(int $i1, string $s2, int $m5 = 0): array => stuff($i1, $s2, 3.5, $point, $m5), + ], + 'Prefill all parameters, making a "delayed call" or "thunk"' => [ + stuff(1, 'hi', 3.4, $point, 5, ...), + static fn(): array => stuff(1, 'hi', 3.4, $point, 5), + ], + + // Variadics + + 'FCC equivalent. The signature is unchanged' => [ + things(...), + static fn(int $i1, ?float $f3 = null, Point ...$points): array => things(...[$i1, $f3, ...$points]), + ], + 'Provide some values, but allow the variadic to remain variadic' => [ + things(1, 3.14, ...), + static fn(Point ...$points): array => things(1, 3.14, ...$points), + ], + 'In this version, the partial requires precisely four arguments, the last two of which will get received by things() in the variadic parameter. Note too that $f becomes required in this case' => [ + things(?, ?, ?, ?), + static fn(int $i1, ?float $f3, Point $points0, Point $points1): array => things($i1, $f3, $points0, $points1), + ], + + // Esoteric examples + + 'Esoteric 1' => [ + four(...), + static fn(int $a, int $b, int $c, int $d): string => four($a, $b, $c, $d), + ], + 'Esoteric 2' => [ + four(1, 2, ...), + static fn(int $c, int $d): string => four(1, 2, $c, $d), + ], + 'Esoteric 3' => [ + four(1, 2, 3, ?), + static fn(int $d): string => four(1, 2, 3, $d), + ], + 'Esoteric 4' => [ + four(1, ?, ?, 4), + static fn(int $b, int $c): string => four(1, $b, $c, 4), + ], + 'Esoteric 5' => [ + four(1, 2, 3, 4, ...), + static fn(): string => four(1, 2, 3, 4, ...array_slice(func_get_args(), 4)), + ], + 'Esoteric 6' => [ + four(d: 4, a: 1, ...), + static fn(int $b, int $c): string => four(1, $b, $c, 4, ...array_slice(func_get_args(), 4)), + ], + 'Esoteric 7' => [ + four(c: ?, d: 4, b: ?, a: 1), + static fn(int $c, int $b): string => four(1, $b, $c, 4, ...array_slice(func_get_args(), 4)), + ], + + // Other callable styles + + 'This is allowed. Note the method is static, thus the partial closure is static' => [ + E::make(1, ?), + static fn(int $y): E => E::make(1, $y), + ], + 'Note the method is non-static, so the partial closure is non-static' => (function () { + $eMaker = E::make(1, ?); + $e = $eMaker(2); + return [ + $e->foo(?, ?, 3), + (function ($e) { + return fn(int $a, int $b): array => $e->foo($a, $b, 3); + })($e)->bindTo($e), + ]; + })(), + '$c can then be further refined' => (function () { + $eMaker = E::make(1, ?); + $e = $eMaker(2); + $c = $e->foo(?, ?, 3); + return [ + $c(1, ?), + (function ($e) { + return fn(int $b): array => $e->foo(1, $b, 3); + })($e)->bindTo($e), + ]; + })(), + 'RunMe' => (function () { + $r = new RunMe(); + return [ + $r(?, 3), + (function ($r) { + return fn(int $a): string => $r($a, 3); + })($r)->bindTo($r), + ]; + })(), +]; + +check_equivalence($tests); + +?> +--EXPECT-- +# Manually specify the first two values, and pull the rest "as is": Ok +# The degenerate "first class callables" case. (Supported since 8.1): Ok +# Provide some values, require the rest to be provided later (1): Ok +# Provide some values, require the rest to be provided later (2): Ok +# Provide some values, but not just from the left (1): Ok +# Provide some values, but not just from the left (2): Ok +# Provide just the last value: Ok +# Not accounting for an optional argument means it will always get its default value: Ok +# Named arguments can be pulled "out of order", and still work (1): Ok +# Named arguments can be pulled "out of order", and still work (2): Ok +# But named placeholders adopt the order listed: Ok +# The ... "everything else" placeholder respects named arguments: Ok +# Prefill all parameters, making a "delayed call" or "thunk": Ok +# FCC equivalent. The signature is unchanged: Ok +# Provide some values, but allow the variadic to remain variadic: Ok +# In this version, the partial requires precisely four arguments, the last two of which will get received by things() in the variadic parameter. Note too that $f becomes required in this case: Ok +# Esoteric 1: Ok +# Esoteric 2: Ok +# Esoteric 3: Ok +# Esoteric 4: Ok +# Esoteric 5: Ok +# Esoteric 6: Ok +# Esoteric 7: Ok +# This is allowed. Note the method is static, thus the partial closure is static: Ok +# Note the method is non-static, so the partial closure is non-static: Ok +# $c can then be further refined: Ok +# RunMe: Ok diff --git a/Zend/tests/partial_application/static_method_001.phpt b/Zend/tests/partial_application/static_method_001.phpt new file mode 100644 index 000000000000..ce4151441c33 --- /dev/null +++ b/Zend/tests/partial_application/static_method_001.phpt @@ -0,0 +1,18 @@ +--TEST-- +PFA supports static methods +--FILE-- + +--EXPECTF-- +Foo::method diff --git a/Zend/tests/partial_application/statics_001.phpt b/Zend/tests/partial_application/statics_001.phpt new file mode 100644 index 000000000000..906c0dedf121 --- /dev/null +++ b/Zend/tests/partial_application/statics_001.phpt @@ -0,0 +1,22 @@ +--TEST-- +PFA static variables are shared (001) +--FILE-- + +--EXPECTF-- +OK diff --git a/Zend/tests/partial_application/statics_002.phpt b/Zend/tests/partial_application/statics_002.phpt new file mode 100644 index 000000000000..8e1b6cefe00a --- /dev/null +++ b/Zend/tests/partial_application/statics_002.phpt @@ -0,0 +1,23 @@ +--TEST-- +PFA static variables are shared (002) +--FILE-- + +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/statics_003.phpt b/Zend/tests/partial_application/statics_003.phpt new file mode 100644 index 000000000000..9fb2568a67e7 --- /dev/null +++ b/Zend/tests/partial_application/statics_003.phpt @@ -0,0 +1,26 @@ +--TEST-- +PFA static variables are shared (003) +--FILE-- + +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/superfluous_args_are_forwarded.phpt b/Zend/tests/partial_application/superfluous_args_are_forwarded.phpt new file mode 100644 index 000000000000..506092655217 --- /dev/null +++ b/Zend/tests/partial_application/superfluous_args_are_forwarded.phpt @@ -0,0 +1,44 @@ +--TEST-- +PFAs forwards superfluous args iff a variadic placeholder is specified +--FILE-- + +--EXPECT-- +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(1) { + [0]=> + int(1) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/Zend/tests/partial_application/this.phpt b/Zend/tests/partial_application/this.phpt new file mode 100644 index 000000000000..bda6900bae39 --- /dev/null +++ b/Zend/tests/partial_application/this.phpt @@ -0,0 +1,20 @@ +--TEST-- +PFA $this +--FILE-- +method(new stdClass, ...); + +$baz = $bar(new stdClass, ...); + +var_dump($foo === $baz()); +?> +--EXPECT-- +bool(true) diff --git a/Zend/tests/partial_application/variation_call_001.phpt b/Zend/tests/partial_application/variation_call_001.phpt new file mode 100644 index 000000000000..72bccd1292b3 --- /dev/null +++ b/Zend/tests/partial_application/variation_call_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +PFA variation: call +--FILE-- +method(?, new Param); + +$closure(1); + +$closure->call(new Foo(), 10); +?> +--EXPECT-- +Bar: 1, Param +Foo: 10, Param diff --git a/Zend/tests/partial_application/variation_closure_001.phpt b/Zend/tests/partial_application/variation_closure_001.phpt new file mode 100644 index 000000000000..c84f8d05f38c --- /dev/null +++ b/Zend/tests/partial_application/variation_closure_001.phpt @@ -0,0 +1,23 @@ +--TEST-- +PFA variation: Closure +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %s 6 - 6 + + - Bound Variables [2] { + Variable #0 [ $fn ] + Variable #1 [ $a ] + } + + - Parameters [1] { + Parameter #0 [ $b ] + } +} diff --git a/Zend/tests/partial_application/variation_closure_002.phpt b/Zend/tests/partial_application/variation_closure_002.phpt new file mode 100644 index 000000000000..41abe0aaab0e --- /dev/null +++ b/Zend/tests/partial_application/variation_closure_002.phpt @@ -0,0 +1,28 @@ +--TEST-- +PFA variation: Closure::__invoke() +--FILE-- +__invoke(1, ?); + +echo (string) new ReflectionFunction($function); + +$function(10); +?> +--EXPECTF-- +Closure [ public method {closure:%s:%d} ] { + @@ %svariation_closure_002.php 6 - 6 + + - Bound Variables [1] { + Variable #0 [ $a ] + } + + - Parameters [1] { + Parameter #0 [ $b ] + } +} +int(1) +int(10) diff --git a/Zend/tests/partial_application/variation_closure_003.phpt b/Zend/tests/partial_application/variation_closure_003.phpt new file mode 100644 index 000000000000..da567e179853 --- /dev/null +++ b/Zend/tests/partial_application/variation_closure_003.phpt @@ -0,0 +1,46 @@ +--TEST-- +PFA variation: Closure::__invoke() with $this +--FILE-- +bar(); + +$function = $closure->__invoke(1, ?); + +echo (string) new ReflectionFunction($function); + +var_dump($function(10)); +?> +--EXPECTF-- +Closure [ public method {closure:%s:%d} ] { + @@ %svariation_closure_003.php 14 - 14 + + - Bound Variables [1] { + Variable #0 [ $a ] + } + + - Parameters [1] { + Parameter #0 [ $b ] + } +} +array(2) { + [0]=> + object(Foo)#1 (0) { + } + [1]=> + array(2) { + [0]=> + int(1) + [1]=> + int(10) + } +} diff --git a/Zend/tests/partial_application/variation_debug_001.phpt b/Zend/tests/partial_application/variation_debug_001.phpt new file mode 100644 index 000000000000..d2f6458634e9 --- /dev/null +++ b/Zend/tests/partial_application/variation_debug_001.phpt @@ -0,0 +1,40 @@ +--TEST-- +PFA variation: var_dump(), user function +--FILE-- + +--EXPECTF-- +object(Closure)#%d (5) { + ["name"]=> + string(%d) "{closure:%s}" + ["file"]=> + string(%d) "%svariation_debug_001.php" + ["line"]=> + int(6) + ["static"]=> + array(4) { + ["b"]=> + object(stdClass)#%d (0) { + } + ["c"]=> + int(20) + ["c0"]=> + object(stdClass)#%d (0) { + } + ["extra_named_params"]=> + array(1) { + ["four"]=> + int(4) + } + } + ["parameter"]=> + array(1) { + ["$a"]=> + string(10) "" + } +} diff --git a/Zend/tests/partial_application/variation_debug_002.phpt b/Zend/tests/partial_application/variation_debug_002.phpt new file mode 100644 index 000000000000..46f80b8b2726 --- /dev/null +++ b/Zend/tests/partial_application/variation_debug_002.phpt @@ -0,0 +1,49 @@ +--TEST-- +PFA variation: var_dump(), internal function +--FILE-- + +--EXPECTF-- +object(Closure)#%d (5) { + ["name"]=> + string(%d) "{closure:%s}" + ["file"]=> + string(%d) "%svariation_debug_002.php" + ["line"]=> + int(2) + ["static"]=> + array(3) { + ["array"]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["arrays0"]=> + array(3) { + [0]=> + int(4) + [1]=> + int(5) + [2]=> + int(6) + } + ["extra_named_params"]=> + array(1) { + ["four"]=> + object(stdClass)#%d (0) { + } + } + } + ["parameter"]=> + array(2) { + ["$callback"]=> + string(10) "" + ["$arrays"]=> + string(10) "" + } +} diff --git a/Zend/tests/partial_application/variation_ex_001.phpt b/Zend/tests/partial_application/variation_ex_001.phpt new file mode 100644 index 000000000000..48db63e70a5e --- /dev/null +++ b/Zend/tests/partial_application/variation_ex_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFA variation: UAF in cleanup unfinished calls +--FILE-- +getMessage(), "\n"; +} +?> +--EXPECTF-- +ArgumentCountError: Partial application of {closure:%s:%d}() expects at most 0 arguments, 1 given diff --git a/Zend/tests/partial_application/variation_gc_001.phpt b/Zend/tests/partial_application/variation_gc_001.phpt new file mode 100644 index 000000000000..887156afc7e1 --- /dev/null +++ b/Zend/tests/partial_application/variation_gc_001.phpt @@ -0,0 +1,19 @@ +--TEST-- +PFA variation: GC (001) +--FILE-- +method = self::__construct(new stdClass, ...); + } +} + +$foo = new Foo(new stdClass); +$foo->bar = $foo; + +echo "OK"; +?> +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/variation_gc_002.phpt b/Zend/tests/partial_application/variation_gc_002.phpt new file mode 100644 index 000000000000..31c721e8e681 --- /dev/null +++ b/Zend/tests/partial_application/variation_gc_002.phpt @@ -0,0 +1,11 @@ +--TEST-- +PFA variation: GC (002) +--FILE-- +prop = var_dump($obj, ?); + +echo "OK"; +?> +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/variation_gc_003.phpt b/Zend/tests/partial_application/variation_gc_003.phpt new file mode 100644 index 000000000000..23cdaa1c666f --- /dev/null +++ b/Zend/tests/partial_application/variation_gc_003.phpt @@ -0,0 +1,15 @@ +--TEST-- +PFA variation: GC (003) +--FILE-- +prop = test(?, x: $obj); + +echo "OK"; +?> +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/variation_invoke_001.phpt b/Zend/tests/partial_application/variation_invoke_001.phpt new file mode 100644 index 000000000000..a6091e955b15 --- /dev/null +++ b/Zend/tests/partial_application/variation_invoke_001.phpt @@ -0,0 +1,21 @@ +--TEST-- +PFA variation: __invoke() +--FILE-- +__invoke(32) == 42); + +try { + $foo->nothing(); +} catch (Error $ex) { + echo $ex::class, ": ", $ex->getMessage(), "\n"; +} +?> +--EXPECT-- +bool(true) +Error: Call to undefined method Closure::nothing() diff --git a/Zend/tests/partial_application/variation_nocall_001.phpt b/Zend/tests/partial_application/variation_nocall_001.phpt new file mode 100644 index 000000000000..3fbb3ec8d8c3 --- /dev/null +++ b/Zend/tests/partial_application/variation_nocall_001.phpt @@ -0,0 +1,12 @@ +--TEST-- +PFA variation: no call args leak +--FILE-- + +--EXPECT-- +OK diff --git a/Zend/tests/partial_application/variation_nocall_002.phpt b/Zend/tests/partial_application/variation_nocall_002.phpt new file mode 100644 index 000000000000..cd4823f1bd05 --- /dev/null +++ b/Zend/tests/partial_application/variation_nocall_002.phpt @@ -0,0 +1,30 @@ +--TEST-- +PFA variation: no call, order of destruction +--FILE-- +id, "\n"; + } +} +$foo = new Foo; +$f = $foo->method(?); +$g = $f(?); + +$map = new WeakMap(); +$map[$f] = new Dtor(1); +$map[$g] = new Dtor(2); + +unset($f); +unset($g); + +echo "OK"; +?> +--EXPECT-- +Dtor::__destruct 2 +Dtor::__destruct 1 +OK diff --git a/Zend/tests/partial_application/variation_parent_001.phpt b/Zend/tests/partial_application/variation_parent_001.phpt new file mode 100644 index 000000000000..6b7545daf2d0 --- /dev/null +++ b/Zend/tests/partial_application/variation_parent_001.phpt @@ -0,0 +1,75 @@ +--TEST-- +PFA variation: parent +--FILE-- +method(10, ...); +$baz = $bar(20, ...); + +var_dump($baz, $baz()); +?> +--EXPECTF-- +object(Closure)#%d (6) { + ["name"]=> + string(%d) "{closure:%s}" + ["file"]=> + string(%d) "%svariation_parent_001.php" + ["line"]=> + int(12) + ["static"]=> + array(2) { + ["fn"]=> + object(Closure)#%d (6) { + ["name"]=> + string(%d) "{closure:%s:%d}" + ["file"]=> + string(%d) "%s" + ["line"]=> + int(11) + ["static"]=> + array(1) { + ["a"]=> + int(10) + } + ["this"]=> + object(Foo)#%d (0) { + } + ["parameter"]=> + array(2) { + ["$b"]=> + string(10) "" + ["$c"]=> + string(10) "" + } + } + ["b"]=> + int(20) + } + ["this"]=> + object(Foo)#%d (0) { + } + ["parameter"]=> + array(1) { + ["$c"]=> + string(10) "" + } +} +object(Closure)#%d (4) { + ["name"]=> + string(25) "{closure:Foo::method():4}" + ["file"]=> + string(%d) "%s" + ["line"]=> + int(4) + ["this"]=> + object(Foo)#%d (0) { + } +} diff --git a/Zend/tests/partial_application/variation_scope_001.phpt b/Zend/tests/partial_application/variation_scope_001.phpt new file mode 100644 index 000000000000..0dcea0921c43 --- /dev/null +++ b/Zend/tests/partial_application/variation_scope_001.phpt @@ -0,0 +1,18 @@ +--TEST-- +PFA variation: called scope +--FILE-- +method(new stdClass, ...); + +$bar(); +?> +--EXPECT-- +Foo::method diff --git a/Zend/tests/partial_application/variation_strict_001.phpt b/Zend/tests/partial_application/variation_strict_001.phpt new file mode 100644 index 000000000000..835f6e138055 --- /dev/null +++ b/Zend/tests/partial_application/variation_strict_001.phpt @@ -0,0 +1,20 @@ +--TEST-- +PFA variation: strict_types declared +--FILE-- +getMessage()); +} +?> +--EXPECTF-- +TypeError: {closure:%s:%d}(): Argument #1 ($int) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/partial_application/variation_variadics_001.phpt b/Zend/tests/partial_application/variation_variadics_001.phpt new file mode 100644 index 000000000000..4710ca4d3b99 --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +PFA variation: variadics, user function +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %s 6 - 6 + + - Bound Variables [2] { + Variable #0 [ $a ] + Variable #1 [ $b0 ] + } + + - Parameters [1] { + Parameter #0 [ ...$b ] + } +} +int(10) +int(100) +int(1000) +int(10000) diff --git a/Zend/tests/partial_application/variation_variadics_002.phpt b/Zend/tests/partial_application/variation_variadics_002.phpt new file mode 100644 index 000000000000..4269dd0e66f0 --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_002.phpt @@ -0,0 +1,25 @@ +--TEST-- +PFA variation: variadics, internal function +--FILE-- + +--EXPECTF-- +Closure [ static function {closure:%s:%d} ] { + @@ %svariation_variadics_002.php 2 - 2 + + - Bound Variables [2] { + Variable #0 [ $format ] + Variable #1 [ $values0 ] + } + + - Parameters [1] { + Parameter #0 [ mixed ...$values ] + } + - Return [ string ] +} +100 1000 10000 diff --git a/Zend/tests/partial_application/variation_variadics_004.phpt b/Zend/tests/partial_application/variation_variadics_004.phpt new file mode 100644 index 000000000000..55ef6cd344f1 --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_004.phpt @@ -0,0 +1,65 @@ +--TEST-- +PFA variation: variadics and optional args +--FILE-- + $day, "month" => $month, "year" => $year]; +} + +$foo = foo(year: 2006, ...); + +var_dump($foo(2)); + +$foo = foo(month: 12, ...); + +$bar = $foo(year: 2016, ...); + +var_dump($foo(2)); + +var_dump($bar(2)); + +var_dump($foo()); + +var_dump($bar()); +?> +--EXPECTF-- +array(3) { + ["day"]=> + int(2) + ["month"]=> + int(1) + ["year"]=> + int(2006) +} +array(3) { + ["day"]=> + int(2) + ["month"]=> + int(12) + ["year"]=> + int(2005) +} +array(3) { + ["day"]=> + int(2) + ["month"]=> + int(12) + ["year"]=> + int(2016) +} +array(3) { + ["day"]=> + int(1) + ["month"]=> + int(12) + ["year"]=> + int(2005) +} +array(3) { + ["day"]=> + int(1) + ["month"]=> + int(12) + ["year"]=> + int(2016) +} diff --git a/Zend/tests/partial_application/variation_variadics_006.phpt b/Zend/tests/partial_application/variation_variadics_006.phpt new file mode 100644 index 000000000000..cda62a2f3bfb --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_006.phpt @@ -0,0 +1,17 @@ +--TEST-- +PFA variation: named may overwrite variadic placeholder +--FILE-- + +--EXPECTF-- +array(1) { + [0]=> + string(1) "a" +} diff --git a/Zend/tests/partial_application/variation_variadics_007.phpt b/Zend/tests/partial_application/variation_variadics_007.phpt new file mode 100644 index 000000000000..9624e05b449b --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_007.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFA variation: extra through variadic +--FILE-- + $a + $b)); +?> +--EXPECT-- +int(3) diff --git a/Zend/tests/partial_application/variation_variadics_008.phpt b/Zend/tests/partial_application/variation_variadics_008.phpt new file mode 100644 index 000000000000..4190bb759e68 --- /dev/null +++ b/Zend/tests/partial_application/variation_variadics_008.phpt @@ -0,0 +1,16 @@ +--TEST-- +PFA variation: variadics wrong signature checked +--FILE-- +getMessage() . PHP_EOL; +} +?> +--EXPECTF-- +Partial application of {closure:%s:%d}() expects at most 1 arguments, 2 given diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index a7e26711cd17..9861edafd540 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1459,6 +1459,16 @@ ZEND_API zend_ast_ref * ZEND_FASTCALL zend_ast_copy(zend_ast *ast) return ref; } +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_dup(zend_ast *ast) +{ + ZEND_ASSERT(ast != NULL); + + void *buf = zend_ast_alloc(zend_ast_tree_size(ast)); + zend_ast_tree_copy(ast, buf); + + return buf; +} + ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast) { tail_call: diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index 32882f5205f7..630f43547883 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -351,6 +351,7 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_ex(zval *result, zend_ast * ZEND_API zend_string *zend_ast_export(const char *prefix, zend_ast *ast, const char *suffix); ZEND_API zend_ast_ref * ZEND_FASTCALL zend_ast_copy(zend_ast *ast); +ZEND_API zend_ast * ZEND_FASTCALL zend_ast_dup(zend_ast *ast); ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast); ZEND_API void ZEND_FASTCALL zend_ast_ref_destroy(zend_ast_ref *ast); diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 314abede4063..3f7d45043fb5 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -27,6 +27,14 @@ #include "zend_globals.h" #include "zend_closures_arginfo.h" +/* Closure is a PFA */ +#define ZEND_PARTIAL OBJ_EXTRA_FLAG_PRIV_1 +/* Closure is a PFA of a Closure. Rebinding the PFA requires rebinding the inner Closure. */ +#define ZEND_PARTIAL_OF_CLOSURE OBJ_EXTRA_FLAG_PRIV_2 + +#define ZEND_CLOSURE_FLAGS(closure) ((closure)->std.extra_flags & (ZEND_PARTIAL|ZEND_PARTIAL_OF_CLOSURE)) +#define ZEND_CLOSURE_IS_FAKE(closure) ((closure)->func.common.fn_flags & ZEND_ACC_FAKE_CLOSURE) + typedef struct _zend_closure { zend_object std; zend_function func; @@ -40,6 +48,7 @@ ZEND_API zend_class_entry *zend_ce_closure; static zend_object_handlers closure_handlers; static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); +static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr, bool is_fake, uint32_t flags); ZEND_METHOD(Closure, __invoke) /* {{{ */ { @@ -77,7 +86,8 @@ static bool zend_valid_closure_binding( zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */ { zend_function *func = &closure->func; - bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0; + bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0 + || (closure->std.extra_flags & ZEND_PARTIAL); if (newthis) { if (func->common.fn_flags & ZEND_ACC_STATIC) { zend_error(E_WARNING, "Cannot bind an instance to a static closure, this will be an error in PHP 9"); @@ -160,7 +170,9 @@ ZEND_METHOD(Closure, call) if (closure->func.common.fn_flags & ZEND_ACC_GENERATOR) { zval new_closure; - zend_create_closure(&new_closure, &closure->func, newclass, closure->called_scope, newthis); + zend_create_closure_ex(&new_closure, &closure->func, newclass, + closure->called_scope, newthis, + ZEND_CLOSURE_IS_FAKE(closure), ZEND_CLOSURE_FLAGS(closure)); closure = (zend_closure *) Z_OBJ(new_closure); fci_cache.function_handler = &closure->func; @@ -176,6 +188,7 @@ ZEND_METHOD(Closure, call) memset(&fake_closure->std, 0, sizeof(fake_closure->std)); fake_closure->std.gc.refcount = 1; fake_closure->std.gc.u.type_info = GC_NULL; + fake_closure->std.extra_flags = ZEND_CLOSURE_FLAGS(closure); ZVAL_UNDEF(&fake_closure->this_ptr); fake_closure->called_scope = NULL; my_function = &fake_closure->func; @@ -222,7 +235,7 @@ ZEND_METHOD(Closure, call) } /* }}} */ -static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, zend_object *scope_obj, zend_string *scope_str) +static zend_result do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, zend_object *scope_obj, zend_string *scope_str) { zend_class_entry *ce, *called_scope; zend_closure *closure = (zend_closure *) Z_OBJ_P(zclosure); @@ -234,14 +247,15 @@ static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, z ce = closure->func.common.scope; } else if ((ce = zend_lookup_class(scope_str)) == NULL) { zend_error(E_WARNING, "Class \"%s\" not found", ZSTR_VAL(scope_str)); - RETURN_NULL(); + RETVAL_NULL(); + return FAILURE; } } else { ce = NULL; } if (!zend_valid_closure_binding(closure, newthis, ce)) { - return; + return FAILURE; } if (newthis) { @@ -250,7 +264,31 @@ static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, z called_scope = ce; } - zend_create_closure(return_value, &closure->func, ce, called_scope, newthis); + zend_create_closure_ex(return_value, &closure->func, ce, called_scope, newthis, + ZEND_CLOSURE_IS_FAKE(closure), ZEND_CLOSURE_FLAGS(closure)); + + if (ZEND_CLOSURE_FLAGS(closure) & ZEND_PARTIAL_OF_CLOSURE) { + /* Re-bind the inner closure */ + + HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); + ZEND_ASSERT(static_variables->nNumOfElements > 0); + zval *inner = &static_variables->arData[0].val; + ZEND_ASSERT(Z_TYPE_P(inner) == IS_OBJECT && Z_OBJCE_P(inner) == zend_ce_closure); + + zval new_inner; + if (do_closure_bind(&new_inner, inner, newthis, scope_obj, scope_str) != SUCCESS) { + ZEND_UNREACHABLE(); + zval_ptr_dtor(return_value); + ZVAL_NULL(return_value); + return FAILURE; + } + + zend_object *garbage = Z_OBJ_P(inner); + ZVAL_COPY_VALUE(inner, &new_inner); + zend_object_release(garbage); + } + + return SUCCESS; } /* {{{ Create a closure from another one and bind to another object and scope */ @@ -587,8 +625,9 @@ static zend_object *zend_closure_clone(zend_object *zobject) /* {{{ */ zend_closure *closure = (zend_closure *)zobject; zval result; - zend_create_closure(&result, &closure->func, - closure->func.common.scope, closure->called_scope, &closure->this_ptr); + zend_create_closure_ex(&result, &closure->func, + closure->func.common.scope, closure->called_scope, &closure->this_ptr, + ZEND_CLOSURE_IS_FAKE(closure), ZEND_CLOSURE_FLAGS(closure)); return Z_OBJ(result); } /* }}} */ @@ -756,7 +795,7 @@ static ZEND_NAMED_FUNCTION(zend_closure_internal_handler) /* {{{ */ } /* }}} */ -static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr, bool is_fake) /* {{{ */ +static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr, bool is_fake, uint32_t flags) /* {{{ */ { zend_closure *closure; void *ptr; @@ -764,6 +803,7 @@ static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_en object_init_ex(res, zend_ce_closure); closure = (zend_closure *)Z_OBJ_P(res); + closure->std.extra_flags = flags; if ((scope == NULL) && this_ptr && (Z_TYPE_P(this_ptr) != IS_UNDEF)) { /* use dummy scope if we're binding an object without specifying a scope */ @@ -861,14 +901,14 @@ static void zend_create_closure_ex(zval *res, zend_function *func, zend_class_en ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) { zend_create_closure_ex(res, func, scope, called_scope, this_ptr, - /* is_fake */ (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0); + /* is_fake */ (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0, 0); } ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr) /* {{{ */ { zend_closure *closure; - zend_create_closure_ex(res, func, scope, called_scope, this_ptr, /* is_fake */ true); + zend_create_closure_ex(res, func, scope, called_scope, this_ptr, /* is_fake */ true, 0); closure = (zend_closure *)Z_OBJ_P(res); closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE; @@ -878,6 +918,16 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_clas } /* }}} */ +ZEND_API void zend_create_partial_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr, bool partial_of_closure) +{ + int flags = ZEND_PARTIAL; + if (partial_of_closure) { + flags |= ZEND_PARTIAL_OF_CLOSURE; + } + zend_create_closure_ex(res, func, scope, called_scope, this_ptr, + /* is_fake */ false, flags); +} + void zend_closure_from_frame(zval *return_value, const zend_execute_data *call) { /* {{{ */ zval instance; zend_internal_function trampoline; diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index 2ff4934f2a3a..305d82e5015a 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -36,6 +36,7 @@ extern ZEND_API zend_class_entry *zend_ce_closure; ZEND_API void zend_create_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr); ZEND_API void zend_create_fake_closure(zval *res, zend_function *op_array, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr); +ZEND_API void zend_create_partial_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zval *this_ptr, bool partial_of_closure); ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj); ZEND_API const zend_function *zend_get_closure_method_def(zend_object *obj); ZEND_API zval* zend_get_closure_this_ptr(zval *obj); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 78cc114223d0..47fee5c2e224 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -28,6 +28,8 @@ #include "zend_exceptions.h" #include "zend_interfaces.h" #include "zend_types.h" +#include "zend_portability.h" +#include "zend_string.h" #include "zend_virtual_cwd.h" #include "zend_multibyte.h" #include "zend_language_scanner.h" @@ -3766,12 +3768,16 @@ static uint32_t zend_get_arg_num(const zend_function *fn, const zend_string *arg return (uint32_t) -1; } -static uint32_t zend_compile_args( - zend_ast *ast, const zend_function *fbc, bool *may_have_extra_named_args) /* {{{ */ +static uint32_t zend_compile_args_ex( + zend_ast *ast, const zend_function *fbc, + bool *may_have_extra_named_args, + bool is_call_partial, bool *uses_variadic_placeholder_p, + zval *named_positions) /* {{{ */ { const zend_ast_list *args = zend_ast_get_list(ast); uint32_t i; bool uses_arg_unpack = false; + bool uses_variadic_placeholder = false; uint32_t arg_count = 0; /* number of arguments not including unpacks */ /* Whether named arguments are used syntactically, to enforce language level limitations. @@ -3797,6 +3803,11 @@ static uint32_t zend_compile_args( "Cannot use argument unpacking after named arguments"); } + if (is_call_partial) { + zend_error_noreturn(E_COMPILE_ERROR, + "Cannot combine partial application and unpacking"); + } + /* Unpack may contain named arguments. */ may_have_undef = true; if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) { @@ -3837,18 +3848,75 @@ static uint32_t zend_compile_args( may_have_undef = true; *may_have_extra_named_args = true; } + + if (uses_variadic_placeholder) { + zend_error_noreturn(E_COMPILE_ERROR, + "Variadic placeholder must be last"); + } } else { if (uses_arg_unpack) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use positional argument after argument unpacking"); } - if (uses_named_args) { + bool is_variadic_placeholder = arg->kind == ZEND_AST_PLACEHOLDER_ARG + && arg->attr == ZEND_PLACEHOLDER_VARIADIC; + + if (uses_named_args && !is_variadic_placeholder) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use positional argument after named argument"); } - arg_count++; + if (uses_variadic_placeholder) { + if (is_variadic_placeholder) { + zend_error_noreturn(E_COMPILE_ERROR, + "Variadic placeholder may only appear once"); + } else { + zend_error_noreturn(E_COMPILE_ERROR, + "Variadic placeholder must be last"); + } + } + + if (!is_variadic_placeholder) { + arg_count++; + } + } + + if (arg->kind == ZEND_AST_PLACEHOLDER_ARG) { + if (uses_arg_unpack) { + zend_error_noreturn(E_COMPILE_ERROR, + "Cannot combine partial application and unpacking"); + } + + if (arg->attr == ZEND_PLACEHOLDER_VARIADIC) { + uses_variadic_placeholder = true; + /* Do not emit ZEND_SEND_PLACEHOLDER: We represent the variadic + * placeholder with a flag on the ZEND_CONVERT_CALLABLE_PARTIAL + * op instead. */ + continue; + } + + if (arg_name) { + if (Z_ISUNDEF_P(named_positions)) { + array_init(named_positions); + } + zval tmp; + ZVAL_LONG(&tmp, zend_hash_num_elements(Z_ARRVAL_P(named_positions))); + zend_hash_add(Z_ARRVAL_P(named_positions), arg_name, &tmp); + } + + opline = zend_emit_op(NULL, ZEND_SEND_PLACEHOLDER, NULL, NULL); + if (arg_name) { + opline->op2_type = IS_CONST; + zend_string_addref(arg_name); + opline->op2.constant = zend_add_literal_string(&arg_name); + opline->result.num = zend_alloc_cache_slots(2); + } else if (arg->attr != ZEND_PLACEHOLDER_VARIADIC) { + opline->op2.opline_num = arg_num; + opline->result.var = EX_NUM_TO_VAR(arg_num - 1); + } + + continue; } /* Treat passing of $GLOBALS the same as passing a call. @@ -3963,14 +4031,24 @@ static uint32_t zend_compile_args( } } - if (may_have_undef) { - zend_emit_op(NULL, ZEND_CHECK_UNDEF_ARGS, NULL, NULL); + if (!is_call_partial) { + if (may_have_undef) { + zend_emit_op(NULL, ZEND_CHECK_UNDEF_ARGS, NULL, NULL); + } + } else { + *uses_variadic_placeholder_p = uses_variadic_placeholder; } return arg_count; } /* }}} */ +static uint32_t zend_compile_args(zend_ast *ast, const zend_function *fbc, + bool *may_have_extra_named_args) /* {{{ */ +{ + return zend_compile_args_ex(ast, fbc, may_have_extra_named_args, false, NULL, NULL); +} + ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, const zend_function *fbc, bool result_used) /* {{{ */ { uint32_t no_discard = result_used ? 0 : ZEND_ACC_NODISCARD; @@ -4004,6 +4082,38 @@ ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, const zend_function *f } /* }}} */ +static void zend_compile_call_partial(znode *result, uint32_t arg_count, + bool may_have_extra_named_args, bool uses_variadic_placeholder, + zval *named_positions, uint32_t opnum_init, const zend_function *fbc) { + + zend_op *init_opline = &CG(active_op_array)->opcodes[opnum_init]; + + init_opline->extended_value = arg_count; + + ZEND_ASSERT(init_opline->opcode != ZEND_NEW); + + if (init_opline->opcode == ZEND_INIT_FCALL) { + init_opline->op1.num = zend_vm_calc_used_stack(arg_count, fbc); + } + + zend_op *opline = zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT_PARTIAL, + NULL, NULL); + + opline->op1.num = zend_alloc_cache_slots(2); + + if (may_have_extra_named_args) { + opline->extended_value = ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS; + } + if (uses_variadic_placeholder) { + opline->extended_value |= ZEND_FCALL_USES_VARIADIC_PLACEHOLDER; + } + + if (!Z_ISUNDEF_P(named_positions)) { + opline->op2.constant = zend_add_literal(named_positions); + opline->op2_type = IS_CONST; + } +} + static bool zend_compile_call_common(znode *result, zend_ast *args_ast, const zend_function *fbc, uint32_t lineno, uint32_t type) /* {{{ */ { zend_op *opline; @@ -4019,23 +4129,43 @@ static bool zend_compile_call_common(znode *result, zend_ast *args_ast, const ze zend_error_noreturn(E_COMPILE_ERROR, "Cannot create Closure for new expression"); } - zend_ast_list *args = zend_ast_get_list(((zend_ast_fcc*)args_ast)->args); - if (args->children != 1 || args->child[0]->attr != ZEND_PLACEHOLDER_VARIADIC) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot create a Closure for call expression with more than one argument, or non-variadic placeholders"); - } + zend_ast_list *fcc_args = zend_ast_get_list(((zend_ast_fcc*)args_ast)->args); - if (opcode == ZEND_INIT_FCALL) { - opline->op1.num = zend_vm_calc_used_stack(0, fbc); - } + /* FCCs are a special case of PFAs with a single variadic placeholder */ + if (fcc_args->children == 1 && fcc_args->child[0]->attr == ZEND_PLACEHOLDER_VARIADIC) { - zend_op *callable_convert_op = zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT, NULL, NULL); - if (opcode == ZEND_INIT_FCALL - || opcode == ZEND_INIT_FCALL_BY_NAME - || opcode == ZEND_INIT_NS_FCALL_BY_NAME) { - callable_convert_op->extended_value = zend_alloc_cache_slot(); - } else { - callable_convert_op->extended_value = (uint32_t)-1; + if (opline->opcode == ZEND_INIT_FCALL) { + opline->op1.num = zend_vm_calc_used_stack(0, fbc); + } + + zend_op *callable_convert_op = zend_emit_op_tmp(result, ZEND_CALLABLE_CONVERT, NULL, NULL); + if (opcode == ZEND_INIT_FCALL + || opcode == ZEND_INIT_FCALL_BY_NAME + || opcode == ZEND_INIT_NS_FCALL_BY_NAME) { + callable_convert_op->extended_value = zend_alloc_cache_slot(); + } else { + callable_convert_op->extended_value = (uint32_t)-1; + } + + return true; } + + args_ast = ((zend_ast_fcc*)args_ast)->args; + + bool may_have_extra_named_args; + bool uses_variadic_placeholder; + + zval named_positions; + ZVAL_UNDEF(&named_positions); + + uint32_t arg_count = zend_compile_args_ex(args_ast, fbc, + &may_have_extra_named_args, true, &uses_variadic_placeholder, + &named_positions); + + zend_compile_call_partial(result, arg_count, + may_have_extra_named_args, uses_variadic_placeholder, + &named_positions, opnum_init, fbc); + return true; } @@ -5141,7 +5271,7 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg * breaking for the generated call. */ if (callback->kind == ZEND_AST_CALL - && callback->child[0]->kind == ZEND_AST_ZVAL + && callback->child[0]->kind == ZEND_AST_ZVAL && Z_TYPE_P(zend_ast_get_zval(callback->child[0])) == IS_STRING && zend_string_equals_literal_ci(zend_ast_get_str(callback->child[0]), "assert")) { return FAILURE; @@ -6770,6 +6900,76 @@ static bool zend_is_pipe_optimizable_callable_name(zend_ast *ast) return true; } +static zend_ast *zend_partial_apply(zend_ast *callable_ast, zend_ast *pipe_arg) +{ + if (callable_ast->kind != ZEND_AST_CALL + && callable_ast->kind != ZEND_AST_STATIC_CALL + && callable_ast->kind != ZEND_AST_METHOD_CALL) { + return NULL; + } + + zend_ast *args_ast = zend_ast_call_get_args(callable_ast); + if (!args_ast || args_ast->kind != ZEND_AST_CALLABLE_CONVERT) { + return NULL; + } + + if (callable_ast->kind == ZEND_AST_CALL && + !zend_is_pipe_optimizable_callable_name(callable_ast->child[0])) { + return NULL; + } + + zend_ast_list *arg_list = zend_ast_get_list(((zend_ast_fcc*)args_ast)->args); + + zend_ast *first_placeholder = NULL; + bool uses_named_args = false; + + for (uint32_t i = 0; i < arg_list->children; i++) { + zend_ast *arg = arg_list->child[i]; + if (arg->kind == ZEND_AST_NAMED_ARG) { + uses_named_args = true; + arg = arg->child[1]; + } + + if (arg->kind == ZEND_AST_PLACEHOLDER_ARG) { + if (first_placeholder == NULL) { + first_placeholder = arg; + } else { + /* A PFA with multiple placeholders is unexpected in is this + * context, and will usually error due to a missing argument, + * so we don't optimize those. */ + return NULL; + } + if (arg->attr == ZEND_PLACEHOLDER_VARIADIC && uses_named_args) { + /* PFAs with both a variadic placeholder and named args can not + * be optimized because the named arg may resolve to the + * position of the placeholder: f(..., name: $v). + * Arg placeholders ('?') are safe, as named args are not + * allowed to override them. */ + return NULL; + } + } + } + + ZEND_ASSERT(first_placeholder); + + zend_ast *new_arg_list = zend_ast_create_list(0, arg_list->kind); + for (uint32_t i = 0; i < arg_list->children; i++) { + zend_ast *arg = arg_list->child[i]; + if (arg == first_placeholder) { + new_arg_list = zend_ast_list_add(new_arg_list, pipe_arg); + } else if (arg->kind == ZEND_AST_NAMED_ARG + && arg->child[1] == first_placeholder) { + zend_ast *name = arg->child[0]; + new_arg_list = zend_ast_list_add(new_arg_list, + zend_ast_create(ZEND_AST_NAMED_ARG, name, pipe_arg)); + } else { + new_arg_list = zend_ast_list_add(new_arg_list, arg); + } + } + + return new_arg_list; +} + static void zend_compile_pipe(znode *result, zend_ast *ast, uint32_t type) { zend_ast *operand_ast = ast->child[0]; @@ -6794,29 +6994,34 @@ static void zend_compile_pipe(znode *result, zend_ast *ast, uint32_t type) } /* Turn the operand into a function parameter list. */ - zend_ast *arg_list_ast = zend_ast_create_list(1, ZEND_AST_ARG_LIST, zend_ast_create_znode(&wrapped_operand_result)); + zend_ast *arg = zend_ast_create_znode(&wrapped_operand_result); zend_ast *fcall_ast; znode callable_result; + zend_ast *pfa_arg_list_ast = NULL; - /* Turn $foo |> bar(...) into bar($foo). */ - if (callable_ast->kind == ZEND_AST_CALL - && callable_ast->child[1]->kind == ZEND_AST_CALLABLE_CONVERT - && zend_is_pipe_optimizable_callable_name(callable_ast->child[0])) { - fcall_ast = zend_ast_create(ZEND_AST_CALL, - callable_ast->child[0], arg_list_ast); - /* Turn $foo |> bar::baz(...) into bar::baz($foo). */ - } else if (callable_ast->kind == ZEND_AST_STATIC_CALL - && callable_ast->child[2]->kind == ZEND_AST_CALLABLE_CONVERT) { - fcall_ast = zend_ast_create(ZEND_AST_STATIC_CALL, - callable_ast->child[0], callable_ast->child[1], arg_list_ast); - /* Turn $foo |> $bar->baz(...) into $bar->baz($foo). */ - } else if (callable_ast->kind == ZEND_AST_METHOD_CALL - && callable_ast->child[2]->kind == ZEND_AST_CALLABLE_CONVERT) { - fcall_ast = zend_ast_create(ZEND_AST_METHOD_CALL, - callable_ast->child[0], callable_ast->child[1], arg_list_ast); + /* Turn $foo |> PFA into plain function call if possible */ + if ((pfa_arg_list_ast = zend_partial_apply(callable_ast, arg))) { + switch (callable_ast->kind) { + case ZEND_AST_CALL: + fcall_ast = zend_ast_create(ZEND_AST_CALL, + callable_ast->child[0], pfa_arg_list_ast); + break; + case ZEND_AST_STATIC_CALL: + fcall_ast = zend_ast_create(ZEND_AST_STATIC_CALL, + callable_ast->child[0], callable_ast->child[1], + pfa_arg_list_ast); + break; + case ZEND_AST_METHOD_CALL: + fcall_ast = zend_ast_create(ZEND_AST_METHOD_CALL, + callable_ast->child[0], callable_ast->child[1], + pfa_arg_list_ast); + break; + EMPTY_SWITCH_DEFAULT_CASE() + } /* Turn $foo |> $expr into ($expr)($foo) */ } else { + zend_ast *arg_list_ast = zend_ast_create_list(1, ZEND_AST_ARG_LIST, arg); zend_compile_expr(&callable_result, callable_ast); callable_ast = zend_ast_create_znode(&callable_result); fcall_ast = zend_ast_create(ZEND_AST_CALL, @@ -11808,6 +12013,13 @@ static void zend_compile_const_expr_fcc(zend_ast **ast_ptr) if ((*args_ast)->kind != ZEND_AST_CALLABLE_CONVERT) { zend_error_noreturn(E_COMPILE_ERROR, "Constant expression contains invalid operations"); } + + zend_ast_list *args = zend_ast_get_list(((zend_ast_fcc*)*args_ast)->args); + if (args->children != 1 || args->child[0]->attr != ZEND_PLACEHOLDER_VARIADIC) { + // TODO: PFAs + zend_error_noreturn(E_COMPILE_ERROR, "Constant expression contains invalid operations"); + } + ZEND_MAP_PTR_NEW(((zend_ast_fcc *)*args_ast)->fptr); switch ((*ast_ptr)->kind) { diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 8f67fee2a52b..da8aab3fe1dd 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -958,6 +958,7 @@ struct _zend_arena; ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type); ZEND_API zend_op_array *compile_string(zend_string *source_string, const char *filename, zend_compile_position position); ZEND_API zend_op_array *compile_filename(int type, zend_string *filename); +ZEND_API zend_op_array *zend_compile_ast(zend_ast *ast, int type, zend_string *filename); ZEND_API zend_ast *zend_compile_string_to_ast( zend_string *code, struct _zend_arena **ast_arena, zend_string *filename); ZEND_API zend_result zend_execute_scripts(int type, zval *retval, int file_count, ...); @@ -1119,7 +1120,8 @@ ZEND_API zend_string *zend_type_to_string(zend_type type); #define ZEND_THROW_IS_EXPR 1u -#define ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS 1 +#define ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS (1<<0) +#define ZEND_FCALL_USES_VARIADIC_PLACEHOLDER (1<<1) /* The send mode, the is_variadic, the is_promoted, and the is_tentative flags are stored as part of zend_type */ #define _ZEND_SEND_MODE_SHIFT _ZEND_TYPE_EXTRA_FLAGS_SHIFT diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 85461eaa1569..cc0412b887f7 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -44,6 +44,7 @@ #include "zend_call_stack.h" #include "zend_attributes.h" #include "Optimizer/zend_func_info.h" +#include "zend_partial.h" /* Virtual current working directory support */ #include "zend_virtual_cwd.h" @@ -1229,6 +1230,13 @@ static zend_always_inline bool zend_check_type( return zend_check_type_slow(type, arg, ref, is_return_type, is_internal); } +ZEND_API bool zend_check_type_ex( + const zend_type *type, zval *arg, zend_class_entry *scope, + bool is_return_type, bool is_internal) +{ + return zend_check_type(type, arg, scope, is_return_type, is_internal); +} + ZEND_API bool zend_check_user_type_slow( const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type) { @@ -4666,6 +4674,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: level++; break; case ZEND_INIT_FCALL: @@ -4722,6 +4731,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: level++; break; case ZEND_INIT_FCALL: @@ -4802,6 +4812,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: level++; break; case ZEND_INIT_FCALL: @@ -4859,6 +4870,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: level++; break; case ZEND_INIT_FCALL: @@ -5568,9 +5580,10 @@ zval * ZEND_FASTCALL zend_handle_named_arg( } } else { arg = ZEND_CALL_VAR_NUM(call, arg_offset); + if (UNEXPECTED(!Z_ISUNDEF_P(arg))) { - zend_throw_error(NULL, "Named parameter $%s overwrites previous argument", - ZSTR_VAL(arg_name)); + zend_throw_error(NULL, "Named parameter $%s overwrites previous %s", + ZSTR_VAL(arg_name), Z_TYPE_P(arg) == _IS_PLACEHOLDER ? "placeholder" : "argument"); return NULL; } } diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ba48b19bcfe1..f44538d62f6a 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -109,6 +109,9 @@ ZEND_API zend_never_inline ZEND_COLD void zend_verify_never_error( ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref); ZEND_API bool zend_check_user_type_slow( const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type); +ZEND_API bool zend_check_type_ex( + const zend_type *type, zval *arg, zend_class_entry *scope, + bool is_return_type, bool is_internal); #if ZEND_DEBUG ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0022eb4a1df8..dc302cc43dd5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -38,6 +38,7 @@ #include "zend_observer.h" #include "zend_call_stack.h" #include "zend_frameless_function.h" +#include "zend_partial.h" #ifdef HAVE_SYS_TIME_H #include #endif @@ -201,6 +202,7 @@ void init_executor(void) /* {{{ */ zend_weakrefs_init(); zend_hash_init(&EG(callable_convert_cache), 8, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_init(&EG(partial_function_application_cache), 8, NULL, zend_partial_op_array_dtor, 0); EG(active) = 1; } @@ -418,6 +420,7 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown) zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1); zend_hash_clean(&EG(callable_convert_cache)); + zend_hash_clean(&EG(partial_function_application_cache)); #if ZEND_DEBUG if (!CG(unclean_shutdown)) { @@ -514,6 +517,7 @@ void shutdown_executor(void) /* {{{ */ } zend_hash_destroy(&EG(callable_convert_cache)); + zend_hash_destroy(&EG(partial_function_application_cache)); } #if ZEND_DEBUG diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 8257df32e831..e94550247701 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -325,6 +325,7 @@ struct _zend_executor_globals { zend_strtod_state strtod_state; HashTable callable_convert_cache; + HashTable partial_function_application_cache; void *reserved[ZEND_MAX_RESERVED_RESOURCES]; }; diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 07f2d44cb5c6..7e9dccff58f5 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -590,6 +590,43 @@ ZEND_API zend_result open_file_for_scanning(zend_file_handle *file_handle) return SUCCESS; } +static zend_op_array *zend_compile_ast_internal(int type) +{ + ZEND_ASSERT(CG(in_compilation)); + ZEND_ASSERT(CG(ast)); + + uint32_t last_lineno = CG(zend_lineno); + zend_file_context original_file_context; + zend_oparray_context original_oparray_context; + zend_op_array *original_active_op_array = CG(active_op_array); + + zend_op_array *op_array = emalloc(sizeof(zend_op_array)); + init_op_array(op_array, type, INITIAL_OP_ARRAY_SIZE); + CG(active_op_array) = op_array; + + /* Use heap to not waste arena memory */ + op_array->fn_flags |= ZEND_ACC_HEAP_RT_CACHE; + + if (zend_ast_process) { + zend_ast_process(CG(ast)); + } + + zend_file_context_begin(&original_file_context); + zend_oparray_context_begin(&original_oparray_context, op_array); + zend_compile_top_stmt(CG(ast)); + CG(zend_lineno) = last_lineno; + zend_emit_final_return(type == ZEND_USER_FUNCTION); + op_array->line_start = 1; + op_array->line_end = last_lineno; + pass_two(op_array); + zend_oparray_context_end(&original_oparray_context); + zend_file_context_end(&original_file_context); + + CG(active_op_array) = original_active_op_array; + + return op_array; +} + static zend_op_array *zend_compile(zend_function_type type) { zend_op_array *op_array = NULL; @@ -600,34 +637,7 @@ static zend_op_array *zend_compile(zend_function_type type) CG(ast_arena) = zend_arena_create(1024 * 32); if (!zendparse()) { - uint32_t last_lineno = CG(zend_lineno); - zend_file_context original_file_context; - zend_oparray_context original_oparray_context; - zend_op_array *original_active_op_array = CG(active_op_array); - - op_array = emalloc(sizeof(zend_op_array)); - init_op_array(op_array, type, INITIAL_OP_ARRAY_SIZE); - CG(active_op_array) = op_array; - - /* Use heap to not waste arena memory */ - op_array->fn_flags |= ZEND_ACC_HEAP_RT_CACHE; - - if (zend_ast_process) { - zend_ast_process(CG(ast)); - } - - zend_file_context_begin(&original_file_context); - zend_oparray_context_begin(&original_oparray_context, op_array); - zend_compile_top_stmt(CG(ast)); - CG(zend_lineno) = last_lineno; - zend_emit_final_return(type == ZEND_USER_FUNCTION); - op_array->line_start = 1; - op_array->line_end = last_lineno; - pass_two(op_array); - zend_oparray_context_end(&original_oparray_context); - zend_file_context_end(&original_file_context); - - CG(active_op_array) = original_active_op_array; + op_array = zend_compile_ast_internal(type); } zend_ast_destroy(CG(ast)); @@ -670,6 +680,23 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type) return op_array; } +ZEND_API zend_op_array *zend_compile_ast( + zend_ast *ast, int type, zend_string *filename) +{ + zend_string *original_compiled_filename = CG(compiled_filename); + bool original_in_compilation = CG(in_compilation); + CG(in_compilation) = 1; + CG(ast) = ast; + + zend_set_compiled_filename(filename); + zend_op_array *op_array = zend_compile_ast_internal(type); + + CG(in_compilation) = original_in_compilation; + zend_restore_compiled_filename(original_compiled_filename); + + return op_array; +} + ZEND_API zend_ast *zend_compile_string_to_ast( zend_string *code, zend_arena **ast_arena, zend_string *filename) { zval code_zv; diff --git a/Zend/zend_partial.c b/Zend/zend_partial.c new file mode 100644 index 000000000000..2a4195c4049b --- /dev/null +++ b/Zend/zend_partial.c @@ -0,0 +1,1146 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ +*/ + +/** + * Partial Function Application: + * + * A partial application is compiled to the usual sequence of function call + * opcodes (INIT_FCALL, SEND_VAR, etc), but the sequence ends with a + * CALLABLE_CONVERT_PARTIAL opcode instead of DO_FCALL, similarly to + * first class callables. Placeholders are compiled to SEND_PLACEHOLDER opcodes: + * + * $f = f($a, ?) + * + * 0001 INIT_FCALL f + * 0002 SEND_VAR CV($a) + * 0003 SEND_PLACEHOLDER + * 0004 CV($f) = CALLABLE_CONVERT_PARTIAL + * + * SEND_PLACEHOLDER sets the argument slot type to _IS_PLACEHOLDER. + * + * CALLABLE_CONVERT_PARTIAL uses the information available on the stack to + * create a Closure and return it, consuming the stack frame in the process + * like an internal function call. + * + * We create the Closure by generating the relevant AST and compling it to an + * op_array. The op_array is cached in the Opcache SHM and inline caches. + * + * This file implements the Closure generation logic + * (see zend_partial_create(), zp_compile()). + */ + +#include "zend.h" +#include "zend_API.h" +#include "zend_arena.h" +#include "zend_ast.h" +#include "zend_compile.h" +#include "zend_closures.h" +#include "zend_attributes.h" +#include "zend_exceptions.h" +#include "ext/opcache/ZendAccelerator.h" + +#define Z_IS_PLACEHOLDER_P(p) (Z_TYPE_P(p) == _IS_PLACEHOLDER) + +#define IS_STATIC_CLOSURE(function) \ + (((function)->common.fn_flags & (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) == (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) + +static zend_never_inline ZEND_COLD void zp_args_underflow( + const zend_function *function, uint32_t args, uint32_t expected) +{ + zend_string *symbol = get_function_or_method_name(function); + const char *limit = function->common.num_args <= function->common.required_num_args ? + "exactly" : "at least"; + + zend_argument_count_error( + "Partial application of %s() expects %s %d arguments, %d given", + ZSTR_VAL(symbol), limit, expected, args); + + zend_string_release(symbol); +} + +static zend_never_inline ZEND_COLD void zp_args_overflow( + const zend_function *function, uint32_t args, uint32_t expected) +{ + zend_string *symbol = get_function_or_method_name(function); + + zend_argument_count_error( + "Partial application of %s() expects at most %d arguments, %d given", + ZSTR_VAL(symbol), expected, args); + + zend_string_release(symbol); +} + +static zend_result zp_args_check(const zend_function *function, + uint32_t argc, const zval *argv, + const zend_array *extra_named_args, + bool uses_variadic_placeholder) { + + if (extra_named_args) { + zval *arg; + zend_string *key; + ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(extra_named_args, key, arg) { + if (UNEXPECTED(Z_IS_PLACEHOLDER_P(arg))) { + zend_throw_error(NULL, + "Cannot use named placeholder for unknown or variadic parameter $%s", + ZSTR_VAL(key)); + return FAILURE; + } + } ZEND_HASH_FOREACH_END(); + } + + if (argc < function->common.required_num_args) { + if (uses_variadic_placeholder) { + /* Missing args will be turned into placeholders */ + return SUCCESS; + } + + zp_args_underflow( + function, argc, function->common.required_num_args); + return FAILURE; + } else if (argc > function->common.num_args && + !(function->common.fn_flags & ZEND_ACC_VARIADIC)) { + zp_args_overflow(function, argc, function->common.num_args); + return FAILURE; + } + + return SUCCESS; +} + +static bool zp_name_exists(zend_string **names, uint32_t num_names, zend_string *name) +{ + for (uint32_t i = 0; i < num_names; i++) { + if (names[i] && zend_string_equals(names[i], name)) { + return true; + } + } + return false; +} + +static zend_string *zp_get_param_name(zend_function *function, uint32_t arg_offset) +{ + return zend_string_copy(function->common.arg_info[arg_offset].name); +} + +/* Assign a name for every variable that will be used in the generated closure, + * including params and used vars. */ +static void zp_assign_names(zend_string **names, uint32_t num_names, + uint32_t argc, zval *argv, + zend_function *function, bool variadic_partial, + zend_array *extra_named_params) +{ + /* Assign names for params. We never rename those. */ + for (uint32_t offset = 0; offset < MIN(argc, function->common.num_args); offset++) { + if (Z_IS_PLACEHOLDER_P(&argv[offset])) { + names[offset] = zp_get_param_name(function, offset); + } + } + + /* Assign name for the variadic param. Never renamed. */ + if (variadic_partial && (function->common.fn_flags & ZEND_ACC_VARIADIC)) { + names[argc] = zp_get_param_name(function, function->common.num_args); + } + + /* Assign names for placeholders that bind to the variadic param: + * + * function f($a, ...$args) {} + * f(?, ?, ...); // The second placeholder binds into the variadic param. + * + * By default these are named $origNameN with N the offset from the + * variadic param. In case of clash we increment N until a free name is + * found. */ + for (uint32_t offset = function->common.num_args; offset < argc; offset++) { + ZEND_ASSERT(function->common.fn_flags & ZEND_ACC_VARIADIC); + if (!Z_IS_PLACEHOLDER_P(&argv[offset])) { + continue; + } + int n = offset - function->common.num_args; + zend_string *orig_name = zp_get_param_name(function, function->common.num_args); + zend_string *new_name; + do { + new_name = zend_strpprintf_unchecked(0, "%S%d", orig_name, n); + if (!zp_name_exists(names, num_names, new_name)) { + break; + } + n++; + zend_string_release(new_name); + } while (true); + names[offset] = new_name; + zend_string_release(orig_name); + } + + /* Assign names for pre-bound params (lexical vars). + * There may be clashes, we ensure to generate unique names. */ + for (uint32_t offset = 0; offset < argc; offset++) { + if (Z_IS_PLACEHOLDER_P(&argv[offset]) || Z_ISUNDEF(argv[offset])) { + continue; + } + int n = -1; + zend_string *orig_name = zp_get_param_name(function, MIN(offset, function->common.num_args)); + zend_string *new_name = zend_string_copy(orig_name); + while (zp_name_exists(names, num_names, new_name)) { + zend_string_release(new_name); + n++; + new_name = zend_strpprintf_unchecked(0, "%S%d", orig_name, n); + } + names[offset] = new_name; + zend_string_release(orig_name); + } + + /* Assign name for $extra_named_params */ + if (extra_named_params) { + int n = 1; + zend_string *new_name = ZSTR_INIT_LITERAL("extra_named_params", 0); + while (zp_name_exists(names, num_names, new_name)) { + zend_string_release(new_name); + n++; + new_name = zend_strpprintf(0, "%s%d", "extra_named_params", n); + } + names[argc + variadic_partial] = new_name; + } + + /* Assign name for $fn */ + if (function->common.fn_flags & ZEND_ACC_CLOSURE) { + int n = 1; + zend_string *new_name = ZSTR_INIT_LITERAL("fn", 0); + while (zp_name_exists(names, num_names, new_name)) { + zend_string_release(new_name); + n++; + new_name = zend_strpprintf(0, "%s%d", "fn", n); + } + names[argc + variadic_partial + (extra_named_params != NULL)] = new_name; + } +} + +static bool zp_is_single_may_be_type(uint32_t type_mask) +{ + return ((type_mask > 0) && (type_mask & (type_mask - 1)) == 0) + || type_mask == MAY_BE_BOOL + || type_mask == MAY_BE_ANY; +} + +static zend_ast *zp_single_may_be_type_to_ast(uint32_t type) +{ + zend_string *name; + + switch (type) { + case MAY_BE_NULL: + name = ZSTR_KNOWN(ZEND_STR_NULL_LOWERCASE); + break; + case MAY_BE_TRUE: + name = ZSTR_KNOWN(ZEND_STR_TRUE); + break; + case MAY_BE_FALSE: + name = ZSTR_KNOWN(ZEND_STR_FALSE); + break; + case MAY_BE_LONG: + name = ZSTR_KNOWN(ZEND_STR_INT); + break; + case MAY_BE_DOUBLE: + name = ZSTR_KNOWN(ZEND_STR_FLOAT); + break; + case MAY_BE_STRING: + name = ZSTR_KNOWN(ZEND_STR_STRING); + break; + case MAY_BE_BOOL: + name = ZSTR_KNOWN(ZEND_STR_BOOL); + break; + case MAY_BE_VOID: + name = ZSTR_KNOWN(ZEND_STR_VOID); + break; + case MAY_BE_NEVER: + name = ZSTR_KNOWN(ZEND_STR_NEVER); + break; + case MAY_BE_OBJECT: + name = ZSTR_KNOWN(ZEND_STR_OBJECT); + break; + case MAY_BE_ANY: + name = ZSTR_KNOWN(ZEND_STR_MIXED); + break; + case MAY_BE_CALLABLE: + return zend_ast_create_ex(ZEND_AST_TYPE, IS_CALLABLE); + case MAY_BE_ARRAY: + return zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); + case MAY_BE_STATIC: + return zend_ast_create_ex(ZEND_AST_TYPE, IS_STATIC); + EMPTY_SWITCH_DEFAULT_CASE() + } + + zend_ast *ast = zend_ast_create_zval_from_str(name); + ast->attr = ZEND_NAME_NOT_FQ; + + return ast; +} + +static zend_ast *zp_type_name_to_ast(zend_string *name) +{ + zend_ast *ast = zend_ast_create_zval_from_str(name); + + if (zend_get_class_fetch_type(name) != ZEND_FETCH_CLASS_DEFAULT) { + ast->attr = ZEND_NAME_NOT_FQ; + } else { + ast->attr = ZEND_NAME_FQ; + } + + return ast; +} + +static zend_ast *zp_type_to_ast(const zend_type type) +{ + if (!ZEND_TYPE_IS_SET(type)) { + return NULL; + } + + if (ZEND_TYPE_IS_UNION(type) + || (ZEND_TYPE_IS_COMPLEX(type) && ZEND_TYPE_PURE_MASK(type)) + || (ZEND_TYPE_PURE_MASK(type) && !zp_is_single_may_be_type(ZEND_TYPE_PURE_MASK(type)))) { + zend_ast *type_ast = zend_ast_create_list(0, ZEND_AST_TYPE_UNION); + if (ZEND_TYPE_HAS_LIST(type)) { + const zend_type *type_ptr; + ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), type_ptr) { + type_ast = zend_ast_list_add(type_ast, zp_type_to_ast(*type_ptr)); + } ZEND_TYPE_LIST_FOREACH_END(); + } else if (ZEND_TYPE_HAS_NAME(type)) { + zend_ast *name_ast = zp_type_name_to_ast( + zend_string_copy(ZEND_TYPE_NAME(type))); + type_ast = zend_ast_list_add(type_ast, name_ast); + } else if (ZEND_TYPE_IS_COMPLEX(type)) { + ZEND_UNREACHABLE(); + } + uint32_t type_mask = ZEND_TYPE_PURE_MASK(type); + if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL) { + type_ast = zend_ast_list_add(type_ast, zp_single_may_be_type_to_ast(MAY_BE_BOOL)); + type_mask &= ~MAY_BE_BOOL; + } + for (uint32_t may_be_type = 1; may_be_type < _ZEND_TYPE_MAY_BE_MASK; may_be_type <<= 1) { + if (type_mask & may_be_type) { + type_ast = zend_ast_list_add(type_ast, zp_single_may_be_type_to_ast(may_be_type)); + } + } + return type_ast; + } + + if (ZEND_TYPE_IS_INTERSECTION(type)) { + zend_ast *type_ast = zend_ast_create_list(0, ZEND_AST_TYPE_INTERSECTION); + const zend_type *type_ptr; + ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), type_ptr) { + type_ast = zend_ast_list_add(type_ast, zp_type_to_ast(*type_ptr)); + } ZEND_TYPE_LIST_FOREACH_END(); + ZEND_ASSERT(!ZEND_TYPE_PURE_MASK(type)); + return type_ast; + } + + if (ZEND_TYPE_HAS_NAME(type)) { + zend_ast *type_ast = zp_type_name_to_ast( + zend_string_copy(ZEND_TYPE_NAME(type))); + return type_ast; + } + + ZEND_ASSERT(!ZEND_TYPE_IS_COMPLEX(type)); + + uint32_t type_mask = ZEND_TYPE_PURE_MASK(type); + ZEND_ASSERT(zp_is_single_may_be_type(type_mask)); + + return zp_single_may_be_type_to_ast(type_mask); +} + +/* Can not use zend_argument_error() as the function is not on the stack */ +static zend_never_inline ZEND_COLD void zp_argument_error(zend_class_entry *error_ce, + zend_function *function, uint32_t arg_num, const char *format, ...) +{ + zend_string *func_name = get_function_or_method_name(function); + const char *arg_name = get_function_arg_name(function, arg_num); + + char *message = NULL; + + va_list va; + va_start(va, format); + zend_vspprintf(&message, 0, format, va); + va_end(va); + + zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", + ZSTR_VAL(func_name), arg_num, + arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message + ); + efree(message); + zend_string_release(func_name); +} + +static zend_result zp_get_param_default_value(zval *result, zend_function *function, uint32_t arg_offset) +{ + ZEND_ASSERT(arg_offset < function->common.num_args); + + if (function->type == ZEND_USER_FUNCTION) { + zend_op *opline = &function->op_array.opcodes[arg_offset]; + if (EXPECTED(opline->opcode == ZEND_RECV_INIT)) { + ZVAL_COPY(result, RT_CONSTANT(opline, opline->op2)); + return SUCCESS; + } else { + ZEND_ASSERT(opline->opcode == ZEND_RECV); + } + } else if (function->type == ZEND_INTERNAL_FUNCTION) { + if (function->common.fn_flags & ZEND_ACC_USER_ARG_INFO) { + goto error; + } + + const zend_arg_info *arg_info = &function->internal_function.arg_info[arg_offset]; + + if (zend_get_default_from_internal_arg_info(result, arg_info) == SUCCESS) { + return SUCCESS; + } + } + +error: + zp_argument_error(zend_ce_argument_count_error, function, arg_offset + 1, + "must be passed explicitly, because the default value is not known"); + + return FAILURE; +} + +static bool zp_arg_must_be_sent_by_ref(zend_function *function, uint32_t arg_num) +{ + if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) { + if (QUICK_ARG_MUST_BE_SENT_BY_REF(function, arg_num)) { + return true; + } + } else if (ARG_MUST_BE_SENT_BY_REF(function, arg_num)) { + return true; + } + return false; +} + +static zend_ast *zp_attribute_to_ast(zend_attribute *attribute) +{ + zend_ast *args_ast; + if (attribute->argc) { + args_ast = zend_ast_create_arg_list(0, ZEND_AST_ARG_LIST); + for (uint32_t i = 0; i < attribute->argc; i++) { + zend_ast *arg_ast = zend_ast_create_zval(&attribute->args[i].value); + if (attribute->args[i].name) { + arg_ast = zend_ast_create(ZEND_AST_NAMED_ARG, + zend_ast_create_zval_from_str( + zend_string_copy(attribute->args[i].name)), + arg_ast); + } + args_ast = zend_ast_list_add(args_ast, arg_ast); + } + } else { + args_ast = NULL; + } + return zend_ast_create(ZEND_AST_ATTRIBUTE, + zend_ast_create_zval_from_str(zend_string_copy(attribute->name)), + args_ast); +} + +static zend_ast *zp_param_attributes_to_ast(zend_function *function, + uint32_t offset) +{ + zend_ast *attributes_ast = NULL; + if (!function->common.attributes) { + return NULL; + } + + /* Inherit the SensitiveParameter attribute */ + zend_attribute *attr = zend_get_parameter_attribute_str( + function->common.attributes, + "sensitiveparameter", strlen("sensitiveparameter"), offset); + if (attr) { + attributes_ast = zend_ast_create_list(1, ZEND_AST_ATTRIBUTE_GROUP, + zp_attribute_to_ast(attr)); + attributes_ast = zend_ast_create_list(1, ZEND_AST_ATTRIBUTE_LIST, + attributes_ast); + } + + return attributes_ast; +} + +static zend_string *zp_pfa_name(const zend_op_array *declaring_op_array, + const zend_op *declaring_opline) +{ + zend_string *filename = declaring_op_array->filename; + uint32_t start_lineno = declaring_opline->lineno; + + zend_string *class = zend_empty_string; + zend_string *separator = zend_empty_string; + zend_string *function = filename; + const char *parens = ""; + + if (declaring_op_array->function_name) { + if (declaring_op_array->fn_flags & ZEND_ACC_CLOSURE) { + /* If the parent function is a closure, don't redundantly + * add the classname and parentheses. + */ + function = declaring_op_array->function_name; + } else { + function = declaring_op_array->function_name; + parens = "()"; + + if (declaring_op_array->scope && declaring_op_array->scope->name) { + class = declaring_op_array->scope->name; + separator = ZSTR_KNOWN(ZEND_STR_PAAMAYIM_NEKUDOTAYIM); + } + } + } + + zend_string *name = zend_strpprintf_unchecked( + 0, + "{closure:pfa:%S%S%S%s:%" PRIu32 "}", + class, + separator, + function, + parens, + start_lineno + ); + + return name; +} + +/* Generate the AST for calling the actual function */ +static zend_ast *zp_compile_forwarding_call( + zval *this_ptr, zend_function *function, + uint32_t argc, zval *argv, zend_array *extra_named_params, + zend_string **param_names, bool variadic_partial, uint32_t num_args, + zend_class_entry *called_scope, zend_type return_type, + bool forward_superfluous_args, + zend_ast *stmts_ast) +{ + bool is_assert = zend_string_equals(function->common.function_name, + ZSTR_KNOWN(ZEND_STR_ASSERT)); + + zend_ast *args_ast = zend_ast_create_list(0, ZEND_AST_ARG_LIST); + zend_ast *call_ast = NULL; + + if (is_assert) { + /* We are going to call assert() dynamically (via call_user_func), + * otherwise assert() would print the generated AST on failure, which is + * irrelevant. */ + args_ast = zend_ast_list_add(args_ast, + zend_ast_create_zval_from_str(ZSTR_KNOWN(ZEND_STR_ASSERT))); + } + + for (uint32_t offset = 0; offset < argc; offset++) { + if (Z_ISUNDEF(argv[offset])) { + /* Argument was not passed. Pass its default value. */ + if (offset < function->common.required_num_args) { + /* Required param was not passed. This can happen due to named + * args. Using the same exception CE and message as + * zend_handle_undef_args(). */ + zp_argument_error(zend_ce_argument_count_error, function, + offset + 1, "not passed"); + goto error; + } + zval default_value; + if (zp_get_param_default_value(&default_value, function, offset) == FAILURE) { + ZEND_ASSERT(EG(exception)); + goto error; + } + zend_ast *default_value_ast; + if (Z_TYPE(default_value) == IS_CONSTANT_AST) { + default_value_ast = zend_ast_dup(Z_ASTVAL(default_value)); + } else { + default_value_ast = zend_ast_create_zval(&default_value); + } + args_ast = zend_ast_list_add(args_ast, default_value_ast); + } else { + args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_VAR, + zend_ast_create_zval_from_str(zend_string_copy(param_names[offset])))); + } + } + if (extra_named_params) { + args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_UNPACK, + zend_ast_create(ZEND_AST_VAR, + zend_ast_create_zval_from_str(zend_string_copy(param_names[argc + variadic_partial]))))); + } + if (variadic_partial) { + if (function->common.fn_flags & ZEND_ACC_VARIADIC) { + args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_UNPACK, + zend_ast_create(ZEND_AST_VAR, + zend_ast_create_zval_from_str(zend_string_copy(param_names[argc]))))); + } else if (forward_superfluous_args) { + /* When a '...' placeholder is used, and the underlying function is + * not variadic, superfluous arguments are forwarded. + * Add a ...array_slice(func_get_args(), n) argument, which should + * be compiled as ZEND_AST_UNPACK + ZEND_FUNC_GET_ARGS. */ + + zend_ast *func_get_args_name_ast = zend_ast_create_zval_from_str( + zend_string_copy(ZSTR_KNOWN(ZEND_STR_FUNC_GET_ARGS))); + func_get_args_name_ast->attr = ZEND_NAME_FQ; + + zend_ast *array_slice_name_ast = zend_ast_create_zval_from_str( + zend_string_copy(ZSTR_KNOWN(ZEND_STR_ARRAY_SLICE))); + array_slice_name_ast->attr = ZEND_NAME_FQ; + + args_ast = zend_ast_list_add(args_ast, + zend_ast_create(ZEND_AST_UNPACK, + zend_ast_create(ZEND_AST_CALL, + array_slice_name_ast, + zend_ast_create_list(2, ZEND_AST_ARG_LIST, + zend_ast_create(ZEND_AST_CALL, + func_get_args_name_ast, + zend_ast_create_list(0, ZEND_AST_ARG_LIST)), + zend_ast_create_zval_from_long(num_args))))); + } + } + + if (is_assert) { + zend_ast *func_name_ast = zend_ast_create_zval_from_str(ZSTR_KNOWN(ZEND_STR_CALL_USER_FUNC)); + func_name_ast->attr = ZEND_NAME_FQ; + call_ast = zend_ast_create(ZEND_AST_CALL, func_name_ast, args_ast); + } else if (function->common.fn_flags & ZEND_ACC_CLOSURE) { + zend_ast *fn_ast = zend_ast_create(ZEND_AST_VAR, + zend_ast_create_zval_from_str(zend_string_copy(param_names[argc + variadic_partial + (extra_named_params != NULL)]))); + call_ast = zend_ast_create(ZEND_AST_CALL, fn_ast, args_ast); + } else if (Z_TYPE_P(this_ptr) == IS_OBJECT) { + zend_ast *this_ast = zend_ast_create(ZEND_AST_VAR, + zend_ast_create_zval_from_str(ZSTR_KNOWN(ZEND_STR_THIS))); + zend_ast *method_name_ast = zend_ast_create_zval_from_str( + zend_string_copy(function->common.function_name)); + call_ast = zend_ast_create(ZEND_AST_METHOD_CALL, this_ast, + method_name_ast, args_ast); + } else if (called_scope) { + zend_ast *class_name_ast = zend_ast_create_zval_from_str(ZSTR_KNOWN(ZEND_STR_STATIC)); + class_name_ast->attr = ZEND_NAME_NOT_FQ; + zend_ast *method_name_ast = zend_ast_create_zval_from_str( + zend_string_copy(function->common.function_name)); + call_ast = zend_ast_create(ZEND_AST_STATIC_CALL, class_name_ast, + method_name_ast, args_ast); + } else { + zend_ast *func_name_ast = zend_ast_create_zval_from_str(zend_string_copy(function->common.function_name)); + func_name_ast->attr = ZEND_NAME_FQ; + call_ast = zend_ast_create(ZEND_AST_CALL, func_name_ast, args_ast); + } + + /* Void functions can not 'return $expr' */ + if (ZEND_TYPE_FULL_MASK(return_type) & MAY_BE_VOID) { + stmts_ast = zend_ast_list_add(stmts_ast, call_ast); + } else { + zend_ast *return_ast = zend_ast_create(ZEND_AST_RETURN, call_ast); + stmts_ast = zend_ast_list_add(stmts_ast, return_ast); + } + + return stmts_ast; + +error: + zend_ast_destroy(args_ast); + zend_ast_destroy(call_ast); + return NULL; +} + +static uint32_t zp_compute_num_required(zend_function *function, + uint32_t orig_offset, uint32_t new_offset, uint32_t num_required) { + if (orig_offset < function->common.num_args) { + if (orig_offset < function->common.required_num_args) { + num_required = MAX(num_required, new_offset + 1); + } + } else { + ZEND_ASSERT(function->common.fn_flags & ZEND_ACC_VARIADIC); + /* Placeholders that run into the variadic portion become + * required and make all params before them required */ + ZEND_ASSERT(orig_offset >= num_required); + num_required = new_offset + 1; + } + + return num_required; +} + +/* Functions that do not allow to be called dynamically */ +static const zend_known_string_id zp_non_dynamic_call_funcs[] = { + ZEND_STR_FUNC_GET_ARG, + ZEND_STR_COMPACT, + ZEND_STR_EXTRACT, + /* Omit nullary functions such as func_num_args(), as these can't be PFA'd*/ +}; + +static bool zp_is_non_dynamic_call_func(zend_function *function) +{ + for (int i = 0; i < sizeof(zp_non_dynamic_call_funcs) / sizeof(zp_non_dynamic_call_funcs[0]); i++) { + if (zend_string_equals(function->common.function_name, ZSTR_KNOWN(zp_non_dynamic_call_funcs[i]))) { + return true; + } + } + + return false; +} + +/* Compile PFA to an op_array */ +static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, + uint32_t argc, zval *argv, zend_array *extra_named_params, + const zend_array *named_positions, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, void **cache_slot, + bool uses_variadic_placeholder) { + + zend_op_array *op_array = NULL; + + if (UNEXPECTED(zp_is_non_dynamic_call_func(function))) { + zend_throw_error(NULL, "Cannot call %.*s() dynamically", + (int) ZSTR_LEN(function->common.function_name), ZSTR_VAL(function->common.function_name)); + return NULL; + } + + if (UNEXPECTED(zp_args_check(function, argc, argv, extra_named_params, uses_variadic_placeholder) != SUCCESS)) { + ZEND_ASSERT(EG(exception)); + return NULL; + } + + zend_class_entry *called_scope; + if (Z_TYPE_P(this_ptr) == IS_OBJECT) { + called_scope = Z_OBJCE_P(this_ptr); + } else { + called_scope = Z_CE_P(this_ptr); + } + + zend_arena *orig_ast_arena = CG(ast_arena); + CG(ast_arena) = zend_arena_create(1024 * 4); + + int orig_lineno = CG(zend_lineno); + CG(zend_lineno) = zend_get_executed_lineno(); + + int new_argc = argc; + + if (uses_variadic_placeholder) { + new_argc = MAX(new_argc, function->common.num_args); + } + + zval *tmp = zend_arena_alloc(&CG(ast_arena), new_argc * sizeof(zval)); + memcpy(tmp, argv, argc * sizeof(zval)); + argv = tmp; + + /* Compute number of required args and param positions, add implicit + * placeholders. + * + * Parameters are placed in the following order: + * - Positional placeholders + * - Then named placeholders in their syntax order + * - Then implicit placeholders added by '...' + */ + uint32_t num_params = 0; + uint32_t num_required = 0; + uint32_t *arg_to_param_offset_map = zend_arena_alloc(&CG(ast_arena), sizeof(uint32_t*) * new_argc); + { + uint32_t num_positional = 0; + + /* First, we handle explicit placeholders */ + for (uint32_t arg_offset = 0; arg_offset < argc; arg_offset++) { + if (!Z_IS_PLACEHOLDER_P(&argv[arg_offset])) { + continue; + } + + num_params++; + + zend_arg_info *arg_info = &function->common.arg_info[MIN(arg_offset, function->common.num_args)]; + zval *named_pos = named_positions ? zend_hash_find(named_positions, arg_info->name) : NULL; + uint32_t param_offset; + if (named_pos) { + /* Placeholder is sent as named arg. 'num_positional' can not + * change at this point. */ + param_offset = num_positional + Z_LVAL_P(named_pos); + } else { + /* Placeholder is sent as positional */ + param_offset = num_positional++; + } + + arg_to_param_offset_map[arg_offset] = param_offset; + + num_required = zp_compute_num_required(function, + arg_offset, param_offset, num_required); + } + + /* Handle implicit placeholders added by '...' */ + if (uses_variadic_placeholder) { + for (uint32_t arg_offset = 0; arg_offset < new_argc; arg_offset++) { + if (arg_offset < argc && !Z_ISUNDEF(argv[arg_offset])) { + continue; + } + + /* Unspecified parameters become placeholders */ + Z_TYPE_INFO(argv[arg_offset]) = _IS_PLACEHOLDER; + + num_params++; + + uint32_t param_offset = num_params - 1; + + arg_to_param_offset_map[arg_offset] = param_offset; + + num_required = zp_compute_num_required(function, + arg_offset, param_offset, num_required); + } + } + } + + argc = new_argc; + + /* Assign variable names */ + + uint32_t num_names = argc + uses_variadic_placeholder + (extra_named_params != NULL) + + ((function->common.fn_flags & ZEND_ACC_CLOSURE) != 0); + zend_string **param_names = zend_arena_calloc(&CG(ast_arena), + num_names, sizeof(zend_string*)); + memset(param_names, 0, sizeof(zend_string*) * num_names); + zp_assign_names(param_names, num_names, argc, argv, function, + uses_variadic_placeholder, extra_named_params); + + /* Generate AST */ + + zend_ast *lexical_vars_ast = zend_ast_create_list(0, ZEND_AST_CLOSURE_USES); + zend_ast *params_ast = zend_ast_create_list(0, ZEND_AST_ARG_LIST); + zend_ast *return_type_ast = NULL; + zend_ast *stmts_ast = zend_ast_create_list(0, ZEND_AST_STMT_LIST); + zend_ast *attributes_ast = NULL; + + /* Generate AST for params and lexical vars */ + { + /* The inner Closure, if any, is assumed to be the first lexical var by + * do_closure_bind(). */ + if (function->common.fn_flags & ZEND_ACC_CLOSURE) { + zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( + zend_string_copy(param_names[argc + uses_variadic_placeholder + (extra_named_params != NULL)])); + lexical_vars_ast = zend_ast_list_add(lexical_vars_ast, lexical_var_ast); + } + + zend_ast **params = zend_arena_calloc(&CG(ast_arena), num_params, sizeof(zend_ast*)); + for (uint32_t offset = 0; offset < argc; offset++) { + if (Z_IS_PLACEHOLDER_P(&argv[offset])) { + zend_arg_info *arg_info = &function->common.arg_info[MIN(offset, function->common.num_args)]; + + int param_flags = 0; + if (zp_arg_must_be_sent_by_ref(function, offset+1)) { + param_flags |= ZEND_PARAM_REF; + } + + uint32_t param_offset = arg_to_param_offset_map[offset]; + zend_ast *param_type_ast = zp_type_to_ast(arg_info->type); + zend_ast *default_value_ast = NULL; + if (param_offset >= num_required) { + zval default_value; + if (zp_get_param_default_value(&default_value, function, offset) == FAILURE) { + for (uint32_t i = 0; i < num_params; i++) { + zend_ast_destroy(params[i]); + } + goto error; + } + default_value_ast = zend_ast_create_zval(&default_value); + } + + ZEND_ASSERT(offset < function->common.num_args || (function->common.fn_flags & ZEND_ACC_VARIADIC)); + + zend_ast *attributes_ast = zp_param_attributes_to_ast(function, MIN(offset, function->common.num_args)); + params[param_offset] = zend_ast_create_ex(ZEND_AST_PARAM, + param_flags, param_type_ast, + zend_ast_create_zval_from_str( + zend_string_copy(param_names[offset])), + default_value_ast, attributes_ast, NULL, NULL); + + } else if (!Z_ISUNDEF(argv[offset])) { + // TODO: If the pre-bound parameter is a literal, it can be a + // literal in the function body instead of a lexical var. + zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( + zend_string_copy(param_names[offset])); + if (zp_arg_must_be_sent_by_ref(function, offset+1)) { + lexical_var_ast->attr = ZEND_BIND_REF; + } + lexical_vars_ast = zend_ast_list_add( + lexical_vars_ast, lexical_var_ast); + } + } + + for (uint32_t i = 0; i < num_params; i++) { + params_ast = zend_ast_list_add(params_ast, params[i]); + } + } + + if (extra_named_params) { + zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( + zend_string_copy(param_names[argc + uses_variadic_placeholder])); + lexical_vars_ast = zend_ast_list_add(lexical_vars_ast, lexical_var_ast); + } + + /* If we have a variadic placeholder and the underlying function is + * variadic, add a variadic param. */ + if (uses_variadic_placeholder + && (function->common.fn_flags & ZEND_ACC_VARIADIC)) { + zend_arg_info *arg_info = &function->common.arg_info[function->common.num_args]; + int param_flags = ZEND_PARAM_VARIADIC; + if (zp_arg_must_be_sent_by_ref(function, function->common.num_args+1)) { + param_flags |= ZEND_PARAM_REF; + } + zend_ast *param_type_ast = zp_type_to_ast(arg_info->type); + zend_ast *attributes_ast = zp_param_attributes_to_ast(function, function->common.num_args); + params_ast = zend_ast_list_add(params_ast, zend_ast_create_ex(ZEND_AST_PARAM, + param_flags, param_type_ast, + zend_ast_create_zval_from_str( + zend_string_copy(param_names[argc])), + NULL, attributes_ast, NULL, NULL)); + } + + zend_type return_type = {0}; + if (function->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { + return_type = (function->common.arg_info-1)->type; + return_type_ast = zp_type_to_ast(return_type); + } + + /** + * Generate function body. + * + * If we may need to forward superflous arguments, do that conditionally, as + * it's faster: + * + * if (func_num_args() <= n) { + * // normal call + * } else { + * // call with superflous arg forwarding + * } + * + * The func_num_args() call should be compiled to a single FUNC_NUM_ARGS op. + */ + + if (uses_variadic_placeholder && !(function->common.fn_flags & ZEND_ACC_VARIADIC)) { + zend_ast *no_forwarding_ast = zend_ast_create_list(0, ZEND_AST_STMT_LIST); + zend_ast *forwarding_ast = zend_ast_create_list(0, ZEND_AST_STMT_LIST); + + no_forwarding_ast = zp_compile_forwarding_call(this_ptr, function, + argc, argv, extra_named_params, + param_names, uses_variadic_placeholder, num_params, + called_scope, return_type, false, no_forwarding_ast); + + if (!no_forwarding_ast) { + ZEND_ASSERT(EG(exception)); + goto error; + } + + forwarding_ast = zp_compile_forwarding_call(this_ptr, function, + argc, argv, extra_named_params, + param_names, uses_variadic_placeholder, num_params, + called_scope, return_type, true, forwarding_ast); + + if (!forwarding_ast) { + ZEND_ASSERT(EG(exception)); + zend_ast_destroy(no_forwarding_ast); + goto error; + } + + zend_ast *func_num_args_name_ast = zend_ast_create_zval_from_str( + zend_string_copy(ZSTR_KNOWN(ZEND_STR_FUNC_NUM_ARGS))); + func_num_args_name_ast->attr = ZEND_NAME_FQ; + + stmts_ast = zend_ast_list_add(stmts_ast, + zend_ast_create_list(2, ZEND_AST_IF, + zend_ast_create(ZEND_AST_IF_ELEM, + zend_ast_create_binary_op(ZEND_IS_SMALLER_OR_EQUAL, + zend_ast_create(ZEND_AST_CALL, func_num_args_name_ast, + zend_ast_create_list(0, ZEND_AST_ARG_LIST)), + zend_ast_create_zval_from_long(num_params)), + no_forwarding_ast), + zend_ast_create(ZEND_AST_IF_ELEM, + NULL, + forwarding_ast))); + } else { + stmts_ast = zp_compile_forwarding_call(this_ptr, function, + argc, argv, extra_named_params, + param_names, uses_variadic_placeholder, num_params, + called_scope, return_type, false, stmts_ast); + + if (!stmts_ast) { + ZEND_ASSERT(EG(exception)); + goto error; + } + } + + /* Inherit the NoDiscard attribute */ + if (function->common.attributes) { + zend_attribute *attr = zend_get_attribute_str( + function->common.attributes, "nodiscard", strlen("nodiscard")); + if (attr) { + attributes_ast = zend_ast_create_list(1, ZEND_AST_ATTRIBUTE_GROUP, + zp_attribute_to_ast(attr)); + attributes_ast = zend_ast_create_list(1, ZEND_AST_ATTRIBUTE_LIST, + attributes_ast); + } + } + + int closure_flags = function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE; + zend_ast *closure_ast = zend_ast_create_decl(ZEND_AST_CLOSURE, + closure_flags, CG(zend_lineno), NULL, + NULL, params_ast, lexical_vars_ast, stmts_ast, + return_type_ast, attributes_ast); + + if (Z_TYPE_P(this_ptr) != IS_OBJECT || IS_STATIC_CLOSURE(function)) { + ((zend_ast_decl*)closure_ast)->flags |= ZEND_ACC_STATIC; + } + +#if ZEND_DEBUG + { + const char *tmp = getenv("DUMP_PFA_AST"); + if (tmp && ZEND_ATOL(tmp)) { + zend_string *str = zend_ast_export("", closure_ast, ""); + fprintf(stderr, "PFA AST: %s\n", ZSTR_VAL(str)); + zend_string_release(str); + } + } +#endif + + zend_string *pfa_name = zp_pfa_name(declaring_op_array, declaring_opline); + + op_array = zend_accel_compile_pfa(closure_ast, declaring_op_array, + declaring_opline, function, pfa_name); + + zend_ast_destroy(closure_ast); + +clean: + for (uint32_t i = 0; i < num_names; i++) { + if (param_names[i]) { + zend_string_release(param_names[i]); + } + } + + zend_arena_destroy(CG(ast_arena)); + CG(ast_arena) = orig_ast_arena; + CG(zend_lineno) = orig_lineno; + + return op_array; + +error: + zend_ast_destroy(lexical_vars_ast); + zend_ast_destroy(params_ast); + zend_ast_destroy(return_type_ast); + zend_ast_destroy(stmts_ast); + zend_ast_destroy(attributes_ast); + goto clean; +} + +static zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function, + uint32_t argc, zval *argv, zend_array *extra_named_params, + const zend_array *named_positions, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, void **cache_slot, + bool uses_variadic_placeholder) { + + if (EXPECTED(function->type == ZEND_INTERNAL_FUNCTION + ? cache_slot[0] == function + : cache_slot[0] == function->op_array.opcodes)) { + return cache_slot[1]; + } + + zend_op_array *op_array = zend_accel_pfa_cache_get(declaring_op_array, + declaring_opline, function); + + if (UNEXPECTED(!op_array)) { + op_array = zp_compile(this_ptr, function, argc, argv, + extra_named_params, named_positions, declaring_op_array, declaring_opline, + cache_slot, uses_variadic_placeholder); + } + + if (EXPECTED(op_array) && !(function->common.fn_flags & ZEND_ACC_NEVER_CACHE)) { + cache_slot[0] = function->type == ZEND_INTERNAL_FUNCTION + ? (void*)function + : (void*)function->op_array.opcodes; + cache_slot[1] = op_array; + } + + return op_array; +} + +/* Bind pre-bound arguments as lexical vars */ +static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval *argv, + zend_array *extra_named_params) { + + zend_arg_info *arg_infos = function->common.arg_info; + uint32_t bind_offset = 0; + + if (function->common.fn_flags & ZEND_ACC_CLOSURE) { + zval var; + ZVAL_OBJ(&var, ZEND_CLOSURE_OBJECT(function)); + Z_ADDREF(var); + zend_closure_bind_var_ex(result, bind_offset, &var); + bind_offset += sizeof(Bucket); + } + + for (uint32_t offset = 0; offset < argc; offset++) { + zval *var = &argv[offset]; + if (Z_IS_PLACEHOLDER_P(var) || Z_ISUNDEF_P(var)) { + continue; + } + zend_arg_info *arg_info; + if (offset < function->common.num_args) { + arg_info = &arg_infos[offset]; + } else if (function->common.fn_flags & ZEND_ACC_VARIADIC) { + arg_info = &arg_infos[function->common.num_args]; + } else { + arg_info = NULL; + } + if (arg_info && ZEND_TYPE_IS_SET(arg_info->type) + && UNEXPECTED(!zend_check_type_ex(&arg_info->type, var, function->common.scope, 0, 0))) { + zend_verify_arg_error(function, arg_info, offset+1, var); + zval_ptr_dtor(result); + ZVAL_NULL(result); + return; + } + ZEND_ASSERT(zp_arg_must_be_sent_by_ref(function, offset+1) ? Z_ISREF_P(var) : !Z_ISREF_P(var)); + zend_closure_bind_var_ex(result, bind_offset, var); + bind_offset += sizeof(Bucket); + } + + if (extra_named_params) { + zval var; + ZVAL_ARR(&var, extra_named_params); + Z_ADDREF(var); + zend_closure_bind_var_ex(result, bind_offset, &var); + } +} + +void zend_partial_create(zval *result, zval *this_ptr, zend_function *function, + uint32_t argc, zval *argv, zend_array *extra_named_params, + const zend_array *named_positions, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, void **cache_slot, + bool uses_variadic_placeholder) { + + zend_op_array *op_array = zp_get_op_array(this_ptr, function, argc, argv, + extra_named_params, named_positions, + declaring_op_array, declaring_opline, + cache_slot, uses_variadic_placeholder); + + if (UNEXPECTED(!op_array)) { + ZEND_ASSERT(EG(exception)); + ZVAL_NULL(result); + return; + } + + zend_class_entry *called_scope; + zval object; + + if (Z_TYPE_P(this_ptr) == IS_OBJECT) { + called_scope = Z_OBJCE_P(this_ptr); + } else { + called_scope = Z_CE_P(this_ptr); + } + + if (Z_TYPE_P(this_ptr) == IS_OBJECT && !IS_STATIC_CLOSURE(function)) { + ZVAL_COPY_VALUE(&object, this_ptr); + } else { + ZVAL_UNDEF(&object); + } + + zend_create_partial_closure(result, (zend_function*)op_array, + function->common.scope, called_scope, &object, + (function->common.fn_flags & ZEND_ACC_CLOSURE) != 0); + + zp_bind(result, function, argc, argv, extra_named_params); +} + +void zend_partial_op_array_dtor(zval *pDest) +{ + destroy_op_array(Z_PTR_P(pDest)); +} diff --git a/Zend/zend_partial.h b/Zend/zend_partial.h new file mode 100644 index 000000000000..7999dc99019c --- /dev/null +++ b/Zend/zend_partial.h @@ -0,0 +1,34 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ +*/ +#ifndef ZEND_PARTIAL_H +#define ZEND_PARTIAL_H + +#include "zend_compile.h" + +BEGIN_EXTERN_C() + +void zend_partial_create(zval *result, zval *this_ptr, zend_function *function, + uint32_t argc, zval *argv, zend_array *extra_named_params, + const zend_array *named_positions, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, void **cache_slot, + bool uses_variadic_placeholder); + +void zend_partial_op_array_dtor(zval *pDest); + +END_EXTERN_C() + +#endif diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 430f4dec02e2..512b7f429733 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -630,6 +630,14 @@ default: ZEND_UNREACHABLE(); _(ZEND_STR_AUTOGLOBAL_ENV, "_ENV") \ _(ZEND_STR_AUTOGLOBAL_REQUEST, "_REQUEST") \ _(ZEND_STR_COUNT, "count") \ + _(ZEND_STR_FUNC_NUM_ARGS, "func_num_args") \ + _(ZEND_STR_FUNC_GET_ARGS, "func_get_args") \ + _(ZEND_STR_FUNC_GET_ARG, "func_get_arg") \ + _(ZEND_STR_COMPACT, "compact") \ + _(ZEND_STR_EXTRACT, "extract") \ + _(ZEND_STR_ASSERT, "assert") \ + _(ZEND_STR_CALL_USER_FUNC, "call_user_func") \ + _(ZEND_STR_ARRAY_SLICE, "array_slice") \ _(ZEND_STR_SENSITIVEPARAMETER, "SensitiveParameter") \ _(ZEND_STR_CONST_EXPR_PLACEHOLDER, "[constant expression]") \ _(ZEND_STR_DEPRECATED_CAPITALIZED, "Deprecated") \ diff --git a/Zend/zend_types.h b/Zend/zend_types.h index dc6ea2c800ee..06ee60f8627b 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -857,6 +857,8 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) { #define IS_OBJ_LAZY_UNINITIALIZED (1U<<31) /* Virtual proxy or uninitialized Ghost */ #define IS_OBJ_LAZY_PROXY (1U<<30) /* Virtual proxy (may be initialized) */ +#define OBJ_EXTRA_FLAG_PRIV_1 (1U<<29) /* Reserved for private use by the object itself */ +#define OBJ_EXTRA_FLAG_PRIV_2 (1U<<28) /* Reserved for private use by the object itself */ #define OBJ_EXTRA_FLAGS(obj) ((obj)->extra_flags) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 1f7e09d1be35..f7894faa477a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5723,6 +5723,30 @@ ZEND_VM_HELPER(zend_verify_recv_arg_type_helper, ANY, ANY, zval *op_1) ZEND_VM_NEXT_OPCODE(); } +ZEND_VM_HANDLER(213, ZEND_SEND_PLACEHOLDER, UNUSED, CONST|UNUSED) +{ + zval *arg; + + if (OP2_TYPE == IS_CONST) { + /* Named placeholder */ + USE_OPLINE + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + HANDLE_EXCEPTION(); + } + } else { + /* Positional placeholder */ + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + Z_TYPE_INFO_P(arg) = _IS_PLACEHOLDER; + + ZEND_VM_NEXT_OPCODE(); +} + ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED) { USE_OPLINE @@ -9838,6 +9862,45 @@ ZEND_VM_HANDLER(202, ZEND_CALLABLE_CONVERT, UNUSED, UNUSED, NUM|CACHE_SLOT) ZEND_VM_NEXT_OPCODE(); } +ZEND_VM_HANDLER(212, ZEND_CALLABLE_CONVERT_PARTIAL, CACHE_SLOT, CONST|UNUSED, NUM) +{ + USE_OPLINE + SAVE_OPLINE(); + + zend_execute_data *call = EX(call); + void **cache_slot = CACHE_ADDR(opline->op1.num); + zval *named_positions = GET_OP2_ZVAL_PTR(); + + zend_partial_create(EX_VAR(opline->result.var), + &call->This, call->func, + ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), + ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + call->extra_named_params : NULL, + OP2_TYPE == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, + &EX(func)->op_array, opline, cache_slot, + opline->extended_value & ZEND_FCALL_USES_VARIADIC_PLACEHOLDER); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_array_release(call->extra_named_params); + } + + if ((call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + zend_free_trampoline(call->func); + } + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } else if (ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(call->func)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + ZEND_VM_HANDLER(208, ZEND_JMP_FRAMELESS, CONST, JMP_ADDR, NUM|CACHE_SLOT) { USE_OPLINE diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d5860da23b4c..921c9e1bc460 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4262,6 +4262,45 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_R ZEND_VM_NEXT_OPCODE(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + SAVE_OPLINE(); + + zend_execute_data *call = EX(call); + void **cache_slot = CACHE_ADDR(opline->op1.num); + zval *named_positions = RT_CONSTANT(opline, opline->op2); + + zend_partial_create(EX_VAR(opline->result.var), + &call->This, call->func, + ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), + ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + call->extra_named_params : NULL, + IS_CONST == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, + &EX(func)->op_array, opline, cache_slot, + opline->extended_value & ZEND_FCALL_USES_VARIADIC_PLACEHOLDER); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_array_release(call->extra_named_params); + } + + if ((call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + zend_free_trampoline(call->func); + } + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } else if (ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(call->func)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_INIT_DYNAMIC_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -4406,6 +4445,45 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_RECV_VARIADIC ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + SAVE_OPLINE(); + + zend_execute_data *call = EX(call); + void **cache_slot = CACHE_ADDR(opline->op1.num); + zval *named_positions = NULL; + + zend_partial_create(EX_VAR(opline->result.var), + &call->This, call->func, + ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), + ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + call->extra_named_params : NULL, + IS_UNUSED == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, + &EX(func)->op_array, opline, cache_slot, + opline->extended_value & ZEND_FCALL_USES_VARIADIC_PLACEHOLDER); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_array_release(call->extra_named_params); + } + + if ((call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + zend_free_trampoline(call->func); + } + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } else if (ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(call->func)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FRAMELESS_ICALL_1_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -34452,6 +34530,30 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CHECK_FUNC_AR ZEND_VM_NEXT_OPCODE(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *arg; + + if (IS_CONST == IS_CONST) { + /* Named placeholder */ + USE_OPLINE + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + HANDLE_EXCEPTION(); + } + } else { + /* Positional placeholder */ + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + Z_TYPE_INFO_P(arg) = _IS_PLACEHOLDER; + + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -37076,6 +37178,30 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_C ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *arg; + + if (IS_UNUSED == IS_CONST) { + /* Named placeholder */ + USE_OPLINE + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + HANDLE_EXCEPTION(); + } + } else { + /* Positional placeholder */ + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + Z_TYPE_INFO_P(arg) = _IS_PLACEHOLDER; + + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_NEW_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -56920,6 +57046,45 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_RECV_I ZEND_VM_NEXT_OPCODE(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + SAVE_OPLINE(); + + zend_execute_data *call = EX(call); + void **cache_slot = CACHE_ADDR(opline->op1.num); + zval *named_positions = RT_CONSTANT(opline, opline->op2); + + zend_partial_create(EX_VAR(opline->result.var), + &call->This, call->func, + ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), + ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + call->extra_named_params : NULL, + IS_CONST == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, + &EX(func)->op_array, opline, cache_slot, + opline->extended_value & ZEND_FCALL_USES_VARIADIC_PLACEHOLDER); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_array_release(call->extra_named_params); + } + + if ((call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + zend_free_trampoline(call->func); + } + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } else if (ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(call->func)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_INIT_DYNAMIC_CALL_SPEC_TMP_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -57064,6 +57229,45 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_RECV_VARIADIC_SPEC ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + SAVE_OPLINE(); + + zend_execute_data *call = EX(call); + void **cache_slot = CACHE_ADDR(opline->op1.num); + zval *named_positions = NULL; + + zend_partial_create(EX_VAR(opline->result.var), + &call->This, call->func, + ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), + ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + call->extra_named_params : NULL, + IS_UNUSED == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, + &EX(func)->op_array, opline, cache_slot, + opline->extended_value & ZEND_FCALL_USES_VARIADIC_PLACEHOLDER); + + if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { + zend_array_release(call->extra_named_params); + } + + if ((call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + zend_free_trampoline(call->func); + } + + if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) { + OBJ_RELEASE(Z_OBJ(call->This)); + } else if (ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE) { + OBJ_RELEASE(ZEND_CLOSURE_OBJECT(call->func)); + } + + EX(call) = call->prev_execute_data; + + zend_vm_stack_free_call_frame(call); + + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FRAMELESS_ICALL_1_SPEC_UNUSED_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -86908,6 +87112,30 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CHECK_FUNC_ARG_SPE ZEND_VM_NEXT_OPCODE(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *arg; + + if (IS_CONST == IS_CONST) { + /* Named placeholder */ + USE_OPLINE + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + HANDLE_EXCEPTION(); + } + } else { + /* Positional placeholder */ + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + Z_TYPE_INFO_P(arg) = _IS_PLACEHOLDER; + + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -89532,6 +89760,30 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CHECK_ ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } +static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + zval *arg; + + if (IS_UNUSED == IS_CONST) { + /* Named placeholder */ + USE_OPLINE + SAVE_OPLINE(); + zend_string *arg_name = Z_STR_P(RT_CONSTANT(opline, opline->op2)); + uint32_t arg_num; + arg = zend_handle_named_arg(&EX(call), arg_name, &arg_num, CACHE_ADDR(opline->result.num)); + if (UNEXPECTED(!arg)) { + HANDLE_EXCEPTION(); + } + } else { + /* Positional placeholder */ + arg = ZEND_CALL_VAR(EX(call), opline->result.var); + } + + Z_TYPE_INFO_P(arg) = _IS_PLACEHOLDER; + + ZEND_VM_NEXT_OPCODE(); +} + static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_NEW_SPEC_UNUSED_UNUSED_TAILCALL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -109213,6 +109465,16 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED_LABEL, (void*)&&ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_LABEL, (void*)&&ZEND_TYPE_ASSERT_SPEC_CONST_LABEL, + (void*)&&ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_NULL_LABEL, + (void*)&&ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_LABEL, + (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_INIT_FCALL_OFFSET_SPEC_CONST_LABEL, (void*)&&ZEND_RECV_NOTYPE_SPEC_LABEL, (void*)&&ZEND_NULL_LABEL, @@ -110617,6 +110879,11 @@ ZEND_API void execute_ex(zend_execute_data *ex) ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); VM_TRACE_OP_END(ZEND_RECV_INIT_SPEC_CONST) HYBRID_BREAK(); + HYBRID_CASE(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST): + VM_TRACE(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST) + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + VM_TRACE_OP_END(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST) + HYBRID_BREAK(); HYBRID_CASE(ZEND_INIT_DYNAMIC_CALL_SPEC_TMP): VM_TRACE(ZEND_INIT_DYNAMIC_CALL_SPEC_TMP) ZEND_INIT_DYNAMIC_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -110632,6 +110899,11 @@ ZEND_API void execute_ex(zend_execute_data *ex) ZEND_RECV_VARIADIC_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); VM_TRACE_OP_END(ZEND_RECV_VARIADIC_SPEC_UNUSED) HYBRID_BREAK(); + HYBRID_CASE(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED): + VM_TRACE(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED) + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + VM_TRACE_OP_END(ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED) + HYBRID_BREAK(); HYBRID_CASE(ZEND_FRAMELESS_ICALL_1_SPEC_UNUSED): VM_TRACE(ZEND_FRAMELESS_ICALL_1_SPEC_UNUSED) ZEND_FRAMELESS_ICALL_1_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -113855,6 +114127,11 @@ ZEND_API void execute_ex(zend_execute_data *ex) ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); VM_TRACE_OP_END(ZEND_CHECK_FUNC_ARG_SPEC_UNUSED_CONST) HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST): + VM_TRACE(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST) + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + VM_TRACE_OP_END(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST) + HYBRID_BREAK(); HYBRID_CASE(ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST): VM_TRACE(ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST) ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -114035,6 +114312,11 @@ ZEND_API void execute_ex(zend_execute_data *ex) ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); VM_TRACE_OP_END(ZEND_CHECK_UNDEF_ARGS_SPEC_UNUSED_UNUSED) HYBRID_BREAK(); + HYBRID_CASE(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED): + VM_TRACE(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED) + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + VM_TRACE_OP_END(ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED) + HYBRID_BREAK(); HYBRID_CASE(ZEND_NEW_SPEC_UNUSED_UNUSED): VM_TRACE(ZEND_NEW_SPEC_UNUSED_UNUSED) ZEND_NEW_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -118151,6 +118433,16 @@ void zend_vm_init(void) ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED_HANDLER, ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_HANDLER, ZEND_TYPE_ASSERT_SPEC_CONST_HANDLER, + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_HANDLER, + ZEND_NULL_HANDLER, + ZEND_NULL_HANDLER, + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_HANDLER, + ZEND_NULL_HANDLER, ZEND_INIT_FCALL_OFFSET_SPEC_CONST_HANDLER, ZEND_RECV_NOTYPE_SPEC_HANDLER, ZEND_NULL_HANDLER, @@ -121629,6 +121921,16 @@ void zend_vm_init(void) ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED_TAILCALL_HANDLER, ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST_TAILCALL_HANDLER, ZEND_TYPE_ASSERT_SPEC_CONST_TAILCALL_HANDLER, + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, + ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, + ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED_TAILCALL_HANDLER, + ZEND_NULL_TAILCALL_HANDLER, ZEND_INIT_FCALL_OFFSET_SPEC_CONST_TAILCALL_HANDLER, ZEND_RECV_NOTYPE_SPEC_TAILCALL_HANDLER, ZEND_NULL_TAILCALL_HANDLER, @@ -122597,7 +122899,7 @@ void zend_vm_init(void) 1255, 1256 | SPEC_RULE_OP1, 1261 | SPEC_RULE_OP1, - 3474, + 3484, 1266 | SPEC_RULE_OP1, 1271 | SPEC_RULE_OP1, 1276 | SPEC_RULE_OP2, @@ -122631,7 +122933,7 @@ void zend_vm_init(void) 1559 | SPEC_RULE_OP1 | SPEC_RULE_OP2, 1584 | SPEC_RULE_OP1, 1589, - 3474, + 3484, 1590 | SPEC_RULE_OP1, 1595 | SPEC_RULE_OP1 | SPEC_RULE_OP2, 1620 | SPEC_RULE_OP1 | SPEC_RULE_OP2, @@ -122764,50 +123066,50 @@ void zend_vm_init(void) 2556, 2557, 2558, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, - 3474, + 2559 | SPEC_RULE_OP2, + 2564 | SPEC_RULE_OP2, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, + 3484, }; #if 0 #elif (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) @@ -122984,7 +123286,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2567 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2577 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -122992,7 +123294,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2592 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2602 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -123000,7 +123302,7 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2617 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2627 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; if (op->op1_type < op->op2_type) { zend_swap_operands(op); } @@ -123011,17 +123313,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2642 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2652 | SPEC_RULE_OP1 | SPEC_RULE_OP2; } else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2667 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2677 | SPEC_RULE_OP1 | SPEC_RULE_OP2; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2692 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 2702 | SPEC_RULE_OP1 | SPEC_RULE_OP2; } break; case ZEND_MUL: @@ -123032,17 +123334,17 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2717 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2727 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2742 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2752 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2767 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 2777 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_IDENTICAL: @@ -123053,16 +123355,16 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2792 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2802 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2867 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2877 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op->op2_type == IS_CONST && (Z_TYPE_P(RT_CONSTANT(op, op->op2)) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(RT_CONSTANT(op, op->op2))) == 0)) { - spec = 3092 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3102 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) { - spec = 3098 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 3108 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_NOT_IDENTICAL: @@ -123073,16 +123375,16 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2942 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2952 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3017 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3027 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op->op2_type == IS_CONST && (Z_TYPE_P(RT_CONSTANT(op, op->op2)) == IS_ARRAY && zend_hash_num_elements(Z_ARR_P(RT_CONSTANT(op, op->op2))) == 0)) { - spec = 3095 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3105 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op->op1_type == IS_CV && (op->op2_type & (IS_CONST|IS_CV)) && !(op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) && !(op2_info & (MAY_BE_UNDEF|MAY_BE_REF))) { - spec = 3103 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; + spec = 3113 | SPEC_RULE_OP2 | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_EQUAL: @@ -123093,12 +123395,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2792 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2802 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2867 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2877 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_NOT_EQUAL: @@ -123109,12 +123411,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 2942 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 2952 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3017 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; + spec = 3027 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH | SPEC_RULE_COMMUTATIVE; } break; case ZEND_IS_SMALLER: @@ -123122,12 +123424,12 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3108 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3118 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3183 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3193 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } break; case ZEND_IS_SMALLER_OR_EQUAL: @@ -123135,79 +123437,79 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3258 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3268 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } else if (op1_info == MAY_BE_DOUBLE && op2_info == MAY_BE_DOUBLE) { if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3333 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; + spec = 3343 | SPEC_RULE_OP1 | SPEC_RULE_OP2 | SPEC_RULE_SMART_BRANCH; } break; case ZEND_QM_ASSIGN: if (op1_info == MAY_BE_LONG) { - spec = 3420 | SPEC_RULE_OP1; + spec = 3430 | SPEC_RULE_OP1; } else if (op1_info == MAY_BE_DOUBLE) { - spec = 3425 | SPEC_RULE_OP1; + spec = 3435 | SPEC_RULE_OP1; } else if ((op->op1_type == IS_CONST) ? !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1)) : (!(op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE))))) { - spec = 3430 | SPEC_RULE_OP1; + spec = 3440 | SPEC_RULE_OP1; } break; case ZEND_PRE_INC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3408 | SPEC_RULE_RETVAL; + spec = 3418 | SPEC_RULE_RETVAL; } else if (op1_info == MAY_BE_LONG) { - spec = 3410 | SPEC_RULE_RETVAL; + spec = 3420 | SPEC_RULE_RETVAL; } break; case ZEND_PRE_DEC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3412 | SPEC_RULE_RETVAL; + spec = 3422 | SPEC_RULE_RETVAL; } else if (op1_info == MAY_BE_LONG) { - spec = 3414 | SPEC_RULE_RETVAL; + spec = 3424 | SPEC_RULE_RETVAL; } break; case ZEND_POST_INC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3416; + spec = 3426; } else if (op1_info == MAY_BE_LONG) { - spec = 3417; + spec = 3427; } break; case ZEND_POST_DEC: if (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG) { - spec = 3418; + spec = 3428; } else if (op1_info == MAY_BE_LONG) { - spec = 3419; + spec = 3429; } break; case ZEND_JMP: if (OP_JMP_ADDR(op, op->op1) > op) { - spec = 2566; + spec = 2576; } break; case ZEND_INIT_FCALL: if (Z_EXTRA_P(RT_CONSTANT(op, op->op2)) != 0) { - spec = 2559; + spec = 2569; } break; case ZEND_RECV: if (op->op2.num == MAY_BE_ANY) { - spec = 2560; + spec = 2570; } break; case ZEND_SEND_VAL: if (op->op1_type == IS_CONST && op->op2_type == IS_UNUSED && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) { - spec = 3470; + spec = 3480; } break; case ZEND_SEND_VAR_EX: if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) { - spec = 3465 | SPEC_RULE_OP1; + spec = 3475 | SPEC_RULE_OP1; } break; case ZEND_FE_FETCH_R: if (op->op2_type == IS_CV && (op1_info & (MAY_BE_ANY|MAY_BE_REF)) == MAY_BE_ARRAY) { - spec = 3472 | SPEC_RULE_RETVAL; + spec = 3482 | SPEC_RULE_RETVAL; } break; case ZEND_FETCH_DIM_R: @@ -123215,22 +123517,22 @@ ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t if (op->op1_type == IS_CONST && op->op2_type == IS_CONST) { break; } - spec = 3435 | SPEC_RULE_OP1 | SPEC_RULE_OP2; + spec = 3445 | SPEC_RULE_OP1 | SPEC_RULE_OP2; } break; case ZEND_SEND_VAL_EX: if (op->op2_type == IS_UNUSED && op->op2.num <= MAX_ARG_FLAG_NUM && op->op1_type == IS_CONST && !Z_REFCOUNTED_P(RT_CONSTANT(op, op->op1))) { - spec = 3471; + spec = 3481; } break; case ZEND_SEND_VAR: if (op->op2_type == IS_UNUSED && (op1_info & (MAY_BE_UNDEF|MAY_BE_REF)) == 0) { - spec = 3460 | SPEC_RULE_OP1; + spec = 3470 | SPEC_RULE_OP1; } break; case ZEND_COUNT: if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == MAY_BE_ARRAY) { - spec = 2561 | SPEC_RULE_OP1; + spec = 2571 | SPEC_RULE_OP1; } break; case ZEND_BW_OR: diff --git a/Zend/zend_vm_handlers.h b/Zend/zend_vm_handlers.h index 6f1595195450..7ffe2c220a02 100644 --- a/Zend/zend_vm_handlers.h +++ b/Zend/zend_vm_handlers.h @@ -1087,507 +1087,511 @@ _(2556, ZEND_INIT_PARENT_PROPERTY_HOOK_CALL_SPEC_CONST_UNUSED) \ _(2557, ZEND_DECLARE_ATTRIBUTED_CONST_SPEC_CONST_CONST) \ _(2558, ZEND_TYPE_ASSERT_SPEC_CONST) \ - _(2559, ZEND_INIT_FCALL_OFFSET_SPEC_CONST) \ - _(2560, ZEND_RECV_NOTYPE_SPEC) \ - _(2562, ZEND_COUNT_ARRAY_SPEC_TMP_UNUSED) \ - _(2565, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \ - _(2566, ZEND_JMP_FORWARD_SPEC) \ - _(2572, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2573, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2574, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2576, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2577, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2578, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2579, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2581, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2559, ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_CONST) \ + _(2562, ZEND_CALLABLE_CONVERT_PARTIAL_SPEC_UNUSED) \ + _(2564, ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_CONST) \ + _(2567, ZEND_SEND_PLACEHOLDER_SPEC_UNUSED_UNUSED) \ + _(2569, ZEND_INIT_FCALL_OFFSET_SPEC_CONST) \ + _(2570, ZEND_RECV_NOTYPE_SPEC) \ + _(2572, ZEND_COUNT_ARRAY_SPEC_TMP_UNUSED) \ + _(2575, ZEND_COUNT_ARRAY_SPEC_CV_UNUSED) \ + _(2576, ZEND_JMP_FORWARD_SPEC) \ + _(2582, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2583, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2584, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2586, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2587, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2588, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2589, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2591, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2597, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ - _(2598, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2599, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2601, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2602, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ - _(2603, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2604, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2606, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2597, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2598, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2599, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2601, ZEND_ADD_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2607, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2608, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2609, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2611, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2612, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ _(2613, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2614, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2616, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2622, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2623, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2624, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2626, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2627, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2628, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2629, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2631, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2622, ZEND_ADD_LONG_SPEC_TMPVARCV_CONST) \ + _(2623, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2624, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2626, ZEND_ADD_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2632, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2633, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2634, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2636, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2637, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2638, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2639, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2641, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2643, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2644, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2646, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ - _(2647, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2648, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2649, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2651, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2652, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2653, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2654, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2656, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2647, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2648, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2649, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2651, ZEND_ADD_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2653, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2654, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2656, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_CONST_TMPVARCV) \ + _(2657, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2658, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2659, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2661, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2662, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2663, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2664, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2666, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2668, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2669, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2671, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ - _(2672, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ - _(2673, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2674, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2676, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2677, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ - _(2678, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2679, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2681, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2672, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2673, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2674, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2676, ZEND_SUB_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2678, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2679, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2681, ZEND_SUB_LONG_SPEC_CONST_TMPVARCV) \ + _(2682, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2683, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2684, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2686, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2687, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ _(2688, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2689, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2691, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2693, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2694, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2696, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(2697, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2698, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2699, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2701, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2702, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2703, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2704, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2706, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2697, ZEND_SUB_LONG_SPEC_TMPVARCV_CONST) \ + _(2698, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2699, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2701, ZEND_SUB_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2703, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2704, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2706, ZEND_SUB_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(2707, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2708, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2709, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2711, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2712, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2713, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2714, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2716, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2722, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2723, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2724, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2726, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2727, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ - _(2728, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2729, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2731, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2722, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2723, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2724, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2726, ZEND_SUB_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2732, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2733, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2734, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2736, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2737, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ _(2738, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2739, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ _(2741, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ - _(2747, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ - _(2748, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2749, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2751, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2752, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ - _(2753, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2754, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2756, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2747, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_CONST) \ + _(2748, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2749, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2751, ZEND_MUL_LONG_NO_OVERFLOW_SPEC_TMPVARCV_TMPVARCV) \ + _(2757, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2758, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2759, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2761, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2762, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ _(2763, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2764, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ _(2766, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2772, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2773, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2774, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2776, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2777, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2778, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2779, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2781, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2772, ZEND_MUL_LONG_SPEC_TMPVARCV_CONST) \ + _(2773, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2774, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2776, ZEND_MUL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2782, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2783, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2784, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2786, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2787, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ _(2788, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2789, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ _(2791, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2807, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2808, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2809, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2810, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2811, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2812, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2813, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2814, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2815, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2819, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2820, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2821, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2822, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2823, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2824, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2825, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2826, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2827, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2828, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2834, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2835, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2836, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2852, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2853, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2854, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2855, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2856, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2857, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2858, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2859, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2860, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2864, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2865, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2866, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2882, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2883, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2884, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2885, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2886, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2887, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2888, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2889, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2890, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2894, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2895, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2896, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2897, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2898, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2899, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2900, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2901, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2902, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2903, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2909, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2910, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2911, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2927, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(2928, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2929, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2930, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2931, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2932, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2933, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2934, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2935, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2939, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(2940, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2941, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2957, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2958, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2959, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2960, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2961, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2962, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2963, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2964, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2965, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2969, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2970, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2971, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2972, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(2973, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(2974, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(2975, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2976, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2977, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2978, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(2984, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(2985, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(2986, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3002, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3003, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3004, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3005, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3006, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3007, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3008, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3009, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3010, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3014, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3015, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3016, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3032, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3033, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3034, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3035, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3036, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3037, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3038, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3039, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3040, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3044, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3045, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3046, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3047, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3048, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3049, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3050, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3051, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3052, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3053, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3059, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3060, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3061, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3077, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3078, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3079, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3080, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3081, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3082, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3083, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3084, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3085, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3089, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3090, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3091, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3092, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST) \ - _(3093, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3094, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3095, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST) \ - _(3096, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3097, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3098, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ - _(3102, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \ - _(3103, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ - _(3107, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \ - _(3111, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3112, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3113, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3114, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3115, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3116, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3120, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ - _(3121, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3122, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3123, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ - _(3124, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3125, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3126, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3127, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3128, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3129, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3130, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3131, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3135, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3136, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ - _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3142, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3143, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3144, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3145, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3146, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3150, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3151, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3168, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ - _(3169, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3170, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3171, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3172, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3173, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3174, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3175, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3176, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3180, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3181, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3186, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3187, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3188, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3189, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3190, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3191, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3195, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3196, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3197, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3202, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3203, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3204, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3205, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3206, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3210, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3211, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3217, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3218, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3219, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3220, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3221, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3225, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3226, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3243, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3244, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3245, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3246, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3247, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3248, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3249, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3250, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3251, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3255, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3256, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3261, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3262, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3263, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3264, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3265, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3266, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3270, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ - _(3271, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3272, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3277, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3278, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3279, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3280, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3281, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3285, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3286, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3292, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3293, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3294, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3295, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3296, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3300, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3301, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3318, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ - _(3319, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3320, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3321, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3322, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3323, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3324, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3325, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3326, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3330, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ - _(3331, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3336, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3337, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3338, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3339, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3340, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3341, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3345, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ - _(3346, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ - _(3347, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ - _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3352, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3353, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3354, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3355, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3356, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3360, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3361, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3367, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3368, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3369, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3370, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3371, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3375, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3376, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3393, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ - _(3394, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ - _(3395, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ - _(3396, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3397, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3398, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3399, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3400, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3401, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3405, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ - _(3406, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ - _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ - _(3408, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ - _(3409, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ - _(3410, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \ - _(3411, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \ - _(3412, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ - _(3413, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ - _(3414, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \ - _(3415, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \ - _(3416, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \ - _(3417, ZEND_POST_INC_LONG_SPEC_CV) \ - _(3418, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \ - _(3419, ZEND_POST_DEC_LONG_SPEC_CV) \ - _(3420, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \ - _(3421, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3422, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3424, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ - _(3425, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \ - _(3426, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3427, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3429, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ - _(3430, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \ - _(3431, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3432, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3434, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ - _(3436, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3437, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3439, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ - _(3440, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ - _(3441, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3442, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3444, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3445, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ - _(3446, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3447, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3449, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ - _(3455, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \ - _(3456, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3459, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ - _(3462, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \ - _(3464, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \ - _(3467, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \ - _(3469, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \ - _(3470, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \ - _(3471, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \ - _(3472, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \ - _(3473, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \ - _(3473+1, ZEND_NULL) + _(2797, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2798, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2799, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2801, ZEND_MUL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2817, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2818, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2819, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2820, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2821, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2822, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2823, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2824, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2825, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2829, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2830, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2831, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2832, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2833, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2834, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2835, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2836, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2837, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2838, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2839, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2840, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2844, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2845, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2846, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2862, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2863, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2864, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2865, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2866, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2867, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2868, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2869, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2870, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2874, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2875, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2876, ZEND_IS_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2892, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2893, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2894, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2895, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2896, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2897, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2898, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2899, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2900, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2904, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2905, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2906, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2907, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2908, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2909, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2910, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2911, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2912, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2913, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2914, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2915, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2919, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2920, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2921, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2937, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(2938, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2939, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2940, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2941, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2942, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2943, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2944, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2945, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2949, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(2950, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2951, ZEND_IS_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2967, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2968, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2969, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2970, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2971, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2972, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2973, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2974, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2975, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2979, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2980, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2981, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2982, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(2983, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(2984, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(2985, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2986, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2987, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2988, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2989, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2990, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(2994, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(2995, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(2996, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3012, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3013, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3014, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3015, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3016, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3017, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3018, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3019, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3020, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3024, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3025, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3026, ZEND_IS_NOT_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3042, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3043, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3044, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3045, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3046, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3047, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3048, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3049, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3050, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3054, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3055, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3056, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3057, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3058, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3059, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3060, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3061, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3062, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3063, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3064, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3065, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3069, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3070, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3071, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3087, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3088, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3089, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3090, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3091, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3092, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3093, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3094, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3095, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3099, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3100, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3101, ZEND_IS_NOT_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3102, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST) \ + _(3103, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3104, ZEND_IS_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3105, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST) \ + _(3106, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3107, ZEND_IS_NOT_IDENTICAL_EMPTY_ARRAY_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3108, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3112, ZEND_IS_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3113, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CONST) \ + _(3117, ZEND_IS_NOT_IDENTICAL_NOTHROW_SPEC_CV_CV) \ + _(3121, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3122, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3123, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3124, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3125, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3126, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3130, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV) \ + _(3131, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3132, ZEND_IS_SMALLER_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3133, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3134, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3135, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3136, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3137, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3138, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3139, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3140, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3141, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3145, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3146, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3147, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3148, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3149, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3150, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3151, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3152, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3153, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3154, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3155, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3156, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3160, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3161, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3162, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3178, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST) \ + _(3179, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3180, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3181, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3182, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3183, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3184, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3185, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3186, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3190, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3191, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3192, ZEND_IS_SMALLER_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3196, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3197, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3198, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3199, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3200, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3201, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3205, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3206, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3207, ZEND_IS_SMALLER_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3208, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3209, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3210, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3211, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3212, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3213, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3214, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3215, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3216, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3220, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3221, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3222, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3223, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3224, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3225, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3226, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3227, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3228, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3229, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3230, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3231, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3235, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3236, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3237, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3253, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3254, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3255, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3256, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3257, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3258, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3259, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3260, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3261, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3265, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3266, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3267, ZEND_IS_SMALLER_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3271, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3272, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3273, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3274, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3275, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3276, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3280, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV) \ + _(3281, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3282, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3283, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3284, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3285, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3286, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3287, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3288, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3289, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3290, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3291, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3295, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3296, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3297, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3298, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3299, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3300, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3301, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3302, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3303, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3304, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3305, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3306, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3310, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3311, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3312, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3328, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST) \ + _(3329, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3330, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3331, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3332, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3333, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3334, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3335, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3336, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3340, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV) \ + _(3341, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3342, ZEND_IS_SMALLER_OR_EQUAL_LONG_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3346, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3347, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3348, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3349, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3350, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3351, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3355, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV) \ + _(3356, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPZ) \ + _(3357, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_CONST_TMPVARCV_JMPNZ) \ + _(3358, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3359, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3360, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3361, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3362, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3363, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3364, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3365, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3366, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3370, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3371, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3372, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3373, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3374, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3375, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3376, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3377, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3378, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3379, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3380, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3381, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3385, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3386, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3387, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3403, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST) \ + _(3404, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPZ) \ + _(3405, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_CONST_JMPNZ) \ + _(3406, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3407, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3408, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3409, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3410, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3411, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3415, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV) \ + _(3416, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPZ) \ + _(3417, ZEND_IS_SMALLER_OR_EQUAL_DOUBLE_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \ + _(3418, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3419, ZEND_PRE_INC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3420, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3421, ZEND_PRE_INC_LONG_SPEC_CV_RETVAL_USED) \ + _(3422, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_UNUSED) \ + _(3423, ZEND_PRE_DEC_LONG_NO_OVERFLOW_SPEC_CV_RETVAL_USED) \ + _(3424, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_UNUSED) \ + _(3425, ZEND_PRE_DEC_LONG_SPEC_CV_RETVAL_USED) \ + _(3426, ZEND_POST_INC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3427, ZEND_POST_INC_LONG_SPEC_CV) \ + _(3428, ZEND_POST_DEC_LONG_NO_OVERFLOW_SPEC_CV) \ + _(3429, ZEND_POST_DEC_LONG_SPEC_CV) \ + _(3430, ZEND_QM_ASSIGN_LONG_SPEC_CONST) \ + _(3431, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3432, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3434, ZEND_QM_ASSIGN_LONG_SPEC_TMPVARCV) \ + _(3435, ZEND_QM_ASSIGN_DOUBLE_SPEC_CONST) \ + _(3436, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3437, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3439, ZEND_QM_ASSIGN_DOUBLE_SPEC_TMPVARCV) \ + _(3440, ZEND_QM_ASSIGN_NOREF_SPEC_CONST) \ + _(3441, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3442, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3444, ZEND_QM_ASSIGN_NOREF_SPEC_TMPVARCV) \ + _(3446, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3447, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3449, ZEND_FETCH_DIM_R_INDEX_SPEC_CONST_TMPVARCV) \ + _(3450, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ + _(3451, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3452, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3454, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3455, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_CONST) \ + _(3456, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3457, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3459, ZEND_FETCH_DIM_R_INDEX_SPEC_TMPVAR_TMPVARCV) \ + _(3465, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_CONST) \ + _(3466, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3467, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3469, ZEND_FETCH_DIM_R_INDEX_SPEC_CV_TMPVARCV) \ + _(3472, ZEND_SEND_VAR_SIMPLE_SPEC_VAR) \ + _(3474, ZEND_SEND_VAR_SIMPLE_SPEC_CV) \ + _(3477, ZEND_SEND_VAR_EX_SIMPLE_SPEC_VAR_UNUSED) \ + _(3479, ZEND_SEND_VAR_EX_SIMPLE_SPEC_CV_UNUSED) \ + _(3480, ZEND_SEND_VAL_SIMPLE_SPEC_CONST) \ + _(3481, ZEND_SEND_VAL_EX_SIMPLE_SPEC_CONST) \ + _(3482, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_UNUSED) \ + _(3483, ZEND_FE_FETCH_R_SIMPLE_SPEC_VAR_CV_RETVAL_USED) \ + _(3483+1, ZEND_NULL) diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 0ece3e6f0c66..76f3af369845 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -21,7 +21,7 @@ #include #include -static const char *zend_vm_opcodes_names[212] = { +static const char *zend_vm_opcodes_names[214] = { "ZEND_NOP", "ZEND_ADD", "ZEND_SUB", @@ -234,9 +234,11 @@ static const char *zend_vm_opcodes_names[212] = { "ZEND_INIT_PARENT_PROPERTY_HOOK_CALL", "ZEND_DECLARE_ATTRIBUTED_CONST", "ZEND_TYPE_ASSERT", + "ZEND_CALLABLE_CONVERT_PARTIAL", + "ZEND_SEND_PLACEHOLDER", }; -static uint32_t zend_vm_opcodes_flags[212] = { +static uint32_t zend_vm_opcodes_flags[214] = { 0x00000000, 0x00000b0b, 0x00000b0b, @@ -449,6 +451,8 @@ static uint32_t zend_vm_opcodes_flags[212] = { 0x01001103, 0x00000303, 0x01000003, + 0x010003a0, + 0x00000301, }; ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode) { diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index b63177e2421e..1d204b9281f5 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -331,7 +331,9 @@ END_EXTERN_C() #define ZEND_INIT_PARENT_PROPERTY_HOOK_CALL 209 #define ZEND_DECLARE_ATTRIBUTED_CONST 210 #define ZEND_TYPE_ASSERT 211 +#define ZEND_CALLABLE_CONVERT_PARTIAL 212 +#define ZEND_SEND_PLACEHOLDER 213 -#define ZEND_VM_LAST_OPCODE 211 +#define ZEND_VM_LAST_OPCODE 213 #endif diff --git a/configure.ac b/configure.ac index 6c517ecc0a1e..a83eb5c3dba4 100644 --- a/configure.ac +++ b/configure.ac @@ -1774,6 +1774,7 @@ PHP_ADD_SOURCES([Zend], m4_normalize([ zend_observer.c zend_opcode.c zend_operators.c + zend_partial.c zend_property_hooks.c zend_ptr_stack.c zend_signal.c diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 3d005b3835a7..c9344f671db7 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -24,7 +24,9 @@ #include "zend_compile.h" #include "ZendAccelerator.h" #include "zend_modules.h" +#include "zend_operators.h" #include "zend_persist.h" +#include "zend_portability.h" #include "zend_shared_alloc.h" #include "zend_accelerator_module.h" #include "zend_accelerator_blacklist.h" @@ -48,6 +50,7 @@ #include "zend_system_id.h" #include "ext/pcre/php_pcre.h" #include "ext/standard/basic_functions.h" +#include "zend_vm_opcodes.h" #ifdef ZEND_WIN32 # include "ext/hash/php_hash.h" @@ -2006,6 +2009,219 @@ static bool check_persistent_script_access(const zend_persistent_script *persist } } +static const char hexchars[] = "0123456789abcdef"; + +static char *zend_accel_uintptr_hex(char *dest, uintptr_t n) +{ + char *start = dest; + dest += sizeof(uintptr_t)*2; + + while (n > 0) { + *--dest = hexchars[n % strlen(hexchars)]; + n /= strlen(hexchars); + } + while (dest > start) { + *--dest = '0'; + } + + return dest + sizeof(uintptr_t)*2; +} + +/* Prevents collisions with real scripts, as we don't cache paths prefixed with + * a scheme, except file:// and phar://. */ +#define PFA_KEY_PREFIX "pfa://" + +static zend_string *zend_accel_pfa_key(const zend_op *declaring_opline, + const zend_function *called_function) +{ + size_t key_len = strlen(PFA_KEY_PREFIX) + (sizeof(uintptr_t)*2) + strlen(":") + (sizeof(uintptr_t)*2); + zend_string *key = zend_string_alloc(key_len, 0); + char *dest = ZSTR_VAL(key); + + dest = zend_mempcpy(ZSTR_VAL(key), PFA_KEY_PREFIX, strlen(PFA_KEY_PREFIX)); + dest = zend_accel_uintptr_hex(dest, (uintptr_t)declaring_opline); + *dest++ = ':'; + + void *ptr; + if ((called_function->common.fn_flags & ZEND_ACC_CLOSURE) + && called_function->type == ZEND_USER_FUNCTION) { + /* Can not use 'called_function' as part of the key, as it's an inner + * pointer to a Closure, which may be freed. Use its opcodes instead. + * zend_accel_compile_pfa() ensures to extend the lifetime of opcodes + * in this case. */ + ptr = called_function->op_array.opcodes; + } else { + ptr = (void*) called_function; + } + dest = zend_accel_uintptr_hex(dest, (uintptr_t)ptr); + + ZEND_ASSERT(dest == ZSTR_VAL(key) + key_len); + + ZSTR_VAL(key)[key_len] = 0; + ZSTR_LEN(key) = key_len; + + return key; +} + +zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, const zend_function *called_function) +{ + zend_string *key = zend_accel_pfa_key(declaring_opline, called_function); + zend_op_array *op_array = NULL; + + /* A PFA is SHM-cacheable if the declaring_op_array and called_function are + * cached. */ + if (ZCG(accelerator_enabled) + && !file_cache_only + && !declaring_op_array->refcount + && (called_function->type != ZEND_USER_FUNCTION || !called_function->op_array.refcount)) { + zend_persistent_script *persistent_script = zend_accel_hash_find(&ZCSG(hash), key); + if (persistent_script) { + op_array = persistent_script->script.main_op_array.dynamic_func_defs[0]; + if (persistent_script->num_warnings) { + zend_emit_recorded_errors_ex(persistent_script->num_warnings, + persistent_script->warnings); + } + } + } else { + op_array = zend_hash_find_ptr(&EG(partial_function_application_cache), key); + } + + zend_string_release(key); + + return op_array; +} + +zend_op_array *zend_accel_compile_pfa(zend_ast *ast, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, + const zend_function *called_function, + zend_string *pfa_func_name) +{ + zend_begin_record_errors(); + zend_op_array *op_array; + + uint32_t orig_compiler_options = CG(compiler_options); + + zend_try { + CG(compiler_options) |= ZEND_COMPILE_HANDLE_OP_ARRAY; + CG(compiler_options) |= ZEND_COMPILE_DELAYED_BINDING; + CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION; + CG(compiler_options) |= ZEND_COMPILE_IGNORE_OTHER_FILES; + CG(compiler_options) |= ZEND_COMPILE_IGNORE_OBSERVER; +#ifdef ZEND_WIN32 + /* On Windows, don't compile with internal classes. Shm may be attached from different + * processes with internal classes living in different addresses. */ + CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES; +#endif + + op_array = zend_compile_ast(ast, ZEND_USER_FUNCTION, declaring_op_array->filename); + + ZEND_ASSERT(op_array->num_dynamic_func_defs == 1); + + CG(compiler_options) = orig_compiler_options; + } zend_catch { + op_array = NULL; + CG(compiler_options) = orig_compiler_options; + EG(record_errors) = false; + zend_free_recorded_errors(); + zend_bailout(); + } zend_end_try(); + + if (!op_array) { + zend_emit_recorded_errors(); + zend_free_recorded_errors(); + return NULL; + } + + ZEND_ASSERT(op_array->num_dynamic_func_defs == 1); + + zend_string_release(op_array->dynamic_func_defs[0]->function_name); + op_array->dynamic_func_defs[0]->function_name = pfa_func_name; + + zend_string *key = zend_accel_pfa_key(declaring_opline, called_function); + + /* Cache op_array only if the declaring op_array and the called function + * are cached */ + if (!ZCG(accelerator_enabled) + || file_cache_only + || declaring_op_array->refcount + || (called_function->type == ZEND_USER_FUNCTION && called_function->op_array.refcount) + || (ZCSG(restart_in_progress) && accel_restart_is_active()) + || (!ZCG(counted) && accel_activate_add() == FAILURE)) { + zend_op_array *script_op_array = op_array; + zend_op_array *op_array = script_op_array->dynamic_func_defs[0]; + GC_ADDREF(op_array->function_name); + (*op_array->refcount)++; + destroy_op_array(script_op_array); + efree(script_op_array); + + if ((called_function->common.fn_flags & ZEND_ACC_CLOSURE) + && called_function->type == ZEND_USER_FUNCTION + && called_function->op_array.refcount) { + /* Extend the lifetime of the called opcodes if + * the called function is a closure. + * See comment in zend_accel_pfa_key(). */ + zend_op_array *copy = zend_arena_alloc(&CG(arena), sizeof(zend_function)); + memcpy(copy, called_function, sizeof(zend_op_array)); + zend_string_addref(copy->function_name); + (*copy->refcount)++; + /* Reference the copy in op_array->dynamic_func_defs so that it's + * destroyed when op_array is destroy. */ + ZEND_ASSERT(!op_array->dynamic_func_defs && !op_array->num_dynamic_func_defs); + op_array->dynamic_func_defs = emalloc(sizeof(zend_op_array*)); + op_array->dynamic_func_defs[0] = copy; + op_array->num_dynamic_func_defs = 1; + } + + zend_hash_add_new_ptr(&EG(partial_function_application_cache), key, op_array); + zend_string_release(key); + + zend_emit_recorded_errors(); + zend_free_recorded_errors(); + + return op_array; + } + + zend_persistent_script *new_persistent_script = create_persistent_script(); + new_persistent_script->script.main_op_array = *op_array; + efree_size(op_array, sizeof(zend_op_array)); + new_persistent_script->script.filename = key; + + if (ZCG(accel_directives).record_warnings) { + new_persistent_script->num_warnings = EG(num_errors); + new_persistent_script->warnings = EG(errors); + } + + HANDLE_BLOCK_INTERRUPTIONS(); + SHM_UNPROTECT(); + + bool from_shared_memory; + /* See GH-17246: we disable GC so that user code cannot be executed during the optimizer run. */ + bool orig_gc_state = gc_enable(false); + char *orig_file_cache = ZCG(accel_directives).file_cache; + /* Disable file_cache temporarily, as we can't guarantee consistency. */ + ZCG(accel_directives).file_cache = false; + new_persistent_script = cache_script_in_shared_memory(new_persistent_script, NULL, &from_shared_memory); + ZCG(accel_directives).file_cache = orig_file_cache; + gc_enable(orig_gc_state); + + SHM_PROTECT(); + HANDLE_UNBLOCK_INTERRUPTIONS(); + + /* We may have switched to an existing persistent script that was persisted in + * the meantime. Make sure to use its warnings if available. */ + if (ZCG(accel_directives).record_warnings) { + EG(record_errors) = false; + zend_emit_recorded_errors_ex(new_persistent_script->num_warnings, new_persistent_script->warnings); + } else { + zend_emit_recorded_errors(); + } + zend_free_recorded_errors(); + + return new_persistent_script->script.main_op_array.dynamic_func_defs[0]; +} + /* zend_compile() replacement */ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) { diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 91642e288d31..9eec7555c4ea 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -334,6 +334,16 @@ zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str); uint32_t zend_accel_get_class_name_map_ptr(zend_string *type_name); +zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, + const zend_function *called_function); + +zend_op_array *zend_accel_compile_pfa(zend_ast *ast, + const zend_op_array *declaring_op_array, + const zend_op *declaring_opline, + const zend_function *called_function, + zend_string *pfa_func_name); + END_EXTERN_C() /* memory write protection */ diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 738f204c5026..21e0213302dc 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -301,6 +301,7 @@ static int zend_jit_needs_call_chain(zend_call_info *call_info, uint32_t b, cons case ZEND_DO_FCALL_BY_NAME: case ZEND_DO_FCALL: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: return 0; case ZEND_SEND_VAL: case ZEND_SEND_VAR: @@ -386,6 +387,7 @@ static int zend_jit_needs_call_chain(zend_call_info *call_info, uint32_t b, cons case ZEND_DO_FCALL_BY_NAME: case ZEND_DO_FCALL: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: end = opline; if (end - op_array->opcodes >= ssa->cfg.blocks[b].start + ssa->cfg.blocks[b].len) { /* INIT_FCALL and DO_FCALL in different BasicBlocks */ @@ -865,6 +867,7 @@ static bool zend_jit_dec_call_level(uint8_t opcode) case ZEND_DO_UCALL: case ZEND_DO_FCALL_BY_NAME: case ZEND_CALLABLE_CONVERT: + case ZEND_CALLABLE_CONVERT_PARTIAL: return true; default: return false; diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index c4b88b74f64d..583ae38d93fb 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -10092,7 +10092,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen } bool may_have_extra_named_params = - opline->extended_value == ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS && + (opline->extended_value & ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS) && (!func || func->common.fn_flags & ZEND_ACC_VARIADIC); if (!jit->reuse_ip) { diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 1c7fb4073569..8796703ea015 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -1057,7 +1057,8 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, TRACE_RECORD(ZEND_JIT_TRACE_DO_ICALL, 0, func); } } else if (opline->opcode == ZEND_INCLUDE_OR_EVAL - || opline->opcode == ZEND_CALLABLE_CONVERT) { + || opline->opcode == ZEND_CALLABLE_CONVERT + || opline->opcode == ZEND_CALLABLE_CONVERT_PARTIAL) { /* TODO: Support tracing JIT for ZEND_CALLABLE_CONVERT. */ stop = ZEND_JIT_TRACE_STOP_INTERPRETER; break; diff --git a/win32/build/config.w32 b/win32/build/config.w32 index aefcfb5f8247..b04c636d53c9 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -241,7 +241,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c \ zend_inheritance.c zend_smart_str.c zend_cpuinfo.c zend_observer.c zend_system_id.c \ zend_enum.c zend_fibers.c zend_atomic.c zend_hrtime.c zend_frameless_function.c zend_property_hooks.c \ - zend_lazy_objects.c zend_autoload.c"); + zend_lazy_objects.c zend_autoload.c zend_partial.c"); ADD_SOURCES("Zend\\Optimizer", "zend_optimizer.c pass1.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c zend_cfg.c zend_dfg.c dfa_pass.c zend_ssa.c zend_inference.c zend_func_info.c zend_call_graph.c zend_dump.c escape_analysis.c compact_vars.c dce.c sccp.c scdf.c"); var PHP_ASSEMBLER = PATH_PROG({ From 94a88c64705c0f345d4c0abf518d2ad58c7f15eb Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 6 Jan 2026 17:33:40 +0100 Subject: [PATCH 298/300] Squashed changes --- Zend/Optimizer/zend_call_graph.c | 4 - .../compile_errors_006.phpt | 2 +- .../tests/partial_application/deprecated.phpt | 14 + .../tests/partial_application/errors_003.phpt | 7 +- .../tests/partial_application/errors_006.phpt | 22 ++ .../partial_application/function_name.phpt | 25 +- Zend/tests/partial_application/fuzz_001.phpt | 2 +- .../instance_polymorphism.phpt | 43 +++ Zend/tests/partial_application/magic_001.phpt | 29 +- Zend/tests/partial_application/magic_002.phpt | 25 +- Zend/tests/partial_application/magic_003.phpt | 2 +- Zend/tests/partial_application/magic_004.phpt | 3 +- Zend/tests/partial_application/magic_005.phpt | 5 +- .../named_placeholders.phpt | 30 +- .../partial_application/never_cache_001.phpt | 30 ++ .../non_dynamic_call_funcs.phpt | 6 +- .../pipe_optimization_001.phpt | 8 +- .../pipe_optimization_002.phpt | 8 +- .../pipe_optimization_003.phpt | 10 +- .../pipe_optimization_004.phpt | 39 +-- .../pipe_optimization_005.phpt | 10 +- .../pipe_optimization_006.phpt | 8 +- .../pipe_optimization_007.phpt | 37 +-- .../pipe_optimization_008.phpt | 24 +- .../pipe_optimization_009.phpt | 39 ++- .../pipe_optimization_010.phpt | 8 +- .../pipe_optimization_011.phpt | 62 ++--- .../pipe_optimization_012.phpt | 52 ++++ .../pipe_optimization_013.phpt | 87 ++++++ .../pipe_optimization_014.phpt | 68 +++++ .../pipe_optimization_015.phpt | 55 ++++ .../tests/partial_application/preloading.phpt | 4 + .../partial_application/rebinding_001.phpt | 14 +- .../partial_application/rebinding_002.phpt | 4 +- .../partial_application/rebinding_003.phpt | 46 +-- .../partial_application/references_001.phpt | 2 +- .../partial_application/references_002.phpt | 2 +- .../partial_application/references_004.phpt | 4 +- .../partial_application/reflection_001.phpt | 2 +- .../relative_return_types.phpt | 37 ++- .../partial_application/rfc_examples.inc | 1 + .../rfc_examples_debug.phpt | 2 +- .../rfc_examples_eval_order.phpt | 6 +- .../rfc_examples_incompatible_functions.phpt | 4 +- .../rfc_examples_magic_methods.phpt | 2 +- .../partial_application/static_pfa_001.phpt | 45 +++ .../partial_application/static_pfa_002.phpt | 35 +++ .../partial_application/static_pfa_003.phpt | 30 ++ .../partial_application/static_pfa_004.phpt | 39 +++ .../partial_application/static_pfa_005.phpt | 34 +++ .../static_polymorphism.phpt | 43 +++ ...{statics_001.phpt => static_vars_001.phpt} | 11 +- ...{statics_002.phpt => static_vars_002.phpt} | 9 +- ...{statics_003.phpt => static_vars_003.phpt} | 9 +- .../variation_call_001.phpt | 2 +- .../variation_closure_001.phpt | 23 +- .../variation_debug_002.phpt | 2 +- .../partial_application/variation_ex_001.phpt | 2 +- .../partial_application/variation_gc_001.phpt | 6 +- .../variation_invoke_001.phpt | 4 +- .../variation_parent_001.phpt | 3 +- .../variation_variadics_004.phpt | 74 ++--- Zend/zend_API.c | 39 ++- Zend/zend_API.h | 8 + Zend/zend_ast.c | 2 +- Zend/zend_closures.c | 2 + Zend/zend_compile.c | 56 ++-- Zend/zend_execute.c | 7 +- Zend/zend_execute.h | 3 +- Zend/zend_language_scanner.l | 4 +- Zend/zend_partial.c | 261 ++++++++++-------- Zend/zend_partial.h | 17 +- Zend/zend_string.h | 1 + Zend/zend_vm_def.h | 9 +- Zend/zend_vm_execute.h | 19 +- Zend/zend_vm_execute.skl | 1 + Zend/zend_vm_opcodes.c | 2 +- ext/opcache/ZendAccelerator.c | 14 +- ext/opcache/ZendAccelerator.h | 2 +- .../array_map_foreach_optimization_006.phpt | 84 ++++++ .../array_map_foreach_optimization_007.phpt | 109 ++++++++ 81 files changed, 1389 insertions(+), 516 deletions(-) create mode 100644 Zend/tests/partial_application/deprecated.phpt create mode 100644 Zend/tests/partial_application/instance_polymorphism.phpt create mode 100644 Zend/tests/partial_application/never_cache_001.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_012.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_013.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_014.phpt create mode 100644 Zend/tests/partial_application/pipe_optimization_015.phpt create mode 100644 Zend/tests/partial_application/static_pfa_001.phpt create mode 100644 Zend/tests/partial_application/static_pfa_002.phpt create mode 100644 Zend/tests/partial_application/static_pfa_003.phpt create mode 100644 Zend/tests/partial_application/static_pfa_004.phpt create mode 100644 Zend/tests/partial_application/static_pfa_005.phpt create mode 100644 Zend/tests/partial_application/static_polymorphism.phpt rename Zend/tests/partial_application/{statics_001.phpt => static_vars_001.phpt} (70%) rename Zend/tests/partial_application/{statics_002.phpt => static_vars_002.phpt} (76%) rename Zend/tests/partial_application/{statics_003.phpt => static_vars_003.phpt} (74%) create mode 100644 ext/standard/tests/array/array_map_foreach_optimization_006.phpt create mode 100644 ext/standard/tests/array/array_map_foreach_optimization_007.phpt diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index 56f326e100b5..b67f57cf041d 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -147,10 +147,6 @@ ZEND_API void zend_analyze_calls(zend_arena **arena, zend_script *script, uint32 call_info->named_args = true; break; } - if (opline->opcode == ZEND_SEND_PLACEHOLDER - && opline->op1.num == ZEND_PLACEHOLDER_VARIADIC) { - break; - } uint32_t num = opline->op2.num; if (num > 0) { diff --git a/Zend/tests/partial_application/compile_errors_006.phpt b/Zend/tests/partial_application/compile_errors_006.phpt index 90210be6acae..8549c671e906 100644 --- a/Zend/tests/partial_application/compile_errors_006.phpt +++ b/Zend/tests/partial_application/compile_errors_006.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA compile errors: can not use unpacking in PFA, including with variadic placeholdres +PFA compile errors: can not use unpacking in PFA, including with variadic placeholders --FILE-- "bar"], ...); diff --git a/Zend/tests/partial_application/deprecated.phpt b/Zend/tests/partial_application/deprecated.phpt new file mode 100644 index 000000000000..5a6280347cfc --- /dev/null +++ b/Zend/tests/partial_application/deprecated.phpt @@ -0,0 +1,14 @@ +--TEST-- +PFAs may emit deprecation warnings +--FILE-- + +--EXPECTF-- +Deprecated: Function f() is deprecated in %s on line %d diff --git a/Zend/tests/partial_application/errors_003.phpt b/Zend/tests/partial_application/errors_003.phpt index bc1c16e64f9b..85ecf398fa1b 100644 --- a/Zend/tests/partial_application/errors_003.phpt +++ b/Zend/tests/partial_application/errors_003.phpt @@ -62,11 +62,8 @@ try { printf("%s: %s\n", $ex::class, $ex->getMessage()); } -try { - $usleep(1, 2); -} catch (Error $ex) { - printf("%s: %s\n", $ex::class, $ex->getMessage()); -} +$usleep(1, 2); + ?> --EXPECTF-- ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected diff --git a/Zend/tests/partial_application/errors_006.phpt b/Zend/tests/partial_application/errors_006.phpt index aec2fc5dc073..9534bb40ee54 100644 --- a/Zend/tests/partial_application/errors_006.phpt +++ b/Zend/tests/partial_application/errors_006.phpt @@ -3,6 +3,16 @@ PFA errors: Some internal function parameters have UNKNOWN default value --FILE-- array_keys($array, ???, true) $f = array_keys(?, strict: true); @@ -19,5 +29,17 @@ try { ?> --EXPECT-- +array(1) { + [0]=> + int(1) +} +array(0) { +} +array(1) { + [0]=> + int(1) +} +array(0) { +} ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known diff --git a/Zend/tests/partial_application/function_name.phpt b/Zend/tests/partial_application/function_name.phpt index 5ed0c5869640..68d2ccf84871 100644 --- a/Zend/tests/partial_application/function_name.phpt +++ b/Zend/tests/partial_application/function_name.phpt @@ -5,15 +5,36 @@ Partial application function name function g($a) {} +class C { + static function m() { + echo "# From a method:\n"; + var_dump((new ReflectionFunction(g(?)))->getName()); + } +} + function f() { + echo "# From a function:\n"; var_dump((new ReflectionFunction(g(?)))->getName()); + + echo "# Declared on same line:\n"; + [$a, $b] = [g(?), g(?)]; + var_dump((new ReflectionFunction($a))->getName(), (new ReflectionFunction($b))->getName()); } f(); +C::m(); +echo "# From global scope:\n"; var_dump((new ReflectionFunction(g(?)))->getName()); ?> --EXPECTF-- -string(%d) "{closure:pfa:f():6}" -string(%d) "{closure:pfa:%sfunction_name.php:11}" +# From a function: +string(20) "{closure:pfa:f():14}" +# Declared on same line: +string(20) "{closure:pfa:f():17}" +string(20) "{closure:pfa:f():17}" +# From a method: +string(22) "{closure:pfa:C::m():8}" +# From global scope: +string(%d) "{closure:pfa:%sfunction_name.php:25}" diff --git a/Zend/tests/partial_application/fuzz_001.phpt b/Zend/tests/partial_application/fuzz_001.phpt index f6544105a435..790162ba6a36 100644 --- a/Zend/tests/partial_application/fuzz_001.phpt +++ b/Zend/tests/partial_application/fuzz_001.phpt @@ -7,7 +7,7 @@ $closure = function($a, $b) {}; echo (string) new ReflectionFunction($closure(1, ?)); ?> --EXPECTF-- -Closure [ static function {closure:%s:%d} ] { +Closure [ function {closure:%s:%d} ] { @@ %s 4 - 4 - Bound Variables [2] { diff --git a/Zend/tests/partial_application/instance_polymorphism.phpt b/Zend/tests/partial_application/instance_polymorphism.phpt new file mode 100644 index 000000000000..59fb5795d60f --- /dev/null +++ b/Zend/tests/partial_application/instance_polymorphism.phpt @@ -0,0 +1,43 @@ +--TEST-- +PFA: instance polymorphism +--FILE-- +m(?); + } +} + +class C extends P { + public function m(string|array $b): void { + echo __METHOD__, PHP_EOL; + var_dump($b); + } +} + +for ($i = 0; $i < 2; $i++) { + (new P())->get()(a: 'a'); + (new C())->get()(b: []); +} + +?> +--EXPECT-- +P::m +string(1) "a" +C::m +array(0) { +} +P::m +string(1) "a" +C::m +array(0) { +} diff --git a/Zend/tests/partial_application/magic_001.phpt b/Zend/tests/partial_application/magic_001.phpt index 60f5a3f20dfb..6cd6044c62de 100644 --- a/Zend/tests/partial_application/magic_001.phpt +++ b/Zend/tests/partial_application/magic_001.phpt @@ -3,10 +3,10 @@ __call() can be partially applied --FILE-- getMessage()); } -try { - $bar(1, 2); -} catch (Error $ex) { - printf("%s: %s\n", $ex::class, $ex->getMessage()); -} - +$bar(1, 2); $bar(1); $bar = $foo->method(?, ...); @@ -35,6 +30,7 @@ $bar = $foo->method(?, ...); echo (string) new ReflectionFunction($bar); $bar(10); +$bar(10, 20); $bar = $foo->method(new Foo, ...); @@ -47,7 +43,7 @@ Closure [ public method {closure:%s:%d} ] { @@ %s 12 - 12 - Parameters [1] { - Parameter #0 [ $args0 ] + Parameter #0 [ mixed $arguments0 ] } } ArgumentCountError: Too few arguments to function Foo::{closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected @@ -56,24 +52,27 @@ int(1) Foo::method int(1) Closure [ public method {closure:%s:%d} ] { - @@ %s 30 - 30 + @@ %s 25 - 25 - Parameters [2] { - Parameter #0 [ $args0 ] - Parameter #1 [ ...$args ] + Parameter #0 [ mixed $arguments0 ] + Parameter #1 [ mixed ...$arguments ] } } Foo::method int(10) +Foo::method +int(10) +int(20) Closure [ public method {closure:%s:%d} ] { - @@ %s 36 - 36 + @@ %s 32 - 32 - Bound Variables [1] { - Variable #0 [ $args0 ] + Variable #0 [ $arguments0 ] } - Parameters [1] { - Parameter #0 [ ...$args ] + Parameter #0 [ mixed ...$arguments ] } } Foo::method diff --git a/Zend/tests/partial_application/magic_002.phpt b/Zend/tests/partial_application/magic_002.phpt index d4baf7afc18f..d91ef7a7afe2 100644 --- a/Zend/tests/partial_application/magic_002.phpt +++ b/Zend/tests/partial_application/magic_002.phpt @@ -3,10 +3,10 @@ __callStatic() can be partially applied --FILE-- static public method {closure:%s:%d} ] { @@ %s 10 - 10 - Parameters [1] { - Parameter #0 [ $args0 ] + Parameter #0 [ mixed $arguments0 ] } } Foo::method int(1) +Foo::method +int(1) Closure [ static public method {closure:%s:%d} ] { - @@ %s 16 - 16 + @@ %s 17 - 17 - Parameters [2] { - Parameter #0 [ $args0 ] - Parameter #1 [ ...$args ] + Parameter #0 [ mixed $arguments0 ] + Parameter #1 [ mixed ...$arguments ] } } Foo::method int(10) +Foo::method +int(10) +int(20) Closure [ static public method {closure:%s:%d} ] { - @@ %s 22 - 22 + @@ %s 24 - 24 - Bound Variables [1] { - Variable #0 [ $args0 ] + Variable #0 [ $arguments0 ] } - Parameters [1] { - Parameter #0 [ ...$args ] + Parameter #0 [ mixed ...$arguments ] } } Foo::method diff --git a/Zend/tests/partial_application/magic_003.phpt b/Zend/tests/partial_application/magic_003.phpt index 75e26c70b1a3..242403ea38fc 100644 --- a/Zend/tests/partial_application/magic_003.phpt +++ b/Zend/tests/partial_application/magic_003.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA magic trampoline release unused +PFA magic trampoline release (result unused) --FILE-- diff --git a/Zend/tests/partial_application/magic_005.phpt b/Zend/tests/partial_application/magic_005.phpt index 8c4e878196fc..e70ed90b1767 100644 --- a/Zend/tests/partial_application/magic_005.phpt +++ b/Zend/tests/partial_application/magic_005.phpt @@ -4,7 +4,6 @@ PFA magic null ptr deref in arginfo string(%d) "%smagic_005.php" ["line"]=> - int(8) + int(7) ["this"]=> object(Foo)#%d (0) { } ["parameter"]=> array(1) { - ["$args0"]=> + ["$arguments0"]=> string(10) "" } } diff --git a/Zend/tests/partial_application/named_placeholders.phpt b/Zend/tests/partial_application/named_placeholders.phpt index 6517a8946d36..7d4a11f93624 100644 --- a/Zend/tests/partial_application/named_placeholders.phpt +++ b/Zend/tests/partial_application/named_placeholders.phpt @@ -11,43 +11,43 @@ function foo($a = 1, $b = 2, $c = 3) { var_dump($a, $b, $c); } -$foo = foo(b: ?); +$c = foo(b: ?); -echo (string) new ReflectionFunction($foo); +echo (string) new ReflectionFunction($c); -$foo(new B); +$c(new B); -$foo = $foo(?); +$c = $c(?); -echo (string) new ReflectionFunction($foo); +echo (string) new ReflectionFunction($c); -$foo(new B); +$c(new B); -$foo = foo(?, ?); -$foo = $foo(b: ?); +$c = foo(?, ?); +$c = $c(b: ?); -echo (string) new ReflectionFunction($foo); +echo (string) new ReflectionFunction($c); -$foo(new B); +$c(new B); function bar($a = 1, $b = 2, ...$c) { var_dump($a, $b, $c); } -$bar = bar(b: ?, ...); +$d = bar(b: ?, ...); -echo (string) new ReflectionFunction($bar); +echo (string) new ReflectionFunction($d); -$bar(new B, new A, new C); +$d(new B, new A, new C); try { - $bar = bar(?, a: ?); + $d = bar(?, a: ?); } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } try { - $bar = bar(c: ?, ...); + $d = bar(c: ?, ...); } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } diff --git a/Zend/tests/partial_application/never_cache_001.phpt b/Zend/tests/partial_application/never_cache_001.phpt new file mode 100644 index 000000000000..3c9e8a173e51 --- /dev/null +++ b/Zend/tests/partial_application/never_cache_001.phpt @@ -0,0 +1,30 @@ +--TEST-- +Inline cache can not be used for ZEND_ACC_NEVER_CACHE functions +--FILE-- +__invoke(?)); +} + +?> +--EXPECT-- +string(1) "A" +string(1) "B" +string(1) "A" +string(1) "B" diff --git a/Zend/tests/partial_application/non_dynamic_call_funcs.phpt b/Zend/tests/partial_application/non_dynamic_call_funcs.phpt index 0430986be2ac..db25ef3dcc93 100644 --- a/Zend/tests/partial_application/non_dynamic_call_funcs.phpt +++ b/Zend/tests/partial_application/non_dynamic_call_funcs.phpt @@ -41,6 +41,6 @@ foreach (['_func_get_arg', '_compact', '_extract', '_func_get_args', '_func_num_ Error: Cannot call func_get_arg() dynamically Error: Cannot call compact() dynamically Error: Cannot call extract() dynamically -ArgumentCountError: Partial application of func_get_args() expects at most 0 arguments, 1 given -ArgumentCountError: Partial application of func_num_args() expects at most 0 arguments, 1 given -ArgumentCountError: Partial application of get_defined_vars() expects at most 0 arguments, 1 given +Error: Cannot call func_get_args() dynamically +Error: Cannot call func_num_args() dynamically +Error: Cannot call get_defined_vars() dynamically diff --git a/Zend/tests/partial_application/pipe_optimization_001.phpt b/Zend/tests/partial_application/pipe_optimization_001.phpt index 71bfee5dba44..9610f37b76ac 100644 --- a/Zend/tests/partial_application/pipe_optimization_001.phpt +++ b/Zend/tests/partial_application/pipe_optimization_001.phpt @@ -22,12 +22,12 @@ if (time() > 0) { ?> --EXPECTF-- $_main: - ; (lines=9, args=0, vars=0, tmps=2) + ; (lines=9, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_001.php:1-12 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 1 string("foo") @@ -36,7 +36,7 @@ $_main: 0008 RETURN int(1) foo: - ; (lines=5, args=1, vars=1, tmps=0) + ; (lines=5, args=1, vars=1, tmps=%d) ; (after optimizer) ; %spipe_optimization_001.php:4-6 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_002.phpt b/Zend/tests/partial_application/pipe_optimization_002.phpt index ae5992e405a0..729e70d30e6b 100644 --- a/Zend/tests/partial_application/pipe_optimization_002.phpt +++ b/Zend/tests/partial_application/pipe_optimization_002.phpt @@ -22,12 +22,12 @@ if (time() > 0) { ?> --EXPECTF-- $_main: - ; (lines=10, args=0, vars=0, tmps=2) + ; (lines=10, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_002.php:1-12 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 2 string("foo") @@ -37,7 +37,7 @@ $_main: 0009 RETURN int(1) foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_002.php:4-6 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_003.phpt b/Zend/tests/partial_application/pipe_optimization_003.phpt index 4f45eb5555e2..da112f8f3cea 100644 --- a/Zend/tests/partial_application/pipe_optimization_003.phpt +++ b/Zend/tests/partial_application/pipe_optimization_003.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA pipe optimization: PFA with only one placeholder can be optimized +PFA pipe optimization: PFA with only one placeholder can be optimized (placeholder first) --EXTENSIONS-- opcache --INI-- @@ -22,12 +22,12 @@ if (time() > 0) { ?> --EXPECTF-- $_main: - ; (lines=10, args=0, vars=0, tmps=2) + ; (lines=10, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_003.php:1-12 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 2 string("foo") @@ -37,7 +37,7 @@ $_main: 0009 RETURN int(1) foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_003.php:4-6 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_004.phpt b/Zend/tests/partial_application/pipe_optimization_004.phpt index a2ad5f72ed58..addee498d810 100644 --- a/Zend/tests/partial_application/pipe_optimization_004.phpt +++ b/Zend/tests/partial_application/pipe_optimization_004.phpt @@ -18,41 +18,44 @@ if (time() > 0) { } try { -2 |> foo(?, ?); + 2 |> foo(?, ?); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } ?> --EXPECTF-- $_main: - ; (lines=19, args=0, vars=1, tmps=2) + ; (lines=22, args=0, vars=1, tmps=%d) ; (after optimizer) ; %spipe_optimization_004.php:1-16 0000 INIT_FCALL 0 %d string("time") -0001 V2 = DO_ICALL -0002 T1 = IS_SMALLER int(0) V2 +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 0003 JMPZ T1 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 2 string("foo") -0006 SEND_PLACEHOLDER -0007 SEND_PLACEHOLDER +0006 SEND_PLACEHOLDER 1 +0007 SEND_PLACEHOLDER 2 0008 T1 = CALLABLE_CONVERT_PARTIAL %d 0009 INIT_DYNAMIC_CALL 1 T1 0010 SEND_VAL_EX int(2) 1 0011 DO_FCALL 0012 RETURN int(1) 0013 CV0($e) = CATCH string("Throwable") -0014 INIT_METHOD_CALL 0 CV0($e) string("getMessage") -0015 V1 = DO_FCALL -0016 ECHO V1 -0017 ECHO string("\n") -0018 RETURN int(1) +0014 T1 = FETCH_CLASS_NAME CV0($e) +0015 ECHO T1 +0016 ECHO string(": ") +0017 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0018 T1 = DO_FCALL +0019 ECHO T1 +0020 ECHO string("\n") +0021 RETURN int(1) EXCEPTION TABLE: 0005, 0013, -, - foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_004.php:4-6 0000 CV0($a) = RECV 1 @@ -64,7 +67,7 @@ foo: 0006 RETURN null $_main: - ; (lines=3, args=0, vars=0, tmps=1) + ; (lines=3, args=0, vars=0, tmps=%d) ; (after optimizer) ; %s:1-10 0000 T0 = DECLARE_LAMBDA_FUNCTION 0 @@ -72,7 +75,7 @@ $_main: 0002 RETURN int(1) {closure:%s:%d}: - ; (lines=7, args=2, vars=2, tmps=1) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %s:10-10 0000 CV0($a) = RECV 1 @@ -80,6 +83,6 @@ $_main: 0002 INIT_FCALL 2 %d string("foo") 0003 SEND_VAR CV0($a) 1 0004 SEND_VAR CV1($b) 2 -0005 V2 = DO_UCALL -0006 RETURN V2 -Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected +0005 T2 = DO_UCALL +0006 RETURN T2 +ArgumentCountError: Too few arguments to function {closure:pfa:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected diff --git a/Zend/tests/partial_application/pipe_optimization_005.phpt b/Zend/tests/partial_application/pipe_optimization_005.phpt index 3844e09aa8ad..3ccfec836609 100644 --- a/Zend/tests/partial_application/pipe_optimization_005.phpt +++ b/Zend/tests/partial_application/pipe_optimization_005.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA pipe optimization: PFA with only one placeholder can be optimized +PFA pipe optimization: PFA with only one placeholder can be optimized (variadic) --EXTENSIONS-- opcache --INI-- @@ -22,12 +22,12 @@ if (time() > 0) { ?> --EXPECTF-- $_main: - ; (lines=10, args=0, vars=0, tmps=2) + ; (lines=10, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_005.php:1-12 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 2 string("foo") @@ -37,7 +37,7 @@ $_main: 0009 RETURN int(1) foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_005.php:4-6 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_006.phpt b/Zend/tests/partial_application/pipe_optimization_006.phpt index 2a83f2b83fe9..6e06477427a3 100644 --- a/Zend/tests/partial_application/pipe_optimization_006.phpt +++ b/Zend/tests/partial_application/pipe_optimization_006.phpt @@ -22,12 +22,12 @@ if (time() > 0) { ?> --EXPECTF-- $_main: - ; (lines=11, args=0, vars=0, tmps=2) + ; (lines=11, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_006.php:1-12 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 1 string("foo") @@ -38,7 +38,7 @@ $_main: 0010 RETURN int(1) foo: - ; (lines=9, args=3, vars=3, tmps=0) + ; (lines=9, args=3, vars=3, tmps=%d) ; (after optimizer) ; %spipe_optimization_006.php:4-6 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_007.phpt b/Zend/tests/partial_application/pipe_optimization_007.phpt index 39dd48b632e4..09c3c765d237 100644 --- a/Zend/tests/partial_application/pipe_optimization_007.phpt +++ b/Zend/tests/partial_application/pipe_optimization_007.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA pipe optimization: PFA with multiple placeholders can not be optimized +PFA pipe optimization: PFA with multiple placeholders can not be optimized (named) --EXTENSIONS-- opcache --INI-- @@ -18,20 +18,20 @@ if (time() > 0) { } try { -2 |> foo(a: ?, b: ?); + 2 |> foo(a: ?, b: ?); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } ?> --EXPECTF-- $_main: - ; (lines=19, args=0, vars=1, tmps=2) + ; (lines=22, args=0, vars=1, tmps=%d) ; (after optimizer) ; %spipe_optimization_007.php:1-16 0000 INIT_FCALL 0 %d string("time") -0001 V2 = DO_ICALL -0002 T1 = IS_SMALLER int(0) V2 +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 0003 JMPZ T1 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 0 string("foo") @@ -43,16 +43,19 @@ $_main: 0011 DO_FCALL 0012 RETURN int(1) 0013 CV0($e) = CATCH string("Throwable") -0014 INIT_METHOD_CALL 0 CV0($e) string("getMessage") -0015 V1 = DO_FCALL -0016 ECHO V1 -0017 ECHO string("\n") -0018 RETURN int(1) +0014 T1 = FETCH_CLASS_NAME CV0($e) +0015 ECHO T1 +0016 ECHO string(": ") +0017 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0018 T1 = DO_FCALL +0019 ECHO T1 +0020 ECHO string("\n") +0021 RETURN int(1) EXCEPTION TABLE: 0005, 0013, -, - foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_007.php:4-6 0000 CV0($a) = RECV 1 @@ -64,7 +67,7 @@ foo: 0006 RETURN null $_main: - ; (lines=3, args=0, vars=0, tmps=1) + ; (lines=3, args=0, vars=0, tmps=%d) ; (after optimizer) ; %s:1-10 0000 T0 = DECLARE_LAMBDA_FUNCTION 0 @@ -72,7 +75,7 @@ $_main: 0002 RETURN int(1) {closure:%s:%d}: - ; (lines=7, args=2, vars=2, tmps=1) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %s:10-10 0000 CV0($a) = RECV 1 @@ -80,6 +83,6 @@ $_main: 0002 INIT_FCALL 2 %d string("foo") 0003 SEND_VAR CV0($a) 1 0004 SEND_VAR CV1($b) 2 -0005 V2 = DO_UCALL -0006 RETURN V2 -Too few arguments to function {closure:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected +0005 T2 = DO_UCALL +0006 RETURN T2 +ArgumentCountError: Too few arguments to function {closure:pfa:%s:%d}(), 1 passed in %s on line %d and exactly 2 expected diff --git a/Zend/tests/partial_application/pipe_optimization_008.phpt b/Zend/tests/partial_application/pipe_optimization_008.phpt index 6293f782d4d4..070074632c77 100644 --- a/Zend/tests/partial_application/pipe_optimization_008.phpt +++ b/Zend/tests/partial_application/pipe_optimization_008.phpt @@ -26,12 +26,12 @@ try { ?> --EXPECTF-- $_main: - ; (lines=18, args=0, vars=1, tmps=2) + ; (lines=18, args=0, vars=1, tmps=%d) ; (after optimizer) ; %spipe_optimization_008.php:1-16 0000 INIT_FCALL 0 %d string("time") -0001 V2 = DO_ICALL -0002 T1 = IS_SMALLER int(0) V2 +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 0003 JMPZ T1 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 0 string("foo") @@ -43,15 +43,15 @@ $_main: 0011 RETURN int(1) 0012 CV0($e) = CATCH string("Throwable") 0013 INIT_METHOD_CALL 0 CV0($e) string("getMessage") -0014 V1 = DO_FCALL -0015 ECHO V1 +0014 T1 = DO_FCALL +0015 ECHO T1 0016 ECHO string("\n") 0017 RETURN int(1) EXCEPTION TABLE: 0005, 0012, -, - foo: - ; (lines=7, args=2, vars=2, tmps=0) + ; (lines=7, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_008.php:4-6 0000 CV0($a) = RECV 1 @@ -63,7 +63,7 @@ foo: 0006 RETURN null $_main: - ; (lines=4, args=0, vars=1, tmps=1) + ; (lines=4, args=0, vars=1, tmps=%d) ; (after optimizer) ; %s:1-10 0000 T1 = DECLARE_LAMBDA_FUNCTION 0 @@ -74,7 +74,7 @@ LIVE RANGES: 1: 0001 - 0002 (tmp/var) {closure:%s:%d}: - ; (lines=18, args=1, vars=2, tmps=2) + ; (lines=18, args=1, vars=2, tmps=%d) ; (after optimizer) ; %s:10-10 0000 CV0($b) = RECV 1 @@ -85,15 +85,15 @@ LIVE RANGES: 0005 INIT_FCALL 2 %d string("foo") 0006 SEND_VAR CV1($a) 1 0007 SEND_VAR CV0($b) 2 -0008 V2 = DO_UCALL -0009 RETURN V2 +0008 T2 = DO_UCALL +0009 RETURN T2 0010 INIT_FCALL 2 %d string("foo") 0011 SEND_VAR CV1($a) 1 0012 SEND_VAR CV0($b) 2 0013 T2 = FUNC_GET_ARGS int(1) 0014 SEND_UNPACK T2 0015 CHECK_UNDEF_ARGS -0016 V2 = DO_UCALL -0017 RETURN V2 +0016 T2 = DO_UCALL +0017 RETURN T2 int(1) int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_009.phpt b/Zend/tests/partial_application/pipe_optimization_009.phpt index 090278661637..118482a3860b 100644 --- a/Zend/tests/partial_application/pipe_optimization_009.phpt +++ b/Zend/tests/partial_application/pipe_optimization_009.phpt @@ -34,35 +34,34 @@ lhs() |> foo(arg1(), ?, arg2()); ?> --EXPECTF-- $_main: - ; (lines=21, args=0, vars=0, tmps=2) + ; (lines=20, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_009.php:1-24 0000 INIT_FCALL 0 %d string("time") -0001 V1 = DO_ICALL -0002 T0 = IS_SMALLER int(0) V1 +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 0003 JMPZ T0 0008 0004 DECLARE_FUNCTION string("foo") 0 0005 DECLARE_FUNCTION string("lhs") 1 0006 DECLARE_FUNCTION string("arg1") 2 0007 DECLARE_FUNCTION string("arg2") 3 0008 INIT_FCALL_BY_NAME 0 string("lhs") -0009 V1 = DO_FCALL_BY_NAME -0010 T0 = QM_ASSIGN V1 -0011 INIT_FCALL_BY_NAME 3 string("foo") -0012 INIT_FCALL_BY_NAME 0 string("arg1") -0013 V1 = DO_FCALL_BY_NAME -0014 SEND_VAR_NO_REF_EX V1 1 -0015 SEND_VAL_EX T0 2 -0016 INIT_FCALL_BY_NAME 0 string("arg2") -0017 V0 = DO_FCALL_BY_NAME -0018 SEND_VAR_NO_REF_EX V0 3 -0019 DO_FCALL_BY_NAME -0020 RETURN int(1) +0009 T0 = DO_FCALL_BY_NAME +0010 INIT_FCALL_BY_NAME 3 string("foo") +0011 INIT_FCALL_BY_NAME 0 string("arg1") +0012 V1 = DO_FCALL_BY_NAME +0013 SEND_VAR_NO_REF_EX V1 1 +0014 SEND_VAL_EX T0 2 +0015 INIT_FCALL_BY_NAME 0 string("arg2") +0016 V0 = DO_FCALL_BY_NAME +0017 SEND_VAR_NO_REF_EX V0 3 +0018 DO_FCALL_BY_NAME +0019 RETURN int(1) LIVE RANGES: - 0: 0011 - 0015 (tmp/var) + 0: 0010 - 0014 (tmp/var) foo: - ; (lines=9, args=3, vars=3, tmps=0) + ; (lines=9, args=3, vars=3, tmps=%d) ; (after optimizer) ; %spipe_optimization_009.php:4-6 0000 CV0($a) = RECV 1 @@ -76,21 +75,21 @@ foo: 0008 RETURN null lhs: - ; (lines=2, args=0, vars=0, tmps=0) + ; (lines=2, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_009.php:7-10 0000 ECHO string("lhs\n") 0001 RETURN int(0) arg1: - ; (lines=2, args=0, vars=0, tmps=0) + ; (lines=2, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_009.php:11-14 0000 ECHO string("arg1\n") 0001 RETURN int(1) arg2: - ; (lines=2, args=0, vars=0, tmps=0) + ; (lines=2, args=0, vars=0, tmps=%d) ; (after optimizer) ; %spipe_optimization_009.php:15-18 0000 ECHO string("arg2\n") diff --git a/Zend/tests/partial_application/pipe_optimization_010.phpt b/Zend/tests/partial_application/pipe_optimization_010.phpt index 60202e72cfd1..f77c2a97732e 100644 --- a/Zend/tests/partial_application/pipe_optimization_010.phpt +++ b/Zend/tests/partial_application/pipe_optimization_010.phpt @@ -24,12 +24,12 @@ var_dump($a); ?> --EXPECTF-- $_main: - ; (lines=13, args=0, vars=1, tmps=2) + ; (lines=13, args=0, vars=1, tmps=%d) ; (after optimizer) ; %spipe_optimization_010.php:1-14 0000 INIT_FCALL 0 %d string("time") -0001 V2 = DO_ICALL -0002 T1 = IS_SMALLER int(0) V2 +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 0003 JMPZ T1 0005 0004 DECLARE_FUNCTION string("foo") 0 0005 INIT_FCALL_BY_NAME 2 string("foo") @@ -42,7 +42,7 @@ $_main: 0012 RETURN int(1) foo: - ; (lines=8, args=2, vars=2, tmps=0) + ; (lines=8, args=2, vars=2, tmps=%d) ; (after optimizer) ; %spipe_optimization_010.php:4-7 0000 CV0($a) = RECV 1 diff --git a/Zend/tests/partial_application/pipe_optimization_011.phpt b/Zend/tests/partial_application/pipe_optimization_011.phpt index 1a39e4ff2f0d..cd1c986d99e7 100644 --- a/Zend/tests/partial_application/pipe_optimization_011.phpt +++ b/Zend/tests/partial_application/pipe_optimization_011.phpt @@ -15,10 +15,6 @@ if (time() > 0) { function foo($a, $b, $c) { var_dump($a, $b, $c); } - function lhs() { - echo __FUNCTION__, "\n"; - return 0; - } function arg1() { global $a; $a = 2; @@ -39,34 +35,33 @@ $a |> foo(arg1(), ?, arg2()); ?> --EXPECTF-- $_main: - ; (lines=20, args=0, vars=1, tmps=2) + ; (lines=19, args=0, vars=1, tmps=%d) ; (after optimizer) - ; %spipe_optimization_011.php:1-29 + ; %spipe_optimization_011.php:1-25 0000 INIT_FCALL 0 %d string("time") -0001 V2 = DO_ICALL -0002 T1 = IS_SMALLER int(0) V2 -0003 JMPZ T1 0008 +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 +0003 JMPZ T1 0007 0004 DECLARE_FUNCTION string("foo") 0 -0005 DECLARE_FUNCTION string("lhs") 1 -0006 DECLARE_FUNCTION string("arg1") 2 -0007 DECLARE_FUNCTION string("arg2") 3 -0008 ASSIGN CV0($a) int(0) -0009 T1 = QM_ASSIGN CV0($a) -0010 INIT_FCALL_BY_NAME 3 string("foo") -0011 INIT_FCALL_BY_NAME 0 string("arg1") -0012 V2 = DO_FCALL_BY_NAME -0013 SEND_VAR_NO_REF_EX V2 1 -0014 SEND_VAL_EX T1 2 -0015 INIT_FCALL_BY_NAME 0 string("arg2") -0016 V1 = DO_FCALL_BY_NAME -0017 SEND_VAR_NO_REF_EX V1 3 -0018 DO_FCALL_BY_NAME -0019 RETURN int(1) +0005 DECLARE_FUNCTION string("arg1") %d +0006 DECLARE_FUNCTION string("arg2") %d +0007 ASSIGN CV0($a) int(0) +0008 T1 = QM_ASSIGN CV0($a) +0009 INIT_FCALL_BY_NAME 3 string("foo") +0010 INIT_FCALL_BY_NAME 0 string("arg1") +0011 V2 = DO_FCALL_BY_NAME +0012 SEND_VAR_NO_REF_EX V2 1 +0013 SEND_VAL_EX T1 2 +0014 INIT_FCALL_BY_NAME 0 string("arg2") +0015 V1 = DO_FCALL_BY_NAME +0016 SEND_VAR_NO_REF_EX V1 3 +0017 DO_FCALL_BY_NAME +0018 RETURN int(1) LIVE RANGES: - 1: 0010 - 0014 (tmp/var) + 1: 0009 - 0013 (tmp/var) foo: - ; (lines=9, args=3, vars=3, tmps=0) + ; (lines=9, args=3, vars=3, tmps=%d) ; (after optimizer) ; %spipe_optimization_011.php:4-6 0000 CV0($a) = RECV 1 @@ -79,26 +74,19 @@ foo: 0007 DO_ICALL 0008 RETURN null -lhs: - ; (lines=2, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %spipe_optimization_011.php:7-10 -0000 ECHO string("lhs\n") -0001 RETURN int(0) - arg1: - ; (lines=4, args=0, vars=1, tmps=0) + ; (lines=4, args=0, vars=1, tmps=%d) ; (after optimizer) - ; %spipe_optimization_011.php:11-16 + ; %spipe_optimization_011.php:7-12 0000 BIND_GLOBAL CV0($a) string("a") 0001 ASSIGN CV0($a) int(2) 0002 ECHO string("arg1\n") 0003 RETURN int(1) arg2: - ; (lines=4, args=0, vars=1, tmps=0) + ; (lines=4, args=0, vars=1, tmps=%d) ; (after optimizer) - ; %spipe_optimization_011.php:17-22 + ; %spipe_optimization_011.php:13-18 0000 BIND_GLOBAL CV0($a) string("a") 0001 ASSIGN CV0($a) int(3) 0002 ECHO string("arg2\n") diff --git a/Zend/tests/partial_application/pipe_optimization_012.phpt b/Zend/tests/partial_application/pipe_optimization_012.phpt new file mode 100644 index 000000000000..da172874adce --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_012.phpt @@ -0,0 +1,52 @@ +--TEST-- +PFA optimization: PFA with named args and placeholders can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +1 |> foo(?, b: 2); + +?> +--EXPECTF-- +$_main: + ; (lines=11, args=0, vars=0, tmps=%d) + ; (after optimizer) + ; %s:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 1 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(2) string("b") +0008 CHECK_UNDEF_ARGS +0009 DO_FCALL_BY_NAME +0010 RETURN int(1) + +foo: + ; (lines=7, args=2, vars=2, tmps=%d) + ; (after optimizer) + ; %s:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_013.phpt b/Zend/tests/partial_application/pipe_optimization_013.phpt new file mode 100644 index 000000000000..7d1a48b2f2ed --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_013.phpt @@ -0,0 +1,87 @@ +--TEST-- +PFA optimization: PFA with named args and a variadic placeholder can not be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b) { + var_dump($a, $b); + } +} + +1 |> foo(b: 2, ...); + +?> +--EXPECTF-- +$_main: + ; (lines=12, args=0, vars=0, tmps=%d) + ; (after optimizer) + ; %s:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 0 string("foo") +0006 SEND_VAL_EX int(2) string("b") +0007 T0 = CALLABLE_CONVERT_PARTIAL 3 +0008 INIT_DYNAMIC_CALL 1 T0 +0009 SEND_VAL_EX int(1) 1 +0010 DO_FCALL +0011 RETURN int(1) + +foo: + ; (lines=7, args=2, vars=2, tmps=%d) + ; (after optimizer) + ; %s:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV 2 +0002 INIT_FCALL 2 %d string("var_dump") +0003 SEND_VAR CV0($a) 1 +0004 SEND_VAR CV1($b) 2 +0005 DO_ICALL +0006 RETURN null + +$_main: + ; (lines=4, args=0, vars=1, tmps=%d) + ; (after optimizer) + ; %s:1-9 +0000 T1 = DECLARE_LAMBDA_FUNCTION 0 +0001 BIND_LEXICAL T1 CV0($b) +0002 FREE T1 +0003 RETURN int(1) +LIVE RANGES: + 1: 0001 - 0002 (tmp/var) + +{closure:pfa:%s:9}: + ; (lines=18, args=1, vars=2, tmps=%d) + ; (after optimizer) + ; %s:9-9 +0000 CV0($a) = RECV 1 +0001 BIND_STATIC CV1($b) +0002 T3 = FUNC_NUM_ARGS +0003 T2 = IS_SMALLER_OR_EQUAL T3 int(1) +0004 JMPZ T2 0010 +0005 INIT_FCALL 2 %d string("foo") +0006 SEND_VAR CV0($a) 1 +0007 SEND_VAR CV1($b) 2 +0008 T2 = DO_UCALL +0009 RETURN T2 +0010 INIT_FCALL 2 %d string("foo") +0011 SEND_VAR CV0($a) 1 +0012 SEND_VAR CV1($b) 2 +0013 T2 = FUNC_GET_ARGS int(1) +0014 SEND_UNPACK T2 +0015 CHECK_UNDEF_ARGS +0016 T2 = DO_UCALL +0017 RETURN T2 +int(1) +int(2) diff --git a/Zend/tests/partial_application/pipe_optimization_014.phpt b/Zend/tests/partial_application/pipe_optimization_014.phpt new file mode 100644 index 000000000000..6e66d7e0e99d --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_014.phpt @@ -0,0 +1,68 @@ +--TEST-- +PFA pipe optimization: PFA with unknown named parameter can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b = null, $c = null) { + var_dump($a, $b, $c); + } +} + +try { + 2 |> foo(1, unknown: ?); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +$_main: + ; (lines=20, args=0, vars=1, tmps=%d) + ; (after optimizer) + ; %s:1-16 +0000 INIT_FCALL 0 %d string("time") +0001 T2 = DO_ICALL +0002 T1 = IS_SMALLER int(0) T2 +0003 JMPZ T1 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 1 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(2) string("unknown") +0008 CHECK_UNDEF_ARGS +0009 DO_FCALL_BY_NAME +0010 RETURN int(1) +0011 CV0($e) = CATCH string("Error") +0012 T1 = FETCH_CLASS_NAME CV0($e) +0013 ECHO T1 +0014 ECHO string(": ") +0015 INIT_METHOD_CALL 0 CV0($e) string("getMessage") +0016 T1 = DO_FCALL +0017 ECHO T1 +0018 ECHO string("\n") +0019 RETURN int(1) +EXCEPTION TABLE: + 0005, 0011, -, - + +foo: + ; (lines=9, args=3, vars=3, tmps=%d) + ; (after optimizer) + ; %s:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV_INIT 2 null +0002 CV2($c) = RECV_INIT 3 null +0003 INIT_FCALL 3 %d string("var_dump") +0004 SEND_VAR CV0($a) 1 +0005 SEND_VAR CV1($b) 2 +0006 SEND_VAR CV2($c) 3 +0007 DO_ICALL +0008 RETURN null +Error: Unknown named parameter $unknown diff --git a/Zend/tests/partial_application/pipe_optimization_015.phpt b/Zend/tests/partial_application/pipe_optimization_015.phpt new file mode 100644 index 000000000000..ce293c7a300c --- /dev/null +++ b/Zend/tests/partial_application/pipe_optimization_015.phpt @@ -0,0 +1,55 @@ +--TEST-- +PFA pipe optimization: PFA with skipped optional parameter can be optimized +--EXTENSIONS-- +opcache +--INI-- +opcache.opt_debug_level=0x20000 +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_cache= +opcache.file_cache_only=0 +--FILE-- + 0) { + function foo($a, $b = null, $c = null) { + var_dump($a, $b, $c); + } +} + +3 |> foo(1, c: ?); + +?> +--EXPECTF-- +$_main: + ; (lines=11, args=0, vars=0, tmps=%d) + ; (after optimizer) + ; %s:1-12 +0000 INIT_FCALL 0 %d string("time") +0001 T1 = DO_ICALL +0002 T0 = IS_SMALLER int(0) T1 +0003 JMPZ T0 0005 +0004 DECLARE_FUNCTION string("foo") 0 +0005 INIT_FCALL_BY_NAME 1 string("foo") +0006 SEND_VAL_EX int(1) 1 +0007 SEND_VAL_EX int(3) string("c") +0008 CHECK_UNDEF_ARGS +0009 DO_FCALL_BY_NAME +0010 RETURN int(1) + +foo: + ; (lines=9, args=3, vars=3, tmps=%d) + ; (after optimizer) + ; %s:4-6 +0000 CV0($a) = RECV 1 +0001 CV1($b) = RECV_INIT 2 null +0002 CV2($c) = RECV_INIT 3 null +0003 INIT_FCALL 3 %d string("var_dump") +0004 SEND_VAR CV0($a) 1 +0005 SEND_VAR CV1($b) 2 +0006 SEND_VAR CV2($c) 3 +0007 DO_ICALL +0008 RETURN null +int(1) +NULL +int(3) diff --git a/Zend/tests/partial_application/preloading.phpt b/Zend/tests/partial_application/preloading.phpt index 5e3069c271a6..23ad6edf2c4c 100644 --- a/Zend/tests/partial_application/preloading.phpt +++ b/Zend/tests/partial_application/preloading.phpt @@ -4,6 +4,10 @@ PFA preloading opcache.enable=1 opcache.enable_cli=1 opcache.preload={PWD}/preloading.inc +--SKIPIF-- + --FILE-- bindTo(new Unrelated)(1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } echo "# Cannot unbind \$this on instance method:\n"; try { $f->bindTo(null)(1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } echo "# Can unbind \$this on static method:\n"; -try { - $g->bindTo(null)(1); -} catch (Error $e) { - echo $e->getMessage(), "\n"; -} +$g->bindTo(null)(1); ?> --EXPECTF-- @@ -54,10 +50,10 @@ object(SubClass)#%d (0) { # Cannot be rebound to an unrelated class: Warning: Cannot bind method C::{closure:%s:%d}() to object of class Unrelated, this will be an error in PHP 9 in %s on line %d -Value of type null is not callable +Error: Value of type null is not callable # Cannot unbind $this on instance method: Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d -Value of type null is not callable +Error: Value of type null is not callable # Can unbind $this on static method: string(1) "C" diff --git a/Zend/tests/partial_application/rebinding_002.phpt b/Zend/tests/partial_application/rebinding_002.phpt index fca6db08500f..25e938120676 100644 --- a/Zend/tests/partial_application/rebinding_002.phpt +++ b/Zend/tests/partial_application/rebinding_002.phpt @@ -25,7 +25,7 @@ try { echo $e->getMessage(), "\n"; } -echo "# Function cannot be refound to a different scope:\n"; +echo "# Function cannot be rebound to a different scope:\n"; try { $g->bindTo($c, SubClass::class)(1); } catch (Error $e) { @@ -39,7 +39,7 @@ string(1) "C" Warning: Cannot rebind scope of closure created from method, this will be an error in PHP 9 in %s on line %d Value of type null is not callable -# Function cannot be refound to a different scope: +# Function cannot be rebound to a different scope: Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d Value of type null is not callable diff --git a/Zend/tests/partial_application/rebinding_003.phpt b/Zend/tests/partial_application/rebinding_003.phpt index 7b8a29231c32..9417bbc2d320 100644 --- a/Zend/tests/partial_application/rebinding_003.phpt +++ b/Zend/tests/partial_application/rebinding_003.phpt @@ -4,8 +4,12 @@ Rebinding PFA of Closure rebinds inner Closure f(?); -$g = $c->g(?); +$f = $c->getF()(?); +$g = $c->getG()(?); echo "# Can be rebound to \$this of the same class:\n"; -$f->bindTo(new C)($c); +$d = new C(); +$f->bindTo($d)($d); echo "# Can be rebound to \$this of a sub-class:\n"; -$f->bindTo(new SubClass)($c); +$d = new SubClass(); +$f->bindTo($d)($d); echo "# Cannot be rebound to an unrelated class:\n"; try { $f->bindTo(new Unrelated)($c); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } -echo "# Cannot unbind \$this on instance method:\n"; +echo "# Cannot unbind \$this on non-static closure:\n"; try { $f->bindTo(null)($c); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } -echo "# Can unbind \$this on static method:\n"; -try { - $g->bindTo(null)($c); -} catch (Error $e) { - echo $e->getMessage(), "\n"; -} +echo "# Can unbind \$this on static closure:\n"; +$g->bindTo(null)($c); ?> --EXPECTF-- # Can be rebound to $this of the same class: object(C)#%d (0) { } -bool(false) +bool(true) # Can be rebound to $this of a sub-class: object(SubClass)#%d (0) { } -bool(false) +bool(true) # Cannot be rebound to an unrelated class: Warning: Cannot bind method C::{closure:%s:%d}() to object of class Unrelated, this will be an error in PHP 9 in %s on line %d -Value of type null is not callable -# Cannot unbind $this on instance method: +Error: Value of type null is not callable +# Cannot unbind $this on non-static closure: Warning: Cannot unbind $this of method, this will be an error in PHP 9 in %s on line %d -Value of type null is not callable -# Can unbind $this on static method: +Error: Value of type null is not callable +# Can unbind $this on static closure: string(1) "C" +object(C)#%d (0) { +} diff --git a/Zend/tests/partial_application/references_001.phpt b/Zend/tests/partial_application/references_001.phpt index 4a6a8663d870..080b3085acc0 100644 --- a/Zend/tests/partial_application/references_001.phpt +++ b/Zend/tests/partial_application/references_001.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA returns by val if the actual function does +PFA receives by val if the actual function does --FILE-- static function {closure:%s:%d} ] { - Bound Variables [2] { Variable #0 [ $a ] - Variable #1 [ $args0 ] + Variable #1 [ $args1 ] } - Parameters [2] { - Parameter #0 [ &$args1 ] + Parameter #0 [ &$args0 ] Parameter #1 [ &...$args ] } } diff --git a/Zend/tests/partial_application/reflection_001.phpt b/Zend/tests/partial_application/reflection_001.phpt index 4ee997f562db..f101bc3348e0 100644 --- a/Zend/tests/partial_application/reflection_001.phpt +++ b/Zend/tests/partial_application/reflection_001.phpt @@ -1,5 +1,5 @@ --TEST-- -PFA reflection: required parameters +PFA reflection: optional parameters --FILE-- getSelf(?); echo (string) new ReflectionFunction($self), "\n"; @@ -35,6 +37,8 @@ try { echo $e->getMessage(), "\n"; } +echo "# C::getStatic():\n"; + $static = $c->getStatic(?); echo (string) new ReflectionFunction($static), "\n"; @@ -49,24 +53,32 @@ try { $d = new D; +echo "# D::getSelf():\n"; + $self = $d->getSelf(?); echo (string) new ReflectionFunction($self), "\n"; var_dump($self($d)); -var_dump($self(new D)); +var_dump($self(new C)); try { $self(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ": ", $e->getMessage(), "\n"; } +echo "# D::getStatic():\n"; + $static = $d->getStatic(?); echo (string) new ReflectionFunction($static), "\n"; var_dump($static($d)); -var_dump($static(new D)); +try { + var_dump($static(new C)); +} catch (Error $e) { + echo $e::class, ": ", $e->getMessage(), "\n"; +} try { $static(new stdClass); } catch (Error $e) { @@ -75,8 +87,9 @@ try { ?> --EXPECTF-- +# C::getSelf(): Closure [ public method {closure:%s:%d} ] { - @@ %s.php 23 - 23 + @@ %s 25 - 25 - Parameters [1] { Parameter #0 [ object $o ] @@ -89,8 +102,9 @@ object(C)#%d (0) { object(D)#%d (0) { } C::getSelf(): Return value must be of type C, stdClass returned +# C::getStatic(): Closure [ public method {closure:%s:%d} ] { - @@ %s.php 35 - 35 + @@ %s 39 - 39 - Parameters [1] { Parameter #0 [ object $o ] @@ -103,8 +117,9 @@ object(C)#%d (0) { object(D)#%d (0) { } C::getStatic(): Return value must be of type C, stdClass returned +# D::getSelf(): Closure [ public method {closure:%s:%d} ] { - @@ %s.php 49 - 49 + @@ %s 55 - 55 - Parameters [1] { Parameter #0 [ object $o ] @@ -114,11 +129,12 @@ Closure [ public method {closure:%s:%d} ] { object(D)#%d (0) { } -object(D)#%d (0) { +object(C)#%d (0) { } -C::getSelf(): Return value must be of type C, stdClass returned +TypeError: C::getSelf(): Return value must be of type C, stdClass returned +# D::getStatic(): Closure [ public method {closure:%s:%d} ] { - @@ %s.php 61 - 61 + @@ %s 69 - 69 - Parameters [1] { Parameter #0 [ object $o ] @@ -128,6 +144,5 @@ Closure [ public method {closure:%s:%d} ] { object(D)#%d (0) { } -object(D)#%d (0) { -} +TypeError: C::getStatic(): Return value must be of type D, C returned C::getStatic(): Return value must be of type D, stdClass returned diff --git a/Zend/tests/partial_application/rfc_examples.inc b/Zend/tests/partial_application/rfc_examples.inc index f6e7d9f6266d..53babc07888b 100644 --- a/Zend/tests/partial_application/rfc_examples.inc +++ b/Zend/tests/partial_application/rfc_examples.inc @@ -52,6 +52,7 @@ function check_equivalence($tests) '?float' => 100.5 + $i, 'string' => (string) (100 + $i), 'Point' => new Point, + 'mixed' => "mixed($i)", '' => "mixed($i)", }; } diff --git a/Zend/tests/partial_application/rfc_examples_debug.phpt b/Zend/tests/partial_application/rfc_examples_debug.phpt index be06e24229f7..9c5501090d4e 100644 --- a/Zend/tests/partial_application/rfc_examples_debug.phpt +++ b/Zend/tests/partial_application/rfc_examples_debug.phpt @@ -12,7 +12,7 @@ function g() { } $f = f(?, ?, 3); -$f(1,2); +$f(1, 2); ?> --EXPECTF-- diff --git a/Zend/tests/partial_application/rfc_examples_eval_order.phpt b/Zend/tests/partial_application/rfc_examples_eval_order.phpt index b54ce0ce15e4..2fd6c9422e92 100644 --- a/Zend/tests/partial_application/rfc_examples_eval_order.phpt +++ b/Zend/tests/partial_application/rfc_examples_eval_order.phpt @@ -4,12 +4,12 @@ PFA RFC examples: "Evaluation order" section speak($who, getArg()); diff --git a/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt b/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt index 2455252b3eba..dd99cb229ae8 100644 --- a/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt +++ b/Zend/tests/partial_application/rfc_examples_incompatible_functions.phpt @@ -4,11 +4,11 @@ PFA RFC examples: "Incompatible functions" section getMessage(), "\n"; } ?> --EXPECT-- -Error: Cannot call func_get_args() dynamically +Error: Cannot call func_get_arg() dynamically diff --git a/Zend/tests/partial_application/rfc_examples_magic_methods.phpt b/Zend/tests/partial_application/rfc_examples_magic_methods.phpt index bf3ce3404e66..7162a790c57c 100644 --- a/Zend/tests/partial_application/rfc_examples_magic_methods.phpt +++ b/Zend/tests/partial_application/rfc_examples_magic_methods.phpt @@ -18,7 +18,7 @@ check_equivalence([ 'Test 1' => [ $f->method(?, ?), (function ($f) { - return fn($args0, $args1) => $f->method($args0, $args1); + return fn(mixed $arguments0, mixed $arguments1) => $f->method($arguments0, $arguments1); })($f)->bindTo($f), ], ]); diff --git a/Zend/tests/partial_application/static_pfa_001.phpt b/Zend/tests/partial_application/static_pfa_001.phpt new file mode 100644 index 000000000000..bc0f65b1ffd8 --- /dev/null +++ b/Zend/tests/partial_application/static_pfa_001.phpt @@ -0,0 +1,45 @@ +--TEST-- +PFA of static method is static +--FILE-- +f(?); +echo new ReflectionFunction($f), "\n"; +$f(1); + +// Warns +var_dump($f->bindTo(new C)); + +?> +--EXPECTF-- +Closure [ static public method {closure:pfa:%s:9} ] { + @@ %s 9 - 9 + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +int(1) +Closure [ static public method {closure:pfa:%s:13} ] { + @@ %s 13 - 13 + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +int(1) + +Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d +NULL diff --git a/Zend/tests/partial_application/static_pfa_002.phpt b/Zend/tests/partial_application/static_pfa_002.phpt new file mode 100644 index 000000000000..5222109958b8 --- /dev/null +++ b/Zend/tests/partial_application/static_pfa_002.phpt @@ -0,0 +1,35 @@ +--TEST-- +PFA of instance method is not static +--FILE-- +f(?); +echo new ReflectionFunction($f), "\n"; +$f($c); + +$c2 = new C(); +$f->bindTo($c2)($c2); + +?> +--EXPECTF-- +Closure [ public method {closure:pfa:%s:10} ] { + @@ %s 10 - 10 + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +object(C)#%d (0) { +} +bool(true) +object(C)#%d (0) { +} +bool(true) diff --git a/Zend/tests/partial_application/static_pfa_003.phpt b/Zend/tests/partial_application/static_pfa_003.phpt new file mode 100644 index 000000000000..e7b3c187e187 --- /dev/null +++ b/Zend/tests/partial_application/static_pfa_003.phpt @@ -0,0 +1,30 @@ +--TEST-- +PFA of standalone function is static +--FILE-- +bindTo(new class {})); + +?> +--EXPECTF-- +Closure [ static function {closure:pfa:%s:7} ] { + @@ %s 7 - 7 + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +int(1) + +Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d +NULL diff --git a/Zend/tests/partial_application/static_pfa_004.phpt b/Zend/tests/partial_application/static_pfa_004.phpt new file mode 100644 index 000000000000..9b842c91c4cd --- /dev/null +++ b/Zend/tests/partial_application/static_pfa_004.phpt @@ -0,0 +1,39 @@ +--TEST-- +PFA of non-static closure is not static +--FILE-- +bindTo($c2)($c2); + +?> +--EXPECTF-- +Closure [ function {closure:pfa:%s:11} ] { + @@ %s 11 - 11 + + - Bound Variables [1] { + Variable #0 [ $fn ] + } + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +NULL +bool(false) +object(class@anonymous)#3 (0) { +} +bool(true) diff --git a/Zend/tests/partial_application/static_pfa_005.phpt b/Zend/tests/partial_application/static_pfa_005.phpt new file mode 100644 index 000000000000..2783485b2f49 --- /dev/null +++ b/Zend/tests/partial_application/static_pfa_005.phpt @@ -0,0 +1,34 @@ +--TEST-- +PFA of static closure is static +--FILE-- +bindTo(new class {})); + +?> +--EXPECTF-- +Closure [ static function {closure:pfa:%s:7} ] { + @@ %s 7 - 7 + + - Bound Variables [1] { + Variable #0 [ $fn ] + } + + - Parameters [1] { + Parameter #0 [ $a ] + } +} + +int(1) + +Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d +NULL diff --git a/Zend/tests/partial_application/static_polymorphism.phpt b/Zend/tests/partial_application/static_polymorphism.phpt new file mode 100644 index 000000000000..5f121c65c0e8 --- /dev/null +++ b/Zend/tests/partial_application/static_polymorphism.phpt @@ -0,0 +1,43 @@ +--TEST-- +PFA: static polymorphism +--FILE-- + +--EXPECT-- +P::m +string(1) "a" +C::m +array(0) { +} +P::m +string(1) "a" +C::m +array(0) { +} diff --git a/Zend/tests/partial_application/statics_001.phpt b/Zend/tests/partial_application/static_vars_001.phpt similarity index 70% rename from Zend/tests/partial_application/statics_001.phpt rename to Zend/tests/partial_application/static_vars_001.phpt index 906c0dedf121..610cddf37b54 100644 --- a/Zend/tests/partial_application/statics_001.phpt +++ b/Zend/tests/partial_application/static_vars_001.phpt @@ -10,13 +10,12 @@ function foo($a) { return $var; } -foo(new stdClass); +var_dump(foo(new stdClass)); $foo = foo(new stdClass, ...); -if ($foo() == 2) { - echo "OK"; -} +var_dump($foo()); ?> ---EXPECTF-- -OK +--EXPECT-- +int(1) +int(2) diff --git a/Zend/tests/partial_application/statics_002.phpt b/Zend/tests/partial_application/static_vars_002.phpt similarity index 76% rename from Zend/tests/partial_application/statics_002.phpt rename to Zend/tests/partial_application/static_vars_002.phpt index 8e1b6cefe00a..4e6cc82b720d 100644 --- a/Zend/tests/partial_application/statics_002.phpt +++ b/Zend/tests/partial_application/static_vars_002.phpt @@ -10,14 +10,13 @@ $closure = function ($a) { return $var; }; -$closure(new stdClass); +var_dump($closure(new stdClass)); $foo = $closure(new stdClass, ...); $closure = null; -if ($foo() == 2) { - echo "OK"; -} +var_dump($foo()); ?> --EXPECT-- -OK +int(1) +int(2) diff --git a/Zend/tests/partial_application/statics_003.phpt b/Zend/tests/partial_application/static_vars_003.phpt similarity index 74% rename from Zend/tests/partial_application/statics_003.phpt rename to Zend/tests/partial_application/static_vars_003.phpt index 9fb2568a67e7..04328bf717b8 100644 --- a/Zend/tests/partial_application/statics_003.phpt +++ b/Zend/tests/partial_application/static_vars_003.phpt @@ -10,7 +10,7 @@ $closure = function ($a) { return $var; }; -$closure(new stdClass); +var_dump($closure(new stdClass)); $foo = $closure(?); $closure = null; @@ -18,9 +18,8 @@ $closure = null; $bar = $foo(?); $foo = null; -if ($bar(new stdClass) == 2) { - echo "OK"; -} +var_dump($bar(new stdClass)); ?> --EXPECT-- -OK +int(1) +int(2) diff --git a/Zend/tests/partial_application/variation_call_001.phpt b/Zend/tests/partial_application/variation_call_001.phpt index 72bccd1292b3..b9c1c19ec9c6 100644 --- a/Zend/tests/partial_application/variation_call_001.phpt +++ b/Zend/tests/partial_application/variation_call_001.phpt @@ -24,7 +24,7 @@ $closure = $bar->method(?, new Param); $closure(1); -$closure->call(new Foo(), 10); +$closure->call(/* newThis: */ new Foo(), 10); ?> --EXPECT-- Bar: 1, Param diff --git a/Zend/tests/partial_application/variation_closure_001.phpt b/Zend/tests/partial_application/variation_closure_001.phpt index c84f8d05f38c..1d31f22c7f8a 100644 --- a/Zend/tests/partial_application/variation_closure_001.phpt +++ b/Zend/tests/partial_application/variation_closure_001.phpt @@ -3,14 +3,19 @@ PFA variation: Closure --FILE-- --EXPECTF-- -Closure [ static function {closure:%s:%d} ] { - @@ %s 6 - 6 +Closure [ function {closure:%s:%d} ] { + @@ %s 5 - 5 - Bound Variables [2] { Variable #0 [ $fn ] @@ -21,3 +26,15 @@ Closure [ static function {closure:%s:%d} ] { Parameter #0 [ $b ] } } +Closure [ function {closure:pfa:%s:%d} ] { + @@ %s 10 - 10 + + - Bound Variables [2] { + Variable #0 [ $fn2 ] + Variable #1 [ $a ] + } + + - Parameters [1] { + Parameter #0 [ $fn ] + } +} diff --git a/Zend/tests/partial_application/variation_debug_002.phpt b/Zend/tests/partial_application/variation_debug_002.phpt index 46f80b8b2726..9a1121ed7918 100644 --- a/Zend/tests/partial_application/variation_debug_002.phpt +++ b/Zend/tests/partial_application/variation_debug_002.phpt @@ -2,7 +2,7 @@ PFA variation: var_dump(), internal function --FILE-- --EXPECTF-- object(Closure)#%d (5) { diff --git a/Zend/tests/partial_application/variation_ex_001.phpt b/Zend/tests/partial_application/variation_ex_001.phpt index 48db63e70a5e..0f36e90f616d 100644 --- a/Zend/tests/partial_application/variation_ex_001.phpt +++ b/Zend/tests/partial_application/variation_ex_001.phpt @@ -5,7 +5,7 @@ PFA variation: UAF in cleanup unfinished calls function test($a){} try { - test(1,...)(?); + test(1, ...)(?); } catch (Error $ex) { echo $ex::class, ": ", $ex->getMessage(), "\n"; } diff --git a/Zend/tests/partial_application/variation_gc_001.phpt b/Zend/tests/partial_application/variation_gc_001.phpt index 887156afc7e1..2db49cc74363 100644 --- a/Zend/tests/partial_application/variation_gc_001.phpt +++ b/Zend/tests/partial_application/variation_gc_001.phpt @@ -5,9 +5,9 @@ PFA variation: GC (001) #[AllowDynamicProperties] class Foo { - public function __construct($a) { - $this->method = self::__construct(new stdClass, ...); - } + public function __construct($a) { + $this->method = self::__construct(new stdClass, ...); + } } $foo = new Foo(new stdClass); diff --git a/Zend/tests/partial_application/variation_invoke_001.phpt b/Zend/tests/partial_application/variation_invoke_001.phpt index a6091e955b15..9285c08da19b 100644 --- a/Zend/tests/partial_application/variation_invoke_001.phpt +++ b/Zend/tests/partial_application/variation_invoke_001.phpt @@ -8,7 +8,7 @@ function foo($a, $b) { $foo = foo(b: 10, ...); -var_dump($foo->__invoke(32) == 42); +var_dump($foo->__invoke(32)); try { $foo->nothing(); @@ -17,5 +17,5 @@ try { } ?> --EXPECT-- -bool(true) +int(42) Error: Call to undefined method Closure::nothing() diff --git a/Zend/tests/partial_application/variation_parent_001.phpt b/Zend/tests/partial_application/variation_parent_001.phpt index 6b7545daf2d0..98095f45009a 100644 --- a/Zend/tests/partial_application/variation_parent_001.phpt +++ b/Zend/tests/partial_application/variation_parent_001.phpt @@ -14,7 +14,7 @@ $foo = new Foo(); $bar = $foo->method(10, ...); $baz = $bar(20, ...); -var_dump($baz, $baz()); +var_dump($baz, $c = $baz(), $c() === $foo); ?> --EXPECTF-- object(Closure)#%d (6) { @@ -73,3 +73,4 @@ object(Closure)#%d (4) { object(Foo)#%d (0) { } } +bool(true) diff --git a/Zend/tests/partial_application/variation_variadics_004.phpt b/Zend/tests/partial_application/variation_variadics_004.phpt index 55ef6cd344f1..228404dc8272 100644 --- a/Zend/tests/partial_application/variation_variadics_004.phpt +++ b/Zend/tests/partial_application/variation_variadics_004.phpt @@ -3,63 +3,43 @@ PFA variation: variadics and optional args --FILE-- $day, "month" => $month, "year" => $year]; + printf("%04d-%02d-%02d\n", $year, $month, $day); } $foo = foo(year: 2006, ...); -var_dump($foo(2)); +echo "# Bound year, pass day:\n"; + +$foo(2); $foo = foo(month: 12, ...); $bar = $foo(year: 2016, ...); -var_dump($foo(2)); +echo "# Bound month, pass day:\n"; + +$foo(2); + +echo "# Bound month, bound year, pass day:\n"; + +$bar(2); + +echo "# Bound month, no args:\n"; -var_dump($bar(2)); +$foo(); -var_dump($foo()); +echo "# Bound month, bound year, no args:\n"; -var_dump($bar()); +$bar(); ?> ---EXPECTF-- -array(3) { - ["day"]=> - int(2) - ["month"]=> - int(1) - ["year"]=> - int(2006) -} -array(3) { - ["day"]=> - int(2) - ["month"]=> - int(12) - ["year"]=> - int(2005) -} -array(3) { - ["day"]=> - int(2) - ["month"]=> - int(12) - ["year"]=> - int(2016) -} -array(3) { - ["day"]=> - int(1) - ["month"]=> - int(12) - ["year"]=> - int(2005) -} -array(3) { - ["day"]=> - int(1) - ["month"]=> - int(12) - ["year"]=> - int(2016) -} +--EXPECT-- +# Bound year, pass day: +2006-01-02 +# Bound month, pass day: +2005-12-02 +# Bound month, bound year, pass day: +2016-12-02 +# Bound month, no args: +2005-12-01 +# Bound month, bound year, no args: +2016-12-01 diff --git a/Zend/zend_API.c b/Zend/zend_API.c index c97d9308e208..2643f9e61367 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -374,7 +374,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void) ); } -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va) /* {{{ */ +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic_ex( + const zend_function *function, uint32_t arg_num, + zend_class_entry *error_ce, const char *format, va_list va) { zend_string *func_name; const char *arg_name; @@ -383,8 +385,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_en return; } - func_name = get_active_function_or_method_name(); - arg_name = get_active_function_arg_name(arg_num); + func_name = get_function_or_method_name(function); + arg_name = get_function_arg_name(function, arg_num); zend_vspprintf(&message, 0, format, va); zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", @@ -394,8 +396,27 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_en efree(message); zend_string_release(func_name); } + +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va) /* {{{ */ +{ + ZEND_ASSERT(zend_is_executing()); + + const zend_function *function = zend_active_function(); + + zend_argument_error_variadic_ex(function, arg_num, error_ce, format, va); +} /* }}} */ +ZEND_API ZEND_COLD void zend_argument_error_ex(const zend_function *function, + uint32_t arg_num, zend_class_entry *error_ce, const char *format, ...) +{ + va_list va; + + va_start(va, format); + zend_argument_error_variadic_ex(function, arg_num, error_ce, format, va); + va_end(va); +} + ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...) /* {{{ */ { va_list va; @@ -406,6 +427,18 @@ ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t } /* }}} */ +ZEND_API ZEND_COLD void zend_argument_type_error_ex( + const zend_function *function, uint32_t arg_num, + const char *format, ...) +{ + va_list va; + + va_start(va, format); + zend_argument_error_variadic_ex(function, arg_num, + zend_ce_type_error, format, va); + va_end(va); +} + ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...) /* {{{ */ { va_list va; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 9eaa1ec7b3c8..8de5ef771c0a 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -1563,8 +1563,16 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, ch ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_or_null_error(uint32_t num, char *error); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va); +ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic_ex( + const zend_function *function, uint32_t arg_num, + zend_class_entry *error_ce, const char *format, va_list va); ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...); +ZEND_API ZEND_COLD void zend_argument_error_ex(const zend_function *function, + uint32_t arg_num, zend_class_entry *error_ce, const char *format, ...); ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...); +ZEND_API ZEND_COLD void zend_argument_type_error_ex( + const zend_function *function, uint32_t arg_num, + const char *format, ...); ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format, ...); ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num); ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, const zend_class_entry *old_ce); diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 9861edafd540..5b1ff675e1c0 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1463,7 +1463,7 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_dup(zend_ast *ast) { ZEND_ASSERT(ast != NULL); - void *buf = zend_ast_alloc(zend_ast_tree_size(ast)); + zend_ast *buf = zend_ast_alloc(zend_ast_tree_size(ast)); zend_ast_tree_copy(ast, buf); return buf; diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 3f7d45043fb5..e1fd7c04f129 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -86,6 +86,7 @@ static bool zend_valid_closure_binding( zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */ { zend_function *func = &closure->func; + // TODO: rename variable bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0 || (closure->std.extra_flags & ZEND_PARTIAL); if (newthis) { @@ -270,6 +271,7 @@ static zend_result do_closure_bind(zval *return_value, zval *zclosure, zval *new if (ZEND_CLOSURE_FLAGS(closure) & ZEND_PARTIAL_OF_CLOSURE) { /* Re-bind the inner closure */ + closure = (zend_closure*)Z_OBJ_P(return_value); HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); ZEND_ASSERT(static_variables->nNumOfElements > 0); zval *inner = &static_variables->arData[0].val; diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 47fee5c2e224..c52b32da020e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -104,6 +104,8 @@ static void zend_compile_expr(znode *result, zend_ast *ast); static void zend_compile_stmt(zend_ast *ast); static void zend_compile_assign(znode *result, zend_ast *ast, bool stmt, uint32_t type); +static zend_ast *zend_partial_apply(zend_ast *callable_ast, zend_ast *pipe_arg); + #ifdef ZEND_CHECK_STACK_LIMIT zend_never_inline static void zend_stack_limit_error(void) { @@ -5251,42 +5253,21 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg } zend_ast *callback = args->child[0]; - - /* Bail out if the callback is not a FCC/PFA. */ - zend_ast *args_ast; - switch (callback->kind) { - case ZEND_AST_CALL: - case ZEND_AST_STATIC_CALL: - args_ast = zend_ast_call_get_args(callback); - if (args_ast->kind != ZEND_AST_CALLABLE_CONVERT) { - return FAILURE; - } - - break; - default: - return FAILURE; - } - - /* Bail out if the callback is assert() due to the AST stringification logic - * breaking for the generated call. - */ - if (callback->kind == ZEND_AST_CALL - && callback->child[0]->kind == ZEND_AST_ZVAL - && Z_TYPE_P(zend_ast_get_zval(callback->child[0])) == IS_STRING - && zend_string_equals_literal_ci(zend_ast_get_str(callback->child[0]), "assert")) { - return FAILURE; - } - - zend_ast_list *callback_args = zend_ast_get_list(((zend_ast_fcc*)args_ast)->args); - if (callback_args->children != 1 || callback_args->child[0]->attr != ZEND_PLACEHOLDER_VARIADIC) { - /* Full PFA is not yet implemented, will fail in zend_compile_call_common(). */ + if (callback->kind != ZEND_AST_CALL && callback->kind != ZEND_AST_STATIC_CALL) { return FAILURE; } znode value; value.op_type = IS_TMP_VAR; value.u.op.var = get_temporary_variable(); - zend_ast *call_args = zend_ast_create_list(1, ZEND_AST_ARG_LIST, zend_ast_create_znode(&value)); + + zend_ast *call_args = zend_partial_apply(callback, + zend_ast_create_znode(&value)); + if (!call_args) { + CG(active_op_array)->T--; + /* The callback is not a FCC/PFA, or is not optimizable */ + return FAILURE; + } zend_op *opline; @@ -6934,17 +6915,17 @@ static zend_ast *zend_partial_apply(zend_ast *callable_ast, zend_ast *pipe_arg) if (first_placeholder == NULL) { first_placeholder = arg; } else { - /* A PFA with multiple placeholders is unexpected in is this + /* A PFA with multiple placeholders is unexpected in this * context, and will usually error due to a missing argument, * so we don't optimize those. */ return NULL; } if (arg->attr == ZEND_PLACEHOLDER_VARIADIC && uses_named_args) { - /* PFAs with both a variadic placeholder and named args can not - * be optimized because the named arg may resolve to the - * position of the placeholder: f(..., name: $v). - * Arg placeholders ('?') are safe, as named args are not - * allowed to override them. */ + /* A PFA with both a variadic placeholder and named args can not + * be optimized because this would result in a positional arg + * after a named arg: f(name: $v, ...) -> f(name: $v, pipe_arg). + * Arg placeholders ('?') are safe since they are not allowed + * after named args. */ return NULL; } } @@ -7017,7 +6998,8 @@ static void zend_compile_pipe(znode *result, zend_ast *ast, uint32_t type) callable_ast->child[0], callable_ast->child[1], pfa_arg_list_ast); break; - EMPTY_SWITCH_DEFAULT_CASE() + default: + ZEND_UNREACHABLE(); } /* Turn $foo |> $expr into ($expr)($foo) */ } else { diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index cc0412b887f7..1fb8f208cff6 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -44,7 +44,6 @@ #include "zend_call_stack.h" #include "zend_attributes.h" #include "Optimizer/zend_func_info.h" -#include "zend_partial.h" /* Virtual current working directory support */ #include "zend_virtual_cwd.h" @@ -1230,11 +1229,11 @@ static zend_always_inline bool zend_check_type( return zend_check_type_slow(type, arg, ref, is_return_type, is_internal); } +/* We can not expose zend_check_type() directly because it's inline and uses static functions */ ZEND_API bool zend_check_type_ex( - const zend_type *type, zval *arg, zend_class_entry *scope, - bool is_return_type, bool is_internal) + const zend_type *type, zval *arg, bool is_return_type, bool is_internal) { - return zend_check_type(type, arg, scope, is_return_type, is_internal); + return zend_check_type(type, arg, is_return_type, is_internal); } ZEND_API bool zend_check_user_type_slow( diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index f44538d62f6a..48f7e7a72530 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -110,8 +110,7 @@ ZEND_API bool zend_verify_ref_array_assignable(zend_reference *ref); ZEND_API bool zend_check_user_type_slow( const zend_type *type, zval *arg, const zend_reference *ref, bool is_return_type); ZEND_API bool zend_check_type_ex( - const zend_type *type, zval *arg, zend_class_entry *scope, - bool is_return_type, bool is_internal); + const zend_type *type, zval *arg, bool is_return_type, bool is_internal); #if ZEND_DEBUG ZEND_API bool zend_internal_call_should_throw(const zend_function *fbc, zend_execute_data *call); diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 7e9dccff58f5..f4fba2240784 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -600,7 +600,7 @@ static zend_op_array *zend_compile_ast_internal(int type) zend_oparray_context original_oparray_context; zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *op_array = emalloc(sizeof(zend_op_array)); + zend_op_array *op_array = emalloc(sizeof(*op_array)); init_op_array(op_array, type, INITIAL_OP_ARRAY_SIZE); CG(active_op_array) = op_array; @@ -685,7 +685,7 @@ ZEND_API zend_op_array *zend_compile_ast( { zend_string *original_compiled_filename = CG(compiled_filename); bool original_in_compilation = CG(in_compilation); - CG(in_compilation) = 1; + CG(in_compilation) = true; CG(ast) = ast; zend_set_compiled_filename(filename); diff --git a/Zend/zend_partial.c b/Zend/zend_partial.c index 2a4195c4049b..e44c67f165d3 100644 --- a/Zend/zend_partial.c +++ b/Zend/zend_partial.c @@ -2,15 +2,16 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ */ @@ -35,7 +36,7 @@ * create a Closure and return it, consuming the stack frame in the process * like an internal function call. * - * We create the Closure by generating the relevant AST and compling it to an + * We create the Closure by generating the relevant AST and compiling it to an * op_array. The op_array is cached in the Opcache SHM and inline caches. * * This file implements the Closure generation logic @@ -54,8 +55,13 @@ #define Z_IS_PLACEHOLDER_P(p) (Z_TYPE_P(p) == _IS_PLACEHOLDER) -#define IS_STATIC_CLOSURE(function) \ - (((function)->common.fn_flags & (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) == (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) +static zend_always_inline bool zp_is_static_closure(const zend_function *function) { + return ((function->common.fn_flags & (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) == (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)); +} + +static zend_always_inline bool zp_is_non_static_closure(const zend_function *function) { + return ((function->common.fn_flags & (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) == ZEND_ACC_CLOSURE); +} static zend_never_inline ZEND_COLD void zp_args_underflow( const zend_function *function, uint32_t args, uint32_t expected) @@ -119,38 +125,75 @@ static zend_result zp_args_check(const zend_function *function, return SUCCESS; } -static bool zp_name_exists(zend_string **names, uint32_t num_names, zend_string *name) +typedef struct zp_names { + zend_string *variadic_param; + zend_string *extra_named_params; + zend_string *inner_closure; + zend_string *params[1]; +} zp_names; + +static bool zp_name_exists(zp_names *names, uint32_t argc, const zend_string *name) { - for (uint32_t i = 0; i < num_names; i++) { - if (names[i] && zend_string_equals(names[i], name)) { + for (uint32_t i = 0; i < argc; i++) { + if (names->params[i] && zend_string_equals(names->params[i], name)) { return true; } } + if (names->variadic_param && zend_string_equals(names->variadic_param, name)) { + return true; + } + if (names->extra_named_params && zend_string_equals(names->extra_named_params, name)) { + return true; + } + if (names->inner_closure && zend_string_equals(names->inner_closure, name)) { + return true; + } + return false; } -static zend_string *zp_get_param_name(zend_function *function, uint32_t arg_offset) +static void zp_names_dtor(zp_names *names, uint32_t argc) +{ + for (uint32_t i = 0; i < argc; i++) { + if (names->params[i]) { + zend_string_release(names->params[i]); + } + } + if (names->variadic_param) { + zend_string_release(names->variadic_param); + } + if (names->extra_named_params) { + zend_string_release(names->extra_named_params); + } + if (names->inner_closure) { + zend_string_release(names->inner_closure); + } +} + +static zend_string *zp_get_func_param_name(zend_function *function, uint32_t arg_offset) { return zend_string_copy(function->common.arg_info[arg_offset].name); } /* Assign a name for every variable that will be used in the generated closure, * including params and used vars. */ -static void zp_assign_names(zend_string **names, uint32_t num_names, - uint32_t argc, zval *argv, +static zp_names *zp_assign_names(uint32_t argc, zval *argv, zend_function *function, bool variadic_partial, zend_array *extra_named_params) { + zp_names *names = zend_arena_calloc(&CG(ast_arena), + 1, XtOffsetOf(zp_names, params) + sizeof(zend_string*) * argc); + /* Assign names for params. We never rename those. */ for (uint32_t offset = 0; offset < MIN(argc, function->common.num_args); offset++) { if (Z_IS_PLACEHOLDER_P(&argv[offset])) { - names[offset] = zp_get_param_name(function, offset); + names->params[offset] = zp_get_func_param_name(function, offset); } } /* Assign name for the variadic param. Never renamed. */ if (variadic_partial && (function->common.fn_flags & ZEND_ACC_VARIADIC)) { - names[argc] = zp_get_param_name(function, function->common.num_args); + names->variadic_param = zp_get_func_param_name(function, function->common.num_args); } /* Assign names for placeholders that bind to the variadic param: @@ -166,18 +209,16 @@ static void zp_assign_names(zend_string **names, uint32_t num_names, if (!Z_IS_PLACEHOLDER_P(&argv[offset])) { continue; } - int n = offset - function->common.num_args; - zend_string *orig_name = zp_get_param_name(function, function->common.num_args); + zend_string *orig_name = zp_get_func_param_name(function, function->common.num_args); zend_string *new_name; - do { - new_name = zend_strpprintf_unchecked(0, "%S%d", orig_name, n); - if (!zp_name_exists(names, num_names, new_name)) { + for (uint32_t n = 0;; n++) { + new_name = zend_strpprintf_unchecked(0, "%S%" PRIu32, orig_name, n); + if (!zp_name_exists(names, argc, new_name)) { break; } - n++; zend_string_release(new_name); - } while (true); - names[offset] = new_name; + } + names->params[offset] = new_name; zend_string_release(orig_name); } @@ -187,51 +228,60 @@ static void zp_assign_names(zend_string **names, uint32_t num_names, if (Z_IS_PLACEHOLDER_P(&argv[offset]) || Z_ISUNDEF(argv[offset])) { continue; } - int n = -1; - zend_string *orig_name = zp_get_param_name(function, MIN(offset, function->common.num_args)); + uint32_t n = 0; + zend_string *orig_name = zp_get_func_param_name(function, MIN(offset, function->common.num_args)); zend_string *new_name = zend_string_copy(orig_name); - while (zp_name_exists(names, num_names, new_name)) { + while (zp_name_exists(names, argc, new_name)) { zend_string_release(new_name); + new_name = zend_strpprintf_unchecked(0, "%S%" PRIu32, orig_name, n); n++; - new_name = zend_strpprintf_unchecked(0, "%S%d", orig_name, n); } - names[offset] = new_name; + names->params[offset] = new_name; zend_string_release(orig_name); } /* Assign name for $extra_named_params */ if (extra_named_params) { - int n = 1; + uint32_t n = 1; zend_string *new_name = ZSTR_INIT_LITERAL("extra_named_params", 0); - while (zp_name_exists(names, num_names, new_name)) { + while (zp_name_exists(names, argc, new_name)) { zend_string_release(new_name); n++; - new_name = zend_strpprintf(0, "%s%d", "extra_named_params", n); + new_name = zend_strpprintf(0, "%s%" PRIu32, "extra_named_params", n); } - names[argc + variadic_partial] = new_name; + names->extra_named_params = new_name; } /* Assign name for $fn */ if (function->common.fn_flags & ZEND_ACC_CLOSURE) { - int n = 1; + uint32_t n = 1; zend_string *new_name = ZSTR_INIT_LITERAL("fn", 0); - while (zp_name_exists(names, num_names, new_name)) { + while (zp_name_exists(names, argc, new_name)) { zend_string_release(new_name); n++; - new_name = zend_strpprintf(0, "%s%d", "fn", n); + new_name = zend_strpprintf(0, "%s%" PRIu32, "fn", n); } - names[argc + variadic_partial + (extra_named_params != NULL)] = new_name; + names->inner_closure = new_name; } + + return names; } -static bool zp_is_single_may_be_type(uint32_t type_mask) +static inline bool zp_is_power_of_two(uint32_t x) { - return ((type_mask > 0) && (type_mask & (type_mask - 1)) == 0) + return (x > 0) && !(x & (x - 1)); +} + +static bool zp_is_simple_type(uint32_t type_mask) +{ + ZEND_ASSERT(!(type_mask & ~_ZEND_TYPE_MAY_BE_MASK)); + + return zp_is_power_of_two(type_mask) || type_mask == MAY_BE_BOOL || type_mask == MAY_BE_ANY; } -static zend_ast *zp_single_may_be_type_to_ast(uint32_t type) +static zend_ast *zp_simple_type_to_ast(uint32_t type) { zend_string *name; @@ -275,7 +325,8 @@ static zend_ast *zp_single_may_be_type_to_ast(uint32_t type) return zend_ast_create_ex(ZEND_AST_TYPE, IS_ARRAY); case MAY_BE_STATIC: return zend_ast_create_ex(ZEND_AST_TYPE, IS_STATIC); - EMPTY_SWITCH_DEFAULT_CASE() + default: + ZEND_UNREACHABLE(); } zend_ast *ast = zend_ast_create_zval_from_str(name); @@ -305,7 +356,7 @@ static zend_ast *zp_type_to_ast(const zend_type type) if (ZEND_TYPE_IS_UNION(type) || (ZEND_TYPE_IS_COMPLEX(type) && ZEND_TYPE_PURE_MASK(type)) - || (ZEND_TYPE_PURE_MASK(type) && !zp_is_single_may_be_type(ZEND_TYPE_PURE_MASK(type)))) { + || (ZEND_TYPE_PURE_MASK(type) && !zp_is_simple_type(ZEND_TYPE_PURE_MASK(type)))) { zend_ast *type_ast = zend_ast_create_list(0, ZEND_AST_TYPE_UNION); if (ZEND_TYPE_HAS_LIST(type)) { const zend_type *type_ptr; @@ -316,33 +367,34 @@ static zend_ast *zp_type_to_ast(const zend_type type) zend_ast *name_ast = zp_type_name_to_ast( zend_string_copy(ZEND_TYPE_NAME(type))); type_ast = zend_ast_list_add(type_ast, name_ast); - } else if (ZEND_TYPE_IS_COMPLEX(type)) { - ZEND_UNREACHABLE(); + } else { + ZEND_ASSERT(!ZEND_TYPE_IS_COMPLEX(type)); } uint32_t type_mask = ZEND_TYPE_PURE_MASK(type); if ((type_mask & MAY_BE_BOOL) == MAY_BE_BOOL) { - type_ast = zend_ast_list_add(type_ast, zp_single_may_be_type_to_ast(MAY_BE_BOOL)); + type_ast = zend_ast_list_add(type_ast, zp_simple_type_to_ast(MAY_BE_BOOL)); type_mask &= ~MAY_BE_BOOL; } for (uint32_t may_be_type = 1; may_be_type < _ZEND_TYPE_MAY_BE_MASK; may_be_type <<= 1) { if (type_mask & may_be_type) { - type_ast = zend_ast_list_add(type_ast, zp_single_may_be_type_to_ast(may_be_type)); + type_ast = zend_ast_list_add(type_ast, zp_simple_type_to_ast(may_be_type)); } } return type_ast; } if (ZEND_TYPE_IS_INTERSECTION(type)) { + ZEND_ASSERT(!ZEND_TYPE_PURE_MASK(type)); zend_ast *type_ast = zend_ast_create_list(0, ZEND_AST_TYPE_INTERSECTION); const zend_type *type_ptr; ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), type_ptr) { type_ast = zend_ast_list_add(type_ast, zp_type_to_ast(*type_ptr)); } ZEND_TYPE_LIST_FOREACH_END(); - ZEND_ASSERT(!ZEND_TYPE_PURE_MASK(type)); return type_ast; } if (ZEND_TYPE_HAS_NAME(type)) { + ZEND_ASSERT(!ZEND_TYPE_PURE_MASK(type)); zend_ast *type_ast = zp_type_name_to_ast( zend_string_copy(ZEND_TYPE_NAME(type))); return type_ast; @@ -351,31 +403,9 @@ static zend_ast *zp_type_to_ast(const zend_type type) ZEND_ASSERT(!ZEND_TYPE_IS_COMPLEX(type)); uint32_t type_mask = ZEND_TYPE_PURE_MASK(type); - ZEND_ASSERT(zp_is_single_may_be_type(type_mask)); - - return zp_single_may_be_type_to_ast(type_mask); -} + ZEND_ASSERT(zp_is_simple_type(type_mask)); -/* Can not use zend_argument_error() as the function is not on the stack */ -static zend_never_inline ZEND_COLD void zp_argument_error(zend_class_entry *error_ce, - zend_function *function, uint32_t arg_num, const char *format, ...) -{ - zend_string *func_name = get_function_or_method_name(function); - const char *arg_name = get_function_arg_name(function, arg_num); - - char *message = NULL; - - va_list va; - va_start(va, format); - zend_vspprintf(&message, 0, format, va); - va_end(va); - - zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", - ZSTR_VAL(func_name), arg_num, - arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message - ); - efree(message); - zend_string_release(func_name); + return zp_simple_type_to_ast(type_mask); } static zend_result zp_get_param_default_value(zval *result, zend_function *function, uint32_t arg_offset) @@ -387,10 +417,9 @@ static zend_result zp_get_param_default_value(zval *result, zend_function *funct if (EXPECTED(opline->opcode == ZEND_RECV_INIT)) { ZVAL_COPY(result, RT_CONSTANT(opline, opline->op2)); return SUCCESS; - } else { - ZEND_ASSERT(opline->opcode == ZEND_RECV); } - } else if (function->type == ZEND_INTERNAL_FUNCTION) { + ZEND_ASSERT(opline->opcode == ZEND_RECV); + } else { if (function->common.fn_flags & ZEND_ACC_USER_ARG_INFO) { goto error; } @@ -403,7 +432,8 @@ static zend_result zp_get_param_default_value(zval *result, zend_function *funct } error: - zp_argument_error(zend_ce_argument_count_error, function, arg_offset + 1, + zend_argument_error_ex(function, arg_offset + 1, + zend_ce_argument_count_error, "must be passed explicitly, because the default value is not known"); return FAILURE; @@ -511,7 +541,7 @@ static zend_string *zp_pfa_name(const zend_op_array *declaring_op_array, static zend_ast *zp_compile_forwarding_call( zval *this_ptr, zend_function *function, uint32_t argc, zval *argv, zend_array *extra_named_params, - zend_string **param_names, bool variadic_partial, uint32_t num_args, + zp_names *var_names, bool variadic_partial, uint32_t num_args, zend_class_entry *called_scope, zend_type return_type, bool forward_superfluous_args, zend_ast *stmts_ast) @@ -537,8 +567,8 @@ static zend_ast *zp_compile_forwarding_call( /* Required param was not passed. This can happen due to named * args. Using the same exception CE and message as * zend_handle_undef_args(). */ - zp_argument_error(zend_ce_argument_count_error, function, - offset + 1, "not passed"); + zend_argument_error_ex(function, offset + 1, + zend_ce_argument_count_error, "not passed"); goto error; } zval default_value; @@ -548,6 +578,7 @@ static zend_ast *zp_compile_forwarding_call( } zend_ast *default_value_ast; if (Z_TYPE(default_value) == IS_CONSTANT_AST) { + /* Must dup AST because we are doing to destroy it */ default_value_ast = zend_ast_dup(Z_ASTVAL(default_value)); } else { default_value_ast = zend_ast_create_zval(&default_value); @@ -555,19 +586,19 @@ static zend_ast *zp_compile_forwarding_call( args_ast = zend_ast_list_add(args_ast, default_value_ast); } else { args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_VAR, - zend_ast_create_zval_from_str(zend_string_copy(param_names[offset])))); + zend_ast_create_zval_from_str(zend_string_copy(var_names->params[offset])))); } } if (extra_named_params) { args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_UNPACK, zend_ast_create(ZEND_AST_VAR, - zend_ast_create_zval_from_str(zend_string_copy(param_names[argc + variadic_partial]))))); + zend_ast_create_zval_from_str(zend_string_copy(var_names->extra_named_params))))); } if (variadic_partial) { if (function->common.fn_flags & ZEND_ACC_VARIADIC) { args_ast = zend_ast_list_add(args_ast, zend_ast_create(ZEND_AST_UNPACK, zend_ast_create(ZEND_AST_VAR, - zend_ast_create_zval_from_str(zend_string_copy(param_names[argc]))))); + zend_ast_create_zval_from_str(zend_string_copy(var_names->variadic_param))))); } else if (forward_superfluous_args) { /* When a '...' placeholder is used, and the underlying function is * not variadic, superfluous arguments are forwarded. @@ -600,7 +631,7 @@ static zend_ast *zp_compile_forwarding_call( call_ast = zend_ast_create(ZEND_AST_CALL, func_name_ast, args_ast); } else if (function->common.fn_flags & ZEND_ACC_CLOSURE) { zend_ast *fn_ast = zend_ast_create(ZEND_AST_VAR, - zend_ast_create_zval_from_str(zend_string_copy(param_names[argc + variadic_partial + (extra_named_params != NULL)]))); + zend_ast_create_zval_from_str(zend_string_copy(var_names->inner_closure))); call_ast = zend_ast_create(ZEND_AST_CALL, fn_ast, args_ast); } else if (Z_TYPE_P(this_ptr) == IS_OBJECT) { zend_ast *this_ast = zend_ast_create(ZEND_AST_VAR, @@ -657,15 +688,17 @@ static uint32_t zp_compute_num_required(zend_function *function, /* Functions that do not allow to be called dynamically */ static const zend_known_string_id zp_non_dynamic_call_funcs[] = { - ZEND_STR_FUNC_GET_ARG, ZEND_STR_COMPACT, ZEND_STR_EXTRACT, - /* Omit nullary functions such as func_num_args(), as these can't be PFA'd*/ + ZEND_STR_FUNC_GET_ARG, + ZEND_STR_FUNC_GET_ARGS, + ZEND_STR_FUNC_NUM_ARGS, + ZEND_STR_GET_DEFINED_VARS, }; static bool zp_is_non_dynamic_call_func(zend_function *function) { - for (int i = 0; i < sizeof(zp_non_dynamic_call_funcs) / sizeof(zp_non_dynamic_call_funcs[0]); i++) { + for (size_t i = 0; i < sizeof(zp_non_dynamic_call_funcs) / sizeof(zp_non_dynamic_call_funcs[0]); i++) { if (zend_string_equals(function->common.function_name, ZSTR_KNOWN(zp_non_dynamic_call_funcs[i]))) { return true; } @@ -702,13 +735,14 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, called_scope = Z_CE_P(this_ptr); } + /* CG(ast_arena) is usually NULL, so we can't just make a snapshot */ zend_arena *orig_ast_arena = CG(ast_arena); CG(ast_arena) = zend_arena_create(1024 * 4); - int orig_lineno = CG(zend_lineno); + uint32_t orig_lineno = CG(zend_lineno); CG(zend_lineno) = zend_get_executed_lineno(); - int new_argc = argc; + uint32_t new_argc = argc; if (uses_variadic_placeholder) { new_argc = MAX(new_argc, function->common.num_args); @@ -718,7 +752,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, memcpy(tmp, argv, argc * sizeof(zval)); argv = tmp; - /* Compute number of required args and param positions, add implicit + /* Compute param positions and number of required args, add implicit * placeholders. * * Parameters are placed in the following order: @@ -784,12 +818,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, /* Assign variable names */ - uint32_t num_names = argc + uses_variadic_placeholder + (extra_named_params != NULL) - + ((function->common.fn_flags & ZEND_ACC_CLOSURE) != 0); - zend_string **param_names = zend_arena_calloc(&CG(ast_arena), - num_names, sizeof(zend_string*)); - memset(param_names, 0, sizeof(zend_string*) * num_names); - zp_assign_names(param_names, num_names, argc, argv, function, + zp_names *var_names = zp_assign_names(argc, argv, function, uses_variadic_placeholder, extra_named_params); /* Generate AST */ @@ -806,7 +835,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, * do_closure_bind(). */ if (function->common.fn_flags & ZEND_ACC_CLOSURE) { zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( - zend_string_copy(param_names[argc + uses_variadic_placeholder + (extra_named_params != NULL)])); + zend_string_copy(var_names->inner_closure)); lexical_vars_ast = zend_ast_list_add(lexical_vars_ast, lexical_var_ast); } @@ -840,14 +869,14 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, params[param_offset] = zend_ast_create_ex(ZEND_AST_PARAM, param_flags, param_type_ast, zend_ast_create_zval_from_str( - zend_string_copy(param_names[offset])), + zend_string_copy(var_names->params[offset])), default_value_ast, attributes_ast, NULL, NULL); } else if (!Z_ISUNDEF(argv[offset])) { // TODO: If the pre-bound parameter is a literal, it can be a // literal in the function body instead of a lexical var. zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( - zend_string_copy(param_names[offset])); + zend_string_copy(var_names->params[offset])); if (zp_arg_must_be_sent_by_ref(function, offset+1)) { lexical_var_ast->attr = ZEND_BIND_REF; } @@ -863,7 +892,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, if (extra_named_params) { zend_ast *lexical_var_ast = zend_ast_create_zval_from_str( - zend_string_copy(param_names[argc + uses_variadic_placeholder])); + zend_string_copy(var_names->extra_named_params)); lexical_vars_ast = zend_ast_list_add(lexical_vars_ast, lexical_var_ast); } @@ -881,7 +910,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, params_ast = zend_ast_list_add(params_ast, zend_ast_create_ex(ZEND_AST_PARAM, param_flags, param_type_ast, zend_ast_create_zval_from_str( - zend_string_copy(param_names[argc])), + zend_string_copy(var_names->variadic_param)), NULL, attributes_ast, NULL, NULL)); } @@ -912,7 +941,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, no_forwarding_ast = zp_compile_forwarding_call(this_ptr, function, argc, argv, extra_named_params, - param_names, uses_variadic_placeholder, num_params, + var_names, uses_variadic_placeholder, num_params, called_scope, return_type, false, no_forwarding_ast); if (!no_forwarding_ast) { @@ -922,7 +951,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, forwarding_ast = zp_compile_forwarding_call(this_ptr, function, argc, argv, extra_named_params, - param_names, uses_variadic_placeholder, num_params, + var_names, uses_variadic_placeholder, num_params, called_scope, return_type, true, forwarding_ast); if (!forwarding_ast) { @@ -949,7 +978,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, } else { stmts_ast = zp_compile_forwarding_call(this_ptr, function, argc, argv, extra_named_params, - param_names, uses_variadic_placeholder, num_params, + var_names, uses_variadic_placeholder, num_params, called_scope, return_type, false, stmts_ast); if (!stmts_ast) { @@ -976,7 +1005,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, NULL, params_ast, lexical_vars_ast, stmts_ast, return_type_ast, attributes_ast); - if (Z_TYPE_P(this_ptr) != IS_OBJECT || IS_STATIC_CLOSURE(function)) { + if (Z_TYPE_P(this_ptr) != IS_OBJECT && !zp_is_non_static_closure(function)) { ((zend_ast_decl*)closure_ast)->flags |= ZEND_ACC_STATIC; } @@ -999,12 +1028,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, zend_ast_destroy(closure_ast); clean: - for (uint32_t i = 0; i < num_names; i++) { - if (param_names[i]) { - zend_string_release(param_names[i]); - } - } - + zp_names_dtor(var_names, argc); zend_arena_destroy(CG(ast_arena)); CG(ast_arena) = orig_ast_arena; CG(zend_lineno) = orig_lineno; @@ -1020,7 +1044,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, goto clean; } -static zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function, +static const zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function, uint32_t argc, zval *argv, zend_array *extra_named_params, const zend_array *named_positions, const zend_op_array *declaring_op_array, @@ -1030,10 +1054,11 @@ static zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function, if (EXPECTED(function->type == ZEND_INTERNAL_FUNCTION ? cache_slot[0] == function : cache_slot[0] == function->op_array.opcodes)) { + ZEND_ASSERT(!(function->common.fn_flags & ZEND_ACC_NEVER_CACHE)); return cache_slot[1]; } - zend_op_array *op_array = zend_accel_pfa_cache_get(declaring_op_array, + const zend_op_array *op_array = zend_accel_pfa_cache_get(declaring_op_array, declaring_opline, function); if (UNEXPECTED(!op_array)) { @@ -1046,7 +1071,7 @@ static zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function, cache_slot[0] = function->type == ZEND_INTERNAL_FUNCTION ? (void*)function : (void*)function->op_array.opcodes; - cache_slot[1] = op_array; + cache_slot[1] = (zend_op_array*)op_array; } return op_array; @@ -1081,7 +1106,7 @@ static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval * arg_info = NULL; } if (arg_info && ZEND_TYPE_IS_SET(arg_info->type) - && UNEXPECTED(!zend_check_type_ex(&arg_info->type, var, function->common.scope, 0, 0))) { + && UNEXPECTED(!zend_check_type_ex(&arg_info->type, var, 0, 0))) { zend_verify_arg_error(function, arg_info, offset+1, var); zval_ptr_dtor(result); ZVAL_NULL(result); @@ -1107,7 +1132,7 @@ void zend_partial_create(zval *result, zval *this_ptr, zend_function *function, const zend_op *declaring_opline, void **cache_slot, bool uses_variadic_placeholder) { - zend_op_array *op_array = zp_get_op_array(this_ptr, function, argc, argv, + const zend_op_array *op_array = zp_get_op_array(this_ptr, function, argc, argv, extra_named_params, named_positions, declaring_op_array, declaring_opline, cache_slot, uses_variadic_placeholder); @@ -1127,7 +1152,7 @@ void zend_partial_create(zval *result, zval *this_ptr, zend_function *function, called_scope = Z_CE_P(this_ptr); } - if (Z_TYPE_P(this_ptr) == IS_OBJECT && !IS_STATIC_CLOSURE(function)) { + if (Z_TYPE_P(this_ptr) == IS_OBJECT && !zp_is_static_closure(function)) { ZVAL_COPY_VALUE(&object, this_ptr); } else { ZVAL_UNDEF(&object); diff --git a/Zend/zend_partial.h b/Zend/zend_partial.h index 7999dc99019c..3c47305ff543 100644 --- a/Zend/zend_partial.h +++ b/Zend/zend_partial.h @@ -2,15 +2,16 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | + | Copyright © Zend Technologies Ltd., a subsidiary company of | + | Perforce Software, Inc., and Contributors. | +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Arnaud Le Blanc | +----------------------------------------------------------------------+ */ #ifndef ZEND_PARTIAL_H diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 512b7f429733..94ba6e776ecc 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -638,6 +638,7 @@ default: ZEND_UNREACHABLE(); _(ZEND_STR_ASSERT, "assert") \ _(ZEND_STR_CALL_USER_FUNC, "call_user_func") \ _(ZEND_STR_ARRAY_SLICE, "array_slice") \ + _(ZEND_STR_GET_DEFINED_VARS, "get_defined_vars") \ _(ZEND_STR_SENSITIVEPARAMETER, "SensitiveParameter") \ _(ZEND_STR_CONST_EXPR_PLACEHOLDER, "[constant expression]") \ _(ZEND_STR_DEPRECATED_CAPITALIZED, "Deprecated") \ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index f7894faa477a..ff5c85e10a9b 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5723,7 +5723,7 @@ ZEND_VM_HELPER(zend_verify_recv_arg_type_helper, ANY, ANY, zval *op_1) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(213, ZEND_SEND_PLACEHOLDER, UNUSED, CONST|UNUSED) +ZEND_VM_HANDLER(213, ZEND_SEND_PLACEHOLDER, UNUSED, CONST|UNUSED|NUM) { zval *arg; @@ -8942,9 +8942,10 @@ ZEND_VM_HOT_HANDLER(211, ZEND_TYPE_ASSERT, CONST, ANY, NUM) zend_arg_info *arginfo = &fbc->common.arg_info[argno - 1]; if (!zend_check_type(&arginfo->type, value, /* is_return_type */ false, /* is_internal */ true)) { - const char *param_name = get_function_arg_name(fbc, argno); zend_string *expected = zend_type_to_string(arginfo->type); - zend_type_error("%s(): Argument #%d%s%s%s must be of type %s, %s given", ZSTR_VAL(fbc->common.function_name), argno, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "", ZSTR_VAL(expected), zend_zval_value_name(value)); + zend_argument_type_error_ex(fbc, argno, + "must be of type %s, %s given", + ZSTR_VAL(expected), zend_zval_value_name(value)); zend_string_release(expected); } } @@ -9874,7 +9875,7 @@ ZEND_VM_HANDLER(212, ZEND_CALLABLE_CONVERT_PARTIAL, CACHE_SLOT, CONST|UNUSED, NU zend_partial_create(EX_VAR(opline->result.var), &call->This, call->func, ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), - ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) ? call->extra_named_params : NULL, OP2_TYPE == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, &EX(func)->op_array, opline, cache_slot, diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 921c9e1bc460..f74f3497a01f 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -306,6 +306,7 @@ static uint8_t zend_user_opcodes[256] = {0, }; #include "Zend/zend_vm_opcodes.h" +#include "Zend/zend_partial.h" #define SPEC_START_MASK 0x0000ffff #define SPEC_EXTRA_MASK 0xfffc0000 @@ -4274,7 +4275,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONV zend_partial_create(EX_VAR(opline->result.var), &call->This, call->func, ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), - ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) ? call->extra_named_params : NULL, IS_CONST == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, &EX(func)->op_array, opline, cache_slot, @@ -4457,7 +4458,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_CALLABLE_CONV zend_partial_create(EX_VAR(opline->result.var), &call->This, call->func, ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), - ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) ? call->extra_named_params : NULL, IS_UNUSED == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, &EX(func)->op_array, opline, cache_slot, @@ -6238,9 +6239,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_T zend_arg_info *arginfo = &fbc->common.arg_info[argno - 1]; if (!zend_check_type(&arginfo->type, value, /* is_return_type */ false, /* is_internal */ true)) { - const char *param_name = get_function_arg_name(fbc, argno); zend_string *expected = zend_type_to_string(arginfo->type); - zend_type_error("%s(): Argument #%d%s%s%s must be of type %s, %s given", ZSTR_VAL(fbc->common.function_name), argno, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "", ZSTR_VAL(expected), zend_zval_value_name(value)); + zend_argument_type_error_ex(fbc, argno, + "must be of type %s, %s given", + ZSTR_VAL(expected), zend_zval_value_name(value)); zend_string_release(expected); } } @@ -57058,7 +57060,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_P zend_partial_create(EX_VAR(opline->result.var), &call->This, call->func, ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), - ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) ? call->extra_named_params : NULL, IS_CONST == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, &EX(func)->op_array, opline, cache_slot, @@ -57241,7 +57243,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_CALLABLE_CONVERT_P zend_partial_create(EX_VAR(opline->result.var), &call->This, call->func, ZEND_CALL_NUM_ARGS(call), ZEND_CALL_ARG(call, 1), - ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS ? + (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) ? call->extra_named_params : NULL, IS_UNUSED == IS_CONST ? Z_ARRVAL_P(named_positions) : NULL, &EX(func)->op_array, opline, cache_slot, @@ -59022,9 +59024,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_TYPE_A zend_arg_info *arginfo = &fbc->common.arg_info[argno - 1]; if (!zend_check_type(&arginfo->type, value, /* is_return_type */ false, /* is_internal */ true)) { - const char *param_name = get_function_arg_name(fbc, argno); zend_string *expected = zend_type_to_string(arginfo->type); - zend_type_error("%s(): Argument #%d%s%s%s must be of type %s, %s given", ZSTR_VAL(fbc->common.function_name), argno, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "", ZSTR_VAL(expected), zend_zval_value_name(value)); + zend_argument_type_error_ex(fbc, argno, + "must be of type %s, %s given", + ZSTR_VAL(expected), zend_zval_value_name(value)); zend_string_release(expected); } } diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 3237a696a695..f2cfd898964e 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -1,4 +1,5 @@ #include "Zend/zend_vm_opcodes.h" +#include "Zend/zend_partial.h" {%DEFINES%} diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 76f3af369845..9846e36037b9 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -452,7 +452,7 @@ static uint32_t zend_vm_opcodes_flags[214] = { 0x00000303, 0x01000003, 0x010003a0, - 0x00000301, + 0x00001301, }; ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(uint8_t opcode) { diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index c9344f671db7..1bce00f0edde 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2034,7 +2034,7 @@ static char *zend_accel_uintptr_hex(char *dest, uintptr_t n) static zend_string *zend_accel_pfa_key(const zend_op *declaring_opline, const zend_function *called_function) { - size_t key_len = strlen(PFA_KEY_PREFIX) + (sizeof(uintptr_t)*2) + strlen(":") + (sizeof(uintptr_t)*2); + const size_t key_len = strlen(PFA_KEY_PREFIX) + (sizeof(uintptr_t)*2) + strlen(":") + (sizeof(uintptr_t)*2); zend_string *key = zend_string_alloc(key_len, 0); char *dest = ZSTR_VAL(key); @@ -2042,7 +2042,7 @@ static zend_string *zend_accel_pfa_key(const zend_op *declaring_opline, dest = zend_accel_uintptr_hex(dest, (uintptr_t)declaring_opline); *dest++ = ':'; - void *ptr; + const void *ptr; if ((called_function->common.fn_flags & ZEND_ACC_CLOSURE) && called_function->type == ZEND_USER_FUNCTION) { /* Can not use 'called_function' as part of the key, as it's an inner @@ -2051,7 +2051,7 @@ static zend_string *zend_accel_pfa_key(const zend_op *declaring_opline, * in this case. */ ptr = called_function->op_array.opcodes; } else { - ptr = (void*) called_function; + ptr = called_function; } dest = zend_accel_uintptr_hex(dest, (uintptr_t)ptr); @@ -2063,7 +2063,7 @@ static zend_string *zend_accel_pfa_key(const zend_op *declaring_opline, return key; } -zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, +const zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, const zend_op *declaring_opline, const zend_function *called_function) { zend_string *key = zend_accel_pfa_key(declaring_opline, called_function); @@ -2167,7 +2167,7 @@ zend_op_array *zend_accel_compile_pfa(zend_ast *ast, zend_string_addref(copy->function_name); (*copy->refcount)++; /* Reference the copy in op_array->dynamic_func_defs so that it's - * destroyed when op_array is destroy. */ + * destroyed when op_array is destroyed. */ ZEND_ASSERT(!op_array->dynamic_func_defs && !op_array->num_dynamic_func_defs); op_array->dynamic_func_defs = emalloc(sizeof(zend_op_array*)); op_array->dynamic_func_defs[0] = copy; @@ -2189,8 +2189,8 @@ zend_op_array *zend_accel_compile_pfa(zend_ast *ast, new_persistent_script->script.filename = key; if (ZCG(accel_directives).record_warnings) { - new_persistent_script->num_warnings = EG(num_errors); - new_persistent_script->warnings = EG(errors); + new_persistent_script->num_warnings = EG(errors).size; + new_persistent_script->warnings = EG(errors).errors; } HANDLE_BLOCK_INTERRUPTIONS(); diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 9eec7555c4ea..ef7eea433c09 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -334,7 +334,7 @@ zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str); uint32_t zend_accel_get_class_name_map_ptr(zend_string *type_name); -zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, +const zend_op_array *zend_accel_pfa_cache_get(const zend_op_array *declaring_op_array, const zend_op *declaring_opline, const zend_function *called_function); diff --git a/ext/standard/tests/array/array_map_foreach_optimization_006.phpt b/ext/standard/tests/array/array_map_foreach_optimization_006.phpt new file mode 100644 index 000000000000..e21e3e0a9a8b --- /dev/null +++ b/ext/standard/tests/array/array_map_foreach_optimization_006.phpt @@ -0,0 +1,84 @@ +--TEST-- +array_map(): foreach optimization - PFA +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.opt_debug_level=0x20000 +--FILE-- + +--EXPECTF-- +$_main: + ; (lines=%d, args=0, vars=%d, tmps=%d) + ; (after optimizer) + ; %s +0000 INIT_FCALL 2 %d string("range") +0001 SEND_VAL int(1) 1 +0002 SEND_VAL int(10) 2 +0003 T2 = DO_ICALL +0004 ASSIGN CV0($array) T2 +0005 TYPE_ASSERT 131079 string("array_map") CV0($array) +0006 T2 = INIT_ARRAY 0 (packed) NEXT +0007 V3 = FE_RESET_R CV0($array) 0015 +0008 T5 = FE_FETCH_R V3 T4 0015 +0009 INIT_FCALL 2 %d string("plusn") +0010 SEND_VAL T4 1 +0011 SEND_VAL int(2) 2 +0012 T4 = DO_UCALL +0013 T2 = ADD_ARRAY_ELEMENT T4 T5 +0014 JMP 0008 +0015 FE_FREE V3 +0016 ASSIGN CV1($foo) T2 +0017 INIT_FCALL 1 %d string("var_dump") +0018 SEND_VAR CV1($foo) 1 +0019 DO_ICALL +0020 RETURN int(1) +LIVE RANGES: + 2: 0007 - 0016 (tmp/var) + 3: 0008 - 0015 (loop) + 4: 0009 - 0010 (tmp/var) + 5: 0009 - 0013 (tmp/var) + +plusn: + ; (lines=4, args=2, vars=2, tmps=1) + ; (after optimizer) + ; %s +0000 CV0($x) = RECV 1 +0001 CV1($n) = RECV 2 +0002 T2 = ADD CV0($x) CV1($n) +0003 RETURN T2 +array(10) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) + [3]=> + int(6) + [4]=> + int(7) + [5]=> + int(8) + [6]=> + int(9) + [7]=> + int(10) + [8]=> + int(11) + [9]=> + int(12) +} diff --git a/ext/standard/tests/array/array_map_foreach_optimization_007.phpt b/ext/standard/tests/array/array_map_foreach_optimization_007.phpt new file mode 100644 index 000000000000..67654b9e7640 --- /dev/null +++ b/ext/standard/tests/array/array_map_foreach_optimization_007.phpt @@ -0,0 +1,109 @@ +--TEST-- +array_map(): foreach optimization - unoptimizable PFA +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.opt_debug_level=0x20000 +--FILE-- + +--EXPECTF-- +$_main: + ; (lines=%d, args=0, vars=%d, tmps=%d) + ; (after optimizer) + ; %s +0000 INIT_FCALL 2 %d string("range") +0001 SEND_VAL int(1) 1 +0002 SEND_VAL int(10) 2 +0003 T2 = DO_ICALL +0004 ASSIGN CV0($array) T2 +0005 INIT_FCALL 2 %d string("array_map") +0006 INIT_FCALL 0 %d string("plusn") +0007 SEND_VAL int(2) string("n") +0008 T2 = CALLABLE_CONVERT_PARTIAL 2 +0009 SEND_VAL T2 1 +0010 SEND_VAR CV0($array) 2 +0011 T2 = DO_ICALL +0012 ASSIGN CV1($foo) T2 +0013 INIT_FCALL 1 %d string("var_dump") +0014 SEND_VAR CV1($foo) 1 +0015 DO_ICALL +0016 RETURN int(1) + +plusn: + ; (lines=4, args=2, vars=2, tmps=1) + ; (after optimizer) + ; %s +0000 CV0($x) = RECV 1 +0001 CV1($n) = RECV 2 +0002 T2 = ADD CV0($x) CV1($n) +0003 RETURN T2 + +$_main: + ; (lines=4, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %s:1-9 +0000 T1 = DECLARE_LAMBDA_FUNCTION 0 +0001 BIND_LEXICAL T1 CV0($n) +0002 FREE T1 +0003 RETURN int(1) +LIVE RANGES: + 1: 0001 - 0002 (tmp/var) + +{closure:pfa:%s:9}: + ; (lines=18, args=1, vars=2, tmps=2) + ; (after optimizer) + ; %s:9-9 +0000 CV0($x) = RECV 1 +0001 BIND_STATIC CV1($n) +0002 T3 = FUNC_NUM_ARGS +0003 T2 = IS_SMALLER_OR_EQUAL T3 int(1) +0004 JMPZ T2 0010 +0005 INIT_FCALL 2 %d string("plusn") +0006 SEND_VAR CV0($x) 1 +0007 SEND_VAR CV1($n) 2 +0008 T2 = DO_UCALL +0009 RETURN T2 +0010 INIT_FCALL 2 %d string("plusn") +0011 SEND_VAR CV0($x) 1 +0012 SEND_VAR CV1($n) 2 +0013 T2 = FUNC_GET_ARGS int(1) +0014 SEND_UNPACK T2 +0015 CHECK_UNDEF_ARGS +0016 T2 = DO_UCALL +0017 RETURN T2 +array(10) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) + [3]=> + int(6) + [4]=> + int(7) + [5]=> + int(8) + [6]=> + int(9) + [7]=> + int(10) + [8]=> + int(11) + [9]=> + int(12) +} From e775c2700bf525c17bbc77600c48147ffd041c00 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 22 Apr 2026 10:23:46 +0200 Subject: [PATCH 299/300] Use ZEND_ACC2_FORBID_DYN_CALLS --- Zend/zend_partial.c | 23 +---------------------- Zend/zend_string.h | 4 ---- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/Zend/zend_partial.c b/Zend/zend_partial.c index e44c67f165d3..a367c7784a1c 100644 --- a/Zend/zend_partial.c +++ b/Zend/zend_partial.c @@ -686,27 +686,6 @@ static uint32_t zp_compute_num_required(zend_function *function, return num_required; } -/* Functions that do not allow to be called dynamically */ -static const zend_known_string_id zp_non_dynamic_call_funcs[] = { - ZEND_STR_COMPACT, - ZEND_STR_EXTRACT, - ZEND_STR_FUNC_GET_ARG, - ZEND_STR_FUNC_GET_ARGS, - ZEND_STR_FUNC_NUM_ARGS, - ZEND_STR_GET_DEFINED_VARS, -}; - -static bool zp_is_non_dynamic_call_func(zend_function *function) -{ - for (size_t i = 0; i < sizeof(zp_non_dynamic_call_funcs) / sizeof(zp_non_dynamic_call_funcs[0]); i++) { - if (zend_string_equals(function->common.function_name, ZSTR_KNOWN(zp_non_dynamic_call_funcs[i]))) { - return true; - } - } - - return false; -} - /* Compile PFA to an op_array */ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, uint32_t argc, zval *argv, zend_array *extra_named_params, @@ -717,7 +696,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function, zend_op_array *op_array = NULL; - if (UNEXPECTED(zp_is_non_dynamic_call_func(function))) { + if (UNEXPECTED(function->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)) { zend_throw_error(NULL, "Cannot call %.*s() dynamically", (int) ZSTR_LEN(function->common.function_name), ZSTR_VAL(function->common.function_name)); return NULL; diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 94ba6e776ecc..9127f55a5754 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -632,13 +632,9 @@ default: ZEND_UNREACHABLE(); _(ZEND_STR_COUNT, "count") \ _(ZEND_STR_FUNC_NUM_ARGS, "func_num_args") \ _(ZEND_STR_FUNC_GET_ARGS, "func_get_args") \ - _(ZEND_STR_FUNC_GET_ARG, "func_get_arg") \ - _(ZEND_STR_COMPACT, "compact") \ - _(ZEND_STR_EXTRACT, "extract") \ _(ZEND_STR_ASSERT, "assert") \ _(ZEND_STR_CALL_USER_FUNC, "call_user_func") \ _(ZEND_STR_ARRAY_SLICE, "array_slice") \ - _(ZEND_STR_GET_DEFINED_VARS, "get_defined_vars") \ _(ZEND_STR_SENSITIVEPARAMETER, "SensitiveParameter") \ _(ZEND_STR_CONST_EXPR_PLACEHOLDER, "[constant expression]") \ _(ZEND_STR_DEPRECATED_CAPITALIZED, "Deprecated") \ From a7331b1a13cbc8cf88a5e01eaee151cdc69e1d97 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 22 Apr 2026 10:49:34 +0200 Subject: [PATCH 300/300] Comment --- Zend/zend_ast.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h index 630f43547883..c029d7615e47 100644 --- a/Zend/zend_ast.h +++ b/Zend/zend_ast.h @@ -350,7 +350,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_ex(zval *result, zend_ast *ast, zend_class_entry *scope, bool *short_circuited_ptr, zend_ast_evaluate_ctx *ctx); ZEND_API zend_string *zend_ast_export(const char *prefix, zend_ast *ast, const char *suffix); +/* Copies 'ast' to the heap, returns a refcounted AST reference */ ZEND_API zend_ast_ref * ZEND_FASTCALL zend_ast_copy(zend_ast *ast); +/* Duplicates 'ast' on the arena */ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_dup(zend_ast *ast); ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast); ZEND_API void ZEND_FASTCALL zend_ast_ref_destroy(zend_ast_ref *ast);