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.
A Maioridade do PHP
Daniel Archer - Setembro/2015
The Developers Conference 2015 – Porto Alegre
7
Quem sou eu
Formado pelo Senac em
2011
Palestrante da PHP
Conference Brasil
5 Anos de experiência
em PHP
Desenvolvedor PHP...
Mas e o PHP6?
• 2005 – Andrei Zmievski
• UTF-16
• Unicode everywhere!
– Core
– Extensões
– API
• PHP6 = PHP5 + Unicode
Fon...
Mas e o PHP6?
Fonte: slideshare – Andrei Zmievski – Whats happened to Unicode and PHP6 - 2011
Por que não PHP 5.7 ?
• Limpeza do código
• Refatorar antigas funções
• Novas funcionalidade
Fonte: https://wiki.php.net/r...
Por que não PHP 5.7 ?
• Limpeza do código
• Refatorar antigas funções
• Novas funcionalidade
• Novo core PHPNG
Fonte: http...
PHPNG?
• PHP Next Generation
• Branch criado pela Zend em Jan/2014
• Nenhuma funcionalidade extra
• Foco na performance (c...
PHPNG?
• PHP Next Generation
• Branch criado pela Zend em Jan/2014
• Nenhuma funcionalidade extra
• Foco na performance (c...
HashTable
• HashTable reduzida de 72 para 56
bytes
• Bucket reduzido de 72 to 32 bytes
Fonte: talk ZendCon-2014 at https:/...
1001 Pequenas Melhorias
• Nova HashTable API
• Otimização na duplicação de Arrays
• Contagem de Referências ao invés de
co...
PHPNG Performance
PHP 5.6 PHPNG
Memory Usage 428 MB
Time 0.29 sec
Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng
PHPNG Performance
PHP 5.6 PHPNG
Memory Usage 428 MB 33 MB
Time 0.29 sec 0.06 sec
Fonte: talk ZendCon-2014 at https://wiki....
PHP-5.6 PHP-7
HHVM-
3.3.0
Diff
ZF1 Hello 1150 1655 961 72%
ZF2 Test 269 421 260 62%
Drupal 194 281 261 8%
SugarCRM
(login)...
Wordpress Performace
Tarefa: Wordpress Homepage
• Antes dos PHPNG
– 9.4 Bilhões de instruções de CPU
• Com PHPNG
Fonte: ht...
Wordpress Performace
Tarefa: Wordpress Homepage
• Antes dos PHPNG
– 9.4 Bilhões de instruções de CPU
• Com PHPNG
– 2.6 Bil...
Agosto 2014
• Core do PHP recebe o merge do
PHPNG
• É aberta a oportunidade de mudar!
Novas Features
• Scalar Type Declarations
• Return Type Declarations
• Combined Comparison Operator (Spaceship)
• Null Coa...
Scalar type hints
• O PHP é conhecido por ser uma
linguagem de tipagem dinâmica.
Scalar type hints
Return Type Declarations
• A proposta desse RFC era simples.
• Possibilitar a garantia do retorno de
uma função ou método....
Return Type Declarations
Fonte: https://wiki.php.net/rfc/return_types
Return Type Declarations
Fonte: https://wiki.php.net/rfc/return_types
must be of the type array
Return Type Declarations
Fonte: https://wiki.php.net/rfc/return_types
Return Type Declarations
Fonte: https://wiki.php.net/rfc/return_types
must be of the type int, integer returned
Spaceship Operator <=>
Spaceship Operator <=>
Fonte: https://wiki.php.net/rfc/combined-comparison-operator
• Utilizado principalmente em funções
...
Spaceship Operator <=>
Fonte: https://wiki.php.net/rfc/combined-comparison-operator
Spaceship Operator <=>
Fonte: https://wiki.php.net/rfc/combined-comparison-operator
Spaceship Operator <=>
Fonte: https://wiki.php.net/rfc/combined-comparison-operator
Null Coalesce Operator
Fonte: https://github.com/tpunt/PHP7-Reference#null-coalesce-operator
• Figura antiga em banco de d...
Group Use Declarations
Fonte: https://wiki.php.net/rfc/group_use_declarations
• Possibilidade de realizar uma
chamada Use ...
Group Use Declarations
Fonte: https://wiki.php.net/rfc/group_use_declarations
Alterações (Atenção)
• Uniform Variable Syntax
• Changes to list’s behavior
• Fixes to Custom Session Handler Return
Value...
Adeus
• ext/mysql
• ext/ereg
• $obj =& new ClassName;
• PHP 4 Constructors
• <script language=“PHP”></script>
• <% ... %>
...
Adeus
• ext/mysql
• ext/ereg
• $obj =& new ClassName;
• PHP 4 Constructors
• <script language=“PHP”></script>
• <% ... %>
...
Incompatibilidades
• Adicionadas palavras a lista de reservadas
– Int
– Float
– Bool
– String
– True
– False
– Null
– Reso...
Uniform Variable Syntax
• Muda completamente o modo que o PHP
realiza a leitura de variáveis variáveis.
• A leitura passa ...
Uniform Variable Syntax
Fonte: https://wiki.php.net/rfc/uniform_variable_syntax
Uniform Variable Syntax
Fonte: https://wiki.php.net/rfc/uniform_variable_syntax
... pausa, chega de código.
Resumo PHP7
• Novo Core
Resumo PHP7
• Novo Core
• Novos Operadores
Resumo PHP7
• Novo Core
• Novos Operadores
• Melhor desempenho
Resumo PHP7
• Novo Core
• Novos Operadores
• Melhor desempenho
• Preparado para futuras melhorias
– Multithread?
Resumo PHP7
• Maturidade
– Core otimizado
– OOP Muito bem implementada
– Coerência Sintática
– Preocupação com a Comunidade
Notícias
• HHVM x PHP7
Notícias
• HHVM x PHP7
• HHVM vai rodar PHP7?
– http://stackoverflow.com/questions/31883096/will-hhvm-be-able-to-run-php7
...
Notícias
Fonte: http://devzone.zend.com/6647/introducing-php-7-express/
http://stackoverflow.com/questions/31883096/will-h...
Notícias
• Travis-CI
– Já é possível acessar a nova versão do
PHP através da build “Nightly”
Fonte: http://docs.travis-ci....
PHPRS
Grupo de Usuários PHP do Rio Grande
Procure pelo Grupo PHPRS no Facebook
http://php-rs.org/
Certificação ZCPE
Desconto de 25%
Créditos: Cyrille Grandval
https://goo.gl/qX38vJ
Z-Ray
Ferramenta para debug, agora não
mais vinculada ao Zend Server
https://goo.gl/TqKHfJ
PHP 7 - A Maioridade do PHP
PHP 7 - A Maioridade do PHP
Próximos SlideShares
Carregando em…5
×

PHP 7 - A Maioridade do PHP

1.395 visualizações

Publicada em

Nessa palestra apresentarei o que mudou e por que mudou na nova major version do PHP. Grandes mudanças possibilitaram uma melhor padronização da linguagem, novas possibilidades e encorparam ainda mais esse universo que temos.
Novidades, mudanças, notícias e incompatibilidades do PHP7.

Publicada em: Software
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui

PHP 7 - A Maioridade do PHP

  1. 1. A Maioridade do PHP Daniel Archer - Setembro/2015 The Developers Conference 2015 – Porto Alegre 7
  2. 2. Quem sou eu Formado pelo Senac em 2011 Palestrante da PHP Conference Brasil 5 Anos de experiência em PHP Desenvolvedor PHP Sênior na Servicoop Coordenador PHPRS
  3. 3. Mas e o PHP6? • 2005 – Andrei Zmievski • UTF-16 • Unicode everywhere! – Core – Extensões – API • PHP6 = PHP5 + Unicode Fonte: slideshare – Andrei Zmievski – Whats happened to Unicode and PHP6 - 2011
  4. 4. Mas e o PHP6? Fonte: slideshare – Andrei Zmievski – Whats happened to Unicode and PHP6 - 2011
  5. 5. Por que não PHP 5.7 ? • Limpeza do código • Refatorar antigas funções • Novas funcionalidade Fonte: https://wiki.php.net/rfc/php7_57_roadmap
  6. 6. Por que não PHP 5.7 ? • Limpeza do código • Refatorar antigas funções • Novas funcionalidade • Novo core PHPNG Fonte: https://wiki.php.net/rfc/php7_57_roadmap
  7. 7. PHPNG? • PHP Next Generation • Branch criado pela Zend em Jan/2014 • Nenhuma funcionalidade extra • Foco na performance (como?) Fonte: https://wiki.php.net/phpng
  8. 8. PHPNG? • PHP Next Generation • Branch criado pela Zend em Jan/2014 • Nenhuma funcionalidade extra • Foco na performance (como?) – Com a possibilidade de prever qual o tipo de valor será retornado, é possível otimizar a estrutura de dados. (Ver mais: Talk ZendCon-2014) Fonte: https://wiki.php.net/phpng
  9. 9. HashTable • HashTable reduzida de 72 para 56 bytes • Bucket reduzido de 72 to 32 bytes Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng
  10. 10. 1001 Pequenas Melhorias • Nova HashTable API • Otimização na duplicação de Arrays • Contagem de Referências ao invés de copia-las • Otimização do Serialize() • Etc.. Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng
  11. 11. PHPNG Performance PHP 5.6 PHPNG Memory Usage 428 MB Time 0.29 sec Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng
  12. 12. PHPNG Performance PHP 5.6 PHPNG Memory Usage 428 MB 33 MB Time 0.29 sec 0.06 sec Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng
  13. 13. PHP-5.6 PHP-7 HHVM- 3.3.0 Diff ZF1 Hello 1150 1655 961 72% ZF2 Test 269 421 260 62% Drupal 194 281 261 8% SugarCRM (login) 132 225 165 36% Magento 43 57 60 -5% Symfony 2.5 ACME 85 110 92 20% Fonte: talk ZendCon-2014 at https://wiki.php.net/phpng PHPNG Performance [req / seg]
  14. 14. Wordpress Performace Tarefa: Wordpress Homepage • Antes dos PHPNG – 9.4 Bilhões de instruções de CPU • Com PHPNG Fonte: https://www.zend.com/en/resources/php-7
  15. 15. Wordpress Performace Tarefa: Wordpress Homepage • Antes dos PHPNG – 9.4 Bilhões de instruções de CPU • Com PHPNG – 2.6 Bilhões de instruções de CPU 72% menos! Fonte: https://www.zend.com/en/resources/php-7
  16. 16. Agosto 2014 • Core do PHP recebe o merge do PHPNG • É aberta a oportunidade de mudar!
  17. 17. Novas Features • Scalar Type Declarations • Return Type Declarations • Combined Comparison Operator (Spaceship) • Null Coalesce Operator • Anonymous Classes • Unicode Codepoint Escape Syntax • Closure call() Method • Group Use Declarations • Session_start() Options • Support for Array Constants in define() Fonte: https://github.com/tpunt/PHP7-Reference
  18. 18. Scalar type hints • O PHP é conhecido por ser uma linguagem de tipagem dinâmica.
  19. 19. Scalar type hints
  20. 20. Return Type Declarations • A proposta desse RFC era simples. • Possibilitar a garantia do retorno de uma função ou método. Fonte: https://wiki.php.net/rfc/return_types
  21. 21. Return Type Declarations Fonte: https://wiki.php.net/rfc/return_types
  22. 22. Return Type Declarations Fonte: https://wiki.php.net/rfc/return_types must be of the type array
  23. 23. Return Type Declarations Fonte: https://wiki.php.net/rfc/return_types
  24. 24. Return Type Declarations Fonte: https://wiki.php.net/rfc/return_types must be of the type int, integer returned
  25. 25. Spaceship Operator <=>
  26. 26. Spaceship Operator <=> Fonte: https://wiki.php.net/rfc/combined-comparison-operator • Utilizado principalmente em funções de ordenação • 3 retornos possíveis – Inteiro positivo • operador da esquerda é maior – Zero • operadores iguais – Inteiro negativo • operador da direita é maior
  27. 27. Spaceship Operator <=> Fonte: https://wiki.php.net/rfc/combined-comparison-operator
  28. 28. Spaceship Operator <=> Fonte: https://wiki.php.net/rfc/combined-comparison-operator
  29. 29. Spaceship Operator <=> Fonte: https://wiki.php.net/rfc/combined-comparison-operator
  30. 30. Null Coalesce Operator Fonte: https://github.com/tpunt/PHP7-Reference#null-coalesce-operator • Figura antiga em banco de dados • Finalmente temos um operador para diversos valores nulos
  31. 31. Group Use Declarations Fonte: https://wiki.php.net/rfc/group_use_declarations • Possibilidade de realizar uma chamada Use para diversas classes do mesmo grupo. • Lembrando, o uso é opcional.
  32. 32. Group Use Declarations Fonte: https://wiki.php.net/rfc/group_use_declarations
  33. 33. Alterações (Atenção) • Uniform Variable Syntax • Changes to list’s behavior • Fixes to Custom Session Handler Return Values • Deprecation of PHP 4-Style Constructors • Removal of date.timezone Warning • Removal of Alternative PHP Tags • Removal of Multiple Default Blocks in Switch Statements Fonte: https://github.com/tpunt/PHP7-Reference
  34. 34. Adeus • ext/mysql • ext/ereg • $obj =& new ClassName; • PHP 4 Constructors • <script language=“PHP”></script> • <% ... %> Fonte: Slideshare – Cyrille Grandval – Nouveautes PHP 7
  35. 35. Adeus • ext/mysql • ext/ereg • $obj =& new ClassName; • PHP 4 Constructors • <script language=“PHP”></script> • <% ... %> Fonte: Slideshare – Cyrille Grandval – Nouveautes PHP 7
  36. 36. Incompatibilidades • Adicionadas palavras a lista de reservadas – Int – Float – Bool – String – True – False – Null – Resourse – Object – Mixed – Numeric Fonte: Slideshare – Cyrille Grandval – Nouveautes PHP 7
  37. 37. Uniform Variable Syntax • Muda completamente o modo que o PHP realiza a leitura de variáveis variáveis. • A leitura passa a ser sempre da esquerda para a direita Fonte: Slideshare – Cyrille Grandval – Nouveautes PHP 7
  38. 38. Uniform Variable Syntax Fonte: https://wiki.php.net/rfc/uniform_variable_syntax
  39. 39. Uniform Variable Syntax Fonte: https://wiki.php.net/rfc/uniform_variable_syntax
  40. 40. ... pausa, chega de código.
  41. 41. Resumo PHP7 • Novo Core
  42. 42. Resumo PHP7 • Novo Core • Novos Operadores
  43. 43. Resumo PHP7 • Novo Core • Novos Operadores • Melhor desempenho
  44. 44. Resumo PHP7 • Novo Core • Novos Operadores • Melhor desempenho • Preparado para futuras melhorias – Multithread?
  45. 45. Resumo PHP7 • Maturidade – Core otimizado – OOP Muito bem implementada – Coerência Sintática – Preocupação com a Comunidade
  46. 46. Notícias • HHVM x PHP7
  47. 47. Notícias • HHVM x PHP7 • HHVM vai rodar PHP7? – http://stackoverflow.com/questions/31883096/will-hhvm-be-able-to-run-php7 – De Acordo com Josh Watzman, podemos esperar algo assim!
  48. 48. Notícias Fonte: http://devzone.zend.com/6647/introducing-php-7-express/ http://stackoverflow.com/questions/31883096/will-hhvm-be-able-to-run-php7 • HHVM x PHP7 • HHVM vai rodar PHP7? – http://stackoverflow.com/questions/31883096/will-hhvm-be-able-to-run-php7 – De Acordo com Josh Watzman, podemos esperar algo assim! • PHP 7 Express – O Zend Studio 13 virá com uma ferramenta para procurar potenciais incompatibilidades
  49. 49. Notícias • Travis-CI – Já é possível acessar a nova versão do PHP através da build “Nightly” Fonte: http://docs.travis-ci.com/user/languages/php/
  50. 50. PHPRS Grupo de Usuários PHP do Rio Grande Procure pelo Grupo PHPRS no Facebook http://php-rs.org/
  51. 51. Certificação ZCPE Desconto de 25% Créditos: Cyrille Grandval https://goo.gl/qX38vJ
  52. 52. Z-Ray Ferramenta para debug, agora não mais vinculada ao Zend Server https://goo.gl/TqKHfJ

×