Commit 2945c72
authored
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.1 parent b33fee5 commit 2945c72
File tree
7 files changed
+439
-804
lines changed- build
- ext/dom
- tests
- modern/spec
7 files changed
+439
-804
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2354 | 2354 | | |
2355 | 2355 | | |
2356 | 2356 | | |
2357 | | - | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
2358 | 2368 | | |
2359 | 2369 | | |
2360 | 2370 | | |
| |||
2450 | 2460 | | |
2451 | 2461 | | |
2452 | 2462 | | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
2453 | 2474 | | |
2454 | 2475 | | |
2455 | 2476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | 415 | | |
421 | 416 | | |
422 | 417 | | |
| |||
429 | 424 | | |
430 | 425 | | |
431 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
| |||
0 commit comments