Php 5.3 And Php 6 - A Look Ahead (DPC 2008, Amsterdam)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

9 Favorites

Php 5.3 And Php 6 - A Look Ahead (DPC 2008, Amsterdam) - Presentation Transcript

  1. What is new in PHP 5.3?
    • Stefan Priebsch, e-novative GmbH
  2. Disclaimer
  3. First Plans for PHP 6
    • Paris Developer Meeting
    • Derick's Meeting Minutes
      • www.php.net/~derick/meeting-notes.html
    • First Release Candidate late 2006
  4. First Plans for PHP 6
    • Paris Developer Meeting
    • Derick's Meeting Minutes
      • www.php.net/~derick/meeting-notes.html
    • First Release Candidate late 2007
  5. First Plans for PHP 6
    • Paris Developer Meeting
    • Derick's Meeting Minutes
      • www.php.net/~derick/meeting-notes.html
    • First Release Candidate ... some day
  6. And PHP 6 ...
  7. ... became PHP 5.3 ...
  8. ... almost
  9. Unicode
  10. Unicode
    • One Standard to rule them all
    • PHP 6's killer feature
    • One character != one byte
  11. Garbage Collection
  12. Garbage Collection
    • Free memory while script is running
    • gc_enable();
    • gc_disable();
  13. SPL Improvements
  14. SPL Improvements
    • SplDoublyLinkedList
    • SPLStack
    • SPLQueue
    • SplPriorityQueue
  15. SPL Stack
    • $stack = new SplStack(); $stack->push('a'); $stack->push('b'); $stack->push('c'); echo $stack->pop(); echo $stack->pop(); echo $stack->pop();
  16. SPL Stack
    • $stack = new SplStack(); $stack->push('a'); $stack->push('b'); $stack->push('c'); echo $stack->pop(); echo $stack->pop(); echo $stack->pop(); -> cba
  17. Magic Static Calls
  18. Magic Calls
    • class Foo { public function __call($aName, $aParameters) { var_dump($aName); var_dump($aParameters); } } $foo = new Foo(); $foo->test('something');
  19. Magic Calls
    • class Foo { public function __call($aName, $aParameters) { var_dump($aName); var_dump($aParameters); } } $foo = new Foo(); $foo->test('something'); -> string(4) "test" array(1) { [0]=> string(9) "something" }
  20. Magic Calls
    • Strict standards: Non-static method Foo::test() should not be called statically
  21. Magic Static Calls
    • class Foo { public static function __callStatic($aName, $aParameters) { ... } } Foo::doSomething(...);
  22. Late Static Binding
  23. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return self::$foo; } } var_dump(Foo::getFoo());
  24. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return self::$foo; } } var_dump(Foo::getFoo()); -> Test
  25. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return self::$foo; } } class MyFoo extends Foo { protected static $foo = 'MyTest'; } var_dump(Foo::getFoo()); var_dump(MyFoo::getFoo());
  26. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return self::$foo; } } class MyFoo extends Foo { protected static $foo = 'MyTest'; } var_dump(Foo::getFoo()); var_dump(MyFoo::getFoo()); -> string(4) "Test" string(4) "Test"
  27. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return static::$foo; } } class MyFoo extends Foo { protected static $foo = 'MyTest'; } var_dump(Foo::getFoo()); var_dump(MyFoo::getFoo());
  28. Late Static Binding
    • class Foo { protected static $foo = 'Test'; public static function getFoo() { return static::$foo; } } class MyFoo extends Foo { protected static $foo = 'MyTest'; } var_dump(Foo::getFoo()); var_dump(MyFoo::getFoo()); -> string(4) "Test" string(6) "MyTest"
  29. Namespaces
    • class File { ... }
    Namespaces
    • class File { ... } // somewhere else class File { ... }
    Namespaces
    • class my_Web_Framework_Foo_Bar_Baz { ... }
    Namespaces
    • namespace my::Web::Framework::Foo::Bar; class Baz { ... }
    Namespaces
    • namespace my::Web::Framework::Foo::Bar; class Baz { ... }
    • // somewhere else: $baz = new my::Web::Framework::Foo::Bar::Baz();
    Namespaces
    • use my::Web::Framework::Foo::Bar::Baz as MyBaz; $baz = new myBaz();
    Namespaces
    • namespace crypt; function gnupg_decrypt($aText, $aKeyFile) { return 'some plaintext'; }
    Namespaces
    • namespace crypt; function gnupg_decrypt($aText, $aKeyFile) { return 'some plaintext'; } var_dump(gnupg_decrypt('sa45hzq734hrq243rwaefsd80', 'my.key'));
    Namespaces
    • namespace foo; class bar { static public function baz() { return 'baz method'; } } var_dump(foo::bar::baz());
    Namespaces
    • namespace foo; class bar { static public function baz() { return 'baz method'; } } var_dump(foo::bar::baz()); -> string(10) "baz method"
    Namespaces
    • namespace foo::bar; function baz() { return 'baz function'; } namespace foo; class bar { static public function baz() { return 'baz method'; } } var_dump(foo::bar::baz());
    Namespaces
  30. Namespaces
    • Access built-in functions/classes by prefixing ::
      • some_fn(...) vs. ::some_fn(...)
    • __NAMESPACE__ constant
    • Multiple namespaces per file
  31. More New Features
    • ifsetor
    • OpenID support
    • SQLite3
    • getopt() works on Windows
    • __DIR__ = dirname(__FILE__)
  32. Error Handling
  33. Error Handling
    • New error class E_DEPRECATED
    • E_ALL includes E_STRICT
  34. Future-Proofing
  35. Regular Expressions
    • ereg will move to PECL
      • replace ereg_* by preg_*
    • by the way, ereg is not binary safe
  36. Deprecated php.ini Settings
    • short open tags
    • magic quotes
    • register_globals
    • register_long_arrays
    • ze1.compatibility_mode
    • allow_call_time_pass_reference
    • safe_mode
  37. Blatant Advertisement
  38.  
  39.  
  40. Thank you.
  41. http://www.priebsch.de (de) http://inside.e-novative.de (en) [email_address]
  42.  

Stefan PriebschStefan Priebsch, 2 years ago

custom

6056 views, 9 favs, 16 embeds more stats

Slides of my conference presentation at Dutch PHP

More Info

© All Rights Reserved

Go to text version
  • Total Views 6056
    • 5344 on SlideShare
    • 712 from embeds
  • Comments 1
  • Favorites 9
  • Downloads 140
Most viewed embeds
  • 232 views on http://www.phpeye.com
  • 158 views on http://inside.e-novative.de
  • 93 views on http://www.planet-php.net
  • 64 views on http://www.priebsch.de
  • 60 views on http://phpeye.com

more

All embeds
  • 232 views on http://www.phpeye.com
  • 158 views on http://inside.e-novative.de
  • 93 views on http://www.planet-php.net
  • 64 views on http://www.priebsch.de
  • 60 views on http://phpeye.com
  • 41 views on http://www.scriptorama.nl
  • 37 views on http://www.planet-php.org
  • 11 views on http://planet-php.org
  • 7 views on http://priebsch.de
  • 2 views on http://lj-toys.com
  • 2 views on http://localhost
  • 1 views on http://live.southdreamz.com
  • 1 views on http://www.heise.de
  • 1 views on http://192.168.51.252
  • 1 views on http://static.slideshare.net
  • 1 views on http://nanoroboticmedicine.com

less

Flagged as inappropriate Flag as inappropriate
Flag as innappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

Categories