Skip to content

Commit cccc548

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Fix incorrect property_info sizing for locally shadowed trait properties
2 parents 148dc1d + ff3f59b commit cccc548

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

Zend/tests/gh20672.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
GH-20672: Incorrect property_info sizing for locally shadowed trait properties
3+
--CREDITS--
4+
Jonne Ransijn (yyny)
5+
--FILE--
6+
<?php
7+
8+
trait T {
9+
public static $a;
10+
public static $b;
11+
public static $c;
12+
}
13+
14+
class Base {
15+
public $x;
16+
public $y;
17+
}
18+
19+
class Child extends Base {
20+
public static $a;
21+
public static $b;
22+
public static $c;
23+
public static $d;
24+
25+
use T;
26+
}
27+
28+
?>
29+
===DONE===
30+
--EXPECT--
31+
===DONE===

Zend/zend_inheritance.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,9 +2925,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
29252925
ZSTR_VAL(prop_name),
29262926
ZSTR_VAL(ce->name));
29272927
}
2928-
if (!(flags & ZEND_ACC_STATIC)) {
2929-
continue;
2930-
}
2928+
continue;
29312929
}
29322930
}
29332931

0 commit comments

Comments
 (0)