-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more work for PHP 8 #383
more work for PHP 8 #383
Conversation
✅ Build php-amqp master.12 completed (commit 8c91d703d4 by @remicollet) |
Using PHP_VERSION : 8.0.0beta2
|
@@ -331,7 +336,7 @@ static PHP_METHOD(amqp_channel_class, __construct) | |||
amqp_connection_object *connection; | |||
|
|||
/* Parse out the method parameters */ | |||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &connection_object) == FAILURE) { | |||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &connection_object, amqp_connection_class_entry) == FAILURE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure parameter type is checked (warning with php 5 and 7, TypeError exception with php 8)
@@ -65,20 +65,20 @@ static PHP_METHOD(amqp_exchange_class, __construct) | |||
zval *channelObj; | |||
amqp_channel_resource *channel_resource; | |||
|
|||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &channelObj) == FAILURE) { | |||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &channelObj, amqp_channel_class_entry) == FAILURE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure parameter type is checked...
@@ -68,20 +68,20 @@ static PHP_METHOD(amqp_queue_class, __construct) | |||
zval *channelObj; | |||
amqp_channel_resource *channel_resource; | |||
|
|||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &channelObj) == FAILURE) { | |||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &channelObj, amqp_channel_class_entry) == FAILURE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure parameter type is checked...
✅ Build php-amqp master.13 completed (commit 945bc2f305 by @remicollet) |
For constructor, for consistency, perhaps better to switch to zend_parse_parameters_throw |
Looks good, thank you! |
win32/php_stdint.h does not exist anymore in PHP 8. A generic solution could use something like this
It checks if a MSVC compiler is used and if the VC compiler is VC15 or less. |
Mostly about property function arg change from zval to zend_object.