Your SlideShare is downloading. ×
PHP: The Beginning and the Zend
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PHP: The Beginning and the Zend

2,159
views

Published on

An introduction to PHP, covering topics from history of the platform and personalities involved, to strengths/weaknesses of the language and how to best use it. …

An introduction to PHP, covering topics from history of the platform and personalities involved, to strengths/weaknesses of the language and how to best use it.

Available under the Creative Commons Attribution Share-Alike Non-Commercial Unported 3.0 license.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,159
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Rasmus Lerdorf also has Canadian citizenship.
  • Andi Gutmans is of Swiss descent
  • What happens when your graphics people help with the back-end.
  • Transcript

    • 1. PHP: The Beginning and the Zend Presentation by Jonathan Hawk. Available under the Creative Commons Attribution Share-Alike Non-Commercial license.
    • 2. History
      • 1994 – Started development
      • 3. 1995-06-08 – PHP/FI
      • 4. 1997-11-01 – PHP/FI 2
      • 5. 1998-06-06 – PHP 3
      • 6. 2000-05-22 – PHP 4 (powered by Zend Engine)
      • 7. 2001-12-10 – PHP 4.1 (superglobals)
      • 8. 2002-12-27 – PHP 4.3 (CLI)
      • 9. 2004-07-13 – PHP 5 (powered by Zend Engine II)
      • 10. 2009-06-30 – PHP 5.3 (namespaces, closures)
      http://upload.wikimedia.org/wikipedia/commons/a/ac/RasmuswJGang.jpg (public domain) Rasmus Lerdorf Joomla! Developers
    • 11. Rasmus Lerdorf
      • Twitter: @rasmus
      https://secure.wikimedia.org/wikipedia/commons/wiki/File:Rasmus_Lerdorf_cropped.jpg (CC-BY-SA)
    • 12. http://www.flickr.com/photos/isthmene/4370546993 (CC-BY-NC)
    • 13. Andi Gutmans & Zeev Suraski
      • Twitter: @andigutmans/ @zeevs
      https://secure.wikimedia.org/wikipedia/commons/wiki/File:Andi_Gutmans_1.jpg (CC-BY) https://secure.wikimedia.org/wikipedia/commons/wiki/File:Zeev_Suraski_2005_cropped.jpg (CC-BY-SA)
    • 14. http://www.flickr.com/photos/heyskinny/549085823 (CC-BY-NC)
    • 15. Use: When?
      • Web sites and Web applications
        • Easy to learn* – finally your web designers can help with the back end!**
          • * = also easy to screw up
          • 16. ** = web designers should not help you with the back end
      • CLI scripts
      • 17. GUI applications (PHP-GTK)
      • 18. Available on Linux, Unix, Windows , Mac OS X, AS/400, Novell NetWare, OS/2, RISC OS, SGI IRIX 6.5.x, Solaris (SPARC, INTEL), Solaris OpenCSW packages
    • 19. http://flickr.com/photos/sister_ray/3461372416 (CC-BY-NC)
    • 20. Use: Good Company
    • 21. Use: Software
      • Most widely-used forums (phpBB, vBulletin)
      • 22. Most widely-used CMSs (Drupal, Joomla!, ezPublish)
      • 23. Most widely-used blogs (WordPress, Typo3, Serendipity)
      • 24. Most widely-used wikis (MediaWiki, DokuWiki)
      • 25. Most web-based e-mail (SquirrelMail, Roundcube, Kerio, Horde IMP)
    • 26. Use: Web Slinger
      • PHP was made for web sites
        • Web server module (ISAPI)
          • Runs in same memory space as web server
        • Fast-CGI
        • 27. CGI
      • Widely adopted – most web hosting includes PHP and MySQL
    • 28. Use: Tag Soup
    • 29. Language: PHP in One Sentence "What if C and Perl had a love child that Java babysat from time to time?"
    • 30. Language: Borrowed
      • From Perl:
        • String usage, type system, variable syntax, operators
        • 31. PHP arrays appear to be a combination of Perl arrays and hashes
      • From C: (PHP is written in C, by the way)
        • Function names
        • 32. Pass-by-reference syntax
      • From Java:
        • Class syntax, interfaces, exceptions
    • 33. Language: Features
      • Dynamically and weakly typed
      • 34. Interpreted
        • Speed through bytecode caches
      • Reflective
        • Types, Names
      • Both procedural and Object-oriented
      • 35. Clone any object, serialize any object
      • 36. Objects passed by reference
      • 37. Arrays and primitives passed by value
    • 38. Language: Typing
      • Dynamic
        • Variable types unnecessary, same variable can hold different types
      • Weak
        • 0 == 0.0 == false == null == "" == array()
        • 39. 1 == 1.0 == true == "!empty" == array('!empty') == $object
        • 40. Methods expecting one type will convert from others
          • "1234" will be converted to 1234.
          • 41. "foobar" will be converted to 0.
    • 42. Language: Classes
      • Namespaces
      • 43. Public/protected/private members
      • 44. Superclasses and interfaces
      • 45. Abstract and final classes
      • 46. Constructors and destructors
    • 47. Language: Class Example
    • 48. Language: Methods
      • Abstract, static, and final
      • 49. Arguments
        • Optionally type-hinted
        • 50. "Overloading"
      • No return types
    • 51. Language: Methods Example
    • 52. Language: Docblocks
      • Docblocks often necessary for IDE code completion
    • 53. http://www.flickr.com/photos/thebigdurian/374229490 (CC-BY-NC-SA) Strengths
    • 54. Strengths
      • Anonymous functions/closures
      • 55. Variable method names
      • 56. Magic methods
      • 57. Arrays
      • 58. Database connectivity
      • 59. Date operations
      • 60. Perl-Compatible Regular Expressions
      • 61. Web-related stuff: file uploads, tag stripping, etc
    • 62. Strengths: Closures
    • 63. Strengths: Dynamic invocations
    • 64. Strengths: Magic Methods
    • 65. Strengths: Arrays
    • 66. Strengths: Database Connectivity Bold = Built-in at compile time. * = PDO Driver available.
    • 87. Strengths: Date Operations
      • strtotime — Parses almost any date format
        • "+1 year"
        • 88. "-3 weeks"
        • 89. "Last wednesday"
        • 90. "Tomorrow 6:12pm"
        • 91. "2010-01-12T12:21:12+0500"
        • 92. "Wed, Mar 2, 2011 3:00 pm"
      • "date" — displays dates
    • 93. Strengths: PCRE
    • 94. Strengths: Web stuff
      • Superglobals: $_GET, $_POST, $_COOKIE, $_SESSION, $_FILE, $_SERVER, $_ENV
      • 95. htmlspecialchars(), htmlentities(), strip_tags(), nl2br()
      • 96. header(), setcookie()
    • 97. http://www.flickr.com/photos/thetrouseredape/3267689296 (CC-BY-NC-SA) Weaknesses
    • 98. Weaknesses: Language
      • Inconsistent API
        • in_array($needle, $haystack)
        • 99. strpos($haystack, $needle)
      • Unicode support*
      • 100. Errors and Exceptions*
      • 101. Extensions are hit-or-miss
    • 102. Weaknesses: Scaling/Speed
      • Overhead with single-request scope
        • Move session storage to memory
        • 103. In-memory cache (Memcached/APC)
        • 104. Database
        • 105. Clustered software (Zend Platform, etc.)
      • Bytecode caching (APC, Xcache, etc.)
    • 106. Weaknesses: Thread Safety
      • Linux/Unix
      • Windows
        • Most Windows libraries PHP uses are thread-safe
        • 108. Recommends FastCGI, anyway
    • 109. PHP Personalities Andrei Zmievski (@a) PHP Core, PHP-GTK, Smarty Wez Furlong (@wezfurlong) PHP Core, PDO, PECL extensions Sebastian Bergmann (@s_bergmann) PHPUnit Derick Rethans (@derickr) PECL extensions, Xdebug Ilia Alshanetsky (@iliaa) PHP Core Matthew Weier O'Phinney (@weierophinney) Zend Framework
    • 110. Where do you go?
      • http://php.net
      • 111. http://devzone.zend.com
      • 112. http://www.planet-php.net
      • 113. http://www.phparch.com

    ×