In PHP 5.3 you can do
Late Static BindingThrough some testing I found that you can overwrite the value of the parents values for both variables and constants by using them statically in the parent class. Here's an example.
__phpcode0__
Our class is very generic, we have a static class variable $foo and a constant bar. We also have two supporting functions that will echo out each value. Note that we are using static:: on both and not $this-> or self::
__phpcode1__
This is our child class where we again define $foo and bar but we set the values differently. Again we have two functions but they're calling the parent functions to echo both values.
The script is set up and executed as such,
__phpcode2__
The result
quotechild var
child const
as you can see we have successfully modified the variables used in the parent class through the child via Late Static Binding.
technology
Any function in the 87' Impala that use static::$include_tape_deck will now be false even though the original is still set to true.