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

__LINE__

__LINE__ holds the current line number in the current file.

The line numbers starts at 1. It is always available.

__LINE__ is often used with __FILE__, which holds the file name.

This constant is written in uppercase, by convention. It is case insensitive, and may be used with any combination of uppercase and lower case.

<?php

    function trumpet() {
        echo __FILE__.':'.__LINE__; // /tmp/test.php:4
    }

trumpet();

?>

Documentation

See Also