]> granicus.if.org Git - php/commitdiff
Use fast zpp for ReflectionClass constructor
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 8 May 2019 15:04:28 +0000 (17:04 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 8 May 2019 15:06:00 +0000 (17:06 +0200)
At this point zpp overhead makes up a significant part of this
function.

ext/reflection/php_reflection.c

index 7b7afa9547baa6f7f4fe9993e690dd4997cfa6bd..31c9fcc51b573da4d254c976393a3d09a04d0a32 100644 (file)
@@ -3669,13 +3669,13 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
        zend_class_entry *ce;
 
        if (is_object) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &argument) == FAILURE) {
-                       return;
-               }
+               ZEND_PARSE_PARAMETERS_START(1, 1)
+                       Z_PARAM_OBJECT(argument)
+               ZEND_PARSE_PARAMETERS_END();
        } else {
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &argument) == FAILURE) {
-                       return;
-               }
+               ZEND_PARSE_PARAMETERS_START(1, 1)
+                       Z_PARAM_ZVAL(argument)
+               ZEND_PARSE_PARAMETERS_END();
        }
 
        object = ZEND_THIS;