Skip to content
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

Merged
merged 2 commits into from
Dec 9, 2020
Merged

more work for PHP 8 #383

merged 2 commits into from
Dec 9, 2020

Conversation

remicollet
Copy link
Contributor

Mostly about property function arg change from zval to zend_object.

@AppVeyorBot
Copy link

@remicollet
Copy link
Contributor Author

Using PHP_VERSION : 8.0.0beta2

TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   16
---------------------------------------------------------------------

Number of tests :  175               166
Tests skipped   :    9 (  5.1%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Tests passed    :  166 ( 94.9%) (100.0%)
---------------------------------------------------------------------
Time taken      :   80 seconds
=====================================================================

@@ -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) {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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...

@AppVeyorBot
Copy link

@remicollet
Copy link
Contributor Author

For constructor, for consistency, perhaps better to switch to zend_parse_parameters_throw

@lstrojny
Copy link
Collaborator

Looks good, thank you!

rgomezcasas added a commit to CodelyTV/php-ddd-example that referenced this pull request Nov 10, 2020
rgomezcasas added a commit to CodelyTV/php-ddd-example that referenced this pull request Nov 10, 2020
rgomezcasas added a commit to CodelyTV/php-ddd-example that referenced this pull request Nov 10, 2020
@Jan-E
Copy link
Contributor

Jan-E commented Nov 18, 2020

win32/php_stdint.h does not exist anymore in PHP 8. A generic solution could use something like this

#if defined(_MSC_VER) && _MSC_VER <= 1916
#include <win32/php_stdint.h>
#else
#include <main/php_stdint.h>
#endif

It checks if a MSVC compiler is used and if the VC compiler is VC15 or less.

@lstrojny lstrojny merged commit df12418 into php-amqp:master Dec 9, 2020
@remicollet remicollet deleted the issue-php8 branch December 10, 2020 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants