From 1d897c842bf8220a1d18c8385dde2ed2de495112 Mon Sep 17 00:00:00 2001 From: Song Date: Fri, 16 Nov 2018 15:49:43 +0800 Subject: [PATCH] move is_string() to the front of is_numeric() toHex: is numbericPHP Fatal error: Uncaught Error: Call to a member function toHex() on array in \web3.php\src\Formatters\IntegerFormatter.php:36 move is_string() to the front of is_numeric(), resolve the problem of digit string recognition. such as a string "20180001" --- src/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils.php b/src/Utils.php index f31aae9..c98202d 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -90,7 +90,7 @@ class Utils if (is_string($value)) { $value = self::stripZero($value); $hex = implode('', unpack('H*', $value)); - } esleif (is_numeric($value)) { + } elseif (is_numeric($value)) { // turn to hex number $bn = self::toBn($value); $hex = $bn->toHex(true);