# getline

Exception::getLine

Gets the line in which the exception was created

# 

ENTITY

<div data-wrapper="1" role="Exception">

final

</div>

<div data-wrapper="1" role="Exception">

public

</div>

<div data-wrapper="1" role="Exception">

int

</div>

<div data-wrapper="1" role="Exception">

Exception::getLine

</div>

Get line number where the exception was created.

# 

ENTITY ENTITY

# 

ENTITY

Returns the line number where the exception was created.

# 

ENTITY

<div class="example">

<div class="title">

`Exception::getLine` example

</div>

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

    
```

ENTITY

    The exception was created on line: 3

        

</div>

# 

ENTITY

Throwable::getLine