TDC SP 2015 - PHP7: better & faster
-
Upload
bruno-ricardo-siqueira -
Category
Software
-
view
129 -
download
1
Transcript of TDC SP 2015 - PHP7: better & faster
ABOUT THE SPEAKER
Bruno Ricardo Siqueira.
Web developer and PHP evangelist in Brazil. Docker enthusiast. Git heavy user.
Working with Web Development for the last 8 years, Bachelor in Information Systems by University of Sao Paulo ICMC - USP, currently working at CI&T as Software Engineer.
AGENDA
● Warming-up
○ Contextualization
○ Deprecations
○ Removals &
inconsistency reduction
● Looking inside
○ Memory
○ Performance
● New features
○ Unicode
○ Exception in the core
○ Anonymous classes
○ Operators
○ Declarations
○ Generators
● Near future & conclusions
● Questions
WARMING-UP - CONTEXTUALIZATION
● 2009 - PHP 5.3
○ Namespaces
○ Anonymous functions
● 2009 - PHP-FIG
● 2010 - HipHop for PHP
(HPHPc)
○ PHP -> C++ binary
● 2011 - HipHop Virtual Machine
(HHVM)
○ JIT -> HipHop ByteCode
● 2012 - PHP 5.4
○ Traits
○ Built in Webserver
● 2013 - PHP 5.5
○ Generators
○ OpCache in the core
● 2014 - HACK Language
● 2014 - PHP 5.6
○ Variadic Functions (...)
○ reusable php://input
WARMING-UP - REMOVALS & INCONSISTENCY REDUCTION
● date.timezone warning:
○ default value
● alternative tags:
○ <% opening tag○ <%= opening tag with echo○ %> closing tag○ (<script\s+language\s*=\s*(php|"php"|'php')\s*>)i
opening tag○ (</script>)i closing tag
● multiple default blocks in switch constructions
WARMING-UP - REMOVALS & INCONSISTENCY REDUCTION
● SAPIs & extensions:
○ sapi/aolserver, sapi/apache, sapi/apache_hooks, sapi/apache2filter, sapi/caudium, sapi/continuity, sapi/isapi, sapi/milter, sapi/nsapi, sapi/phttpd, sapi/pi3web, sapi/roxen, sapi/thttpd, sapi/tux, sapi/webjames, ext/mssql, ext/mysql, ext/sybase_ct, ext/ereg
○ moved to PECL
● hexadecimals in numeric strings
● E_STRICT Notices
LOOKING INSIDE - PERFORMANCE
● ZVALs PHP 5.X
○ (almost) always heap
allocated
○ reference counted &
cycle colletcion
○ duplicated refcount
(objects)
○ too much referencing, e.
g.: 1 object in 1 variable ->
4 pointers
● ZVALs PHP 7
○ simple values (int, bool…)
without head allocation &
without refcount
○ no more double refcount.
○ reusable values
independent of zval
structure
Smaller data structures.Less allocations.Less referencing.
BETTER PERFORMANCE!
LOOKING INSIDE - PERFORMANCE
NEW FEATURES - GENERATORS delegating generator
return expressions + delegating generator…
Can you see the concurrency?
FUTURO PRÓXIMO
● PSR7 + Middleware pattern will
boost even more the PHP
packages reusability
● JIT + PHP Virtual Machine
● Language specification
● Better consistency
● AST will bring new/better
static analysis tools
● ...
THANKS FOR
BEINGHERE!
PHP7: better & faster
References: http://bit.ly/tdcsp-2015-php7
BRUNO RICARDO SIQUEIRA
@brunoric
https://joind.in/14853