Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

_getVersion() must be compatible

Hello, I Installed de last version from phalcon and then install the same for devtools (I think), but when I try to use the command phalcon, I recived this:

PHP Fatal error: Declaration of Phalcon\Devtools\Version::_getVersion() must be compatible with Phalcon\Version::_getVersion(): array in /var/www/html/phalcon-devtools/scripts/Phalcon/Devtools/Version.php on line 44

And this line does not give any clue....


the error says that the method declaration of _getVersion in /var/www/html/phalcon-devtools/scripts/Phalcon/Devtools/Version.php should be compatible with Phalcon\Version::_getVersion() as the class extends Phalcon\Version which is defined in the extension

you php cli could use a different php than used in http

first do this command in your cmd/console

php -r var_dump(Phalcon\Version::get());

and this

php -v

and then paste the phalcon-dev tools version from the file /var/www/html/phalcon-devtools/scripts/Phalcon/Devtools/Version.php

edited Dec '19

In the file /var/www/html/phalcon-devtools/scripts/Phalcon/Devtools/Version.php add : array as returntype hint to the _getVersion() function

protected static function _getVersion() : array