I have been seen this Does variable name length matter for performance C#? topic and have same question about php.
My co-worker (Front-end) have been encoded everything like $o, $r, $x, $m, $c and motivated it best performance. I really very doubt about it and code became difficult to read.
- $o – object or obj
- $m – $model
- $r – $query_result or $result
- $x – $xml_node
Every thing look like
if ( isset ( self::$o[ self::$x -> name ] ) ) :
$c = 'ClassPrefix_' . self::$o[ self::$x -> name ];
$o = new $c;
self::$x -> read ( );
Variable names exist more as a programmer aide – when a program or script is interpreted, these are converted into memory locations. Shorter variables will only negatively impact performance of the programmer(s) when modifying / debugging code in the future.
Obfuscation is a widely used technique that involves replacing variable names with single/multi-character variable names, but that is used in an attempt to make reverse engineering / lifting core technology from projects where the source code is readily available / easily extracted more difficult.