| 1 | <?php |
||
| 10 | class SymfonyVersion |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @return string |
||
| 14 | */ |
||
| 15 | public static function getRootWebPath() |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return bool |
||
| 22 | */ |
||
| 23 | public static function isKernelLessThan($major, $minor = null, $patch = null) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return bool |
||
| 30 | */ |
||
| 31 | private static function kernelVersionCompare($operator, $major, $minor = null, $patch = null) |
||
| 35 | } |
||
| 36 |
Let’s assume you have a class which uses late-static binding:
}
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClassto useselfinstead: