Bug #77535 [Com]: Invalid callback, h2 server push
| From: | tobias dot nyholm at gmail dot com | Date: | Sat, 02 Feb 2019 13:04:04 +0000 |
| Subject: | Bug #77535 [Com]: Invalid callback, h2 server push | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219334@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
Comment by: tobias dot nyholm at gmail dot com
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 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.
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2019-01-28 20:41:21] requinix@php.net
What about if you have the code in sendRequest and use
curl_multi_setopt($this->mh, CURLMOPT_PUSHFUNCTION, static function () {
return CURL_PUSH_OK;
});
without putting the callback into a variable?
------------------------------------------------------------------------
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