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

PHP 7.2: Failure evaluating code: is_resource($handle) #36

Closed
samuelnogueira opened this issue Mar 26, 2018 · 4 comments · Fixed by #37
Closed

PHP 7.2: Failure evaluating code: is_resource($handle) #36

samuelnogueira opened this issue Mar 26, 2018 · 4 comments · Fixed by #37
Assignees

Comments

@samuelnogueira
Copy link

samuelnogueira commented Mar 26, 2018

In src/PromiseCore.php:79, there are 2 assertions as string:

        assert('is_resource($handle)');
        assert('get_resource_type($handle) === "curl"');

This behavior is deprecated in PHP 7.2 (see http://php.net/manual/en/function.assert.php).

@mekras mekras self-assigned this Mar 26, 2018
@samuelnogueira
Copy link
Author

Since this library supports both PHP 5 and 7, and assertions as language construct exist only since version 7.0, I'm not sure what's the best course of action here, should the library stop supporting PHP 5? Or should assertions be rewritten as if (...) { throw exception }?

@samuelnogueira samuelnogueira mentioned this issue Mar 26, 2018
@samuelnogueira
Copy link
Author

@mekras I didn't mean to overstep, I just already had a working fix that I would like to share with you and the other contributors if it somehow saves you guys work.

@Nyholm
Copy link
Member

Nyholm commented Mar 26, 2018

No worries. I would say this is perfect behavior to write an issue and then create a fix for it. I promise @mekras is super happy that you added a PR.

@mekras
Copy link
Collaborator

mekras commented Mar 26, 2018

Version 1.7.1 released.

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 a pull request may close this issue.

3 participants