closure icon indicating copy to clipboard operation
closure copied to clipboard

Serialize closures, anonymous classes, and arbitrary data

Results 20 closure issues
Sort by recently updated
recently updated
newest added

I have the following use case: - `$foo` may contain data that is either serialized or unserialized. - If it is serialized, I need to unserialize to ensure `$foo` is...

Hello, I encountered an issue with the following code: ```php use function Opis\Closure\serialize; use Carbon\Carbon; serialize(Carbon::now()); ``` It works using a regular DateTime object. Carbon version: **2.58.0** PHP version: **8.0.18**...

The examples in the docs referring to `$this` all use classes, but I just want to serialize a closure, not the entire class. I'm passing the following closure to the...

Starting at PHP 7.4 there is a bug that prevents the use of the ReflectionObject with a DateTime object, as the getProperties() method returns an empty array. @see https://bugs.php.net/bug.php?id=79041 @see...

Creating a closure from a callable before serialization causes an error when it is later unserialized. Both the callable and closure work apparently the same way, but there must be...

Hi, I just wanted to ask for a few examples of what you use the library for in real life. Why do you need to serialize closures? I can see...

i have some closure need to be serialized to run it in other server. I serialized it and save to redis, retrieve it from other server but it return false...

Hi, everyone! I'm happy to announce that we are about to launch [a new version of Opis Closure](/opis/closure/tree/4.x). This version targets PHP +7.4 and use FFI to make closures truly...

Hi! I’m author of the `lisachenko/z-engine` library. I’ve noticed that your library also using FFI to do some low-level tricks, which is really cool! Even some parts in your library...