Static property may not have asymmetric visibility

Description

Asymmetric visibility is only applicable to object properties, not static properties.

Example

<?php
class X {
    static private(set) $p = 1;
}
?>

Solutions

  • Make the property non-static.

  • Remove the asymmetric visibility.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.