Access PHP version inside file template

Hello,

In our company we decided as coding standard to use this declaration at begining of each new file.

declare(strict_types=1);

Like you know, this statement is only available in PHP7+.

So I would like update my PHP files template to add this line conditionally using PHP version. 

<?php
#if (${PHP_VERSION > 7})
declare(strict_types=1);
#end

Do you know a way to retrieve/insert PHP version inside file template ? 

Thank in advance for your help :)

1

请先登录再写评论。