Error in accessing print_r($kite->getPositions());

jaskirats
Hi,
I just got started.
I retrieved the access token using manual/ python script combination .. got stuck in python a bit and tried php client but got this error. Its just one line which is causing this ..

print_r($kite->getPositions());

PHP Fatal error: Uncaught TypeError: Return value of KiteConnect\KiteConnect::getPositions() must be an instance of KiteConnect\mixed, instance of stdClass returned in /home/webrosoft/zerodha/php/vendor/zerodha/phpkiteconnect/src/KiteConnect.php:648
Stack trace:
#0 /home/webrosoft/zerodha/myphp/1.php(29): KiteConnect\KiteConnect->getPositions()
#1 {main}
thrown in /home/webrosoft/zerodha/php/vendor/zerodha/phpkiteconnect/src/KiteConnect.php on line 648
  • jaskirats
    I am using php 7.4
  • rakeshr
    @jaskirats
    There is some compatibility issue on our latest PHP client, so you need to have PHP >= 8 for this now. We are soon planning to downgrade the PHP version requirement to >=7.3. So, if you want to use the current PHP client, please upgrade to PHP >=8.
  • jaskirats
    Thanks it worked after installing php 8
Sign In or Register to comment.