Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
!$a == 'hello'
将$a
转换为(否定的)布尔值并将其与字符串进行比较。这可能会更快,因为它比实际比较两个字符串更容易做出决定。它还会给你错误的结果。您需要比较的是!($a == 'hello')
,我猜它所花费的时间大约相等。!$a == 'hello'
casts$a
to a (negated) boolean and compares that to a string. That may be faster, since it's easier to decide than actually comparing two strings. It'll also give you wrong results. What you need to compare against is!($a == 'hello')
, which I would guess is about equal in time taken.