|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch ReflectionClass_newInstanceWithoutConstructor for Reflection related Bug #55490Patch version 2011-08-25 09:24 UTC Return to Bug #55490 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:
Developer: sebastian@php.net
Index: ext/reflection/tests/ReflectionClass_toString_001.phpt
===================================================================
--- ext/reflection/tests/ReflectionClass_toString_001.phpt (revision 315465)
+++ ext/reflection/tests/ReflectionClass_toString_001.phpt (working copy)
@@ -34,7 +34,7 @@
Property [ <default> public $name ]
}
- - Methods [48] {
+ - Methods [49] {
Method [ <internal:Reflection> final private method __clone ] {
- Parameters [0] {
@@ -250,6 +250,12 @@
}
}
+ Method [ <internal:Reflection> public method newInstanceWithoutConstructor ] {
+
+ - Parameters [0] {
+ }
+ }
+
Method [ <internal:Reflection> public method newInstanceArgs ] {
- Parameters [1] {
Index: ext/reflection/php_reflection.c
===================================================================
--- ext/reflection/php_reflection.c (revision 315465)
+++ ext/reflection/php_reflection.c (working copy)
@@ -4129,6 +4129,21 @@
}
/* }}} */
+/* {{{ proto public stdclass ReflectionClass::newInstanceWithoutConstructor()
+ Returns an instance of this class without invoking its constructor */
+ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
+{
+ zval *retval_ptr = NULL;
+ reflection_object *intern;
+ zend_class_entry *ce;
+
+ METHOD_NOTSTATIC(reflection_class_ptr);
+ GET_REFLECTION_OBJECT_PTR(ce);
+
+ object_init_ex(return_value, ce);
+}
+/* }}} */
+
/* {{{ proto public stdclass ReflectionClass::newInstanceArgs([array args])
Returns an instance of this class */
ZEND_METHOD(reflection_class, newInstanceArgs)
@@ -5694,6 +5709,9 @@
ZEND_ARG_INFO(0, args)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstanceWithoutConstructor, 0)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_newInstanceArgs, 0, 0, 0)
ZEND_ARG_ARRAY_INFO(0, args, 0)
ZEND_END_ARG_INFO()
@@ -5742,6 +5760,7 @@
ZEND_ME(reflection_class, getModifiers, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInstance, arginfo_reflection_class_isInstance, 0)
ZEND_ME(reflection_class, newInstance, arginfo_reflection_class_newInstance, 0)
+ ZEND_ME(reflection_class, newInstanceWithoutConstructor, arginfo_reflection_class_newInstanceWithoutConstructor, 0)
ZEND_ME(reflection_class, newInstanceArgs, arginfo_reflection_class_newInstanceArgs, 0)
ZEND_ME(reflection_class, getParentClass, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isSubclassOf, arginfo_reflection_class_isSubclassOf, 0)
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |