declare()

declare() is a language construct. It is used to set execution directives for a block of code.

declare() may set the following values :

  • strict_types : strict typing in the block

  • ticks : generate a tick event

  • encoding : per-file encoding directive

declare() affects some configuration for the next block of code.

<?php
    declare(strict_types=1, encoding='UTF-8');
?>

Documentation

Related : strict_types, Tick, declare Encoding