1 / 12

PHP: Hypertext Preprocessor

PHP: Hypertext Preprocessor. Jordan Davenport. Brief History. Created in 1994 by Rasmus Lerdorf Released June 1995 as "Personal Homepage Tools" Rewritten a few times, carried different names. Rasmus Lerdorf. Image Source: http://lerdorf.com/bio.php. ...Not So Brief History!.

darci
Télécharger la présentation

PHP: Hypertext Preprocessor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP: Hypertext Preprocessor Jordan Davenport

  2. Brief History • Created in 1994 by RasmusLerdorf • Released June 1995 as "Personal Homepage Tools" • Rewritten a few times, carried different names • Rasmus Lerdorf Image Source: http://lerdorf.com/bio.php

  3. ...Not So Brief History! • Rewritten in 1997 by AndiGutman and ZeevSuraski • Rewrite became PHP 3.0 • Officially replaced PHP/FI 2.0 in 1998 • Multi-Platform • PHP Development Team • Current Stable Release: 5.3.8 • Release Candidate: 5.4.0RC2 on Thanksgiving

  4. Data Typing Weakly Typed Four Scalar Types: • Boolean • Integer • Float • String Compound Types: • Array • Object Special Types: • Resource • NULL

  5. Functions & Variables • Variables prefixed with $ • Alphanumeric with underscores • Must start with letter or _ • Global scope isolated from local • Variable Functions

  6. Expressions, Statements, & Control • C-like syntax and operators • String concatenation: . and .= • No integer division! • if, if...else, if...elseif...else, switch • while, do...while, for, foreach

  7. Abstraction & OOP • Class-based OOP • Variables are "Properties" • Properties must be declared public/protected/private • Functions default public • -> instead of "dotting in" to access members (like C++ pointers)

  8. Paamayim Nekudotayim • Scope resolution operator :: • Access class members without instantiation • <class_name>::<member> • self::foo($bar) • Confuses users:http://phpsadness.com/sad/1 פעמיים נקודתיים

  9. Exception! try { code block here } catch { another block here } • Uncaught exceptions cause "Fatal Error" • set_exception_handler() for what isn't caught

  10. Evaluation Time • Readability • Overloading? Pft! • Lacks data type declarations • Writability • Syntax to suit your needs • Reliability • Different integers, floats on different systems • Cost • FOSS but GPL-incompatible • Inconsistent documentation

  11. Examples http://www.caitsith2.com/ds/fc.php http://kurtis.voidaudio.net/phpbb_news.php http://kurtis.voidaudio.net/test.php

  12. References • Phalanger: The PHP Language Compiler for the .NET Framework. 26 September 2011. 26 September 2011. <http://phalanger.codeplex.com/>. • "PHP." 20 September 2011. Wikipedia, The Free Encyclopedia. 26 September 2011. <http://en.wikipedia.org/wiki/PHP>. • "PHP Tutorial." n.d. W3Schools Online Web Tutorials. 26 September 2011. <http://www.w3schools.com/php/default.asp>. • PHP: Hypertext Preprocessor. n.d. 26 September 2011. <http://www.php.net/>. • "PHP: License Information." 10 2011. PHP: Hypertext Preprocessor. 20 10 20011. <http://php.net/license/index.php>. • Sebesta, Robert W. Concepts of Programming Languages, Ninth Edition. Boston, MA: Pearson Education, Inc., 2010.

More Related