Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP at the Next Step

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for nunulk nunulk
February 22, 2017

PHP at the Next Step

Differences and Similarities PHP 7 and Hack / Laravel in Hack with Laradock

Avatar for nunulk

nunulk

February 22, 2017
Tweet

More Decks by nunulk

Other Decks in Programming

Transcript

  1. 7.0 • scalar type declarations • spaceship operator • null

    coalescing operator • return type declarations 7.1 • nullable type • void return type PHP / Hack
  2. 7.2 or later? RFC: under discussion • arrow function [*1]

    • pipe operator • generics [*1]: シンタックスは違います PHP / Hack
  3. • enum • type alias • callable type hinting •

    null-safe operator • tuple, shape Only in Hack
  4. $ composer create-project --prefer-dist laravel/laravel app $ cd app $

    git clone https://github.com/Laradock/laradock.git $ cd laradock $ docker-compose up -d nginx hhvm mysql workspace
  5. Hack を学んで PHP力 を上げる • 最初は PHP で書いてみる • 徐々に型を増やしていく

    • 引数や戻り値の型を厳密に指定する • hh_client で型チェック • nullable を意識する • pipe operator でメソッド分割を美しくする • PHPへ戻る