The OverflowException class

(PHP 5 >= 5.1.0, PHP 7)

Introdução

Exception thrown when adding an element to a full container.

Sinopse da classe

OverflowException extends RuntimeException {
/* Propriedades herdadas */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Métodos herdados */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public string Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private string Exception::__clone ( void )
}
add a note add a note

User Contributed Notes 1 note

up
0
evguenia dot chagnon at gmail dot com
3 months ago
postgres=# create temporary table test (demo numeric(3,2));

function sumThenInsertDemo($a, $b){
    $sum = $a + $b;

    if ($sum >= 10){
        throw new OverflowException('$a + $b will overflow storage');
    }
   
    $link = pg_connect(...);
    pg_query($link, 'insert into test values('.$sum.')');
}
To Top