How to remove render blocking JavaScript with defer and async

With HTML5 there are 2 new boolean attributes for <script> tag which indicates to the browser how the script should be evaluated. The 2 attributes are defer and async. Using these attributes can help improve the page load time by downloading the script in parallel when the page is being parsed and then executing it either immediately or at the end of page parsing.
Read more »

What does int(11) means in MySQL?

A very common misconception about what int(11) means in MySQL is that the column can store maximum integer value with 11 digits in length. However, this is not true. int(11) does not determines the maximum value that the column can store in it. 11 is the display width of the integer column, unlike the characters columns where the number means number of character that can be stored.
Read more »

How to add custom nodes to WordPress RSS feed

Recently I was working on a WordPress site and wanted to add a custom node to the WordPress RSS Feeds. In my previous post How to add featured image to WordPress RSS feed we saw how to add a featured image to the post content in RSS Feed. In this post we will see how we can add any node to the RSS Feed. To add a custom node in the RSS feed we just need to add some code to the theme’s functions.php file.
Read more »

PHP 7 – Combined Comparison (Spaceship) Operator

In this post we will take a look and another new operator in PHP 7. This operator is the Combined Comparison or Spaceship operator (<=>). This operator is a three way comparison operator. It will do greater-than, less-than and equal comparisons between two operands.

The spaceship operator (<=>) returns -1 if the left side is smaller, 0 if the values are equal and 1 if the left side is larger. It can be used on all generic PHP values with the same semantics as < , <=, ==, >=, >. This operator is similar in behavior to strcmp() or version_compare(). This operator can be used with integers, floats, strings, arrays, objects, etc.
Read more »

PHP 7 – Null Coalesce Operator

PHP 7 brings a lot of improvements, features and new operators as compared to the earlier versions on PHP. One of the new operators is the Null Coalesce Operator (??). This operator can be used instead of using isset() along with the ternary operator (?:).

The Null coalesce operator (??) returns the result of its first operand if it exists and is not NULL, or else it will return its second operand. Using this operator like $_GET[‘mykey’] ?? “” will not raise an E_NOTICE, and can be safely used.
Read more »