phpkiteconnect
phpkiteconnect copied to clipboard
Incompatible with PHP 7.3
Please test it thoroughly before publishing it to production.
https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed
The feature is introduced in PHP 8.0, yet it's used widely in the code.
Example error: ( ! ) Fatal error: Uncaught TypeError: Return value of KiteConnect\KiteConnect::getPositions() must be an instance of KiteConnect\mixed, instance of stdClass returned in D:\www\trading\vendor\zerodha\phpkiteconnect\src\KiteConnect.php on line 648
There might be more issues with PHP 7.3. Please test it thoroughly with PHP 7.3.
@ranjanrak Can you take a look at this?
@VarunAgw The issue seems to be at Composer file, as it has captured the minimum required PHP version as 7.3. Checking on this composer file issue. We have thoroughly tested this on our local setup including running the added unit tests. Our local setup has PHP 8.0.3. Mostly, we will update the package with the minimum requirement of PHP >=8. For the older PHP version, users can always refer to our older version, as stated in README.
Besides, it's terrible to force people to use PHP 8.0 which was released just 4 months ago.
You have to understand that people run multiple projects other than Zerodha PHP SDK on their development/production machine.
PHP 8 has breaking changes. By upgrading Zerodha SDK, I am not going to break all my other projects whose dependencies are not compatible with PHP 8 yet. You have to give the entire PHP eco-system time to upgrade before forcing such latest standards.
@VarunAgw
PHP 8 has breaking changes. By upgrading Zerodha SDK, I am not going to break all my other projects whose dependencies are not compatible with PHP 8 yet. You have to give the entire PHP eco-system time to upgrade before forcing such latest standards.
Thanks for your input. We are re-evaluating our PHP version compatibility for the recent release.
Return type (used in getPositions and getMargins) mixed is not implemented in php7.3 yet. It's in php8.
getLTP function also is not working in > 7.3. Can you please fix it?
You need to upgrade to PHP > 8.0 for now.
Here is the PHP 7.3 fixed I made 6 months ago. Feel free to compare it with master before using it.
@ranjanrak But in "Requirements" section you mentioned 7.3 or greater !!? At least you should update README.
Thanks @VarunAgw
@sathyamoorthi Don't expect too much here. Typical Indian companies attitude.
Here is the PHP 7.3 fixed I made 6 months ago. Feel free to compare it with master before using it.
Not compatible, still same exception throwing,