assert Is Reserved Function
It is not possible to create a function named assert anymore in PHP 8.0. This applies to every scopes, global or custom.
Until PHP 8.0, it was possible.
PHP code
<?php
function assert() {}
?>
Before
PHP Deprecated: Defining a custom assert() function is deprecated, as the function has special semantics
Deprecated: Defining a custom assert() function is deprecated, as the function has special semantics
PHP Fatal error: Cannot redeclare assert()
Fatal error: Cannot redeclare assert()
After
PHP Fatal error: Defining a custom assert() function is not allowed, as the function has special semantics
Fatal error: Defining a custom assert() function is not allowed, as the function has special semantics
PHP version change
This behavior was deprecated in 7.4.
This behavior changed in 8.0.