Skip to content

Commit b1c77b2

Browse files
ondrejmirtesclaude
andcommitted
turbo-ext: make everything outside four files PHP-version-neutral
Spike towards one shared core library per platform with a thin per-PHP-version extension. The engine layout that moves between minors (EG()/CG() fields, zend_function_entry, internal_function.handler, zend_class_entry.info, object handler offsets, ZSTR_KNOWN ids, IS_REFERENCE_EX, ZEND_ACC_USE_GUARDS, lazy-object flags) is read through pt_abi, which Abi.cpp fills in at module startup; engine functions whose signature or behaviour differs (zend_create_closure, the weakref hash helpers, zend_dval_to_lval, ZEND_TRY_ASSIGN_REF_*, the call stack size error) are implemented once per minor in Abi.cpp; the PHP_VERSION_ID gates in shared code became runtime checks. With this, every object file except Abi.o, Shadow.o, TrustedTypes.o and main.o compiles to identical code, data and relocations against the PHP 8.3, 8.4 and 8.5 headers (bin/shared-core/gate.sh, compare-data.sh). A core dylib linked from the 8.4 objects plus three 76 KB thin extensions (bin/shared-core/link-split.sh) loads under all three, passes smoke.php on 8.4 and 8.5 (8.3 fails the same five deep-recursion checks a pristine 2.3.x build fails on Homebrew 8.3), produces byte-identical analysis output, and measured +0.18% (t=1.29, n=10, noise) against 2.3.x. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017h1GfB7vfJPgwcTHD9Fth6
1 parent 0e156a6 commit b1c77b2

29 files changed

Lines changed: 636 additions & 183 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# compare every non-code section (contents + relocations) of each object between two builds
3+
S=${SHARED_CORE_WORK_DIR:?set SHARED_CORE_WORK_DIR to a scratch directory}
4+
O=/opt/homebrew/opt/llvm/bin/llvm-objdump
5+
A=$1; B=$2
6+
cd $S/$A
7+
for o in $(find src -name '*.o' | sort); do
8+
sects=$($O -h $o | awk 'NR>3 && $2 !~ /__text|__compact_unwind|__eh_frame/ && $2 != "" {print $2}' | sort -u)
9+
for sec in $sects; do
10+
a=$($O -s -j "$sec" $o 2>/dev/null | tail -n +3 | md5)
11+
b=$($O -s -j "$sec" $S/$B/$o 2>/dev/null | tail -n +3 | md5)
12+
[ "$a" != "$b" ] && echo "DATA DIFF $o $sec"
13+
done
14+
ra=$($O -r $o | grep -v 'file format' | sed -E 's/OUTLINED_FUNCTION_[0-9]+/OF/; s/l_\.str[.0-9]*/l_.str/; s/lCPI[0-9_]+/lCPI/; s/ltmp[0-9]+/ltmp/; s/\$_[0-9]+/$_/' | md5)
15+
rb=$($O -r $S/$B/$o | grep -v 'file format' | sed -E 's/OUTLINED_FUNCTION_[0-9]+/OF/; s/l_\.str[.0-9]*/l_.str/; s/lCPI[0-9_]+/lCPI/; s/ltmp[0-9]+/ltmp/; s/\$_[0-9]+/$_/' | md5)
16+
[ "$ra" != "$rb" ] && echo "RELOC DIFF $o"
17+
done
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env python3
2+
# Per-function fingerprinting of arm64 Mach-O object files built against
3+
# different PHP versions: identical source -> identical bytes + relocations
4+
# unless a Zend header (struct layout, inline function, macro) differs.
5+
import hashlib, os, re, subprocess, sys
6+
from concurrent.futures import ThreadPoolExecutor
7+
8+
OBJDUMP = '/opt/homebrew/opt/llvm/bin/llvm-objdump'
9+
func_re = re.compile(r'^<(.+)>:$')
10+
addr_re = re.compile(r'0x[0-9a-f]+ <')
11+
12+
13+
def fingerprints(obj):
14+
out = subprocess.run([OBJDUMP, '-d', '-r', '--no-leading-addr', '--no-show-raw-insn', obj],
15+
capture_output=True, text=True).stdout
16+
funcs = {}
17+
cur = None
18+
lines = []
19+
n = 0
20+
def flush():
21+
if cur is not None:
22+
funcs[cur] = (hashlib.sha1('\n'.join(lines).encode()).hexdigest(), n * 4)
23+
for line in out.splitlines():
24+
m = func_re.match(line)
25+
if m:
26+
flush()
27+
cur, lines, n = m.group(1), [], 0
28+
continue
29+
if cur is None:
30+
continue
31+
s = line.strip()
32+
if not s:
33+
continue
34+
# branch targets print absolute section offsets; keep only the symbolic part
35+
s = addr_re.sub('<', s)
36+
s = re.sub(r'OUTLINED_FUNCTION_\d+', 'OUTLINED_FUNCTION', s)
37+
if s.startswith('adrp') or s.startswith('adr\t'):
38+
s = re.sub(r'<.*>', '', s)
39+
s = re.sub(r'\$_\d+', '$_', s)
40+
s = re.sub(r'\.cold\.\d+', '.cold', s)
41+
s = re.sub(r'(l_\.str|ltmp|LJTI|lJTI|l___const|lCPI)[\.\d_]+', r'\1', s)
42+
# relocation lines print an offset column too
43+
s = re.sub(r'^[0-9a-f]+:\s+', '', s)
44+
lines.append(s)
45+
if not s.startswith('ARM64_RELOC'):
46+
n += 1
47+
flush()
48+
return funcs
49+
50+
51+
def collect(builddir):
52+
objs = []
53+
for root, _, files in os.walk(os.path.join(builddir, 'src')):
54+
objs += [os.path.join(root, f) for f in files if f.endswith('.o')]
55+
res = {}
56+
with ThreadPoolExecutor(10) as ex:
57+
for obj, funcs in zip(objs, ex.map(fingerprints, objs)):
58+
rel = os.path.relpath(obj, builddir)
59+
for name, v in funcs.items():
60+
res[(rel, name)] = v
61+
return res
62+
63+
64+
def main():
65+
dirs = sys.argv[1:]
66+
data = [collect(d) for d in dirs]
67+
base = data[0]
68+
total = sum(sz for _, sz in base.values())
69+
print(f'{dirs[0]}: {len(base)} functions, {total/1048576:.2f} MB code')
70+
for d, other in zip(dirs[1:], data[1:]):
71+
same = diff = only = 0
72+
per_file = {}
73+
for k, (h, sz) in base.items():
74+
if k not in other:
75+
only += sz
76+
continue
77+
if other[k][0] == h:
78+
same += sz
79+
else:
80+
diff += sz
81+
per_file.setdefault(k[0], [0, 0])
82+
per_file[k[0]][0] += sz
83+
per_file[k[0]][1] += 1
84+
newonly = sum(sz for k, (_, sz) in other.items() if k not in base)
85+
print(f'vs {d}: identical {same/1048576:.2f} MB ({100*same/total:.1f}%), differing {diff/1048576:.2f} MB ({100*diff/total:.1f}%), '
86+
f'only in base {only/1048576:.2f} MB, only in other {newonly/1048576:.2f} MB')
87+
with open(f'diff-{os.path.basename(d)}.txt', 'w') as fh:
88+
for k, (h, sz) in sorted(base.items(), key=lambda x: -x[1][1]):
89+
if k in other and other[k][0] != h:
90+
fh.write(f'{sz:8d} {k[0]} {k[1]}\n')
91+
print(' top files by differing bytes:')
92+
for f, (sz, cnt) in sorted(per_file.items(), key=lambda x: -x[1][0])[:12]:
93+
print(f' {f:50s} {sz/1024:8.1f} KB in {cnt} fns')
94+
# identical across all
95+
if len(data) > 2:
96+
allsame = sum(sz for k, (h, sz) in base.items() if all(k in o and o[k][0] == h for o in data[1:]))
97+
print(f'identical across all {len(dirs)}: {allsame/1048576:.2f} MB ({100*allsame/total:.1f}%)')
98+
99+
100+
main()

‎turbo-ext/bin/shared-core/gate.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Build turbo-ext against PHP 8.3/8.4/8.5 headers (objects
3+
# kept between runs for incremental builds) and compare per function.
4+
S=${SHARED_CORE_WORK_DIR:?set SHARED_CORE_WORK_DIR to a scratch directory}
5+
WT=$(cd "$(dirname "$0")/../.." && pwd)
6+
rm -f "$S"/g-*.failed
7+
for v in 8.3 8.4 8.5; do
8+
rsync -a --exclude '*.o' --exclude 'phpstan_turbo.so' --exclude PHP-CPP --exclude pgo --exclude version.stamp "$WT/" "$S/g-$v/"
9+
(cd "$S/g-$v" && make -k -j4 ${GATE_MAKE_ARGS} PHP_CONFIG=/opt/homebrew/opt/php@$v/bin/php-config ${GATE_TARGET:-phpstan_turbo.so} > build.log 2>&1 || { touch "$S/g-$v.failed"; echo "BUILD FAILED $v"; grep -E 'error' build.log; }) &
10+
done
11+
wait
12+
ls "$S"/g-*.failed >/dev/null 2>&1 && exit 1
13+
cd "$S" && python3 -I "$WT/bin/shared-core/compare-functions.py" g-8.3 g-8.4 g-8.5
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Link one core dylib (from the objects of $CORE_FROM) and one thin extension per PHP version.
3+
set -e
4+
S=${SHARED_CORE_WORK_DIR:?set SHARED_CORE_WORK_DIR to a scratch directory}
5+
N=/opt/homebrew/opt/llvm/bin/llvm-nm
6+
CORE_FROM=${CORE_FROM:-g-8.4}
7+
OUT=$S/split; rm -rf $OUT; mkdir -p $OUT
8+
SHIM_RE='src/(Abi|Shadow|TrustedTypes|main)\.o$'
9+
cd $S/$CORE_FROM
10+
CORE=$(find src -name '*.o' | grep -v -E "$SHIM_RE" | sort)
11+
SHIM="src/Abi.o src/Shadow.o src/TrustedTypes.o src/main.o"
12+
# the boundary, both directions
13+
$N -u $SHIM | grep -v ':$' | awk '{print $NF}' | sort -u > $OUT/shim-undef
14+
$N --defined-only $CORE | grep -E ' [TDBSC] ' | awk '{print $3}' | sort -u > $OUT/core-def
15+
comm -12 $OUT/shim-undef $OUT/core-def > $OUT/core.exp
16+
$N -u $CORE | grep -v ':$' | awk '{print $NF}' | sort -u > $OUT/core-undef
17+
$N --defined-only $SHIM | grep -E ' [TDBSC] ' | awk '{print $3}' | sort -u > $OUT/shim-def
18+
comm -12 $OUT/core-undef $OUT/shim-def > $OUT/shim.exp
19+
echo _get_module >> $OUT/shim.exp
20+
c++ -shared -undefined dynamic_lookup -Wl,-dead_strip \
21+
-install_name @loader_path/libphpstan_turbo_core.dylib \
22+
-Wl,-exported_symbols_list,$OUT/core.exp \
23+
-o $OUT/libphpstan_turbo_core.dylib $CORE
24+
for v in 8.3 8.4 8.5; do
25+
cd $S/g-$v
26+
c++ -shared -undefined dynamic_lookup -Wl,-dead_strip \
27+
-Wl,-exported_symbols_list,$OUT/shim.exp \
28+
-o $OUT/phpstan_turbo-$v.so $SHIM $OUT/libphpstan_turbo_core.dylib
29+
done
30+
ls -l $OUT/*.dylib $OUT/*.so

‎turbo-ext/src/Abi.cpp‎

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/*
2+
* The version-specific side of abi.h: the only translation unit reading the
3+
* engine globals by their compiled-in layout.
4+
*/
5+
6+
#define PHPSTANTURBO_ABI_IMPL
7+
#include "support.h"
8+
#include "reg.h"
9+
10+
#include "zend_closures.h"
11+
#include "zend_weakrefs.h"
12+
13+
pt_abi_globals pt_abi;
14+
15+
void pt_abi_init()
16+
{
17+
#define PT_ABI_EG_FIELD(field) pt_abi.eg_##field = &EG(field);
18+
#define PT_ABI_CG_FIELD(field) pt_abi.cg_##field = &CG(field);
19+
#define PT_ABI_KNOWN_STRING(id) pt_abi.known_##id = ZSTR_KNOWN(id);
20+
#define PT_ABI_OBJECT_HANDLER(member) pt_abi.handler_offset_##member = offsetof(zend_object_handlers, member);
21+
PT_ABI_EG_FIELDS(PT_ABI_EG_FIELD)
22+
PT_ABI_CG_FIELDS(PT_ABI_CG_FIELD)
23+
PT_ABI_KNOWN_STRINGS(PT_ABI_KNOWN_STRING)
24+
PT_ABI_OBJECT_HANDLERS(PT_ABI_OBJECT_HANDLER)
25+
#undef PT_ABI_EG_FIELD
26+
#undef PT_ABI_CG_FIELD
27+
#undef PT_ABI_KNOWN_STRING
28+
#undef PT_ABI_OBJECT_HANDLER
29+
30+
pt_abi.offset_internal_function_handler = offsetof(zend_internal_function, handler);
31+
pt_abi.offset_class_entry_info = offsetof(zend_class_entry, info);
32+
pt_abi.php_version_id = PHP_VERSION_ID;
33+
#if PHP_VERSION_ID >= 80400
34+
static_assert(offsetof(zend_object, extra_flags) == offsetof(zend_object, handle) + sizeof(uint32_t), "pt_abi_object_is_lazy() reads extra_flags right after handle");
35+
pt_abi.object_lazy_flags = IS_OBJ_LAZY_UNINITIALIZED | IS_OBJ_LAZY_PROXY;
36+
#else
37+
pt_abi.object_lazy_flags = 0;
38+
#endif
39+
pt_abi.is_reference_ex = IS_REFERENCE_EX;
40+
pt_abi.acc_use_guards = ZEND_ACC_USE_GUARDS;
41+
pt_abi.dval_to_lval = [](double d) -> zend_long { return zend_dval_to_lval(d); };
42+
}
43+
44+
const zend_object_handlers *pt_abi_object_handlers(const pt_abi_handlers &overrides)
45+
{
46+
auto *handlers = (zend_object_handlers *) pemalloc(sizeof(zend_object_handlers), 1);
47+
memcpy(handlers, &std_object_handlers, sizeof(zend_object_handlers));
48+
handlers->offset = overrides.offset;
49+
if (overrides.free_obj != NULL) handlers->free_obj = overrides.free_obj;
50+
if (overrides.get_gc != NULL) handlers->get_gc = overrides.get_gc;
51+
if (overrides.clone_obj != NULL) handlers->clone_obj = overrides.clone_obj;
52+
if (overrides.get_closure != NULL) handlers->get_closure = overrides.get_closure;
53+
if (overrides.compare != NULL) handlers->compare = overrides.compare;
54+
return handlers;
55+
}
56+
57+
zend_function_entry *pt_abi_function_entries(const reg::FunctionEntry *entries, size_t count)
58+
{
59+
zend_function_entry *functions = (zend_function_entry *) ecalloc(count + 1, sizeof(zend_function_entry));
60+
for (size_t i = 0; i < count; i++) {
61+
functions[i].fname = entries[i].fname;
62+
functions[i].handler = entries[i].handler;
63+
functions[i].arg_info = entries[i].argInfo;
64+
functions[i].num_args = entries[i].numArgs;
65+
functions[i].flags = entries[i].flags;
66+
}
67+
return functions;
68+
}
69+
70+
zend_class_entry *pt_abi_register_internal_class(const char *name, const reg::FunctionEntry *entries, size_t count)
71+
{
72+
zend_function_entry *functions = pt_abi_function_entries(entries, count);
73+
zend_class_entry ce;
74+
INIT_CLASS_ENTRY_EX(ce, name, strlen(name), functions);
75+
zend_class_entry *registered = zend_register_internal_class(&ce);
76+
efree(functions);
77+
return registered;
78+
}
79+
80+
void pt_abi_create_closure(zval *out, zend_function *fn, zend_class_entry *scope, zend_class_entry *calledScope, zend_object *thisObject)
81+
{
82+
#if PHP_VERSION_ID >= 80600
83+
/* php-src fbb2e1f23d6: $this is passed as zend_object* from 8.6 on */
84+
zend_create_closure(out, fn, scope, calledScope, thisObject);
85+
#else
86+
zval thisZv;
87+
if (thisObject != NULL) {
88+
ZVAL_OBJ(&thisZv, thisObject);
89+
}
90+
zend_create_closure(out, fn, scope, calledScope, thisObject != NULL ? &thisZv : NULL);
91+
#endif
92+
}
93+
94+
zend_object *pt_abi_closure_this(zval *closure)
95+
{
96+
#if PHP_VERSION_ID >= 80600
97+
/* PHP 8.6 holds the bound $this as a zend_object (NULL when unbound) */
98+
return zend_get_closure_this_ptr(closure);
99+
#else
100+
zval *thisZv = zend_get_closure_this_ptr(closure);
101+
return thisZv != NULL && Z_TYPE_P(thisZv) == IS_OBJECT ? Z_OBJ_P(thisZv) : NULL;
102+
#endif
103+
}
104+
105+
/* zend_weakrefs_hash_clean()/_destroy() only exist since PHP 8.5; before,
106+
* the same unregister-then-destroy is spelled out with the API there is */
107+
void pt_abi_weakrefs_hash_clean(HashTable *ht)
108+
{
109+
#if PHP_VERSION_ID >= 80500
110+
zend_weakrefs_hash_clean(ht);
111+
#else
112+
zend_ulong objKey;
113+
ZEND_HASH_MAP_FOREACH_NUM_KEY(ht, objKey) {
114+
zend_weakrefs_hash_del(ht, zend_weakref_key_to_object(objKey));
115+
} ZEND_HASH_FOREACH_END();
116+
#endif
117+
}
118+
119+
void pt_abi_weakrefs_hash_destroy(HashTable *ht)
120+
{
121+
#if PHP_VERSION_ID >= 80500
122+
zend_weakrefs_hash_destroy(ht);
123+
#else
124+
pt_abi_weakrefs_hash_clean(ht);
125+
zend_hash_destroy(ht);
126+
#endif
127+
}
128+
129+
void pt_abi_call_stack_size_error()
130+
{
131+
#if PHP_VERSION_ID >= 80400
132+
zend_call_stack_size_error();
133+
#else
134+
/* static in PHP 8.3; the same message */
135+
zend_throw_error(nullptr, "Maximum call stack size of %zu bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?",
136+
(size_t) ((uintptr_t) EG(stack_base) - (uintptr_t) EG(stack_limit)));
137+
#endif
138+
}
139+
140+
void pt_abi_try_assign_ref_str(zval *zv, zend_string *str)
141+
{
142+
ZEND_TRY_ASSIGN_REF_STR(zv, str);
143+
}
144+
145+
void pt_abi_try_assign_ref_true(zval *zv)
146+
{
147+
ZEND_TRY_ASSIGN_REF_TRUE(zv);
148+
}

‎turbo-ext/src/ArenaCache.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static bool serializeValue(WriteBuffer &out, zval *value, uint32_t depth, Serial
376376
* slots (mangled keys for private/protected) plus dynamic ones;
377377
* uninitialized typed props are UNDEF after deref and skipped —
378378
* the same shape serialize() writes for hook-free classes */
379-
HashTable *props = obj->handlers->get_properties(obj);
379+
HashTable *props = PT_OBJ_HANDLER(obj, get_properties)(obj);
380380
uint32_t propCount = 0;
381381
for (zv::ArrayEntry entry : zv::TableRef(props)) {
382382
zval *propValue = entry.value().raw();

‎turbo-ext/src/ArgumentsHandler.cpp‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ zend_class_entry *pt_ce_arguments_handler = nullptr;
4848

4949
/* the twin's closure names, for the engine's messages */
5050
#define PT_AH_CLASS "PHPStan\\Analyser\\ArgumentsHandler"
51-
#if PHP_VERSION_ID >= 80400
52-
#define PT_AH_CLOSURE(method, line) PT_AH_CLASS "::{closure:" PT_AH_CLASS "::" method "():" line "}"
53-
#else
54-
/* PHP 8.3 names a closure by its namespace alone */
55-
#define PT_AH_CLOSURE(method, line) PT_AH_CLASS "::PHPStan\\Analyser\\{closure}"
56-
#endif
51+
/* the closure names differ: PHP 8.3 names a closure by its namespace alone */
52+
#define PT_AH_CLOSURE(method, line) PT_ABI_SINCE(80400, PT_AH_CLASS "::{closure:" PT_AH_CLASS "::" method "():" line "}", PT_AH_CLASS "::PHPStan\\Analyser\\{closure}")
5753

5854
namespace {
5955

@@ -880,7 +876,7 @@ class ArgumentsHandler
880876
SkeletonFrame *frame = static_cast<SkeletonFrame *>(data);
881877
ZVAL_DEREF(inner);
882878
if (UNEXPECTED(Z_TYPE_P(inner) != IS_OBJECT)) {
883-
zend_type_error(PT_AH_CLOSURE("gatherArrayArgTypeSkeleton", "977") "(): Argument #1 ($inner) must be of type PhpParser\\Node\\Expr, %s given", zend_zval_value_name(inner));
879+
zend_type_error("%s(): Argument #1 ($inner) must be of type PhpParser\\Node\\Expr, %s given", PT_AH_CLOSURE("gatherArrayArgTypeSkeleton", "977"), zend_zval_value_name(inner));
884880
return zv::Val();
885881
}
886882
ArgumentsHandler handler(frame->self);
@@ -916,7 +912,7 @@ class ArgumentsHandler
916912
static void skeletonTypeBody(zval *captures, uint32_t argc, zval *argv, zval *return_value)
917913
{
918914
if (UNEXPECTED(argc < 1)) {
919-
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function " PT_AH_CLOSURE("gatherArrayArgTypeSkeleton", "977") "(), %u passed and exactly 1 expected", argc);
915+
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s(), %u passed and exactly 1 expected", PT_AH_CLOSURE("gatherArrayArgTypeSkeleton", "977"), argc);
920916
return;
921917
}
922918
SkeletonFrame frame{Z_OBJ(captures[0]), &captures[1], &captures[2], &captures[3]};

‎turbo-ext/src/Assertions.cpp‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@ zv::Val tagCall(pt_method_site &site, zval *tag, const char *lcname, size_t len,
4747

4848
/* the twin's closure names, for the parameter TypeError */
4949
#define PT_AS_CLASS "PHPStan\\Reflection\\Assertions"
50-
#if PHP_VERSION_ID >= 80400
51-
#define PT_AS_CLOSURE(method, line) PT_AS_CLASS "::{closure:" PT_AS_CLASS "::" method "():" line "}"
52-
#else
53-
/* PHP 8.3 names a closure by its namespace alone */
54-
#define PT_AS_CLOSURE(method, line) PT_AS_CLASS "::PHPStan\\Reflection\\{closure}"
55-
#endif
50+
/* the closure names differ: PHP 8.3 names a closure by its namespace alone */
51+
#define PT_AS_CLOSURE(method, line) PT_ABI_SINCE(80400, PT_AS_CLASS "::{closure:" PT_AS_CLASS "::" method "():" line "}", PT_AS_CLASS "::PHPStan\\Reflection\\{closure}")
5652

5753
/* the closure's `AssertTag $assert` parameter check; false = TypeError raised */
5854
[[nodiscard]] bool requireAssertTag(zval *value, const char *closureName, const char *parameterName)

‎turbo-ext/src/CalledMethodProcessor.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class CalledMethodProcessor
391391
zend_string *name = zval_try_get_string(subNodeName);
392392
if (UNEXPECTED(name == NULL)) return false;
393393
zval rv;
394-
zval *subNode = Z_OBJ_P(node)->handlers->read_property(Z_OBJ_P(node), name, BP_VAR_R, NULL, &rv);
394+
zval *subNode = PT_OBJ_HANDLER(Z_OBJ_P(node), read_property)(Z_OBJ_P(node), name, BP_VAR_R, NULL, &rv);
395395
zend_string_release(name);
396396
if (UNEXPECTED(EG(exception))) {
397397
if (subNode == &rv) zval_ptr_dtor(&rv);

0 commit comments

Comments
 (0)