Bug #73468 [Com]: PHP 7.1: PHP Notice: A non well formed numeric value encountered

From: Date: Sun, 06 Nov 2016 19:49:04 +0000
Subject: Bug #73468 [Com]: PHP 7.1: PHP Notice: A non well formed numeric value encountered
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205209@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73468&edit=1

 ID:                 73468
 Comment by:         spam2 at rhsoft dot net
 Reported by:        spam2 at rhsoft dot net
 Summary:            PHP 7.1:  PHP Notice:  A non well formed numeric
                     value encountered
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        7.1.0RC5
 Block user comment: N
 Private report:     N

 New Comment:

(floatval($dbsize)*1024) 
((float)$dbsize*1024))

are workarounds - but sicne when is PHP a strong typed language?


Previous Comments:
------------------------------------------------------------------------
[2016-11-06 19:46:27] nikic@php.net

What is the value of $dbsize? Probably something like "128K", which is not a number. If
you want to suppress the warning, use an explicit (int) cast.

See https://wiki.php.net/rfc/invalid_strings_in_arithmetic
for more information.

------------------------------------------------------------------------
[2016-11-06 19:41:07] spam2 at rhsoft dot net

ok, now i get puke

Notice: A non well formed numeric value encountered in /Volumes/dune/www-servers/rhsoft/status.php
on line 466

$dbsize_bytes = $dbsize*1024;

that's just a simple multiplication, no formatting, no magic

------------------------------------------------------------------------
[2016-11-06 19:37:48] spam2 at rhsoft dot net

Description:
------------
in 7.0 the warnings when something in a string *looks like* something where bad but *that* is just
kidding

[06-Nov-2016 20:29:39 Europe/Vienna] PHP Notice:  A non well formed numeric value encountered in
/Volumes/dune/www-servers/rhsoft/status.php on line 470
<td colspan="5"><?=GetSizeString('', ($dbsize*1024))?></td>

[06-Nov-2016 20:16:15 Europe/Vienna] PHP Notice:  A non well formed numeric value encountered in
/Volumes/dune/www-servers/phpincludes/global_rh_misc.inc.php on line 1883 
$Diff = round($BalkenBreite - $AktBreite + 1, 2) . 'px;';




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73468&edit=1


Thread (11 messages)

« previous php.bugs (#205209) next »