AMP is simply modified and constrained HTML. The use of AMP should have no impact on your choice of PHP version. Now if you are using a CMS like wordpress and you are using a plug-in to convert your pages, then that may be a different situation. But that has to do with your CMS and plug-in and not AMP.
it's showing error in console logo.
What exactly is throwing the error? Is it a PHP error or an AMP error?