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"
This commit is contained in:
parent
a4251595a2
commit
1d897c842b
@ -90,7 +90,7 @@ class Utils
|
|||||||
if (is_string($value)) {
|
if (is_string($value)) {
|
||||||
$value = self::stripZero($value);
|
$value = self::stripZero($value);
|
||||||
$hex = implode('', unpack('H*', $value));
|
$hex = implode('', unpack('H*', $value));
|
||||||
} esleif (is_numeric($value)) {
|
} elseif (is_numeric($value)) {
|
||||||
// turn to hex number
|
// turn to hex number
|
||||||
$bn = self::toBn($value);
|
$bn = self::toBn($value);
|
||||||
$hex = $bn->toHex(true);
|
$hex = $bn->toHex(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user