PHP/FI — The Origin Story (1994–1997)
debt(d0/e0/b0/t3)
Axis does not apply. This is a pure historical/factual reference term with no code artefact to detect. There is no misuse pattern that any tool could flag — no detection_hints.tools are listed, and none are applicable.
Axis does not apply. The quick_fix explicitly states 'There is no fix — this is historical context.' There is no code change to make; the term is purely informational.
Axis does not apply. The term has no applies_to scope and carries no structural or architectural commitment. Understanding history imposes no ongoing maintenance tax on a codebase.
Closest to 'minor surprise (one edge case)' (t3). The misconception field states developers assume PHP was always designed as a web language when it originated as a personal productivity script. This is a factual misunderstanding rather than a dangerous behavioral trap — it causes misdirected assumptions about PHP's design quirks (register_globals, short tags, procedural style) but does not cause code bugs directly. Slightly above t1 because the misconception is widespread and shapes how developers interpret legacy PHP patterns, but below t5 since no runtime behavior is directly affected.
Also Known As
TL;DR
Explanation
Rasmus Lerdorf released the original PHP tools in 1994 on the comp.infosystems.www.authoring.cgi newsgroup. The tools parsed form data, tracked page views, and embedded logic directly in HTML — ideas radical at the time. PHP/FI 2.0 (1997) added database support via mSQL and early SQL capabilities. It had no objects, no namespaces, no exceptions — just procedural scripts with global variables and output buffering. Zeev Suraski and Andi Gutmans rewrote the parser entirely in 1997, producing what became PHP 3. That rewrite is when PHP transitioned from a personal tool to a general-purpose scripting language. The name was recursively redefined as PHP: Hypertext Preprocessor.
Common Misconception
Why It Matters
Common Mistakes
- Assuming register_globals was ever safe — it automatically created PHP variables from GET/POST/COOKIE data, making variable injection trivial and causing innumerable security flaws before removal in PHP 5.4.
- Treating PHP's procedural style as a limitation rather than a choice — modern PHP supports full OOP, but procedural code is still valid for simple scripts.
- Confusing PHP/FI with PHP 3 — PHP 3 was the Suraski/Gutmans rewrite that made PHP a real language; PHP/FI was the Lerdorf prototype.
- Thinking short open tags (<?) are standard — they predate XML and are a PHP/FI relic; always use <?php in portable code.
Code Examples
// ❌ PHP/FI era style — global variables, no structure, direct superglobal use
// (Still seen in legacy codebases)
$id = $HTTP_GET_VARS['id']; // pre-$_GET superglobal
mysql_query("SELECT * FROM users WHERE id=$id"); // pre-PDO, no parameterisation
echo "Hello $name"; // $name from register_globals — automatic variable injection
// ✅ Modern PHP — typed, parameterised, structured
declare(strict_types=1);
function getUser(PDO $db, int $id): array|false
{
$stmt = $db->prepare('SELECT * FROM users WHERE id = :id');
$stmt->execute([':id' => $id]);
return $stmt->fetch();
}
$user = getUser($pdo, (int) $_GET['id']);