PHP 7.2.0 Beta 3 Released

The UnderflowException class

(PHP 5 >= 5.1.0, PHP 7)

Introduzione

Exception thrown when performing an invalid operation on an empty container, such as removing an element.

Sommario dellla classe

UnderflowException extends RuntimeException {
/* Proprietà ereditate */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Metodi ereditati */
final public string Exception::getMessage ( void )
final public Throwable Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}
add a note add a note

User Contributed Notes 1 note

up
0
evguenia dot chagnon at gmail dot com
6 months ago
UnderflowException handles exceptions due to a value being too small to maintain precision, resulting in loss of accuracy. In PHP, this can occurs when using floats:

echo (1-0.9) // 0.1
echo (1-0.99) // 0.01
echo (1-0.999) // 0.001
echo (1-0.9999) // 9.9999999999989E-05
echo (1-0.99999) // 9.9999999999545E-06
echo (1-0.999999) // 1.0000000000288E-06
To Top