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

Segmentation Fault

Segmentation fault is the laconic error message that is displayed when PHP crashes. It signals that an error occurred during the execution of the PHP code, and it was not handled by any part of the engine.

Segmentation faults are notoriously hard to fix. They are often linked to a bug, and there are some rare PHP syntax that leads to them. PHP 8.3 addresses them with a sensor that stops the problem before it gets out of hand.

<?php

    // start the file by including itself immediately.
    // What do you expect? 
    include __FILE__; 
    
    // Until PHP 8.3
    // Segmentation fault

?>

Documentation

See Also