File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -6517,7 +6517,7 @@ ZEND_METHOD(ReflectionProperty, getSettableType)
65176517 /* Get-only virtual property can never be written to. */
65186518 if (prop -> hooks && (prop -> flags & ZEND_ACC_VIRTUAL ) && !prop -> hooks [ZEND_PROPERTY_HOOK_SET ]) {
65196519 zend_type never_type = ZEND_TYPE_INIT_CODE (IS_NEVER , 0 , 0 );
6520- reflection_type_factory (never_type , return_value , 0 );
6520+ reflection_type_factory (never_type , return_value , 1 );
65216521 return ;
65226522 }
65236523
@@ -6527,15 +6527,15 @@ ZEND_METHOD(ReflectionProperty, getSettableType)
65276527 if (!ZEND_TYPE_IS_SET (arg_info -> type )) {
65286528 RETURN_NULL ();
65296529 }
6530- reflection_type_factory (arg_info -> type , return_value , 0 );
6530+ reflection_type_factory (arg_info -> type , return_value , 1 );
65316531 return ;
65326532 }
65336533
65346534 /* Fall back to property type */
65356535 if (!ZEND_TYPE_IS_SET (ref -> prop -> type )) {
65366536 RETURN_NULL ();
65376537 }
6538- reflection_type_factory (ref -> prop -> type , return_value , 0 );
6538+ reflection_type_factory (ref -> prop -> type , return_value , 1 );
65396539}
65406540
65416541/* {{{ Returns whether property has a type */
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-19187: ReflectionNamedType::getName() should not include nullable type
3+ --FILE--
4+ <?php
5+
6+ class Foo {
7+ public string |null $ bar {
8+ set(string |null $ value ) => $ value ;
9+ }
10+ }
11+
12+ $ reflProp = new ReflectionProperty (Foo::class, 'bar ' );
13+ echo $ reflProp ->getType ()->getName (), "\n" ;
14+ echo $ reflProp ->getSettableType ()->getName (), "\n" ;
15+
16+ ?>
17+ --EXPECT--
18+ string
19+ string
You can’t perform that action at this time.
0 commit comments