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

Lint, Won’t Execute

Lint, won't execute is a special state of the code, where the source can be parsed, but cannot be executed.

This covers a range of problems, from very obvious to hidden syntaxes. They depend on the moment where PHP applies its checks.

Some situations depend on the inclusion, autoloading and, generally, the order of execution of the code.

<?php

    function trumpet() {
        clone 1; // obviously fails when executed
    }

    function forage(int $a = A) {}
    const A = 'abc';

    // fails when called without arguments
    trumpet(1); // OK
    trumpet();  // KO

?>

Documentation

See Also