« first day (2836 days earlier)
← previous day
next day →
last day (2097 days later) »
Jack Johansson
1:59 PM
Simple php question... I have a conditional like this:
echo $result = $a or $b;
. It works fine. But if I use
||
instead of
or
, it echoes 1. What is happening here?
Never mind, it's
more complicated than I thought
.
4 hours later…
Tom J Nowell
5:53 PM
@JackJohansson I wouldn't include both an
echo
and an
=
in the same statement
too many things on 1 line
I'm assuming it's
1
because of the assignment
1 hour later…
Jack Johansson
7:11 PM
@TomJNowell It was actually a return statement that would either return a value or die()
Tom J Nowell
too many things on 1 line
try to follow the 1 statement per line rule
and wrap boolean logic in
()
so it's clearer
Jack Johansson
Familiarizing myself with more complex lines, seeing everyday
Amazon devs take it so hard that I can barely understand their 1 line code
Not to mention putting a page of code after a single return statement
« first day (2836 days earlier)
← previous day
next day →
last day (2097 days later) »
all rooms
Transcript for
Jul
21
Jul '18
22
Jul
23
The Loop
Where humor doesn’t work.
1
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile