diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-07 12:28:51 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-11 15:49:06 +0100 |
commit | e219ec144ef6682b71e135fd18654ee1bb4676b4 (patch) | |
tree | e4a3ae2b619cdc9fe50ee8e1fa5adb99d804dddf /ext/zip | |
parent | fe8fdfa3bd588d80ce60f6b3848058239e0a760f (diff) | |
download | php-git-e219ec144ef6682b71e135fd18654ee1bb4676b4.tar.gz |
Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2
This is a squash of PR #3734, which is a squash of PR #3313.
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Diffstat (limited to 'ext/zip')
-rw-r--r-- | ext/zip/php_zip.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 5aa17fb669..dbc6c1603e 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2133,7 +2133,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName) ZIP_FROM_OBJECT(intern, self); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/|l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l", &name, &name_len, &z_opsys, &z_attr, &flags) == FAILURE) { return; } @@ -2150,10 +2150,8 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName) (zip_flags_t)flags, &opsys, &attr) < 0) { RETURN_FALSE; } - zval_ptr_dtor(z_opsys); - ZVAL_LONG(z_opsys, opsys); - zval_ptr_dtor(z_attr); - ZVAL_LONG(z_attr, attr); + ZEND_TRY_ASSIGN_LONG(z_opsys, opsys); + ZEND_TRY_ASSIGN_LONG(z_attr, attr); RETURN_TRUE; } /* }}} */ @@ -2171,7 +2169,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex) ZIP_FROM_OBJECT(intern, self); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz/z/|l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzz|l", &index, &z_opsys, &z_attr, &flags) == FAILURE) { return; } @@ -2181,10 +2179,8 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex) (zip_flags_t)flags, &opsys, &attr) < 0) { RETURN_FALSE; } - zval_ptr_dtor(z_opsys); - ZVAL_LONG(z_opsys, opsys); - zval_ptr_dtor(z_attr); - ZVAL_LONG(z_attr, attr); + ZEND_TRY_ASSIGN_LONG(z_opsys, opsys); + ZEND_TRY_ASSIGN_LONG(z_attr, attr); RETURN_TRUE; } /* }}} */ |