Cannot Static Static Property
<?php
class x {
// the way to go is self
static private self $property1;
// tough luck not possible
static private static $property2;
}
?>
Static can be used as a keyword to mark a property as static (sic). It could also be used as a type for that same property, leading to those confusing lines below.
In fact, static would accept self, but also parent and any children class: just like self. So, self is sufficient to type properties, and there is no need for static static.
See Also
- Static properties (PHP manual)
- Late Static Binding (PHP manual)
- 5 usages of static keyword in PHP
- No static static [Try me]
PHP Error Messages
PHP Features
Last updated: 10 September 2026