opis / closure

Serialize closures (anonymous functions)
https://opis.io/closure
MIT License
2.5k stars 84 forks source link

Serialization of 'ReflectionClass' is not allowed on PHP 7.4 #94

Closed ajibarra closed 3 years ago

ajibarra commented 3 years ago

Hi, I have been using Opis Closure v3.3.1 with PHP 7.3 with no issues. Now I am trying to switch to 3.6.1 and PHP 7.4 and I get:

Serialization of 'ReflectionClass' is not allowed in functions.php L20 (serialize call) when trying to serialize an object.

PHP Version: 7.4.16 Opis Closure Version: 3.6.1

I am probably missing something so if somebody has any suggestion please let me know.

Thank you

sorinsarca commented 3 years ago

...when trying to serialize an object

This library is used to serialize closures not arbitrary objects. So, if some class is not serializable (like ReflectionClass) then opis/closure will not try to serialize that object.

If you have some code that can reproduce your problem then please reopen this issue.