Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

FilterComposite issue with Swoole 4.4.0 and higher #104

Open
2 tasks done
MassiAtHG opened this issue Jul 20, 2019 · 2 comments
Open
2 tasks done

FilterComposite issue with Swoole 4.4.0 and higher #104

MassiAtHG opened this issue Jul 20, 2019 · 2 comments

Comments

@MassiAtHG
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing.
  • This is not a question. (Questions should be asked on chat (Signup here) or our forums.)

Provide a narrative description of what you are trying to accomplish.

From Swoole v4.0.0, the extension replaces 'array_walk' and 'array_walk_recursive' with its own versions.

An excerpt fro the release notes under new features:

When RuntimeHook is turned on, the function array_walk, 
array_walk_recursive will be replaced by the version of Swoole, 
which will solve the problem that the native function cannot be reentrant, 
but it will not be able to traverse object

The replacement triggers the below error from within \Zend\Hydrator\Filter\FilterComposite constructor:

Argument 2 passed to swoole_array_walk() must be callable, array given

Wrapping the 'array_walk' function in 'Closure::fromCallable' solves the problem (PHP 7.3, Swoole 4.4.1), but it may not be a comprehensive solution for the library's support matrix.

@MassiAtHG MassiAtHG changed the title FilterComposite issue with Swoole 4.0 and higher FilterComposite issue with Swoole 4.4.0 and higher Jul 22, 2019
MassiAtHG added a commit to MassiAtHG/zend-hydrator that referenced this issue Jul 22, 2019
@fezfez
Copy link

fezfez commented Jul 29, 2019

👍 I have the same error and same fix

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-hydrator; a new issue has been opened at laminas/laminas-hydrator#2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants