php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /opt/php-7.0.1/Zend/tests/ |
files >> //opt/php-7.0.1/Zend/tests/bug69957.phpt |
--TEST-- Bug #69957 (Different ways of handling div/mod by zero) --FILE-- <?php try { $divisor = 0; $result = 1 / $divisor; var_dump($result); } catch (DivisionByZeroError $t){ echo "Variable div\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } try { $divisor = 0; $result = 1 % $divisor; var_dump($result); } catch (DivisionByZeroError $t){ echo "\nVariable mod\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } try { $result = 1 / 0; var_dump($result); } catch (DivisionByZeroError $t){ echo "\nLiteral div\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } try { $result = 1 % 0; var_dump($result); } catch (DivisionByZeroError $t){ echo "\nLiteral mod\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } try { $result = 1 / 0.0; var_dump($result); } catch (DivisionByZeroError $t){ echo "\nDouble div\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } try { $result = 1 % 0.0; var_dump($result); } catch (DivisionByZeroError $t){ echo "\nDouble mod\n"; printf("Type: %s\n", get_class($t)); printf("Message: %s\n", $t->getMessage()); } ?> --EXPECTF-- Warning: Division by zero in %sbug69957.php on line %d float(INF) Variable mod Type: DivisionByZeroError Message: Modulo by zero Warning: Division by zero in %sbug69957.php on line %d float(INF) Literal mod Type: DivisionByZeroError Message: Modulo by zero Warning: Division by zero in %sbug69957.php on line %d float(INF) Double mod Type: DivisionByZeroError Message: Modulo by zeroy~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`