performance - Most efficient php if structure -
What runs fast?
Setting a default value and changing it -
$ Foo = ""; If ($ bar) {$ foo = "someValue"; }
or -
if ($ bar) {$ foo = "someValue"; } And {$ foo = ""; }
You should not be disturbed by the performance of a single if
statement.
Also, consider:
$ foo = $ bar? "": "Some value"
Comments
Post a Comment