unset 关键字带有下划线,就像存在语法错误一样
我有这个简单的循环:
for($i=$_POST['position'];$i<count($myFiles);$i++)
{
$withoutNumber = explode("_",$myFiles[$i]);
$noNr = unset($withoutNumber[0]);
}
我的代码编辑器是 Aptana,问题是当我编写此代码时,我得到 unset
关键字下划线,就像语法错误一样,我不知道为什么会发生这种情况。我现在无法测试代码(此循环是复杂代码的一部分),所以我真的不知道问题是否真实。问题可能是什么?
I have this simple loop:
for($i=$_POST['position'];$i<count($myFiles);$i++)
{
$withoutNumber = explode("_",$myFiles[$i]);
$noNr = unset($withoutNumber[0]);
}
My code editor is Aptana, and the problem is that when I write this code I get the unset
keyword underlined like is an syntax error and I have no idea why that happens. I can not test the code right now (this loop is part of a complex code) so I don't really know if the problem is real or not. What could the problem could be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您尝试执行您的部分代码,则会给出:
这意味着问题出在您的代码中,而不是您的编辑器中;-)
考虑到
unset
不会返回任何内容,您应该:哪个工作得更好:不再有解析错误。
我认为 Aptana“知道”这种语言构造不应该返回任何内容——这就是为什么它表明存在错误。
You portion of code, if you try to execute it, gives :
Which means the problem is in your code, and not with your editor ;-)
Considering
unset
doesn't return anything, you should have :Which is working much better : no Parse Error anymore.
And I suppose that Aptana "knows" that this language construct shouldn't return anything -- which is why it indicates there is an error.
unset
是一种语言构造,而不是普通函数,因此不能用于设置变量。请参阅 unset():unset
is a language construct and not a normal function, and thus can not be used to set a variable. See unset():