1introduction to php 5 presented by brett buddin
DESCRIPTION
3Introduction to PHP 5TRANSCRIPT
![Page 1: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/1.jpg)
1 Introduction to PHP 5
Introduction to PHP 5
Presented by Brett Buddin
![Page 2: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/2.jpg)
2 Introduction to PHP 5
What is PHP?
“PHP: Hypertext Preprocessor”• General purpose scripting language
• Most commonly used for server-side scripting
![Page 3: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/3.jpg)
3 Introduction to PHP 5
![Page 4: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/4.jpg)
4 Introduction to PHP 5
Why use PHP?
• Simple syntax
• Easy to learn
• Great performance
• Fantastic online documentation
• Open Source
![Page 5: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/5.jpg)
5 Introduction to PHP 5
History
• Initially released in June 1995 by Rasmus Lerdorf as “Personal Home Page Tools”
• Lerdorf merged PHP with his Form Interpreter to create PHP/FI
• Zeev Suraski and Andi Gutmans rewrote the parser to form the core of PHP 3
![Page 6: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/6.jpg)
6 Introduction to PHP 5
History
• PHP 4 released in May 2000
• PHP 5 released in July 2004
• Today powers millions of applications
![Page 7: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/7.jpg)
7 Introduction to PHP 5
Growth of PHP
Source: Netcraft
![Page 8: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/8.jpg)
8 Introduction to PHP 5
New in PHP 5
• Completely rewritten object model
• Interoperable XML tools
• MySQLi extension
• SQLite embedded
• Exception handling
![Page 9: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/9.jpg)
9 Introduction to PHP 5
Objects in PHP 3 and 4
• Treated as primitive data types
• Assigned and passed by value
• Had to manually force pass by reference
![Page 10: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/10.jpg)
10 Introduction to PHP 5
Objects in PHP 5
• Woven into the core
• Assigned and passed by handle
• This eliminates a lot of ampersands
![Page 11: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/11.jpg)
11 Introduction to PHP 5
Rewritten object model
• Interfaces and Abstract classes
• Class type hints
• Static keyword
• Final keyword
![Page 12: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/12.jpg)
12 Introduction to PHP 5
Rewritten object model
• Cloning
• Constructors and destructors
• Access modifiers
![Page 13: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/13.jpg)
13 Introduction to PHP 5
Cloning
• __clone() method
• Offers a way to create a copy of an object
![Page 14: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/14.jpg)
14 Introduction to PHP 5
Constructors and Destructors
• __construct() and __destruct() methods added
• Old constructor syntax still works
![Page 15: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/15.jpg)
15 Introduction to PHP 5
Access modifiers
• Access modifiers added for properties and methods
• The three P’s:– Public: All scopes have access
– Private: Only local object has access
– Protected: Only local and derived objects have access
![Page 16: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/16.jpg)
16 Introduction to PHP 5
Interoperable XML tools
• Standardized on libxml2• Extensions work together as a whole
• W3C specification compliant
• Very efficient
![Page 17: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/17.jpg)
17 Introduction to PHP 5
MySQLi Extension
• Prepared statements
• Bound input and output parameters
• SSL connections
• Multi-query functions
![Page 18: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/18.jpg)
18 Introduction to PHP 5
SQLite embedded
• No need for flat file databases
• SQLite supports– Transactions
– Subqueries
– Triggers
![Page 19: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/19.jpg)
19 Introduction to PHP 5
Exception handling
• Eliminates the need to check return values for every function
• Separation of business logic and error logic
![Page 20: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/20.jpg)
20 Introduction to PHP 5
PHP’s drawbacks
• Lack of language design
• Inconsistent naming conventions and function behavior
• Almost too popular
![Page 21: 1Introduction to PHP 5 Presented by Brett Buddin](https://reader035.vdocuments.mx/reader035/viewer/2022081515/5a4d1b117f8b9ab05998fda4/html5/thumbnails/21.jpg)
21 Introduction to PHP 5
Questions?