in reply to Re^4: Logical/defined or as lvalue
in thread Logical/defined or as lvalue
That makes PHP's Elvis operator a value-preserving logical-OR operator, like Perl's ||.
According to the article, || also has this function in Common Lisp, Clojure, Lua, Object Pascal, Python, Ruby, and JavaScript. It's rather disingenuous to call the article "Elvis operator".
In C, || is normalizes the value to 0 or 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Logical/defined or as lvalue
by jo37 (Curate) on Sep 04, 2024 at 18:36 UTC | |
by ikegami (Patriarch) on Sep 04, 2024 at 21:05 UTC |