Please answer this simple SPAM challenge: min(six, zero)?
(Example: nine)

The Note You're Voting On

antickon at gmail dot com
6 years ago
evaluation order of subexpressions is not strictly defined for all operators

function a() {echo 'a';}
b() {echo 'b';}
a() == b(); // outputs "ab", ie evaluates left-to-right

$a = 3;
var_dump( $a == $a = 4 ); // outputs bool(true), ie evaluates right-to-left

this is not a bug: "we [php developers] make no guarantee about the order of evaluation".

<< Back to user notes page

To Top