Comments (3)
@JakeBooher Can you open a pull request, that adds multiple tests for this specific scenario? So we can work on a solution after?
from serializable-closure.
I've added a test case here: #79
The following is the error you will receive:
syntax error, unexpected token "return"
at laravel-serializable-closure://function () {
$var = new \stdClass();
switch(true) {
case $var instanceof \stdClass
return true;
default:
return false;
}
}:7
3▕ $var = new \stdClass();
4▕
5▕ switch(true) {
6▕ case $var instanceof \stdClass
➜ 7▕ return true;
8▕
9▕ default:
10▕ return false;
11▕ }
from serializable-closure.
It seems like this is related to the usage of instanceof
specifically due to the following:
case 'id_name':
switch ($token[0]) {
// named arguments...
case ':':
if ($lastState === 'closure' && $context === 'root') {
$state = 'closure';
$code .= $id_start.$token;
}
In my case $context
is instanceof
so it does not append the :
correctly. What is the reason for limiting the colon to only being applied with the context root
?
from serializable-closure.
Related Issues (20)
- PHP Error: Call to a member function bindTo() on null HOT 5
- Error: File name too long[36] HOT 6
- Class not found when type-hint is defined for closure created from method HOT 4
- Memory leak in anonymous function HOT 1
- Save filename when serializing closures
- PHP 7.3 is not supported. HOT 1
- Support for PHP 8.1 enums HOT 4
- serialization crashes on typed properties HOT 1
- Unserialize from opis/closure serialization? HOT 2
- Serialization of 'Closure' is not allowed HOT 1
- Call to a member function `bindTo()` on `null` HOT 3
- I am not able to send serialized closure in queue job. HOT 2
- Laravel\SerializableClosure\Exceptions\InvalidSignatureException HOT 1
- Namespace resolution missing for named parameter during serialization HOT 6
- Unable to find the called function HOT 2
- When I used `php_strip_whitespace` to compress my PHP code, this library didn't work as expected. HOT 2
- Serialization of an Exception is not possible inside the closure HOT 1
- Serializable closure breaks the Symfony var-dumper HOT 5
- Memory leak in job queue delivery HOT 1
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 serializable-closure.