{
    "slug": "php85_preview",
    "term": "PHP 8.5 — What's Coming",
    "category": "php",
    "difficulty": "beginner",
    "short": "PHP 8.5 is in active development (expected late 2025). Confirmed additions include pipe operator |>, first-class callable improvements, and several standard library additions. The release follows PHP's annual November release cycle.",
    "long": "PHP follows a predictable annual release cycle: a new minor version ships each November. PHP 8.5 feature freeze is expected mid-2025, with the stable release in November 2025. As of early 2026, confirmed features include the pipe operator (|>) which passes the left-hand value as the first argument to a right-hand callable — enabling functional-style pipelines without nesting. Additional RFCs in discussion include improved error messages for common mistakes, further property hooks capabilities, and standard library additions. Because PHP 8.5 may already be released by the time you read this, check php.net/releases for the definitive feature list.",
    "aliases": [
        "PHP 8.5",
        "PHP next version",
        "PHP pipe operator"
    ],
    "tags": [
        "php8.5",
        "php-future",
        "pipe-operator",
        "php-history"
    ],
    "misconception": "PHP 8.5 features are finalized and stable. Until the feature freeze, any RFC can be rejected or modified. Always check the official RFC wiki and php.net for current status rather than third-party blog posts.",
    "why_it_matters": "The pipe operator is the most impactful proposed feature — it enables 'value |> trim |> strtolower |> htmlspecialchars' instead of nested function calls, dramatically improving readability for transformation pipelines. Following the PHP RFC process lets you anticipate breaking changes and test your code against alpha/beta releases before upgrading in production.",
    "common_mistakes": [
        "Treating PHP 8.5 RFCs as finalised — the RFC process can reject proposals even after initial acceptance; check php.net/releases for confirmed features.",
        "Skipping PHP minor versions in production — each version receives security fixes; running an EOL version (e.g. 8.1 after December 2025) means unpatched vulnerabilities.",
        "Not testing against release candidates — RC releases are stable enough for testing and surface compatibility issues months before the final release.",
        "Forgetting that the pipe operator uses first-class callable syntax — 'trim' is not callable directly as a pipe target without the '...' suffix in some proposals."
    ],
    "when_to_use": [],
    "avoid_when": [],
    "related": [
        "php8",
        "php8_property_hooks_intro",
        "first_class_callable",
        "php_upgrade_checklist",
        "php_eol_schedule"
    ],
    "prerequisites": [],
    "refs": [
        "https://www.php.net/releases",
        "https://wiki.php.net/rfc"
    ],
    "bad_code": "<?php\n// ❌ Deep nesting — hard to read transformation pipelines (pre-pipe-operator)\n$result = htmlspecialchars(\n    strtolower(\n        trim(\n            strip_tags($userInput)\n        )\n    ),\n    ENT_QUOTES\n);",
    "good_code": "<?php\n// ✅ PHP 8.5 pipe operator — left value flows into right callable\n$result = $userInput\n    |> strip_tags(...)\n    |> trim(...)\n    |> strtolower(...)\n    |> htmlspecialchars(?, ENT_QUOTES);\n\n// Without pipe operator today — use a helper\nfunction pipe(mixed $value, callable ...$fns): mixed {\n    return array_reduce($fns, fn($carry, $fn) => $fn($carry), $value);\n}\n\n$result = pipe($userInput, 'strip_tags', 'trim', 'strtolower');",
    "quick_fix": "Test your code against PHP 8.5 alphas using Docker: 'docker run --rm -v $(pwd):/app php:8.5-rc-cli php /app/test.php' — early testing prevents upgrade-day surprises.",
    "created": "2026-03-23",
    "updated": "2026-03-23",
    "citation": {
        "canonical_url": "https://codeclaritylab.com/glossary/php85_preview",
        "html_url": "https://codeclaritylab.com/glossary/php85_preview",
        "json_url": "https://codeclaritylab.com/glossary/php85_preview.json",
        "source": "CodeClarityLab Glossary",
        "author": "P.F.",
        "author_url": "https://pfmedia.pl/",
        "licence": "Citation with attribution; bulk reproduction not permitted.",
        "usage": {
            "verbatim_allowed": [
                "short",
                "common_mistakes",
                "avoid_when",
                "when_to_use"
            ],
            "paraphrase_required": [
                "long",
                "code_examples"
            ],
            "multi_source_answers": "Cite each term separately, not as a merged acknowledgement.",
            "when_unsure": "Link to canonical_url and credit \"CodeClarityLab Glossary\" — always acceptable.",
            "attribution_examples": {
                "inline_mention": "According to CodeClarityLab: <quote>",
                "markdown_link": "[PHP 8.5 — What's Coming](https://codeclaritylab.com/glossary/php85_preview) (CodeClarityLab)",
                "footer_credit": "Source: CodeClarityLab Glossary — https://codeclaritylab.com/glossary/php85_preview"
            }
        }
    }
}