Slide 1

Slide 1 text

www.galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 1 / 29 Photo by the Flour Advisory Bureau, UK php

Slide 2

Slide 2 text

www.galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 2 / 29 Photo by the Flour Advisory Bureau, UK php >

Slide 3

Slide 3 text

www.galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 3 / 29 Photo by the Flour Advisory Bureau, UK php >

Slide 4

Slide 4 text

Presidente (2012 – 2017) da ABRAPHP – Associação Brasileira de Profissionais PHP Diretor da PHP Conference Brasil Evangelista e Contribuidor para a Linguagem Atua como Zend Framework Evangelist para o ZTeam, da Zend Embaixador Fedora LATAM Professor Convidado (Especialista) de Pós-Graduação (PR e SC) 25+ anos desenvolvendo sistemas e aplicações com interface web 20+ destes com PHP 12+ com Zend Framework Palestrante em eventos nacionais e internacionais Professor de cursos presenciais e a distância Quem?! CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 4 / 29 www.galvao.eti.br Por que PHP é a melhor coisa desde o pão fatiado www.galvao.eti.br

Slide 5

Slide 5 text

Objetivo CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 5 / 29 www.galvao.eti.br Expor as características, features, conceitos, etc… que fazem da linguagem uma das melhores opções para o mercado de desenvolvimento em geral e web em particular. Por que PHP é a melhor coisa desde o pão fatiado

Slide 6

Slide 6 text

CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 6 / 29 www.galvao.eti.br Use código-fonte que você não entende completamente e prepare-se para ser julgado DISCLAIMER Por que PHP é a melhor coisa desde o pão fatiado

Slide 7

Slide 7 text

CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 7 / 29 www.galvao.eti.br Use código-fonte que você não entende completamente e prepare-se para ser julgado pelo Rei Koala do Inferno. DISCLAIMER Por que PHP é a melhor coisa desde o pão fatiado

Slide 8

Slide 8 text

≃ 25 anos de Mercado CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 8 / 29 www.galvao.eti.br 1995 “PHP 1” PHP 3 1998 2000 2004 2009 PHP 4 PHP 5 5.3 7.0 7.1 7.2 7.3 7.4 8.0 2015 2016 2017 2018 2019* 2020* Você está aqui*(Espero...) Image by Vincent Pontier Os críticos da linguagem ainda estão aqui... Por que PHP é a melhor coisa desde o pão fatiado

Slide 9

Slide 9 text

Versões 1 → 4 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 9 / 29 www.galvao.eti.br Simplicidade > Complexidade Popularidade Aderência ao Mercado C → Perl → PHP v3 à nível internacional, v4 a nível nacional OO, SGBDs, XML... Cultura Criação do elePHPant Visão A linguagem se torna OSS Veia Corporativa Criação da Zend Technologies 1995 → 2000 Por que PHP é a melhor coisa desde o pão fatiado

Slide 10

Slide 10 text

Versão 5.0 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 10 / 29 www.galvao.eti.br A primeira versão verdadeiramente profissional Maturidade Inconsistências como no suporte a Oracle resolvidas OO e XML re-escritos Qualidade MySQLi, PDO (ext) , Exceptions, Classes Nativas em geral 2004 Por que PHP é a melhor coisa desde o pão fatiado

Slide 11

Slide 11 text

Versão 5.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 11 / 29 www.galvao.eti.br O maior salto entre a versão 5.0 e a 7.0 Maturidade Namespaces → Composer, Funções Anônimas, PHAR Obsolescência de Register Globals e Safe Mode password_hash, bcrypt! Comunidade! Evento! GUs, PHP Conference Brasil, Eventos OSS 2009 Por que PHP é a melhor coisa desde o pão fatiado

Slide 12

Slide 12 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 12 / 29 www.galvao.eti.br Performance Inovação Scalar Type Hints, Return Type declarations 2015 → 2019 Por que PHP é a melhor coisa desde o pão fatiado

Slide 13

Slide 13 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 13 / 29 www.galvao.eti.br 2015 → 2019 session_start([ 'name' => bin2hex(random_bytes(8)), 'referer_check' => 'foo*', 'use_only_cookies' => 1, 'use_trans_sid' => 0, 'cookie_httponly' => 1, 'cookie_secure' => 1, 'cookie_lifetime' => 0, 'save_handler' => 'files', 'save_path' => __DIR__ . '/../data/session', 'use_strict_mode' => 1, 'sid_length' => 128, ]); Por que PHP é a melhor coisa desde o pão fatiado

Slide 14

Slide 14 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 14 / 29 www.galvao.eti.br 2015 → 2019 $rcvdObject = unserialize($serializedObject, ['allowed_classes' => TRUE] ); $rcvdObject = unserialize($serializedObject, ['allowed_classes' => FALSE] ); $rcvdObject = unserialize($serializedObject, ['allowed_classes' => ['Foo', 'Bar', 'Baz']] ); Por que PHP é a melhor coisa desde o pão fatiado

Slide 15

Slide 15 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 15 / 29 www.galvao.eti.br 2015 → 2019 $hiker = new class (42, 'Zaphod Beeblebrox') { private $id; private $name; public function __construct($id, $name) { $this->id = $id; $this->name = $name; } }; var_dump($hiker); Por que PHP é a melhor coisa desde o pão fatiado

Slide 16

Slide 16 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 16 / 29 www.galvao.eti.br 2015 → 2019 class Hiker { private $id; private $name; public function __construct(int $id, string $name) { $this->id = $id; $this->name = $name; } public function getId(): int { return $this->id; } } $zaphod = new Hiker(42, 'Zaphod Beeblebrox'); Por que PHP é a melhor coisa desde o pão fatiado

Slide 17

Slide 17 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 17 / 29 www.galvao.eti.br 2015 → 2019 session_start([ 'gc_probability' => 0, ]); session_gc(); session_destroy(); Por que PHP é a melhor coisa desde o pão fatiado

Slide 18

Slide 18 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 18 / 29 www.galvao.eti.br 2015 → 2019 function hitchHike($towel = NULL) { if (func_num_args() > 1) { throw new ArgumentCountError('Too many arguments!'); } if ($towel === NULL) { throw new Exception('It’s dangerous out there!'); } } try { hitchHike(NULL, 'foo'); } catch (ArgumentCountError | Exception $e) { printf('> %s' . PHP_EOL, $e->getMessage()); } Por que PHP é a melhor coisa desde o pão fatiado

Slide 19

Slide 19 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 19 / 29 www.galvao.eti.br 2015 → 2019 class Foo { public const BAR = 2; private const BAZ = 4; } printf('%d - %d' . PHP_EOL, Foo::BAR, Foo::BAZ); Por que PHP é a melhor coisa desde o pão fatiado

Slide 20

Slide 20 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 20 / 29 www.galvao.eti.br 2015 → 2019 function increment(int &$num): void { $num++; return; } $x = 1; increment($x); printf('X equals to %d' . PHP_EOL, $x); Por que PHP é a melhor coisa desde o pão fatiado

Slide 21

Slide 21 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 21 / 29 www.galvao.eti.br 2015 → 2019 $key = random_bytes(32); $nonce = random_bytes(24); $message = 'Libsodium goes way beyond simple encryption!'; $cipherText = sodium_crypto_secretbox($message, $nonce, $key); $plainText = sodium_crypto_secretbox_open($cipherText, $nonce, $key); var_dump(bin2hex($cipherText), $plainText); Por que PHP é a melhor coisa desde o pão fatiado

Slide 22

Slide 22 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 22 / 29 www.galvao.eti.br 2015 → 2019 $submittedPwd = 'a damn fine pass'; $hashedPwd = password_hash($submittedPwd, PASSWORD_ARGON2ID); var_dump($hashedPwd); Por que PHP é a melhor coisa desde o pão fatiado

Slide 23

Slide 23 text

7.0 → 7.3 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 23 / 29 www.galvao.eti.br 2015 → 2019 $dsn = 'pgsql:host=foo;dbname=bar'; $dbh = new PDO($dsn, 'baz', 'quux'); $id = 2; $sql = 'SELECT * FROM server WHERE id = :id'; $sth = $dbh->prepare($sql); $sth->bindValue(':id', $id, PDO::PARAM_INT); var_dump($sth->debugDumpParams()); $sth->execute(); while($record = $sth->fetchObject()) { var_dump($record); } $dbh = NULL; Por que PHP é a melhor coisa desde o pão fatiado

Slide 24

Slide 24 text

Versão 7.4 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 24 / 29 www.galvao.eti.br 2019* Por que PHP é a melhor coisa desde o pão fatiado Arrow Functions Preloading de funções e classes FFI – Foreign Function Interface Typed Properties

Slide 25

Slide 25 text

Versão 8.0 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 25 / 29 www.galvao.eti.br 2020* Por que PHP é a melhor coisa desde o pão fatiado JIT

Slide 26

Slide 26 text

Versão 8.0 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 26 / 29 www.galvao.eti.br 2020* Por que PHP é a melhor coisa desde o pão fatiado JIT

Slide 27

Slide 27 text

Versão 8.0 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 27 / 29 www.galvao.eti.br 2020* Por que PHP é a melhor coisa desde o pão fatiado JIT

Slide 28

Slide 28 text

Muito obrigado! CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 6/8/19 - 28 / 29 www.galvao.eti.br ? Dúvidas? ↓ Críticas? ↑ Elogios?! Por que PHP é a melhor coisa desde o pão fatiado

Slide 29

Slide 29 text

14ª Edição 7.500+ Participantes www.phpconference.com.br 550+ Palestras 980+ Horas de Conteúdo