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
Siapa Rasmus Lerdorf?
| Atribut | Detail |
|---|---|
| 🇨🇦 Kewarganegaraan | Kanada-Greenland |
| 👨💻 Profession | Programmer, Creator of PHP |
| 📅 Lahir | 1968 |
| 🎓 Education | University of Calgary |
| 💼 Sekarang | VP of Platform Engineering di Etsy |
"I really don't like programming. I like solving problems by creating systems."
Stats PHP Sekarang
| Metric | Value |
|---|---|
| Website dengan PHP | ~77% dari semua website |
| Version share (2024) | PHP 8.x: ~60%, PHP 7.x: ~20%, Older: ~20% |
| GitHub repositories | Top 5 most popular language |
| Job postings | Still #1 untuk backend di Indonesia |
Kenapa PHP Tetap Relevan?
1. Legacy Systems
| Platform | Skala |
|---|---|
| WordPress | ~43% semua website |
| WooCommerce | ~10% e-commerce |
| Drupal | Pemerintah, enterprise |
| Laravel | Modern PHP framework |
| Facebook/HHVM | Scale jutaan user |
2. Easy to Host
| Hosting | Dukungan PHP |
|---|---|
| Shared hosting | Nyaris SEMUA support PHP |
| VPS | Apache/Nginx + PHP-FPM |
| Cloud | AWS, GCP, Azure semua punya PHP support |
| Containers | PHP 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?
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:
| Skenario | Versi PHP |
|---|---|
| Production | PHP 8.2 atau PHP 8.3 |
| Learning | PHP 8.3 (latest stable) |
| Legacy | Minimal PHP 8.0 |
| Never | PHP 7.x atau bawah |
Exercise
- Cek versi PHP yang terinstall di komputer kamu dengan command
php -v - Research: Siapa yang membuat Zend Engine?
- Apa perbedaan PHP 7 dan PHP 8 dalam hal performance?
Summary
| Tahun | Version | Milestone |
|---|---|---|
| 1994 | PHP/FI 1.0 | Awal mula oleh Rasmus |
| 1998 | PHP 3.0 | Rewrite total, nama baru |
| 2004 | PHP 5.0 | OOP revolution |
| 2015 | PHP 7.0 | Performance 2x |
| 2020 | PHP 8.0 | JIT, modern features |
| 2024 | PHP 8.4 | Property hooks, asymmetric visibility |
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?