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

never Is Now A Keyword

Never became a PHP reserved keyword in PHP 8.1. It is used as special type, and cannot be used anymore for function names, classnames, etc.

PHP code

<?php

class never {
	function __construct() {
		print __METHOD__;
	}
}

new never;

?>

Before

never::__construct

After

PHP Fatal error:  Cannot use 'never' as class name as it is reserved 

Fatal error: Cannot use 'never' as class name as it is reserved 

PHP version change

This behavior changed in 8.1.

Extension

© 2023-2026, Damien Seguy - Exakat