File tree 2 files changed +32
-3
lines changed
2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -367,13 +367,14 @@ static zend_always_inline const dom_prop_handler *dom_get_prop_handler(const dom
367
367
368
368
if (obj -> prop_handler != NULL ) {
369
369
if (cache_slot && * cache_slot == obj -> prop_handler ) {
370
- hnd = * ( cache_slot + 1 ) ;
370
+ hnd = cache_slot [ 1 ] ;
371
371
}
372
372
if (!hnd ) {
373
373
hnd = zend_hash_find_ptr (obj -> prop_handler , name );
374
374
if (cache_slot ) {
375
- * cache_slot = obj -> prop_handler ;
376
- * (cache_slot + 1 ) = (void * ) hnd ;
375
+ cache_slot [0 ] = obj -> prop_handler ;
376
+ cache_slot [1 ] = (void * ) hnd ;
377
+ cache_slot [2 ] = NULL ;
377
378
}
378
379
}
379
380
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-17991 (Assertion failure dom_attr_value_write)
3
+ --EXTENSIONS--
4
+ dom
5
+ --FILE--
6
+ <?php
7
+ $ attr = new DOMAttr ("r " , "iL " );
8
+ class Box {
9
+ public ?Test $ value ;
10
+ }
11
+ class Test {
12
+ }
13
+ function test ($ box ) {
14
+ var_dump ($ box ->value = new Test );
15
+ }
16
+ $ box = new Box ();
17
+ test ($ box );
18
+ test ($ attr );
19
+ ?>
20
+ --EXPECTF--
21
+ object(Test)#%d (0) {
22
+ }
23
+
24
+ Fatal error: Uncaught TypeError: Cannot assign Test to property DOMAttr::$value of type string in %s:%d
25
+ Stack trace:
26
+ #0 %s(%d): test(Object(DOMAttr))
27
+ #1 {main}
28
+ thrown in %s on line %d
You can’t perform that action at this time.
0 commit comments