PDA

View Full Version : No more iff() ?


Logikos
06-17-2005, 06:30 AM
I need to add quite a few conditions to a query of mine and it seems that 3.5 no longer uses the iff() function? Was this taken out completly or just replaced? I'm searching the /includes/functions.php file now for answer. Thanks guys.

Well i searched the functions.php file and and of course on line 57 it's there. Sorry for the useless post. Need to search before i open my big texteditor next time. :)

Andreas
06-17-2005, 06:47 AM
iif() is now deprecated.
Use ($condition) ? $texttrue : $textfalse instead.

Logikos
06-17-2005, 07:30 AM
Hey KirbyDE, from the looks of the function, they didn't change anything. At least i don't see a change when i compair the function from 3.0.7 to 3.5.0.

Andreas
06-17-2005, 11:59 AM
iif() is just a shortcut for the ternery operator

Xenon
06-20-2005, 09:40 AM
the ? : operator is default in php, the iif was never really needed, so they might have decide to don't use it anymore then :)

akanevsky
06-20-2005, 05:38 PM
the ? : operator is default in php, the iif was never really needed, so they might have decide to don't use it anymore then

Yeah, who needs iif at all? They probably did not know about this operator when they wrote vb2.x

Wayne Luke
06-20-2005, 05:55 PM
the ? : operator is default in php, the iif was never really needed, so they might have decide to don't use it anymore then :)

iff() is what happens when a Visual Basic Programmer moves to a C-syntax based language.

Andreas
06-20-2005, 06:04 PM
Hehe
/me happy that I never used VB much.

Xenon
06-20-2005, 06:37 PM
nice explanation, never thought of that ^^

* Xenon hasn't used visual basic often, C++ was my world ;)