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)
6517
6517
/* Get-only virtual property can never be written to. */
6518
6518
if (prop -> hooks && (prop -> flags & ZEND_ACC_VIRTUAL ) && !prop -> hooks [ZEND_PROPERTY_HOOK_SET ]) {
6519
6519
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 );
6521
6521
return ;
6522
6522
}
6523
6523
@@ -6527,15 +6527,15 @@ ZEND_METHOD(ReflectionProperty, getSettableType)
6527
6527
if (!ZEND_TYPE_IS_SET (arg_info -> type )) {
6528
6528
RETURN_NULL ();
6529
6529
}
6530
- reflection_type_factory (arg_info -> type , return_value , 0 );
6530
+ reflection_type_factory (arg_info -> type , return_value , 1 );
6531
6531
return ;
6532
6532
}
6533
6533
6534
6534
/* Fall back to property type */
6535
6535
if (!ZEND_TYPE_IS_SET (ref -> prop -> type )) {
6536
6536
RETURN_NULL ();
6537
6537
}
6538
- reflection_type_factory (ref -> prop -> type , return_value , 0 );
6538
+ reflection_type_factory (ref -> prop -> type , return_value , 1 );
6539
6539
}
6540
6540
6541
6541
/* {{{ 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