PHP Basics · Beginner Level · Chapter 2

PHP History & Versions क्या है?
Complete Guide in Hindi

PHP का पूरा इतिहास हिंदी में — 1994 से लेकर PHP 8.4 तक। Rasmus Lerdorf की personal script से दुनिया की सबसे popular web language तक की पूरी journey।

📅 1994 से शुरू 🚀 PHP 8.4 Latest 🎯 Interview Questions ⏱️ 8 min read 📝 1500+ words
💣

Classic Interview Trick Question

PHP 6 kabhi officially release nahi hua! PHP 5 ke baad directly PHP 7 aaya। Agar koi interview mein pooche "PHP 6 mein kya aaya?" — jawaab hai: "PHP 6 release hi nahi hua।" Yeh almost har PHP interview mein puchha jaata hai।

1994PHP की शुरुआत
8.4Latest Version (2024)
PHP 6कभी release नहीं हुआ
2xPHP 7 की speed vs PHP 5

📋 इस Article में क्या-क्या है (Table of Contents)

  1. PHP History क्या है?
  2. PHP की शुरुआत — Rasmus Lerdorf
  3. PHP 1.0 से 4.0 — Early Era
  4. PHP 5.0 — OOP का दौर
  5. PHP 6 — जो कभी आया ही नहीं
  6. PHP 7 — Speed Revolution
  7. PHP 8 — Modern PHP
  8. Quick Reference Table
  9. Version क्यों matter करता है?
  10. FAQ और Conclusion
1
PHP History & Versions क्या है?

PHP History से मतलब है — PHP language कैसे बनी, किसने बनाई, और समय के साथ कैसे develop हुई। PHP Versions से मतलब है — PHP के अलग-अलग releases जैसे PHP 5, PHP 7, PHP 8, और इनमें क्या-क्या नया आया।

PHP की official details इस प्रकार हैं: Official name PHP: Hypertext Preprocessor, पहली release June 1995, founder Rasmus Lerdorf, और initial purpose था Personal Resume / Personal Home Page को track करना
यह सब जानना ज़रूरी क्यों है? क्योंकि हर version में नए features आए — और जब आप modern PHP code देखते हैं, तो आपको पता होना चाहिए कि कौन सा feature कब से available है। साथ ही, PHP की history से कई interview questions पूछे जाते हैं।

2
PHP की शुरुआत — Rasmus Lerdorf की कहानी
PHP की story 1994 में शुरू होती है। Rasmus Lerdorf — एक Danish-Canadian programmer — अपने personal homepage को track करना चाहते थे। उन्होंने Perl में कुछ CGI scripts लिखे जो यह बताते थे कि उनके resume को कितने लोगों ने देखा।
इन scripts को उन्होंने "Personal Home Page Tools" नाम दिया — यही PHP का original full form था। यह कोई "language" नहीं थी — बस Perl scripts का एक collection था जो form data handle करता था।
लेकिन जब दूसरे developers ने इसे use करना शुरू किया और feedback दिया, तो Rasmus ने इसे expand किया। धीरे-धीरे यह एक proper scripting language बनती गई। आज वही personal project दुनिया की सबसे ज़्यादा use होने वाली web language है।
"मैंने कभी नहीं सोचा था कि इतने सारे लोग मेरे resume देखने वाले tool को use करेंगे।" — Rasmus Lerdorf (PHP creator)
💡 Interesting Fact: Rasmus Lerdorf ने PHP को इसलिए नहीं बनाया था कि वो एक programming language बनाएं। उनका मकसद था अपने web server logs को easily process करना। PHP की success उनके लिए भी एक surprise थी।

3
PHP का पूरा Version Timeline
PHP 1.0 से PHP 8.4 तक — हर major version में क्या हुआ, step by step:
1995 PHP 1.0 & PHP 2.0 Early Era

Rasmus Lerdorf ने Perl scripts का collection public release किया। PHP 2.0 (PHP/FI — Forms Interpreter) में form data process करने की ability आई। यह कोई proper language नहीं थी — बस tools का set था।

Basic Form Handling Web Logs Processing Simple Variables Perl-based
Note: PHP 1.0 और 2.0 का code आज किसी काम का नहीं — सिर्फ history के लिए जानना ज़रूरी है।
1997 PHP 3.0 Real Language बनी

Zeev Suraski और Andi Gutmans ने पूरी language को scratch से rewrite किया। यहाँ से PHP एक proper programming language बनी। Name officially बदला — "PHP: Hypertext Preprocessor"। MySQL support आया और हज़ारों developers ने adopt करना शुरू किया।

Complete Rewrite MySQL Support Extensible Architecture New Parser Proper Syntax
2000 PHP 4.0 Zend Engine

Zend Engine 1.0 के साथ launch हुई — performance बहुत बढ़ी। Sessions आए जिससे login systems बनाना possible हुआ। Output buffering आया। Millions of websites PHP पर shift हुईं — यह PHP का पहला mass-adoption era था।

Zend Engine 1.0 Sessions Output Buffering Better Performance HTTP Auth
2004 PHP 5.0 OOP का दौर

PHP का सबसे important milestone। Object-Oriented Programming properly implement हुई — Classes, Objects, Interfaces, Abstract Classes, Constructors, Destructors सब आए। PDO (PHP Data Objects) से database handling secure और consistent हुई। Exception Handling आई। यह modern PHP की असली नींव है।

OOP — Classes & Objects PDO Exception Handling Interfaces Abstract Classes Zend Engine 2 SimpleXML
PHP 5 — OOP Example
<?php
class Car {
  public $brand;

  public function __construct($brand) {
    $this->brand = $brand;
  }

  public function getInfo() {
    return "Car: " . $this->brand;
  }
}

$myCar = new Car("Toyota");
echo $myCar->getInfo(); // Car: Toyota
?>
Important: PHP 5 का official support 2018 में खत्म हुआ। अगर कोई server अभी भी PHP 5 run कर रहा है — यह एक serious security risk है।

❌ PHP 6 — कभी Release नहीं हुआ

PHP 6 का development 2005 में शुरू हुआ था — main goal था Unicode support add करना। लेकिन technical challenges इतने ज़्यादा थे कि project 2010 में abandon कर दिया गया। जो useful features थे वो PHP 5.3 और 5.4 में merge हो गए। इसीलिए PHP 5 के बाद directly PHP 7 आया — PHP 6 officially exist नहीं करता।

2015 PHP 7.0 Speed Revolution

PHP की सबसे बड़ी performance leap। PHP 5.6 के मुकाबले 2x speed — यह बहुत बड़ा था। Zend Engine 3.0 आया। Type Declarations से code reliable हुआ। Null Coalescing Operator ?? एक game changer था।

2x Performance ?? Null Coalescing Type Declarations Zend Engine 3 Spaceship Operator <=> Return Types Scalar Type Hints
PHP 7 — Null Coalescing Operator
<?php
// PHP 5 mein aise likhna padta tha:
$name = isset($_GET['name']) ? $_GET['name'] : 'Guest';

// PHP 7 mein ab itna simple hai:
$name = $_GET['name'] ?? 'Guest';

// Type Declaration example:
function addNumbers(int $a, int $b): int {
  return $a + $b;
}
?>
2020 PHP 8.0 Modern PHP शुरू

PHP का modern era शुरू हुआ। JIT (Just-In-Time) Compiler से performance और बढ़ी। Match Expression ने switch statements को replace किया। Named Arguments ने function calls readable बनाए। Union Types, Nullsafe Operator — यह PHP का सबसे बड़ा leap था PHP 7 के बाद।

JIT Compiler Match Expression Named Arguments Union Types Nullsafe Operator ?-> Attributes Constructor Promotion
PHP 8.0 — Match Expression
<?php
// PHP 7 mein switch use karte the:
switch ($status) {
  case 1: $msg = "Active"; break;
  case 2: $msg = "Inactive"; break;
}

// PHP 8 mein match use karo — cleaner!
$msg = match($status) {
  1 => "Active",
  2 => "Inactive",
  default => "Unknown"
};
?>
2021 PHP 8.1 Enums & Fibers

Enums — PHP में finally proper enum type आया। Readonly Properties — value once set होने के बाद change नहीं हो सकती। Fibers — async programming के लिए। Intersection Types, never return type — बहुत powerful additions।

Enums Readonly Properties Fibers Intersection Types never Return Type Array Unpacking
PHP 8.1 — Enums Example
<?php
enum Status {
  case Active;
  case Inactive;
  case Pending;
}

$userStatus = Status::Active;
echo $userStatus->name; // Active
?>
2022 PHP 8.2 Readonly Classes

Readonly Classes — पूरी class readonly बना सकते हो, हर property individually readonly mark करने की ज़रूरत नहीं। Disjunctive Normal Form Types, Deprecated dynamic properties — PHP mature होती जा रही है।

Readonly Classes DNF Types null/false/true Types Random Extension
2023–24 PHP 8.3 & 8.4 Latest — Use This!

PHP 8.3 में Typed Class Constants, json_validate() function, और Readonly के improvements आए। PHP 8.4 (latest as of 2024-2026) में Property Hooks — getter/setter को define करने का elegant तरीका। Asymmetric Visibility, बिना new keyword के method chaining।

Property Hooks (8.4) Typed Constants (8.3) json_validate() (8.3) Asymmetric Visibility (8.4) new without parens (8.4)
✅ Recommendation: नए projects के लिए हमेशा PHP 8.3 या 8.4 use करें। यह fastest, most secure, और feature-rich version है।

8
Quick Reference Table — एक नज़र में
Version Year सबसे बड़ा Feature Status
PHP 1.01995Personal scripts, basic form handlingObsolete
PHP 3.01997Proper language, MySQL supportObsolete
PHP 4.02000Zend Engine, SessionsObsolete
PHP 5.02004OOP, PDO, Exception HandlingEOL 2018
PHP 6Never Released (abandoned)❌ Doesn't Exist
PHP 7.020152x Speed, ??, Type DeclarationsEOL
PHP 7.42019Typed Properties, Arrow FunctionsEOL 2022
PHP 8.02020JIT, Match, Named ArgumentsEOL 2023
PHP 8.12021Enums, Readonly, FibersSecurity only
PHP 8.22022Readonly Classes, DNF TypesActive
PHP 8.32023Typed Constants, json_validate()Active ✅
PHP 8.42024Property Hooks, Asymmetric VisibilityLatest ⭐
📌 याद रखने वाली बात: PHP 5 के बाद PHP 6 नहीं — directly PHP 7 आया। और PHP 7 के बाद PHP 8 आया (PHP 7.0, 7.1, 7.2, 7.3, 7.4 — फिर PHP 8.0)।

9
Version क्यों Matter करता है? (2025-2026)
बहुत से beginners सोचते हैं — "PHP तो PHP है, version से क्या फर्क पड़ता है?" लेकिन यह गलत सोच है। PHP version बहुत matter करता है — security, performance, और features तीनों के लिए।

✅ Use करें (2025-2026)

  • PHP 8.4 (Latest — recommended)
  • PHP 8.3 (Active support)
  • PHP 8.2 (Active support)
  • Laravel 10/11 (requires PHP 8.1+)

❌ बिल्कुल Use न करें

  • PHP 5.x (EOL 2018 — Security Risk)
  • PHP 7.0–7.3 (EOL — No updates)
  • PHP 7.4 (EOL December 2022)
  • PHP 8.0 (EOL November 2023)
Real Example: अगर आपकी website PHP 5.6 पर है और कोई नई vulnerability discover होती है — उसका कोई patch नहीं आएगा क्योंकि PHP 5 का support 2018 में खत्म हो चुका है। इसका मतलब है आपकी website permanently vulnerable है।
PHP 8.4 Latest
Performance
  • JIT Compiler active
  • PHP 5 से ~3x faster
  • Memory use कम
  • Optimized opcache
PHP 8.4 Latest
Security
  • Regular security patches
  • Active bug fixes
  • Modern encryption support
  • Deprecated unsafe functions
PHP 8.4 Latest
New Features
  • Property Hooks
  • Asymmetric Visibility
  • Array functions improvements
  • Cleaner syntax

10
अक्सर पूछे जाने वाले सवाल (FAQ)
Q: PHP 6 क्यों नहीं आया?
PHP 6 का development 2005 में शुरू हुआ था जिसका main goal था native Unicode support। लेकिन यह technically बहुत complex था — performance issues आए, और पूरी codebase को rewrite करना पड़ता। 2010 में project officially abandon हो गया। जो useful features थे वो PHP 5.3 और 5.4 में merge हो गए। PHP 6 नाम के कोई books थे जो outdated हो गईं — इसीलिए PHP 5 के बाद PHP 7 directly आया।
Q: PHP 7 इतना fast कैसे हो गया PHP 5 के मुकाबले?
PHP 7 में Zend Engine को completely rewrite किया गया (Zend Engine 3.0)। Internal data structures optimize हुईं, memory usage कम हुई, और execution pipeline faster हो गई। Real-world applications में PHP 5.6 के मुकाबले PHP 7 ने 2x performance improvement दी — बिना code change किए।
Q: मुझे कौन सा PHP version use करना चाहिए?
2025-2026 में new projects के लिए PHP 8.3 या 8.4 use करें। अगर आप किसी existing project पर काम कर रहे हैं जो PHP 7.4 पर है — जल्द से जल्द PHP 8.x पर migrate करें। PHP 5.x या PHP 7.0-7.3 बिल्कुल use न करें — ये end-of-life हैं।
Q: PHP OOP PHP 5 से पहले थी या नहीं?
PHP 3 और 4 में बहुत basic OOP था — Classes define होती थीं लेकिन properly implement नहीं था। PHP 5.0 में Zend Engine 2 के साथ proper OOP आई — Constructors, Destructors, Interfaces, Abstract Classes, Access Modifiers (public/private/protected) सब PHP 5 में आए। इसीलिए PHP 5 को OOP era कहते हैं।
Q: PHP 8 में JIT क्या है?
JIT का full form है Just-In-Time Compilation। Normally PHP code को runtime पर interpret किया जाता है। JIT compiler PHP code को directly machine code में compile करता है — जिससे especially CPU-intensive tasks में performance बढ़ती है। Web applications में JIT का फर्क उतना visible नहीं, लेकिन mathematical और algorithmic tasks में बड़ा improvement होता है।
Q: Rasmus Lerdorf आज PHP को maintain करते हैं?
नहीं। Rasmus ने PHP की शुरुआत की थी, लेकिन PHP अब एक community-driven open source project है। The PHP Group और हज़ारों contributors globally इसे maintain करते हैं। Rasmus आज भी PHP development में occasionally contribute करते हैं लेकिन lead नहीं करते।

निष्कर्ष (Conclusion)

PHP की history एक personal script से शुरू होकर दुनिया की सबसे ज़्यादा use होने वाली web language तक पहुँचने की inspiring journey है। PHP 1.0 से PHP 8.4 तक — हर version ने language को और powerful, fast, और developer-friendly बनाया।

PHP 1994 में एक personal project था, आज 80%+ websites पर use होता है।

PHP 5 ने OOP लाई — modern PHP programming की नींव यहाँ से पड़ी।

PHP 6 कभी release नहीं हुआ — PHP 5 के बाद directly PHP 7 आया।

PHP 7 ने 2x speed दी — PHP की "slow" वाली reputation यहाँ खत्म हुई।

PHP 8.x modern, fast, और feature-rich है — यही use करें आज।

हमेशा latest stable version (PHP 8.3/8.4) use करें — security और performance के लिए।

🚀 अगला कदम: PHP History clear हो गई? अब अगले chapter में PHP Variables, Data Types, और Constants सीखें। इन्हें समझे बिना PHP code नहीं लिख सकते।