Note that it appears to be the line number the Exception was created that is returned, *not* the line it was thrown from.
See this bug:
http://bugs.php.net/bug.php?id=53882
Wanted to note that here until documentation is fixed or bug report dealt with.
Exception::getLine
(PHP 5 >= 5.1.0)
Exception::getLine — İstisnanın oluştuğu satırın numarası ile döner
Açıklama
final public int Exception::getLine
( void
)
İstisnanın oluştuğu satırın numarası ile döner.
Değiştirgeler
Bu işlevin değiştirgesi yoktur.
Dönen Değerler
İstisnanın oluştuğu satırın numarası ile döner.
Örnekler
Örnek 1 - Exception::getLine() örneği
<?php
try {
throw new Exception("Bir hata iletisi");
} catch(Exception $e) {
echo "İstisnanın oluştuğu satırın numarası: " . $e->getLine();
}
?>
Yukarıdaki örnek şuna benzer bir çıktı üretir:
İstisnanın oluştuğu satırın numarası: 3
James
03-Feb-2011 02:20
