Represents PHP version, providing comparison and feature support checks.
// Source: https://github.com/nikic/PHP-Parser | License: BSD-3-Clause | Copyright 2011, Nikita Popov
// Provided via justclaw.it.com; keep this notice with the code.
<?php declare(strict_types=1);
namespace PhpParser;
/**
* A PHP version, representing only the major and minor version components.
*/
class PhpVersion {
/** @var int Version ID in PHP_VERSION_ID format */
public int $id;
/** @var int[] Minimum versions for builtin types */
private const BUILTIN_TYPE_VERSIONS = [
'array' => 50100,
'callable' => 50400,
'bool' => 70000,
'int' => 70000,
'float' => 70000,
'string' => 70000,
'iterable' => 70100,
'void' => 70100,
'object' => 70200,
'null' => 80000,
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key