PHP/declare
< PHP
Jump to navigation
Jump to search
PHP: declare()
|
The [documentation for the declare() keyword is somewhat scattered. The main documentation page mentions only "ticks" and "encoding" as directives, but there's at least one other.
directive | description |
---|---|
encoding | type of character encoding to use |
strict_types | If set to 1, only a value corresponding exactly to the type declaration will be accepted, otherwise a TypeError will be thrown. The only exception to this rule is that an int value will pass a float type declaration. |
ticks | If set to 1, functions registered with [register_tick_function() https://www.php.net/manual/en/function.register-tick-function.php] will be called in the middle of other code operations. |