モダンPHPチュートリアル (LLまつり版)

モダンPHPチュートリアル (LLまつり版)

レガシーなプラクティスを捨ててモダンなコードを。

9b69fbdeb0713def44a8731091ce5885?s=128

Yusuke Ando

August 24, 2013
Tweet

Transcript

  1. 8.
  2. 10.
  3. 15.

    ݱߦόʔδϣϯ 1)1   ໊લۭؒ Ϋϩʔδϟ    

     ஗Ԇ੩తଋറ -4# 1)1   "SSBZ4IPSU4ZOUBY USBJU      ϏϧτΠϯαʔό 1)1   δΣωϨʔλ pOBMMZ
  4. 20.

    ਺ʑͷؒҧ͍  JOD $3 -' SFHJTUFS@HMPCBMT TBGF@NPEF NBHJD@RVPUF ! WBS

     NZTRM@DPOOFDU SFRVJSF@PODF 1&"3 ؆୯ Nڃ ΍΍ෳࡶ Nڃ ΍΍ෳࡶ Nڃ ෳࡶ Nڃ
  5. 32.

     1)1 <?php class A { var $foo = 1;

    } $obj =& new A(); $obj2 =& $obj; $obj2->foo = 2; echo $obj->foo;
  6. 33.

    ͸ෆཁ 1)1 <?php class A { public $foo = 1;

    } $obj = new A(); $obj2 = $obj; $obj2->foo = 2; echo $obj->foo;
  7. 42.
  8. 48.
  9. 57.
  10. 61.
  11. 63.
  12. 64.
  13. 72.

    DPNQPTFSKTPO { "name": "llmatsuri/sample", "authors": [ { "name": "yando", "email":

    "yandod@gmail.com" } ], "require": { "dg/twitter-php": "*" } }
  14. 74.

    DPNQPTFSJOTUBMM vagrant@precise64:/vagrant_data$ composer install Loading composer repositories with package information

    Installing dependencies (including require-dev) - Installing dg/twitter-php (v3.1) Loading from cache Writing lock file Generating autoload files
  15. 76.
  16. 81.

    औಘ <?php require_once 'vendor/autoload.php'; $twitter = new Twitter( 'aaaa', 'bbbb',

    'cccc', 'dddd' ); $info = $twitter->loadUserInfo('yando'); var_dump($info->status->text);
  17. 82.
  18. 85.