syntax error, unexpected token “(int)”

Description

This is a bug in the parser engine of PHP: (int), (array) or the other cast operators, are recognized early in the code parsing, and are also confused inside a function call.

Example

<?php

var_dump(int);

?>

Solutions

  • Do not use any global constant, with the name of a cast operator: int, float, unset, etc.