Skip to content

Commit d10df05

Browse files
don't return null anymore
1 parent 7fa88f8 commit d10df05

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5178,7 +5178,7 @@ ZEND_METHOD(ReflectionClass, newInstanceFromData)
51785178
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
51795179
zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ZSTR_VAL(ce->name));
51805180
zval_ptr_dtor(return_value);
5181-
RETURN_NULL();
5181+
RETURN_THROWS();
51825182
}
51835183

51845184
zend_call_known_function(

ext/reflection/php_reflection.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public function newInstanceWithoutConstructor(): object {}
371371
/** @tentative-return-type */
372372
public function newInstanceArgs(array $args = []): ?object {}
373373

374-
public function newInstanceFromData(array $data, array $args = []): ?object {}
374+
public function newInstanceFromData(array $data, array $args = []): object {}
375375

376376
public function newLazyGhost(callable $initializer, int $options = 0): object {}
377377

ext/reflection/php_reflection_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/reflection/tests/ReflectionClass_toString_001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Stringable, Refle
338338
Parameter #0 [ <required> array $data ]
339339
Parameter #1 [ <optional> array $args = [] ]
340340
}
341-
- Return [ ?object ]
341+
- Return [ object ]
342342
}
343343

344344
Method [ <internal:Reflection> public method newLazyGhost ] {

0 commit comments

Comments
 (0)