Unknown hook "%s" for property %s::$%s

Description

There can be only two property hooks: get and set, and their case variations. All others are currently explicitly forbidden.

Example

<?php

class Test {
    public $prop {
        foobar {}
    }
}

?>

Literal Examples

  • Unknown hook “foobar” for property Test::$prop

Solutions

  • Use one of the valid names.

  • Remove the property hook.

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>`_.