|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-05-19 16:17 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2021-05-19 16:17 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 18:00:01 2025 UTC |
Description: ------------ According to php.net abs ( mixed $number ) : int|float mixed is equivalent to the union type array|bool|callable|int|float |object|resource|string|null . Available as of PHP 8.0.0. So abs should take a string. Instead we get a fatal error Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string Test script: --------------- abs(''); Expected result: ---------------- 0 Actual result: -------------- Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string