Bug #77535 [Opn]: Invalid callback, h2 server push
| From: | nikic@php.net | Date: | Fri, 15 Mar 2019 16:10:42 +0000 |
| Subject: | Bug #77535 [Opn]: Invalid callback, h2 server push | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219981@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77535&edit=1
ID: 77535
Updated by: nikic@php.net
Reported by: tobias dot nyholm at gmail dot com
Summary: Invalid callback, h2 server push
Status: Open
Type: Bug
Package: cURL related
PHP Version: master-Git-2019-01-28 (Git)
Block user comment: N
Private report: N
New Comment:
I've committed https://github.com/php/php-src/commit/97f9fd6949a52d1eb30c3e1c90f0789b57c29468
to fix this, but don't have a curl to test with (segfaults for other reasons).
Previous Comments:
------------------------------------------------------------------------
[2019-02-02 13:04:04] tobias dot nyholm at gmail dot com
I think I've figured it out. (Or, I got help figure this out)
It is related to the garbage collector. If I do $this->tmp $callback = function.... Then
I've got not issues.
------------------------------------------------------------------------
[2019-01-28 21:39:42] tobias dot nyholm at gmail dot com
Using a callback like "[$this, '_callback']" does not work. I did manage to
declare a global function foobar() and use "foobar" as callback. But that seams
suboptimal.
------------------------------------------------------------------------
[2019-01-28 21:12:28] pmmaga@php.net
IIRC, and according to the warning, the current implementation is only accepting callables but not
Closures. If you make the callback as a named function it should be possible to set it up.
------------------------------------------------------------------------
[2019-01-28 21:05:36] tobias dot nyholm at gmail dot com
Btw, You can test this with this repo: https://github.com/Nyholm/php-test-server-push
There is a test called "test77535.php"
------------------------------------------------------------------------
[2019-01-28 20:53:38] tobias dot nyholm at gmail dot com
Interesting.
If I don't use a variable and I set CURLMOPT_PUSHFUNCTION in sendRequest() then I also get the
warning.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77535
--
Edit this bug report at https://bugs.php.net/bug.php?id=77535&edit=1