getline

Error::getLine

Gets the line in which the error occurred

ENTITY

final

public

int

Error::getLine

Get line number where the error occurred.

ENTITY ENTITY

ENTITY

Returns the line number where the error occurred.

ENTITY

Error::getLine example

<?php
try {
    throw new Error("Some error message");
} catch(Error $e) {
    echo "The error was created on line: " . $e->getLine();
}
?>

    

ENTITY

The error was created on line: 3

ENTITY

Throwable::getLine


版本号 #2
由 壳壳虫 创建于 2026-10-31 17:43:06 UTC
由 壳壳虫 更新于 2026-10-31 17:43:07 UTC