Canonical¶
Canonical PHP are the PHP recommended operators and functions. This adjective is often used in its non-canonical, to highlight that the feature exists, but is not recommended.
There are non-canonical functions, such as sizeof() versus count(), cast operators, such as boolean versus bool, property options, such as var versus public, constants, such as true versus 'on', etc.
Non-canonical operators are often a simple duplicate name for the same feature: they do not had any significant performance loss. In the end, they may be a question of taste or habits.
Canonical URL are HTML <link> tags that help prevent duplicate content issues by specifying the preferred or canonical version of a web page. This is crucial for SEO, because search engines penalize sites with duplicate content.
<?php
$array = [1, 2, 3];
echo sizeof($array); // 3
?>
Related : Habit, Cast Operator, Universal Resource Locator (URL), Search Engine Optimization (SEO), PHP Native Function