Welcome Guest, Not a member yet? Register   Sign In
no output display in dropdown list
#4

(10-11-2018, 07:20 AM)Piotr Wrote: 2) Why you use four times <?php when you can use one?

Because for outputting text, dropping out of PHP parsing mode is generally more efficient than sending all of the text through echo or print. The larger the block of text the more significant the difference.

Because string concatenation creates a large number of temporary objects causing unnecessary use of the garbage collector. Both consume memory and can dramatically slow down script execution. Doing concatenation in loops seriously compounds these effects.

Because there is zero performance hit for dropping into and out of PHP parsing mode.

Because it's easier to write complex output without creating a lot of HTML and/or PHP syntax errors.

It is, more often than not, easier to comprehend. IOW, it's easier to read. Which is probably the most important reason.
Reply


Messages In This Thread
no output display in dropdown list - by kvanaraj - 10-11-2018, 03:35 AM
RE: no output display in dropdown list - by Piotr - 10-11-2018, 07:20 AM
RE: no output display in dropdown list - by dave friend - 10-11-2018, 10:09 AM
RE: no output display in dropdown list - by Piotr - 10-11-2018, 10:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB