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

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

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

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

Yusuke Ando

August 24, 2013
Tweet

More Decks by Yusuke Ando

Other Decks in Programming

Transcript

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

     ஗Ԇ੩తଋറ -4# 1)1   "SSBZ4IPSU4ZOUBY USBJU      ϏϧτΠϯαʔό 1)1   δΣωϨʔλ pOBMMZ
  2. ਺ʑͷؒҧ͍  JOD $3 -' SFHJTUFS@HMPCBMT TBGF@NPEF NBHJD@RVPUF ! WBS

     NZTRM@DPOOFDU SFRVJSF@PODF 1&"3 ؆୯ Nڃ ΍΍ෳࡶ Nڃ ΍΍ෳࡶ Nڃ ෳࡶ Nڃ
  3.  1)1 <?php class A { var $foo = 1;

    } $obj =& new A(); $obj2 =& $obj; $obj2->foo = 2; echo $obj->foo;
  4. ͸ෆཁ 1)1 <?php class A { public $foo = 1;

    } $obj = new A(); $obj2 = $obj; $obj2->foo = 2; echo $obj->foo;
  5. 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
  6. औಘ <?php require_once 'vendor/autoload.php'; $twitter = new Twitter( 'aaaa', 'bbbb',

    'cccc', 'dddd' ); $info = $twitter->loadUserInfo('yando'); var_dump($info->status->text);