Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Integer Non-silent Conversion

When a string is converted into a integer, with problems, the notice was upgraded to a Warning. This raised level may end up filling logs.

This applies to all mathematical operations, such as multiplication, divisions, modulo, exponent, etc.

PHP code

<?php

print $a = 1 + '3a';

?>

Before

PHP Notice:  A non well formed numeric value encountered 

Notice: A non well formed numeric value encountered 
4

After

PHP Warning:  A non-numeric value encountered 

Warning: A non-numeric value encountered 
4

PHP version change

This behavior changed in 8.0.

Error Messages

© 2023-2026, Damien Seguy - Exakat