PHP 5.3 == Awesome!

download PHP 5.3 == Awesome!

of 36

  • date post

    17-Nov-2014
  • Category

    Documents

  • view

    612
  • download

    3

Embed Size (px)

description

Ilia Alshanetsky's slides from ZendCon 2009

Transcript of PHP 5.3 == Awesome!

PHP 5.3 == Awesome!ZendCon 2009 - Ilia Alshanetsky

Tuesday, October 20, 2009

1

version_compare('5.3.0','5.2.11','>')

==

TRUE;

Tuesday, October 20, 2009

2

EVOLUTIONARY RELEASEOld code will still work Focus on mainly improvement of existing functionality Fewer bugs Faster release cycle

Tuesday, October 20, 2009

3

\NamespacesBiggest addition in 5.3 code base Feature complete implementation of namespaces Majority of functionality implemented at compile time Simplies naming conventions

Tuesday, October 20, 2009

4

Cleaner CodeWithout NamespacesfunctionMY_wrapper(){} classMY_DB{} define('MY_CONN_STR','');

With NamespacesnamespaceMY_NS; functionwrapper(){} classDB{}

+MY_wrapper(); newMY_DB(); MY_CONN_STR;

=

constCONN_STR='';

useMY_NS; wrapper(); newDB(); CONN_STR;

Tuesday, October 20, 2009

5

Common ErrorsetProfiling("/tmp/profile.txt"); $xslt->transformToXml($dom);

Resulting In:number 0 match date Total name mode Calls Tot 100us Avg 5 5 58 58 11

Tuesday, October 20, 2009

31

E_DEPRECATEDWhat would a PHP release be without a new error mode? deprecated Used to designate deprecated functionality that maybe, sometime in a far future will get removed, maybe. Part of E_ALL

Tuesday, October 20, 2009

32

Garbage CollectorMemory cleanup for ber-complex and long scripts that need to free-up memory before the end of execution cycle. (!amework folks, this is for you)gc_enable();//EnableGarbage Collector var_dump(gc_enabled());//true var_dump(gc_collect_cycles());//#ofelementscleanedup gc_disable();//DisableGarbage Collector

Tuesday, October 20, 2009

33

NOWDOCA HEREDOC where no escaping is necessary HEREDOC$foo=