Posts tagged php
I wanted to create an interface that would be implemented by a group of classes all extending the same abstract class. Curiosity led me to try implementing the interface in the abstract class alone, forcing the interface’s requirements down to descendants by way of abstract functions fulfilling the interface’s requirements and in turn obligating descendant classes to implement them.Continue reading »
When declaring members of a class in PHP, only the most basic of value assignments may be immediately made.
HTML parse error: <pre class="brush: php;">private $var = 'test'; // will work private $var2 = $var; // will not workContinue reading »
A PHP string will be considered false only under two conditions: either when it is empty or when it contains the single character 0 (zero).
A string of multiple zeros will result in a return value oftrue.