{
    "slug": "php3_history",
    "term": "PHP 3 — Birth of the Language (Rasmus Lerdorf)",
    "category": "php",
    "difficulty": "beginner",
    "short": "PHP 3 (1997) was the first version called 'PHP' — a complete rewrite by Zeev Suraski and Andi Gutmans that transformed Rasmus Lerdorf's Personal Home Page tools into a proper language.",
    "long": "PHP started as 'Personal Home Page Tools' (PHP/FI) by Rasmus Lerdorf in 1994 — simple C scripts to track website visitors. PHP 3 (1997) was a complete rewrite by Zeev Suraski and Andi Gutmans (Tel Aviv University students), renaming it 'PHP: Hypertext Preprocessor'. Key additions: object support (basic), a more consistent function library, database abstraction, and the name change to PHP. The language was simple, procedural, and embedded directly in HTML. About 10% of all web servers ran PHP 3 at its peak. This rewrite established the open-source PHP we know today.",
    "aliases": [],
    "tags": [
        "php",
        "history",
        "php3",
        "origins"
    ],
    "misconception": "Rasmus Lerdorf wrote the version of PHP that became popular — he wrote the original C scripts, but PHP 3 (the foundation of modern PHP) was rewritten by Suraski and Gutmans.",
    "why_it_matters": "Understanding PHP's origins explains its design decisions — HTML embedding, loose typing, and function naming inconsistencies all trace back to its scripting tool origins.",
    "common_mistakes": [
        "Thinking PHP was designed as a serious language — it evolved organically from CGI scripts."
    ],
    "when_to_use": [],
    "avoid_when": [],
    "related": [
        "php4_era",
        "php5_oop_model",
        "php7_performance_leap"
    ],
    "prerequisites": [],
    "refs": [
        "https://www.php.net/manual/en/history.php.php"
    ],
    "bad_code": "<!-- PHP 3 style — HTML with embedded code, no OOP, global functions -->\n<?php\n$result = mysql_query('SELECT * FROM users');\nwhile ($row = mysql_fetch_array($result)) {\n    echo $row['name'] . '<br>';\n}",
    "good_code": "// Modern PHP equivalent:\n$users = $pdo->query('SELECT * FROM users')->fetchAll();\nforeach ($users as $user) {\n    echo htmlspecialchars($user['name']) . PHP_EOL;\n}",
    "quick_fix": "Historical context — no fix needed. Understanding origins helps contextualise PHP's design quirks.",
    "severity": "info",
    "effort": "low",
    "created": "2026-03-23",
    "updated": "2026-03-23",
    "citation": {
        "canonical_url": "https://codeclaritylab.com/glossary/php3_history",
        "html_url": "https://codeclaritylab.com/glossary/php3_history",
        "json_url": "https://codeclaritylab.com/glossary/php3_history.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 3 — Birth of the Language (Rasmus Lerdorf)](https://codeclaritylab.com/glossary/php3_history) (CodeClarityLab)",
                "footer_credit": "Source: CodeClarityLab Glossary — https://codeclaritylab.com/glossary/php3_history"
            }
        }
    }
}