diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2021-01-02 14:07:45 -0500 |
---|---|---|
committer | Tyson Andre <tysonandre775@hotmail.com> | 2021-01-02 16:10:14 -0500 |
commit | dfb9e03336fed7c4c07fb1a30a8be25cfbf546e4 (patch) | |
tree | 6ada3503f63bc7da91a6a1435264f1a6879775eb /ext/spl | |
parent | 64c753e7c823848b55553dee4bdf1a3336fbc0f5 (diff) | |
download | php-git-dfb9e03336fed7c4c07fb1a30a8be25cfbf546e4.tar.gz |
Use Z_PARAM_OBJ macros when zval isn't needed
In some cases, like spl_object_id, the code is simpler but equally efficient
after optimizations.
In other cases, like get_mangled_object_vars(), the compiler can't infer that
the object in the zval won't change.
Closes GH-6567
Diffstat (limited to 'ext/spl')
-rw-r--r-- | ext/spl/php_spl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 8afdb833e7..0cfb28a302 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -641,13 +641,13 @@ PHP_FUNCTION(spl_object_hash) /* {{{ Returns the integer object handle for the given object */ PHP_FUNCTION(spl_object_id) { - zval *obj; + zend_object *obj; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT(obj) + Z_PARAM_OBJ(obj) ZEND_PARSE_PARAMETERS_END(); - RETURN_LONG((zend_long)Z_OBJ_HANDLE_P(obj)); + RETURN_LONG((zend_long)obj->handle); } /* }}} */ |