Throughout CodeIgniter’s code is the use of concatenation.
A simple example:
include_once(APPPATH.'controllers/'.$class.'.php');With PHP, using concatenation for $variables is a convention rather than a rule. PHP has another way to incorporate the value of a variable into a string… parsing.
The same code can be written as this:
include_once(APPPATH."controllers/{$class}.php");Now, you might think that parsing would actually take longer to execute, but it turns out that it’s faster than concatenation and has the nice side effect of being easier to read in most cases.
Note: the performance improvement may be negligible in most cases, but every little bit helps when thousands of concatenations may be done for each request to the framework.
You can even call object methods within a parsed string:
$str = "My name is {$me->getName()}."I would personally like to see the CI developers adopt the parsing approach.