Non-abstract property hook must have a body

Description

Property hooks, both set and get, may be made abstract by replacing the body block by a semi-colon. And, just like methods, property hooks must use the abstract property, although the property definition has to support the option, not the property hook itself.

Example

<?php

class X {
     // error : property hook must have a body
    public $property {
        get;
    }

    public abstract $abstractProperty {
        get;
    }
}

?>

Solutions

  • Add a body to the property hook.

  • Add the abstract keyword to the property definition.