We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果源码里这样写:
a() !== undefined;
编译出来的结果是:
isset(a());
运行时就会报错,如下
Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in /path/to/file.php
通过改源码,有两种方式可解
源码:
undefined !== a();
编译结果:
null !== a();
const b = a(); return b !== undefined;
$b = a(); return isset($b);
直接编译成:新建一个临时变量,对临时变量执行 isset
isset
大概就像 babel 对剪头函数进行转换的时候,在函数最外面先建个变量指向当前 this 那种
this
The text was updated successfully, but these errors were encountered:
欢迎pr
Sorry, something went wrong.
No branches or pull requests
问题描述
如果源码里这样写:
编译出来的结果是:
运行时就会报错,如下
临时方案
通过改源码,有两种方式可解
方法1:反过来判断
源码:
编译结果:
方法2:先赋值给变量,再判断
源码:
编译结果:
期望
直接编译成:新建一个临时变量,对临时变量执行
isset
The text was updated successfully, but these errors were encountered: