Comments (2)
I believe you a running into an issue will null bytes. As explained in a note on the PHP manual entry for serialize()
:
Object's private members have the class name prepended to the member name; protected members have a '*' prepended to the member name. These prepended values have null bytes on either side.
SuperClosure has never done anything to prevent those null bytes from being included in the serialized string. For example, if you serialize a closure that has an object with private members as one of it's context variables, you would've hit the same problem with any version of SuperClosure. It's your responsibility to take the serialized data, and format it for the purpose of whatever you are doing with it. In your case, it sounds like doing a base64_encode()
would be a good idea.
The latest beta of SuperClosure includes the Serializer object in the serialization, which does have private members, and would definitely output null bytes. That is why you are running into issues now. However, I've just made a change that removes the need to serialize the Serializer. With that commit, the symptom of your problem should disappear, but your actual problem still remains.
from super_closure.
That explains a lot. Thanks. I will definitely use base64 as this will prevent future issues in this area.
from super_closure.
Related Issues (20)
- Release 2.2.0 HOT 12
- self:: usage throws error when unserializing HOT 10
- Failing on HHVM HOT 6
- Namespace issue HOT 3
- "Serialize" to javascript? HOT 1
- Error when using Zend Guard HOT 6
- Note HOT 3
- Bug with EventEmitter? HOT 4
- Cannot instantiate interface PhpParser\Parser HOT 10
- PHP5: Cannot bind an instance to a static closure HOT 1
- Serialization of 'Closure' is not allowed HOT 4
- runing composer update on php 7 gives errors with Closure Analyser HOT 1
- Gitter chat link HOT 1
- Nested closures not working. HOT 1
- Why do serialization errors not throw? HOT 4
- Superclosure is now removed from Laravel HOT 1
- wrong repo issue ;)
- Will this still work in Laravel 5.7 HOT 1
- Arrow functions serialization HOT 8
- erialization of closure failed: The closure was not found within the abstract syntax tree.' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from super_closure.