Deprecated Functionality: The each() function is deprecated when run the commands in terminal

I have installed magento 2.2.6 version in php 7.2. After the installation i tried to run the cache clear commands. But there was an error thrown called,

Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/xxxxxxxx.com/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 79 

After i downgraded my php version from 7.2 to 7.0 i’ve done all the required things, disabled 7.2 and enabled 7.0, when i run info.php it showing the right version. But still the same issue is happening. I don’t know where is the problem kindly help me to fix this.

Note: in terminal when i run php -v it showing php 7.2. Thanks in advance