diff options
| author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-02-19 00:00:50 +0100 |
|---|---|---|
| committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-02-19 13:19:37 +0100 |
| commit | 4f892118106741b1765c4704d1feb89a4eade38a (patch) | |
| tree | 39f709d49c4d28296f8320246ff7c27485413563 | |
| parent | 318fe06042a2196e4f79a0141ab71b26a6a3a277 (diff) | |
| download | php-git-4f892118106741b1765c4704d1feb89a4eade38a.tar.gz | |
Remove the deprecated reflection export methods
Closes GH-5188
17 files changed, 13 insertions, 626 deletions
diff --git a/ext/com_dotnet/tests/bug45280.phpt b/ext/com_dotnet/tests/bug45280.phpt index b530083cca..393799e374 100644 --- a/ext/com_dotnet/tests/bug45280.phpt +++ b/ext/com_dotnet/tests/bug45280.phpt @@ -8,8 +8,9 @@ if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; <?php $dict = new COM("Scripting.Dictionary"); +$reflection = new ReflectionObject($dict); ob_start(); -ReflectionObject::export($dict); +echo $reflection; ob_get_clean(); echo 'done'; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8d2d53b028..101913c494 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1261,101 +1261,6 @@ static void reflection_class_constant_factory(zend_class_entry *ce, zend_string } /* }}} */ -static void reflection_export_impl(zval *return_value, zval *object, zend_bool return_output) { - zval fname, retval; - int result; - - /* Invoke the __toString() method */ - ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1); - result = call_user_function(NULL, object, &fname, &retval, 0, NULL); - zval_ptr_dtor_str(&fname); - - if (result == FAILURE) { - _DO_THROW("Invocation of method __toString() failed"); - RETURN_THROWS(); - } - - if (Z_TYPE(retval) == IS_UNDEF) { - php_error_docref(NULL, E_WARNING, "%s::__toString() did not return anything", ZSTR_VAL(Z_OBJCE_P(object)->name)); - RETURN_FALSE; - } - - if (return_output) { - ZVAL_COPY_VALUE(return_value, &retval); - } else { - /* No need for _r variant, return of __toString should always be a string */ - zend_print_zval(&retval, 0); - zend_printf("\n"); - zval_ptr_dtor(&retval); - } -} - -/* {{{ _reflection_export */ -static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_ptr, int ctor_argc) -{ - zval reflector; - zval *argument_ptr, *argument2_ptr; - zval retval, params[2]; - int result; - int return_output = 0; - zend_fcall_info fci; - zend_fcall_info_cache fcc; - - if (ctor_argc == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &argument_ptr, &return_output) == FAILURE) { - RETURN_THROWS(); - } - ZVAL_COPY_VALUE(¶ms[0], argument_ptr); - ZVAL_NULL(¶ms[1]); - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) { - RETURN_THROWS(); - } - ZVAL_COPY_VALUE(¶ms[0], argument_ptr); - ZVAL_COPY_VALUE(¶ms[1], argument2_ptr); - } - - /* Create object */ - if (object_init_ex(&reflector, ce_ptr) == FAILURE) { - _DO_THROW("Could not create reflector"); - RETURN_THROWS(); - } - - /* Call __construct() */ - - fci.size = sizeof(fci); - ZVAL_UNDEF(&fci.function_name); - fci.object = Z_OBJ(reflector); - fci.retval = &retval; - fci.param_count = ctor_argc; - fci.params = params; - fci.no_separation = 1; - - fcc.function_handler = ce_ptr->constructor; - fcc.called_scope = Z_OBJCE(reflector); - fcc.object = Z_OBJ(reflector); - - result = zend_call_function(&fci, &fcc); - - zval_ptr_dtor(&retval); - - if (EG(exception)) { - zval_ptr_dtor(&reflector); - RETURN_THROWS(); - } - if (result == FAILURE) { - zval_ptr_dtor(&reflector); - _DO_THROW("Could not create reflector"); - RETURN_THROWS(); - } - - reflection_export_impl(return_value, &reflector, return_output); - - /* Destruct reflector which is no longer needed */ - zval_ptr_dtor(&reflector); -} -/* }}} */ - /* {{{ _reflection_param_get_default_param */ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS) { @@ -1408,23 +1313,6 @@ ZEND_METHOD(reflection, __clone) } /* }}} */ -/* {{{ proto public static mixed Reflection::export(Reflector r [, bool return]) - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection, export) -{ - zval *object; - zend_bool return_output = 0; - - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_OBJECT_OF_CLASS(object, reflector_ptr) - Z_PARAM_OPTIONAL - Z_PARAM_BOOL(return_output) - ZEND_PARSE_PARAMETERS_END(); - - reflection_export_impl(return_value, object, return_output); -} -/* }}} */ - /* {{{ proto public static array Reflection::getModifierNames(int modifiers) Returns an array of modifier names */ ZEND_METHOD(reflection, getModifierNames) @@ -1463,14 +1351,6 @@ ZEND_METHOD(reflection, getModifierNames) } /* }}} */ -/* {{{ proto public static mixed ReflectionFunction::export(string name [, bool return]) - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_function, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_function_ptr, 1); -} -/* }}} */ - /* {{{ proto public void ReflectionFunction::__construct(string name) Constructor. Throws an Exception in case the given function does not exist */ ZEND_METHOD(reflection_function, __construct) @@ -2227,14 +2107,6 @@ ZEND_METHOD(reflection_generator, getExecutingGenerator) } /* }}} */ -/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_parameter, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_parameter_ptr, 2); -} -/* }}} */ - /* {{{ proto public void ReflectionParameter::__construct(mixed function, mixed parameter) Constructor. Throws an Exception in case the given method does not exist */ ZEND_METHOD(reflection_parameter, __construct) @@ -2986,14 +2858,6 @@ ZEND_METHOD(reflection_union_type, getTypes) } /* }}} */ -/* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_method, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_method_ptr, 2); -} -/* }}} */ - /* {{{ proto public void ReflectionMethod::__construct(mixed class_or_method [, string name]) Constructor. Throws an Exception in case the given method does not exist */ ZEND_METHOD(reflection_method, __construct) @@ -3750,14 +3614,6 @@ ZEND_METHOD(reflection_class_constant, getDocComment) } /* }}} */ -/* {{{ proto public static mixed ReflectionClass::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_class, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_class_ptr, 1); -} -/* }}} */ - /* {{{ reflection_class_object_ctor */ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_object) { @@ -5254,14 +5110,6 @@ ZEND_METHOD(reflection_class, getShortName) } /* }}} */ -/* {{{ proto public static mixed ReflectionObject::export(mixed argument [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_object, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_object_ptr, 1); -} -/* }}} */ - /* {{{ proto public void ReflectionObject::__construct(mixed argument) throws ReflectionException Constructor. Takes an instance as an argument */ ZEND_METHOD(reflection_object, __construct) @@ -5270,22 +5118,6 @@ ZEND_METHOD(reflection_object, __construct) } /* }}} */ -/* {{{ proto public static mixed ReflectionProperty::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_property, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_property_ptr, 2); -} -/* }}} */ - -/* {{{ proto public static mixed ReflectionClassConstant::export(mixed class, string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_class_constant, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_class_constant_ptr, 2); -} -/* }}} */ - /* {{{ proto public void ReflectionProperty::__construct(mixed class, string name) Constructor. Throws an Exception in case the given property does not exist */ ZEND_METHOD(reflection_property, __construct) @@ -5782,14 +5614,6 @@ ZEND_METHOD(reflection_property, getDefaultValue) } /* }}} */ -/* {{{ proto public static mixed ReflectionExtension::export(string name [, bool return]) throws ReflectionException - Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_extension, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_extension_ptr, 1); -} -/* }}} */ - /* {{{ proto public void ReflectionExtension::__construct(string name) Constructor. Throws an Exception in case the given extension does not exist */ ZEND_METHOD(reflection_extension, __construct) @@ -6137,14 +5961,6 @@ ZEND_METHOD(reflection_extension, isTemporary) } /* }}} */ -/* {{{ proto public static mixed ReflectionZendExtension::export(string name [, bool return]) throws ReflectionException - * Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ -ZEND_METHOD(reflection_zend_extension, export) -{ - _reflection_export(INTERNAL_FUNCTION_PARAM_PASSTHRU, reflection_zend_extension_ptr, 1); -} -/* }}} */ - /* {{{ proto public void ReflectionZendExtension::__construct(string name) Constructor. Throws an Exception in case the given Zend extension does not exist */ ZEND_METHOD(reflection_zend_extension, __construct) @@ -6390,7 +6206,6 @@ static const zend_function_entry reflection_exception_functions[] = { static const zend_function_entry reflection_functions[] = { ZEND_ME(reflection, getModifierNames, arginfo_class_Reflection_getModifierNames, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_DEP_ME(reflection, export, arginfo_class_Reflection_export, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; @@ -6432,7 +6247,6 @@ static const zend_function_entry reflection_function_abstract_functions[] = { static const zend_function_entry reflection_function_functions[] = { ZEND_ME(reflection_function, __construct, arginfo_class_ReflectionFunction___construct, 0) ZEND_ME(reflection_function, __toString, arginfo_class_ReflectionFunction___toString, 0) - ZEND_DEP_ME(reflection_function, export, arginfo_class_ReflectionFunction_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_function, isDisabled, arginfo_class_ReflectionFunction_isDisabled, 0) ZEND_ME(reflection_function, invoke, arginfo_class_ReflectionFunction_invoke, 0) ZEND_ME(reflection_function, invokeArgs, arginfo_class_ReflectionFunction_invokeArgs, 0) @@ -6452,7 +6266,6 @@ static const zend_function_entry reflection_generator_functions[] = { }; static const zend_function_entry reflection_method_functions[] = { - ZEND_DEP_ME(reflection_method, export, arginfo_class_ReflectionMethod_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_method, __construct, arginfo_class_ReflectionMethod___construct, 0) ZEND_ME(reflection_method, __toString, arginfo_class_ReflectionMethod___toString, 0) ZEND_ME(reflection_method, isPublic, arginfo_class_ReflectionMethod_isPublic, 0) @@ -6475,7 +6288,6 @@ static const zend_function_entry reflection_method_functions[] = { static const zend_function_entry reflection_class_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionClass___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_class, export, arginfo_class_ReflectionClass_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_class, __construct, arginfo_class_ReflectionClass___construct, 0) ZEND_ME(reflection_class, __toString, arginfo_class_ReflectionClass___toString, 0) ZEND_ME(reflection_class, getName, arginfo_class_ReflectionClass_getName, 0) @@ -6532,14 +6344,12 @@ static const zend_function_entry reflection_class_functions[] = { }; static const zend_function_entry reflection_object_functions[] = { - ZEND_DEP_ME(reflection_object, export, arginfo_class_ReflectionObject_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_object, __construct, arginfo_class_ReflectionObject___construct, 0) PHP_FE_END }; static const zend_function_entry reflection_property_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionProperty___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_property, export, arginfo_class_ReflectionProperty_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_property, __construct, arginfo_class_ReflectionProperty___construct, 0) ZEND_ME(reflection_property, __toString, arginfo_class_ReflectionProperty___toString, 0) ZEND_ME(reflection_property, getName, arginfo_class_ReflectionProperty_getName, 0) @@ -6564,7 +6374,6 @@ static const zend_function_entry reflection_property_functions[] = { static const zend_function_entry reflection_class_constant_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionClassConstant___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_class_constant, export, arginfo_class_ReflectionClassConstant_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_class_constant, __construct, arginfo_class_ReflectionClassConstant___construct, 0) ZEND_ME(reflection_class_constant, __toString, arginfo_class_ReflectionClassConstant___toString, 0) ZEND_ME(reflection_class_constant, getName, arginfo_class_ReflectionClassConstant_getName, 0) @@ -6580,7 +6389,6 @@ static const zend_function_entry reflection_class_constant_functions[] = { static const zend_function_entry reflection_parameter_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionParameter___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_parameter, export, arginfo_class_ReflectionParameter_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_parameter, __construct, arginfo_class_ReflectionParameter___construct, 0) ZEND_ME(reflection_parameter, __toString, arginfo_class_ReflectionParameter___toString, 0) ZEND_ME(reflection_parameter, getName, arginfo_class_ReflectionParameter_getName, 0) @@ -6624,7 +6432,6 @@ static const zend_function_entry reflection_union_type_functions[] = { static const zend_function_entry reflection_extension_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionExtension___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_extension, export, arginfo_class_ReflectionExtension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_extension, __construct, arginfo_class_ReflectionExtension___construct, 0) ZEND_ME(reflection_extension, __toString, arginfo_class_ReflectionExtension___toString, 0) ZEND_ME(reflection_extension, getName, arginfo_class_ReflectionExtension_getName, 0) @@ -6643,7 +6450,6 @@ static const zend_function_entry reflection_extension_functions[] = { static const zend_function_entry reflection_zend_extension_functions[] = { ZEND_ME(reflection, __clone, arginfo_class_ReflectionZendExtension___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_DEP_ME(reflection_zend_extension, export, arginfo_class_ReflectionZendExtension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) ZEND_ME(reflection_zend_extension, __construct, arginfo_class_ReflectionZendExtension___construct, 0) ZEND_ME(reflection_zend_extension, __toString, arginfo_class_ReflectionZendExtension___toString, 0) ZEND_ME(reflection_zend_extension, getName, arginfo_class_ReflectionZendExtension_getName, 0) diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 76cbe75dd7..dc6b701473 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -8,8 +8,6 @@ class Reflection { /** @return string[] */ public static function getModifierNames(int $modifiers) {} - - public static function export(Reflector $reflector, bool $return = false) {} } interface Reflector @@ -106,8 +104,6 @@ class ReflectionFunction extends ReflectionFunctionAbstract /** @return string */ public function __toString() {} - public static function export($name, bool $return = false) {} - /** @return bool */ public function isDisabled() {} @@ -150,8 +146,6 @@ class ReflectionMethod extends ReflectionFunctionAbstract /** @return string */ public function __toString() {} - public static function export($class, $name, bool $return = false) {} - /** @return bool */ public function isPublic() {} @@ -200,8 +194,6 @@ class ReflectionClass implements Reflector { final private function __clone() {} - public static function export($argument, bool $return = false) {} - /** @param object|string $argument */ public function __construct($argument) {} @@ -366,16 +358,12 @@ class ReflectionClass implements Reflector class ReflectionObject extends ReflectionClass { public function __construct(object $argument) {} - - public static function export($argument, bool $return = false) {} } class ReflectionProperty implements Reflector { final private function __clone() {} - public static function export($class, $name, bool $return = false) {} - /** @param string|object $class */ public function __construct($class, string $name) {} @@ -436,8 +424,6 @@ class ReflectionClassConstant implements Reflector { final private function __clone() {} - public static function export($class, $name, bool $return = false) {} - /** @return string|object */ public function __construct($class, string $name) {} @@ -472,8 +458,6 @@ class ReflectionParameter implements Reflector { final private function __clone() {} - public static function export($function, $parameter, bool $return = false) {} - /** * @param string|array|object * @param int|string @@ -566,8 +550,6 @@ class ReflectionExtension implements Reflector { final private function __clone() {} - public static function export($name, bool $return = false) {} - public function __construct(string $name) {} /** @return string */ @@ -611,8 +593,6 @@ class ReflectionZendExtension implements Reflector { final private function __clone() {} - public static function export($name, bool $return = false) {} - public function __construct(string $name) {} /** @return string */ diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index 35ee713732..5f5079f59e 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -4,11 +4,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_export, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, reflector, Reflector, 0) - ZEND_ARG_TYPE_INFO(0, return, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflector___toString, 0, 0, 0) ZEND_END_ARG_INFO() @@ -70,11 +65,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionFunction___toString arginfo_class_Reflector___toString -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_export, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_TYPE_INFO(0, return, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - #define arginfo_class_ReflectionFunction_isDisabled arginfo_class_Reflector___toString ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionFunction_invoke, 0, 0, 0) @@ -112,12 +102,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionMethod___toString arginfo_class_Reflector___toString -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_export, 0, 0, 2) - ZEND_ARG_INFO(0, class) - ZEND_ARG_INFO(0, name) - ZEND_ARG_TYPE_INFO(0, return, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - #define arginfo_class_ReflectionMethod_isPublic arginfo_class_Reflector___toString #define arginfo_class_ReflectionMethod_isPrivate arginfo_class_Reflector___toString @@ -160,11 +144,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass___clone arginfo_class_Reflector___toString -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_export, 0, 0, 1) - ZEND_ARG_INFO(0, argument) - ZEND_ARG_TYPE_INFO(0, return, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass___construct, 0, 0, 1) ZEND_ARG_INFO(0, argument) ZEND_END_ARG_INFO() @@ -293,12 +272,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionObject___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, argument, IS_OBJECT, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionObject_export arginfo_class_ReflectionClass_export - #define arginfo_class_ReflectionProperty___clone arginfo_class_Reflector___toString -#define arginfo_class_ReflectionProperty_export arginfo_class_ReflectionMethod_export - ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionProperty___construct, 0, 0, 2) ZEND_ARG_INFO(0, class) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) @@ -348,8 +323,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClassConstant___clone arginfo_class_Reflector___toString -#define arginfo_class_ReflectionClassConstant_export arginfo_class_ReflectionMethod_export - #define arginfo_class_ReflectionClassConstant___construct arginfo_class_ReflectionProperty___construct #define arginfo_class_ReflectionClassConstant___toString arginfo_class_Reflector___toString @@ -372,12 +345,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter___clone arginfo_class_Reflector___toString -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionParameter_export, 0, 0, 2) - ZEND_ARG_INFO(0, function) - ZEND_ARG_INFO(0, parameter) - ZEND_ARG_TYPE_INFO(0, return, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionParameter___construct, 0, 0, 2) ZEND_ARG_INFO(0, function) ZEND_ARG_INFO(0, parameter) @@ -436,8 +403,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionExtension___clone arginfo_class_Reflector___toString -#define arginfo_class_ReflectionExtension_export arginfo_class_ReflectionFunction_export - #define arginfo_class_ReflectionExtension___construct arginfo_class_ReflectionClass_hasMethod #define arginfo_class_ReflectionExtension___toString arginfo_class_Reflector___toString @@ -466,8 +431,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionZendExtension___clone arginfo_class_Reflector___toString -#define arginfo_class_ReflectionZendExtension_export arginfo_class_ReflectionFunction_export - #define arginfo_class_ReflectionZendExtension___construct arginfo_class_ReflectionClass_hasMethod #define arginfo_class_ReflectionZendExtension___toString arginfo_class_Reflector___toString diff --git a/ext/reflection/tests/001.phpt b/ext/reflection/tests/001.phpt index d476013653..7812679ba7 100644 --- a/ext/reflection/tests/001.phpt +++ b/ext/reflection/tests/001.phpt @@ -22,7 +22,6 @@ $r = new ReflectionClassEx('ReflectionClassEx'); $exp = array ( 'UMLClass::__clone', - 'UMLClass::export', 'UMLClass::__construct', 'UMLClass::__toString', 'UMLClass::getName', diff --git a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt index 181360d733..414fac8543 100644 --- a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test usage of ReflectionClassConstant methods __toString(), export(), getName(), getValue(), isPublic(), isPrivate(), isProtected(), getModifiers(), getDeclaringClass() and getDocComment(). +Test usage of ReflectionClassConstant methods __toString(), getName(), getValue(), isPublic(), isPrivate(), isProtected(), getModifiers(), getDeclaringClass() and getDocComment(). --FILE-- <?php @@ -10,10 +10,6 @@ function reflectClassConstant($base, $constant) { echo "Reflecting on class constant $class::$constant\n\n"; echo "__toString():\n"; var_dump($constInfo->__toString()); - echo "export():\n"; - var_dump(ReflectionClassConstant::export($base, $constant, true)); - echo "export():\n"; - var_dump(ReflectionClassConstant::export($base, $constant, false)); echo "getName():\n"; var_dump($constInfo->getName()); echo "getValue():\n"; @@ -55,17 +51,6 @@ Reflecting on class constant TestClass::PUB __toString(): string(35) "Constant [ public bool PUB ] { 1 } " -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -string(35) "Constant [ public bool PUB ] { 1 } -" -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -Constant [ public bool PUB ] { 1 } - -NULL getName(): string(3) "PUB" getValue(): @@ -93,17 +78,6 @@ Reflecting on class constant TestClass::PROT __toString(): string(38) "Constant [ protected int PROT ] { 4 } " -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -string(38) "Constant [ protected int PROT ] { 4 } -" -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -Constant [ protected int PROT ] { 4 } - -NULL getName(): string(4) "PROT" getValue(): @@ -131,17 +105,6 @@ Reflecting on class constant TestClass::PRIV __toString(): string(45) "Constant [ private string PRIV ] { keepOut } " -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -string(45) "Constant [ private string PRIV ] { keepOut } -" -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -Constant [ private string PRIV ] { keepOut } - -NULL getName(): string(4) "PRIV" getValue(): @@ -169,17 +132,6 @@ Reflecting on class constant TestClass::PRIV __toString(): string(45) "Constant [ private string PRIV ] { keepOut } " -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -string(45) "Constant [ private string PRIV ] { keepOut } -" -export(): - -Deprecated: Function ReflectionClassConstant::export() is deprecated in %s on line %d -Constant [ private string PRIV ] { keepOut } - -NULL getName(): string(4) "PRIV" getValue(): diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index a70e09fa68..0aa46652b7 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -20,14 +20,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] { - Static properties [0] { } - - Static methods [1] { - Method [ <internal, deprecated:Reflection> static public method export ] { - - - Parameters [2] { - Parameter #0 [ <required> $argument ] - Parameter #1 [ <optional> bool $return ] - } - } + - Static methods [0] { } - Properties [1] { diff --git a/ext/reflection/tests/ReflectionExtension_export_basic.phpt b/ext/reflection/tests/ReflectionExtension_export_basic.phpt deleted file mode 100644 index 42972f1574..0000000000 --- a/ext/reflection/tests/ReflectionExtension_export_basic.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -ReflectionExtension::export() ---CREDITS-- -Gerrit "Remi" te Sligte <remi@wolerized.com> -Leon Luijkx <leon@phpgg.nl> ---FILE-- -<?php -ReflectionExtension::export("reflection", true); -ob_start(); -ReflectionExtension::export("reflection", false); -$test = ob_get_clean(); -var_dump(empty($test)); -?> ---EXPECTF-- -Deprecated: Function ReflectionExtension::export() is deprecated in %s on line %d -bool(false) diff --git a/ext/reflection/tests/ReflectionMethod_basic2.phpt b/ext/reflection/tests/ReflectionMethod_basic2.phpt index 46abc6b816..f7d4b9f4d6 100644 --- a/ext/reflection/tests/ReflectionMethod_basic2.phpt +++ b/ext/reflection/tests/ReflectionMethod_basic2.phpt @@ -1,5 +1,5 @@ --TEST-- -ReflectionMethod class __toString() and export() methods +ReflectionMethod class __toString() method --FILE-- <?php @@ -9,8 +9,6 @@ function reflectMethod($class, $method) { echo "Reflecting on method $class::$method()\n\n"; echo "__toString():\n"; var_dump($methodInfo->__toString()); - echo "\nexport():\n"; - var_dump(ReflectionMethod::export($class, $method, true)); echo "\n**********************************\n"; } @@ -55,15 +53,7 @@ Reflecting on method DerivedClass::foo() __toString(): string(%d) "Method [ <user, inherits TestClass> public method foo ] { - @@ %s 16 - 18 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user, inherits TestClass> public method foo ] { - @@ %s 16 - 18 + @@ %s 14 - 16 } " @@ -73,15 +63,7 @@ Reflecting on method TestClass::stat() __toString(): string(%d) "Method [ <user> static public method stat ] { - @@ %s 20 - 22 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user> static public method stat ] { - @@ %s 20 - 22 + @@ %s 18 - 20 } " @@ -91,15 +73,7 @@ Reflecting on method TestClass::priv() __toString(): string(%d) "Method [ <user> private method priv ] { - @@ %s 24 - 26 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user> private method priv ] { - @@ %s 24 - 26 + @@ %s 22 - 24 } " @@ -109,15 +83,7 @@ Reflecting on method TestClass::prot() __toString(): string(%d) "Method [ <user> protected method prot ] { - @@ %s 28 - 28 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user> protected method prot ] { - @@ %s 28 - 28 + @@ %s 26 - 26 } " @@ -127,15 +93,7 @@ Reflecting on method DerivedClass::prot() __toString(): string(%d) "Method [ <user, inherits TestClass> protected method prot ] { - @@ %s 28 - 28 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user, inherits TestClass> protected method prot ] { - @@ %s 28 - 28 + @@ %s 26 - 26 } " @@ -145,15 +103,7 @@ Reflecting on method TestInterface::int() __toString(): string(%d) "Method [ <user> abstract public method int ] { - @@ %s 36 - 36 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user> abstract public method int ] { - @@ %s 36 - 36 + @@ %s 34 - 34 } " @@ -171,33 +121,13 @@ string(%d) "Method [ <internal:Reflection, ctor> public method __construct ] { } " -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <internal:Reflection, ctor> public method __construct ] { - - - Parameters [2] { - Parameter #0 [ <required> $class ] - Parameter #1 [ <required> string $name ] - } -} -" - ********************************** ********************************** Reflecting on method TestClass::__destruct() __toString(): string(%d) "Method [ <user, dtor> public method __destruct ] { - @@ %s 30 - 30 -} -" - -export(): - -Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d -string(%d) "Method [ <user, dtor> public method __destruct ] { - @@ %s 30 - 30 + @@ %s 28 - 28 } " diff --git a/ext/reflection/tests/ReflectionParameter_export_error2.phpt b/ext/reflection/tests/ReflectionParameter_export_error2.phpt deleted file mode 100644 index 3def577e06..0000000000 --- a/ext/reflection/tests/ReflectionParameter_export_error2.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -ReflectionParameter::export() with incorrect first parameter ---CREDITS-- -Stefan Koopmanschap <stefan@stefankoopmanschap.nl> ---FILE-- -<?php -function ReflectionParameterTest($test, $test2 = null) { - echo $test; -} -$reflect = new ReflectionFunction('ReflectionParameterTest'); -$params = $reflect->getParameters(); -try { - foreach($params as $key => $value) { - ReflectionParameter::export($reflect, $key); - } -} -catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; -} -try { - foreach($params as $key => $value) { - ReflectionParameter::export(42, $key); - } -} -catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; -} -?> ---EXPECTF-- -Deprecated: Function ReflectionParameter::export() is deprecated in %s on line %d -Method ReflectionFunction::__invoke() does not exist - -Deprecated: Function ReflectionParameter::export() is deprecated in %s on line %d -The parameter class is expected to be either a string, an array(class, method) or a callable object diff --git a/ext/reflection/tests/ReflectionParameter_export_error3.phpt b/ext/reflection/tests/ReflectionParameter_export_error3.phpt deleted file mode 100644 index 822fca0032..0000000000 --- a/ext/reflection/tests/ReflectionParameter_export_error3.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -ReflectionParameter::export() with incorrect second parameter ---CREDITS-- -Stefan Koopmanschap <stefan@stefankoopmanschap.nl> ---FILE-- -<?php -function ReflectionParameterTest($test, $test2 = null) { - echo $test; -} -$reflect = new ReflectionFunction('ReflectionParameterTest'); -$params = $reflect->getParameters(); -foreach($params as $key => $value) { - ReflectionParameter::export('ReflectionParameterTest', 'incorrect_parameter'); -} ---EXPECTF-- -Deprecated: Function ReflectionParameter::export() is deprecated in %s on line %d - -Fatal error: Uncaught ReflectionException: The parameter specified by its name could not be found in %s:%d -Stack trace: -#0 [internal function]: ReflectionParameter->__construct('ReflectionParam...', 'incorrect_param...') -#1 %s(%d): ReflectionParameter::export('ReflectionParam...', 'incorrect_param...') -#2 {main} - thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_basic1.phpt b/ext/reflection/tests/ReflectionProperty_basic1.phpt index 1748ebfca9..9bdf98b6e0 100644 --- a/ext/reflection/tests/ReflectionProperty_basic1.phpt +++ b/ext/reflection/tests/ReflectionProperty_basic1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test usage of ReflectionProperty methods __toString(), export(), getName(), isPublic(), isPrivate(), isProtected(), isStatic(), getValue() and setValue(). +Test usage of ReflectionProperty methods __toString(), getName(), isPublic(), isPrivate(), isProtected(), isStatic(), getValue() and setValue(). --FILE-- <?php @@ -9,10 +9,6 @@ function reflectProperty($class, $property) { echo "Reflecting on property $class::$property\n\n"; echo "__toString():\n"; var_dump($propInfo->__toString()); - echo "export():\n"; - var_dump(ReflectionProperty::export($class, $property, true)); - echo "export():\n"; - var_dump(ReflectionProperty::export($class, $property, false)); echo "getName():\n"; var_dump($propInfo->getName()); echo "isPublic():\n"; @@ -54,17 +50,6 @@ Reflecting on property TestClass::pub __toString(): string(35) "Property [ <default> public $pub ] " -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -string(35) "Property [ <default> public $pub ] -" -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Property [ <default> public $pub ] - -NULL getName(): string(3) "pub" isPublic(): @@ -87,17 +72,6 @@ Reflecting on property TestClass::stat __toString(): string(33) "Property [ public static $stat ] " -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -string(33) "Property [ public static $stat ] -" -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Property [ public static $stat ] - -NULL getName(): string(4) "stat" isPublic(): @@ -120,17 +94,6 @@ Reflecting on property TestClass::prot __toString(): string(39) "Property [ <default> protected $prot ] " -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -string(39) "Property [ <default> protected $prot ] -" -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Property [ <default> protected $prot ] - -NULL getName(): string(4) "prot" isPublic(): @@ -149,17 +112,6 @@ Reflecting on property TestClass::priv __toString(): string(37) "Property [ <default> private $priv ] " -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -string(37) "Property [ <default> private $priv ] -" -export(): - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Property [ <default> private $priv ] - -NULL getName(): string(4) "priv" isPublic(): diff --git a/ext/reflection/tests/ReflectionProperty_export_basic.phpt b/ext/reflection/tests/ReflectionProperty_export_basic.phpt deleted file mode 100644 index 28f1f6b988..0000000000 --- a/ext/reflection/tests/ReflectionProperty_export_basic.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Test ReflectionProperty::__toString() usage. ---FILE-- -<?php - -class TestClass { - public $proper = 5; -} - -echo new ReflectionProperty('TestClass', 'proper'); - -?> ---EXPECT-- -Property [ <default> public $proper ] diff --git a/ext/reflection/tests/ReflectionProperty_export_error.phpt b/ext/reflection/tests/ReflectionProperty_export_error.phpt deleted file mode 100644 index 446fedf0a3..0000000000 --- a/ext/reflection/tests/ReflectionProperty_export_error.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test ReflectionProperty::export() errors. ---FILE-- -<?php - -class TestClass { -} - -$a = 5; - -echo "Non-existent class:\n"; -try { - ReflectionProperty::export("NonExistentClass", "prop", true); -} -catch(Exception $e) { - echo $e->getMessage(); -} - -echo "\n\nWrong property parameter type:\n"; -try { - ReflectionProperty::export($a, 'TestClass', false); -} -catch(ReflectionException $e) { - echo $e->getMessage(); -} - -echo "\n\nNon-existent property:\n"; -try { - ReflectionProperty::export('TestClass', "nonExistentProperty", true); -} -catch(Exception $e) { - echo $e->getMessage(); -} - -?> ---EXPECTF-- -Non-existent class: - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Class NonExistentClass does not exist - -Wrong property parameter type: - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -The parameter class is expected to be either a string or an object - -Non-existent property: - -Deprecated: Function ReflectionProperty::export() is deprecated in %s on line %d -Property TestClass::$nonExistentProperty does not exist diff --git a/ext/reflection/tests/ReflectionZendExtension.phpt b/ext/reflection/tests/ReflectionZendExtension.phpt index bce34f5a2c..0c5a8e6121 100644 --- a/ext/reflection/tests/ReflectionZendExtension.phpt +++ b/ext/reflection/tests/ReflectionZendExtension.phpt @@ -12,7 +12,6 @@ var_dump($reflection->getCopyright()); var_dump($reflection->getName()); var_dump($reflection->getURL()); var_dump($reflection->getVersion() === PHP_VERSION); -var_dump(gettype($reflection->export('Zend OPcache', true)) === 'string'); ?> --EXPECTF-- string(17) "Zend Technologies" @@ -20,6 +19,3 @@ string(13) "Copyright (c)" string(12) "Zend OPcache" string(20) "http://www.zend.com/" bool(true) - -Deprecated: Function ReflectionZendExtension::export() is deprecated in %s on line %d -bool(true) diff --git a/ext/reflection/tests/bug46205.phpt b/ext/reflection/tests/bug46205.phpt deleted file mode 100644 index 78e381370e..0000000000 --- a/ext/reflection/tests/bug46205.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Bug #46205 (Closure - Memory leaks when ReflectionException is thrown) ---FILE-- -<?php -$x = new reflectionmethod('reflectionparameter', 'export'); -$y = function() { }; - -try { - $x->invokeArgs(new reflectionparameter('trim', 'str'), array($y, 1)); -} catch (Exception $e) { } -?> -ok ---EXPECTF-- -Deprecated: Function ReflectionParameter::export() is deprecated in %s on line %d -ok diff --git a/ext/simplexml/tests/bug37565.phpt b/ext/simplexml/tests/bug37565.phpt deleted file mode 100644 index 38e475a744..0000000000 --- a/ext/simplexml/tests/bug37565.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Bug #37565 (Using reflection::export with simplexml causing a crash) ---SKIPIF-- -<?php if (!extension_loaded("simplexml")) print "skip"; ?> ---FILE-- -<?php - -function my_error_handler($errno, $errstr, $errfile, $errline) { - echo "Error: $errstr\n"; -} - -set_error_handler('my_error_handler'); - -class Setting extends ReflectionObject -{ -} - -try { - Reflection::export(simplexml_load_string('<test/>', 'Setting')); -} catch (Error $e) { - my_error_handler($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); -} - -try { - Reflection::export(simplexml_load_file('data:,<test/>', 'Setting')); -} catch (Error $e) { - my_error_handler($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); -} - -?> ---EXPECT-- -Error: simplexml_load_string() expects argument #2 ($class_name) to be a class name derived from SimpleXMLElement, 'Setting' given -Error: simplexml_load_file() expects argument #2 ($class_name) to be a class name derived from SimpleXMLElement, 'Setting' given |
