Jump to content

To Ternary Or Not To Ternary


127.0.0.1

Recommended Posts

Are ternary statements faster than if-statement comparisons?

I prefer using ternary statements because I don't have to break out of an echo construct. However I've come to a point where I'd have to write a nested ternary statement. I read on [url=http://www.php.net/language.operators.comparison]php.net[/url] that "stacking" ternary statements (I interpret "stacking" as "nested" ternary comparisons) is not recommended.
Link to comment
https://forums.phpfreaks.com/topic/33865-to-ternary-or-not-to-ternary/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.