Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets the current PHP version
<?php phpversion(?string $extension = null): string|false
<?php         if (PlatformRepository::isPlatformPackage($packageName)) {


            if (0 === stripos($packageName, 'php') || $packageName === 'hhvm') {

                $version = self::getPlatformPackageVersion($pool, $packageName, phpversion());



                $msg = "- Root composer.json requires ".$packageName.self::constraintToText($constraint).' but ';
<?php                 $ext = substr($packageName, 4);

                $msg = "- Root composer.json requires PHP extension ".$packageName.self::constraintToText($constraint).' but ';



                $version = self::getPlatformPackageVersion($pool, $packageName, phpversion($ext) ?: '0');

                if (null === $version) {

                    if (extension_loaded($ext)) {

                        return array(
<?php     public function getExtensionVersion($extension)

    {

        return phpversion($extension);

    }
<?php     public function testParseErrorDetectSingleQuotes()

    {

        if (defined('JSON_PARSER_NOTSTRICT') && version_compare(phpversion('json'), '1.3.9', '<')) {

            $this->markTestSkipped('jsonc issue, see https://github.com/remicollet/pecl-json-c/issues/23');

        }

        $json = '{