Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cannot redeclare property hook “%s

Description

Property hook may only have one definition. It is not possible to have duplicates.

Example

<?php

class Test {
    public $prop {
        GeT {}
        get {}
        
    }
}

?>

Literal Examples

  • Cannot redeclare property hook “get”

Alternatives

  • Remove all but one of the definition.
  • Rename one of them with the other property hook name: may be set had a typo and was written get.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See