diff --git a/lib/Compiler.php b/lib/Compiler.php index 0feb6311eda..088f9847399 100755 --- a/lib/Compiler.php +++ b/lib/Compiler.php @@ -40616,8 +40616,11 @@ private function tryFoldHoistedBoolNullLiteralCallArg( if (false === $producerOrdinal) { return null; } + // Only block folding onto arg #0 in an @ end-block (suppress inner result — #15916). + // Trailing return-mode true after a sibling PropertyFetch keeps producerOrdinal 0 with + // boolNullArgIndices=[1]; rejecting that misbinds PropertyFetch to arg1 (#21975). if ( - 0 === $producerOrdinal + 0 === $argIndex && null !== $block->orig && $this->isErrorSuppressEndBlock($block->orig) ) { diff --git a/prelinked/bootstrap-gen0/.bootstrap_lowering_source.sha b/prelinked/bootstrap-gen0/.bootstrap_lowering_source.sha index 2d5b1c0913d..ff99dbdc7b4 100644 --- a/prelinked/bootstrap-gen0/.bootstrap_lowering_source.sha +++ b/prelinked/bootstrap-gen0/.bootstrap_lowering_source.sha @@ -1 +1 @@ -6ed509af3f80a54c4767f5c6271d41a88cb302da602905d6e1bcce3a1793d1c4 \ No newline at end of file +a3d6cb8b689e76e49bf50189a9a5c9a0c9ec7080ecbc961b8ec06eff5bdba483 \ No newline at end of file diff --git a/prelinked/bootstrap-gen0/manifest.json b/prelinked/bootstrap-gen0/manifest.json index c6892dc4309..2643d64be92 100644 --- a/prelinked/bootstrap-gen0/manifest.json +++ b/prelinked/bootstrap-gen0/manifest.json @@ -1,6 +1,6 @@ { "version": 1, - "generated_at": "2026-07-22T12:54:05+00:00", + "generated_at": "2026-07-22T13:05:16+00:00", "driver": "prelinked/bootstrap-gen0/bin-compile-aot", "compiler_minimal_sidecar": "prelinked/bootstrap-gen0/compiler_minimal_aot_blob", "compiler_lib_sidecar": "prelinked/bootstrap-gen0/compiler_lib_aot_blob", @@ -29,5 +29,5 @@ ], "build_target": "inventory argv emit (Zend native rebuild, BOOTSTRAP_INVENTORY_DRIVER_USE_PRELINKED=0)", "issue": "#3053, #1492, #2880, #3046, #8713", - "lowering_source_fingerprint": "6ed509af3f80a54c4767f5c6271d41a88cb302da602905d6e1bcce3a1793d1c4" + "lowering_source_fingerprint": "a3d6cb8b689e76e49bf50189a9a5c9a0c9ec7080ecbc961b8ec06eff5bdba483" } diff --git a/test/compliance/cases/stdlib/var_export_dom_prop_return_true.phpt b/test/compliance/cases/stdlib/var_export_dom_prop_return_true.phpt new file mode 100644 index 00000000000..365f95c2023 --- /dev/null +++ b/test/compliance/cases/stdlib/var_export_dom_prop_return_true.phpt @@ -0,0 +1,26 @@ +--TEST-- +stdlib: var_export($domProp, true) after @loadHTML matches Zend (#21975, ext/standard/var.c) +--FILE-- +loadHTML('

hello

'); +$p = $d->getElementsByTagName('p')->item(0); +$tn = $p->firstChild; +echo var_export($p->nodeName, true), "\n"; +echo var_export($tn->data, true), "\n"; +echo var_export($tn->textContent, true), "\n"; +var_export($tn->data); +echo "\n"; +$x = $tn->data; +echo var_export($x, true), "\n"; +$o = new class { + public string $s = 'hello'; +}; +echo var_export($o->s, true), "\n"; +--EXPECT-- +'p' +'hello' +'hello' +'hello' +'hello' +'hello' diff --git a/test/repro/issue_21975_var_export_dom_prop.php b/test/repro/issue_21975_var_export_dom_prop.php new file mode 100644 index 00000000000..cd143ba327c --- /dev/null +++ b/test/repro/issue_21975_var_export_dom_prop.php @@ -0,0 +1,14 @@ +loadHTML('

hello

'); +$p = $d->getElementsByTagName('p')->item(0); +$tn = $p->firstChild; +echo 'nodeName=', var_export($p->nodeName, true), "\n"; +echo 'data=', var_export($tn->data, true), "\n"; +echo 'onearg='; +var_export($tn->data); +echo "\n"; +$x = $tn->data; +echo 'assign=', var_export($x, true), "\n";