Make PHP execution better

As per seeing the road map of PHP, it looks like php7.1 is way faster than any other older php versions it had. PHP7 executes 59% faster than older versions.

But anyhow, each millisecond counts. And that’s why, today i am gonna show you how to make it faster of upto 3 seconds.

Use echo

Use echo code snippet

Use echo statement and it is proved to save more than 0.0034 seconds in executing the script when compared to print

Use single quotes

Always use single quotes code snippet

Always use single quotes because it prevents the compiler to search for a variable inside the quotes and using single quotes allows the compiler to assume it as a simple string and echoes the value. Simple.

If you want to echo variables, it is recommended to use connecting statement method and it is a must to have a space between each connecting statement.

Use === operators and not ==

Never use wrong operators code snippet

Don’t let the compiler decide what datatype it should be, you should decide what the compiler should assume. It is recommended only if you are so cautious about your speed of page loading.

More tips and tricks will be added as soon as I get down with it, till then bye :)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.