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

Property hook list must not be empty

Description

It is possible to add a block, after a property definition. This is where the get and set methods are defined. There can be one or two of these methods, but the block just cannot be left empty.

Example

<?php

class X {
	public int $p = 3 {	}
}

?>

Alternatives

  • Create at least one accessor method in the block.
  • Remove the block.