O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
PHP 5.3
                                A Walkthrough
                                  @davidcoallier




Dé Luain 20 Meá...
Who are you?
                                       Experiences, usage, etc.




Dé Luain 20 Meán Fómhair 2010
Who am I?
                                   Work, experiences, usage, etc.




Dé Luain 20 Meán Fómhair 2010
The Talk!
                                   Recap of why you are here...




Dé Luain 20 Meán Fómhair 2010
A small PHP 6
                                    Oh no, you didn’t!




Dé Luain 20 Meán Fómhair 2010
In a nutshell
                                   mysqlnd, phar, syntax, sqlite3, spl-sauce, speed, etc.




Dé Luain 20 Me...
ext/intl
                                   Internationalization Extension




Dé Luain 20 Meán Fómhair 2010
Collator
                                  string comparison, sorting, locale




Dé Luain 20 Meán Fómhair 2010
Numbers...
                                   1,000,000; 1.000.000; 1 000 000




Dé Luain 20 Meán Fómhair 2010
ICU
                                  ☕ ♿⚛




Dé Luain 20 Meán Fómhair 2010
More Importantly


Dé Luain 20 Meán Fómhair 2010
LSB
                                Late Static Binding, wtf is that?




Dé Luain 20 Meán Fómhair 2010
NAMESPACES


Dé Luain 20 Meán Fómhair 2010
NAMESPACES!!!!


Dé Luain 20 Meán Fómhair 2010
Closures & λs


Dé Luain 20 Meán Fómhair 2010
Late-Static Bindingself:: vs static::, what’s that? LSB?




Dé Luain 20 Meán Fómhair 2010
class Base {
                                    public static function who() {
                                        ec...
class Base {
                                    public static function who() {
                                        ec...
$this is not static::
                                Don’t get tricked, no inheritance




Dé Luain 20 Meán Fómhair 2010
Object Lifecycle
                                Create, Immute, Memoize




Dé Luain 20 Meán Fómhair 2010
Referencial Transparency  It’s not maths, it’s software.




Dé Luain 20 Meán Fómhair 2010
ZzzZz.....


Dé Luain 20 Meán Fómhair 2010
Dynamic Statics
                                 Oh that sounds nasty...




Dé Luain 20 Meán Fómhair 2010
$class = 'ClassName';
                                $method = 'methodName';

                                $class::$me...
Remember __call?


Dé Luain 20 Meán Fómhair 2010
__callStatic()


Dé Luain 20 Meán Fómhair 2010
Enough Statics..
                                       Moving on.




Dé Luain 20 Meán Fómhair 2010
Namespaces
                                   So we have namespaces, now what?




Dé Luain 20 Meán Fómhair 2010
Get over it.
                                        We know. 




Dé Luain 20 Meán Fómhair 2010
Organize
                                  Structural decisions, maintainability




Dé Luain 20 Meán Fómhair 2010
namespace pearpackage;
                                class Example {
                                    // ...
        ...
use pearpackage;
                        $class = new Example();
                        // or
                        $cl...
Meaning
                                  And community significance




Dé Luain 20 Meán Fómhair 2010
The culprit
                                       strlen




Dé Luain 20 Meán Fómhair 2010
Coding Standards
       http://groups.google.com/group/php-standards/web/psr-0-final-proposal




Dé Luain 20 Meán Fómhair ...
Phar
                                 The jar-like PHP Archives




Dé Luain 20 Meán Fómhair 2010
include 'phar://package.phar/index.php';




Dé Luain 20 Meán Fómhair 2010
$phar = new Phar('drupal7.phar');
              $phar->buildFromDirectory(__DIR__ . '/drupal7');
              $phar->setS...
RewriteRule ^(.*)$ /drupal7.phar/$1 [QSA,L]




Dé Luain 20 Meán Fómhair 2010
Running, web-ing
                                Phar magic-happy-times.




Dé Luain 20 Meán Fómhair 2010
λ (Lambda)
                                      Assigned to a variable




Dé Luain 20 Meán Fómhair 2010
$name = function() {
                                    return 'david';
                                };




Dé Luain 2...
Closure
                                 functions with bound variables




Dé Luain 20 Meán Fómhair 2010
Sto
                                                            len
                                                      ...
$names   = array('david', 'nate');
           $friends = array('helgi', 'joel');

           $split = function($name) use ...
Functors :O


Dé Luain 20 Meán Fómhair 2010
class Name {
                         public function __invoke() {
                             return 'david';
          ...
Other things?
                                      SPL, changes, NOWDOCS, etc




Dé Luain 20 Meán Fómhair 2010
Fast Ternaries
                                     No need to check anymore... Beware




Dé Luain 20 Meán Fómhair 2010
$name = isset($_GET['name']) ? $_GET['name'] : 'No Name';




Dé Luain 20 Meán Fómhair 2010
$name = $_GET['name'] ?: 'No Name';




Dé Luain 20 Meán Fómhair 2010
NOWDOCS
                                  NOWDOCS cooler than HEREDOCS




Dé Luain 20 Meán Fómhair 2010
$name    = 'david';
                     $example =<<<RTFM
                     Hello $name,
                     See you ...
$name    = 'david';
                    $example =<<<'RTFM'
                    Hello $name,
                    See you s...
Performance
                                    Better faster strong. Better stack




Dé Luain 20 Meán Fómhair 2010
Garbage Collection     gc_enable(), gc_disable(), etc.




Dé Luain 20 Meán Fómhair 2010
__DIR__
                                    dirname(__FILE__)




Dé Luain 20 Meán Fómhair 2010
__NAMESPACE__


Dé Luain 20 Meán Fómhair 2010
namespace pearpackageExample2 {
       const TEST = 'In Namespaces...';
       function foo() {
           echo __NAMESPAC...
E_DEPRECATED


Dé Luain 20 Meán Fómhair 2010
MySQLnd
                                 Native MySQL Driver, faster, stats, self-contained




Dé Luain 20 Meán Fómhair 2...
DateTime
                                   Crazy amazing dates handling




Dé Luain 20 Meán Fómhair 2010
$datetime1 = new DateTime('2009-10-11');
      $datetime2 = new DateTime('2009-10-13');
      $interval = $datetime1->diff...
SPL
                                 Iterators, Iterators, Iterators.




Dé Luain 20 Meán Fómhair 2010
SPL
                                Datastructures, Exceptions, Misc...




Dé Luain 20 Meán Fómhair 2010
My Favourite


Dé Luain 20 Meán Fómhair 2010
PHP FPM
                                  Alternate FastCGI Implementation 5.3.3




Dé Luain 20 Meán Fómhair 2010
Incentive
                                   Why do I have to use PHP 5.3?




Dé Luain 20 Meán Fómhair 2010
Lithium
                                     It’s so rad!




Dé Luain 20 Meán Fómhair 2010
Zend Framework 2


Dé Luain 20 Meán Fómhair 2010
Symfony 2


Dé Luain 20 Meán Fómhair 2010
Doctrine 2


Dé Luain 20 Meán Fómhair 2010
Q&A


Dé Luain 20 Meán Fómhair 2010
Thank you
                                  @davidcoallier




Dé Luain 20 Meán Fómhair 2010
Próximos SlideShares
Carregando em…5
×

de

PHP 5.3, a walkthrough Slide 1 PHP 5.3, a walkthrough Slide 2 PHP 5.3, a walkthrough Slide 3 PHP 5.3, a walkthrough Slide 4 PHP 5.3, a walkthrough Slide 5 PHP 5.3, a walkthrough Slide 6 PHP 5.3, a walkthrough Slide 7 PHP 5.3, a walkthrough Slide 8 PHP 5.3, a walkthrough Slide 9 PHP 5.3, a walkthrough Slide 10 PHP 5.3, a walkthrough Slide 11 PHP 5.3, a walkthrough Slide 12 PHP 5.3, a walkthrough Slide 13 PHP 5.3, a walkthrough Slide 14 PHP 5.3, a walkthrough Slide 15 PHP 5.3, a walkthrough Slide 16 PHP 5.3, a walkthrough Slide 17 PHP 5.3, a walkthrough Slide 18 PHP 5.3, a walkthrough Slide 19 PHP 5.3, a walkthrough Slide 20 PHP 5.3, a walkthrough Slide 21 PHP 5.3, a walkthrough Slide 22 PHP 5.3, a walkthrough Slide 23 PHP 5.3, a walkthrough Slide 24 PHP 5.3, a walkthrough Slide 25 PHP 5.3, a walkthrough Slide 26 PHP 5.3, a walkthrough Slide 27 PHP 5.3, a walkthrough Slide 28 PHP 5.3, a walkthrough Slide 29 PHP 5.3, a walkthrough Slide 30 PHP 5.3, a walkthrough Slide 31 PHP 5.3, a walkthrough Slide 32 PHP 5.3, a walkthrough Slide 33 PHP 5.3, a walkthrough Slide 34 PHP 5.3, a walkthrough Slide 35 PHP 5.3, a walkthrough Slide 36 PHP 5.3, a walkthrough Slide 37 PHP 5.3, a walkthrough Slide 38 PHP 5.3, a walkthrough Slide 39 PHP 5.3, a walkthrough Slide 40 PHP 5.3, a walkthrough Slide 41 PHP 5.3, a walkthrough Slide 42 PHP 5.3, a walkthrough Slide 43 PHP 5.3, a walkthrough Slide 44 PHP 5.3, a walkthrough Slide 45 PHP 5.3, a walkthrough Slide 46 PHP 5.3, a walkthrough Slide 47 PHP 5.3, a walkthrough Slide 48 PHP 5.3, a walkthrough Slide 49 PHP 5.3, a walkthrough Slide 50 PHP 5.3, a walkthrough Slide 51 PHP 5.3, a walkthrough Slide 52 PHP 5.3, a walkthrough Slide 53 PHP 5.3, a walkthrough Slide 54 PHP 5.3, a walkthrough Slide 55 PHP 5.3, a walkthrough Slide 56 PHP 5.3, a walkthrough Slide 57 PHP 5.3, a walkthrough Slide 58 PHP 5.3, a walkthrough Slide 59 PHP 5.3, a walkthrough Slide 60 PHP 5.3, a walkthrough Slide 61 PHP 5.3, a walkthrough Slide 62 PHP 5.3, a walkthrough Slide 63 PHP 5.3, a walkthrough Slide 64 PHP 5.3, a walkthrough Slide 65 PHP 5.3, a walkthrough Slide 66 PHP 5.3, a walkthrough Slide 67 PHP 5.3, a walkthrough Slide 68 PHP 5.3, a walkthrough Slide 69 PHP 5.3, a walkthrough Slide 70 PHP 5.3, a walkthrough Slide 71 PHP 5.3, a walkthrough Slide 72 PHP 5.3, a walkthrough Slide 73 PHP 5.3, a walkthrough Slide 74

PHP 5.3, a walkthrough

  1. 1. PHP 5.3 A Walkthrough @davidcoallier Dé Luain 20 Meán Fómhair 2010
  2. 2. Who are you? Experiences, usage, etc. Dé Luain 20 Meán Fómhair 2010
  3. 3. Who am I? Work, experiences, usage, etc. Dé Luain 20 Meán Fómhair 2010
  4. 4. The Talk! Recap of why you are here... Dé Luain 20 Meán Fómhair 2010
  5. 5. A small PHP 6 Oh no, you didn’t! Dé Luain 20 Meán Fómhair 2010
  6. 6. In a nutshell mysqlnd, phar, syntax, sqlite3, spl-sauce, speed, etc. Dé Luain 20 Meán Fómhair 2010
  7. 7. ext/intl Internationalization Extension Dé Luain 20 Meán Fómhair 2010
  8. 8. Collator string comparison, sorting, locale Dé Luain 20 Meán Fómhair 2010
  9. 9. Numbers... 1,000,000; 1.000.000; 1 000 000 Dé Luain 20 Meán Fómhair 2010
  10. 10. ICU ☕ ♿⚛ Dé Luain 20 Meán Fómhair 2010
  11. 11. More Importantly Dé Luain 20 Meán Fómhair 2010
  12. 12. LSB Late Static Binding, wtf is that? Dé Luain 20 Meán Fómhair 2010
  13. 13. NAMESPACES Dé Luain 20 Meán Fómhair 2010
  14. 14. NAMESPACES!!!! Dé Luain 20 Meán Fómhair 2010
  15. 15. Closures & λs Dé Luain 20 Meán Fómhair 2010
  16. 16. Late-Static Bindingself:: vs static::, what’s that? LSB? Dé Luain 20 Meán Fómhair 2010
  17. 17. class Base { public static function who() { echo __CLASS__; } public static function foo() { self::who(); } } class Child extends Base { public static function who() { echo __CLASS__; } } Child::foo(); // Echoes Base Dé Luain 20 Meán Fómhair 2010
  18. 18. class Base { public static function who() { echo __CLASS__; } public static function foo() { static::who(); } } class Child extends Base { public static function who() { echo __CLASS__; } } Child::foo(); // Echoes Child Dé Luain 20 Meán Fómhair 2010
  19. 19. $this is not static:: Don’t get tricked, no inheritance Dé Luain 20 Meán Fómhair 2010
  20. 20. Object Lifecycle Create, Immute, Memoize Dé Luain 20 Meán Fómhair 2010
  21. 21. Referencial Transparency It’s not maths, it’s software. Dé Luain 20 Meán Fómhair 2010
  22. 22. ZzzZz..... Dé Luain 20 Meán Fómhair 2010
  23. 23. Dynamic Statics Oh that sounds nasty... Dé Luain 20 Meán Fómhair 2010
  24. 24. $class = 'ClassName'; $method = 'methodName'; $class::$method(...); Dé Luain 20 Meán Fómhair 2010
  25. 25. Remember __call? Dé Luain 20 Meán Fómhair 2010
  26. 26. __callStatic() Dé Luain 20 Meán Fómhair 2010
  27. 27. Enough Statics.. Moving on. Dé Luain 20 Meán Fómhair 2010
  28. 28. Namespaces So we have namespaces, now what? Dé Luain 20 Meán Fómhair 2010
  29. 29. Get over it. We know. Dé Luain 20 Meán Fómhair 2010
  30. 30. Organize Structural decisions, maintainability Dé Luain 20 Meán Fómhair 2010
  31. 31. namespace pearpackage; class Example { // ... } Dé Luain 20 Meán Fómhair 2010
  32. 32. use pearpackage; $class = new Example(); // or $class = new pearpackageExample(); Dé Luain 20 Meán Fómhair 2010
  33. 33. Meaning And community significance Dé Luain 20 Meán Fómhair 2010
  34. 34. The culprit strlen Dé Luain 20 Meán Fómhair 2010
  35. 35. Coding Standards http://groups.google.com/group/php-standards/web/psr-0-final-proposal Dé Luain 20 Meán Fómhair 2010
  36. 36. Phar The jar-like PHP Archives Dé Luain 20 Meán Fómhair 2010
  37. 37. include 'phar://package.phar/index.php'; Dé Luain 20 Meán Fómhair 2010
  38. 38. $phar = new Phar('drupal7.phar'); $phar->buildFromDirectory(__DIR__ . '/drupal7'); $phar->setStub("<?php Phar::interceptFileFuncs(); Phar::webPhar(); __HALT_COMPILER(); ?>" Dé Luain 20 Meán Fómhair 2010
  39. 39. RewriteRule ^(.*)$ /drupal7.phar/$1 [QSA,L] Dé Luain 20 Meán Fómhair 2010
  40. 40. Running, web-ing Phar magic-happy-times. Dé Luain 20 Meán Fómhair 2010
  41. 41. λ (Lambda) Assigned to a variable Dé Luain 20 Meán Fómhair 2010
  42. 42. $name = function() { return 'david'; }; Dé Luain 20 Meán Fómhair 2010
  43. 43. Closure functions with bound variables Dé Luain 20 Meán Fómhair 2010
  44. 44. Sto len Fro m $names = array( NA 'Nate Abele', 'David Coallier', 'Cap'n Crunch' TE ); ! $split = array_map( function($name) { list($first, $last) = explode(' ', $name); return compact('first', 'last'); }, $names ); // Result: array( array('first' => 'Nate', 'last' => 'Abele'), array('first' => 'David', 'last' => 'Coallier'), array('first' => 'Cap'n', 'last' => 'Crunch') ) Dé Luain 20 Meán Fómhair 2010
  45. 45. $names = array('david', 'nate'); $friends = array('helgi', 'joel'); $split = function($name) use ($friends) { //... }; Dé Luain 20 Meán Fómhair 2010
  46. 46. Functors :O Dé Luain 20 Meán Fómhair 2010
  47. 47. class Name { public function __invoke() { return 'david'; } } echo $name(); Dé Luain 20 Meán Fómhair 2010
  48. 48. Other things? SPL, changes, NOWDOCS, etc Dé Luain 20 Meán Fómhair 2010
  49. 49. Fast Ternaries No need to check anymore... Beware Dé Luain 20 Meán Fómhair 2010
  50. 50. $name = isset($_GET['name']) ? $_GET['name'] : 'No Name'; Dé Luain 20 Meán Fómhair 2010
  51. 51. $name = $_GET['name'] ?: 'No Name'; Dé Luain 20 Meán Fómhair 2010
  52. 52. NOWDOCS NOWDOCS cooler than HEREDOCS Dé Luain 20 Meán Fómhair 2010
  53. 53. $name = 'david'; $example =<<<RTFM Hello $name, See you soon. RTFM; // Hello David Dé Luain 20 Meán Fómhair 2010
  54. 54. $name = 'david'; $example =<<<'RTFM' Hello $name, See you soon. RTFM; // Hello $name Dé Luain 20 Meán Fómhair 2010
  55. 55. Performance Better faster strong. Better stack Dé Luain 20 Meán Fómhair 2010
  56. 56. Garbage Collection gc_enable(), gc_disable(), etc. Dé Luain 20 Meán Fómhair 2010
  57. 57. __DIR__ dirname(__FILE__) Dé Luain 20 Meán Fómhair 2010
  58. 58. __NAMESPACE__ Dé Luain 20 Meán Fómhair 2010
  59. 59. namespace pearpackageExample2 { const TEST = 'In Namespaces...'; function foo() { echo __NAMESPACE__; } } echo pearpackageExample2::TEST; // In Namespaces... pearpackageExample2foo(); // Example2 Dé Luain 20 Meán Fómhair 2010
  60. 60. E_DEPRECATED Dé Luain 20 Meán Fómhair 2010
  61. 61. MySQLnd Native MySQL Driver, faster, stats, self-contained Dé Luain 20 Meán Fómhair 2010
  62. 62. DateTime Crazy amazing dates handling Dé Luain 20 Meán Fómhair 2010
  63. 63. $datetime1 = new DateTime('2009-10-11'); $datetime2 = new DateTime('2009-10-13'); $interval = $datetime1->diff($datetime2); echo $interval->format('%R%d days'); // +2 days Dé Luain 20 Meán Fómhair 2010
  64. 64. SPL Iterators, Iterators, Iterators. Dé Luain 20 Meán Fómhair 2010
  65. 65. SPL Datastructures, Exceptions, Misc... Dé Luain 20 Meán Fómhair 2010
  66. 66. My Favourite Dé Luain 20 Meán Fómhair 2010
  67. 67. PHP FPM Alternate FastCGI Implementation 5.3.3 Dé Luain 20 Meán Fómhair 2010
  68. 68. Incentive Why do I have to use PHP 5.3? Dé Luain 20 Meán Fómhair 2010
  69. 69. Lithium It’s so rad! Dé Luain 20 Meán Fómhair 2010
  70. 70. Zend Framework 2 Dé Luain 20 Meán Fómhair 2010
  71. 71. Symfony 2 Dé Luain 20 Meán Fómhair 2010
  72. 72. Doctrine 2 Dé Luain 20 Meán Fómhair 2010
  73. 73. Q&A Dé Luain 20 Meán Fómhair 2010
  74. 74. Thank you @davidcoallier Dé Luain 20 Meán Fómhair 2010
  • shahbaig

    Mar. 5, 2013
  • popeyevn

    Jul. 3, 2012
  • aaronmcadam

    Sep. 24, 2010

This talk was given as

Vistos

Vistos totais

2.937

No Slideshare

0

De incorporações

0

Número de incorporações

1

Ações

Baixados

57

Compartilhados

0

Comentários

0

Curtir

3

×