PHP 8 · Types and functions

Turn on strict typing

Put this on the first line of a file so scalar type declarations aren't silently converted.

<?php

declare(strict_types=1);

Official PHP 8 documentation

More types and functions commands

All types and functions commands · PHP 8 cheatsheet

Was this page helpful?