Which version of php support both magento 2.2.6 and magento 2.3

I want to upgrade magento 2.2.6. during to upgrade time show php version error if i upgrade it the it not support to 2.2.6. kindly suggest the version which support both.