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

match Is Now A Keyword

match() was introduced as a new command. As a side effect, it is now a PHP keyword, and it is not possible to create classes, functions or constants with that name.

PHP code

<?php

function match() {
	echo __FUNCTION__;
}

match();

?>

Before

match

After

PHP Parse error:  syntax error, unexpected token "match", expecting "(" 

Parse error: syntax error, unexpected token "match", expecting "(" 

PHP version change

This behavior changed in 8.0.

Error Messages

© 2023-2026, Damien Seguy - Exakat