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

php8.1 deprecation warning "strlen(null)" #2

Open
2mt-heuser opened this issue Feb 6, 2023 · 0 comments
Open

php8.1 deprecation warning "strlen(null)" #2

2mt-heuser opened this issue Feb 6, 2023 · 0 comments

Comments

@2mt-heuser
Copy link

Since i've upgraded my current project to php8.1 I always get the deprecation warning about passing null to the strlen() function.

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

The call itself is not in this bundle, but rather in the underlying bunny-project
/vendor/bunny/bunny/src/Bunny/ClientMethods.php:1300)

$buffer->appendUint8(strlen($routingKey)); $buffer->append($routingKey);

but:
This bundle passes null down to bunny (because the used interop classes allow for that) where it gets put into an strlen() function which does not allow null to be passed.
https://github.com/php-enqueue/amqp-bunny/blob/master/AmqpContext.php#L221
https://github.com/php-enqueue/amqp-bunny/blob/master/AmqpContext.php#L230
https://github.com/php-enqueue/amqp-bunny/blob/master/AmqpContext.php#L239

So what's the better approach? Add a check in here or open an issue over at bunny to add stricter typechecks?

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

No branches or pull requests

1 participant