BAB 1: KENAPA PHP?

1-2: Sejarah PHP

Objectives

  • Memahami timeline evolution PHP
  • Mengetahui milestone penting PHP
  • Memahami kenapa PHP terus relevan

Timeline PHP

1994: Awal Mula

Rasmus Lerdorf, seorang programmer Kanada-Greenland, membuat Personal Home Page Tools (PHP Tools) untuk tracking visitor di homepage-nya.

  • Rasmus Lerdorf membuat PHP/FI (Personal Home Page / Forms Interpreter)
  • Tujuan awal: tracker visitor + counter sederhana
  • Pertama kali digunakan di homepage Rasmus sendiri

1998: PHP 3.0

Zeev Zuraski dan Andi Gutmans me-rewrite PHP dari nol dan menghapus banyak keterbatasan versi sebelumnya.

  • Rewrite total oleh Zeev & Andi (Zeev and Andi rewrite everything)
  • Nama berubah: PHP: Hypertext Preprocessor
  • Fitur OOP mulai ditambahkan
  • Extensible dengan module/API
  • Community mulai berkembang

2000: PHP 4.0

Dengan Zend Engine (dibuat oleh Zeev & Andi), PHP 4 membawa performance improvements dan session management.

  • Zend Engine I
  • Output buffering
  • Session handling
  • bool/true/false menjadi case-insensitive
  • Performance meningkat significant

2004: PHP 5.0

Revolusi OOP. PHP 5 membawa PDO, exception handling, dan modern OOP features.

  • Zend Engine II
  • PDO (PHP Data Objects) - unified database API
  • Exception handling
  • OOP yang proper (visibility, interfaces, etc.)
  • Improved XML support
  • SPL (Standard PHP Library)

2015: PHP 7.0

Performance 2x lipat dengan PHP-NG engine. type declarations, return types, anonymous classes.

  • PHP-NG (Next Generation) engine
  • Performance 2x dibanding PHP 5
  • Return type declarations
  • Scalar type hints
  • Anonymous classes
  • Null coalescing operator (??)
  • Spaceship operator (<=>)

2020: PHP 8.0

JIT compiler, named arguments, attributes, match expression, constructor property promotion.

  • JIT (Just-In-Time) Compiler
  • Named arguments
  • Attributes (#[Attribute])
  • Match expression
  • Constructor property promotion
  • Union types
  • Nullsafe operator (?->)
  • Mixed type v2

2022-2024: PHP 8.2, 8.3, 8.4

Continuous improvements dalam performance, typing, dan developer experience.

2022 - PHP 8.2:

  • Read-only classes
  • Disjunctive Normal Form Types
  • Constants in traits
  • Randomizer extension

2023 - PHP 8.3:

  • Typed class constants
  • json_validate()
  • #[\Override] attribute
  • json_validate() function

2024 - PHP 8.4 (latest minor):

  • Property hooks
  • Asymmetric visibility
  • HTML5 parsing with libxml
  • Improved performance

Evolution Chart

📊 Memuat diagram…

Siapa Rasmus Lerdorf?

AtributDetail
🇨🇦 KewarganegaraanKanada-Greenland
👨‍💻 ProfessionProgrammer, Creator of PHP
📅 Lahir1968
🎓 EducationUniversity of Calgary
💼 SekarangVP of Platform Engineering di Etsy
💡Tip

"I really don't like programming. I like solving problems by creating systems."

Stats PHP Sekarang

MetricValue
Website dengan PHP~77% dari semua website
Version share (2024)PHP 8.x: ~60%, PHP 7.x: ~20%, Older: ~20%
GitHub repositoriesTop 5 most popular language
Job postingsStill #1 untuk backend di Indonesia

Kenapa PHP Tetap Relevan?

1. Legacy Systems

PlatformSkala
WordPress~43% semua website
WooCommerce~10% e-commerce
DrupalPemerintah, enterprise
LaravelModern PHP framework
Facebook/HHVMScale jutaan user

2. Easy to Host

HostingDukungan PHP
Shared hostingNyaris SEMUA support PHP
VPSApache/Nginx + PHP-FPM
CloudAWS, GCP, Azure semua punya PHP support
ContainersPHP official image di Docker Hub

3. Low Barrier to Entry

  • Install XAMPP/Laragon → langsung bisa coding
  • Syntax mirip C/JavaScript
  • Dokumentasi lengkap: php.net
  • Community huge: StackOverflow, Reddit, Forum ID
  • tutorials everywhere

PHP versi Mana yang Harus Dipakai?

⚠️Perhatian

Jangan pakai PHP 7.4 atau yang lebih lama. Banyak shared hosting masih pakai PHP 7.4, tapi:

  • PHP 7.4 End of Life: Dec 2022
  • Tidak ada security updates
  • Many modern features tidak tersedia

Rekomendasi:

SkenarioVersi PHP
ProductionPHP 8.2 atau PHP 8.3
LearningPHP 8.3 (latest stable)
LegacyMinimal PHP 8.0
NeverPHP 7.x atau bawah

Exercise

  1. Cek versi PHP yang terinstall di komputer kamu dengan command php -v
  2. Research: Siapa yang membuat Zend Engine?
  3. Apa perbedaan PHP 7 dan PHP 8 dalam hal performance?

Summary

TahunVersionMilestone
1994PHP/FI 1.0Awal mula oleh Rasmus
1998PHP 3.0Rewrite total, nama baru
2004PHP 5.0OOP revolution
2015PHP 7.0Performance 2x
2020PHP 8.0JIT, modern features
2024PHP 8.4Property hooks, asymmetric visibility

💡Tip

Nama "PHP" adalah recursive acronym — artinya PHP berdiri untuk "PHP: Hypertext Preprocessor". Trivia: recursive acronyms juga dipakai di nama lain seperti "GNU" (GNU's Not Unix) dan "WINE" (Wine Is Not an Emulator).

Klik tombol ini setelah menyelesaikan materi

📝

Quiz Bab 1

Uji pemahamanmu tentang Kenapa PHP?