Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, ccxt\huobi given in repos/huobi-bot/vendor/ccxt/ccxt/php/Exchange.php:1821
See original GitHub issueHello,
I’m trying to make ccxt works but I think I get a very basic error.
- OS: Debian Bookworm
- Programming Language version: PHP 8.1.5
- CCXT version: “ccxt/ccxt”: “^1.16”
<?php
require_once __DIR__.'/vendor/autoload.php';
$exchange = new \ccxt\huobi(
[
'apiKey' => 'aaaaaaaaaaaaaa',
'secret' => 'ssssssssssssss',
]
);
$exchange->load_markets();
print_r($exchange->fetch_markets());
print_r($
Array
(
[0] => Array
(
[precision] => Array
(
)
[limits] => Array
(
)
[id] => btc
[symbol] => BTC/CNY
[base] => BTC
[quote] => CNY
[type] => staticmarket
[coinType] => 1
)
[1] => Array
(
[precision] => Array
(
)
[limits] => Array
(
)
[id] => ltc
[symbol] => LTC/CNY
[base] => LTC
[quote] => CNY
[type] => staticmarket
[coinType] => 2
)
)
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, ccxt\huobi given in /repos/huobi-bot/vendor/ccxt/ccxt/php/Exchange.php:1821
Stack trace:
#0 /repos/huobi-bot/vendor/ccxt/ccxt/php/Exchange.php(1821): array_key_exists()
#1 /repos/huobi-bot/vendor/ccxt/ccxt/php/huobi.php(91): ccxt\Exchange->__call()
#2 /repos/huobi-bot/bot.php(13): ccxt\huobi->fetch_balance()
#3 {main}
thrown in /repos/huobi-bot/vendor/ccxt/ccxt/php/Exchange.php on line 1821
There are two problems there, beside the PHP Fatal, I also find weird that the load_markets() only returns 2 markets.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Uncaught TypeError: join(): Argument #2 ($array) must be of ...
The data for the chart comes from a mysql database. This is the error: Uncaught TypeError: join(): Argument #2 ($array) must be of...
Read more >array_key_exists(): Argument #2 ($array) must be of ... - GitHub
This is type related issue because in PHP 8 array_key_exist is not working on non array times and here In ApiRequestor.php we are...
Read more >Uncaught TypeError: array_key_exists(): Argument #2 ($array ...
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, EJ\DropDownList given in ...
Read more >BUGFIX – Fatal error: Uncaught TypeError: array_key_exists ...
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, GF_Field_Post_Title given in ...
Read more >array_key_exists - Manual - PHP
array_key_exists() returns true if the given key is set in the array. key can be any value possible for an array index. Parameters...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
All good, for some reason when I did:
composer require ccxt/ccxt
It installed that old version. With the new version all is good. Thanks.Not sure why it installed this version, I’ll try to install the last one. And come back with the verbose output, may be that.