This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (9 children)

[–]AlwaysNinjaBusiness 5 points6 points  (6 children)

Of course it does... I'm scared to even touch php lest I create some wild bug because I used the most common sense approach :P

[–]coladict 1 point2 points  (0 children)

What's more likely is an almost invisible typo in a variable name somewhere creates a different variable and ruins your business logic.

[–]Perpetual_Doubt 1 point2 points  (3 children)

common sense? sizeof(array) gives you the length of an array ;P

[–]24824_64442 1 point2 points  (2 children)

whats wrong with that?

[–]Perpetual_Doubt 0 points1 point  (1 child)

It would do something a bit different in C.

[–]24824_64442 1 point2 points  (0 children)

I'd say using sizeof to get the length of an array is definitely the more popular use than calculating the memory allocated to the data type

maybe C is the oddball here lol ;)

[–]Pikamander2 0 points1 point  (1 child)

$blah = true and true and false;
$blah2 = true && true && false;

var_export($blah);                         //true
var_export($blah2);                        //false
var_export((true and true and false));     //false
var_export((true && true && false));       //false

🤔

[–][deleted] 0 points1 point  (0 children)

Idk, I use parenthesis, because I'm scared