Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHP のドキュメントを読んで PHP のことをもっと知ろう
Search
Katsuhiro Ogawa
March 01, 2016
Technology
1
3.1k
PHP のドキュメントを読んで PHP のことをもっと知ろう
at PHP BLT #3
Katsuhiro Ogawa
March 01, 2016
Tweet
Share
More Decks by Katsuhiro Ogawa
See All by Katsuhiro Ogawa
新規プロダクト開発に伴う既存マイクロサービスのリアーキテクティングとその後
fivestar
1
130
Goで学ぶSOLID原則
fivestar
0
260
メルカリ CSE チームの 歩みと取り組み / Steps and Tries in the CSE team for Mercari
fivestar
2
870
Go in Corporate Solutions Engineering
fivestar
0
2.4k
いつまでPHP 5.x使ってるの
fivestar
1
1.9k
CrocosSecurityBundleを Symfony3.0に対応した話
fivestar
0
220
PHP BLT だけど HTML5 の コンテンツモデルのお話
fivestar
0
2.3k
THE NEW "PERFECT PHP" WILL BE COMING SOON
fivestar
0
7.9k
Symfony - フレームワークの先へ
fivestar
2
9.8k
Other Decks in Technology
See All in Technology
実務における脅威モデリングを考えよう
nikinusu
0
620
『GRANBLUE FANTASY Relink』キャラクターの魅力を支えるリグ・シミュレーション制作事例
cygames
0
120
サーバー管理しないサーバーサービスManaged DevOps Pool
kkamegawa
0
130
たった1人からはじめる【Agile Community of Practice】~ソース原理とFearless Changeを添えて~
ktc_corporate_it
1
480
プロダクトエンジニアを支えるための開発生産性向上施策
tsukakei
0
140
なにもしてないのにNew Relicのデータ転送量が増えていたときに確認したこと
tk3fftk
2
230
エンジニア視点で見る、 組織で運用されるデザインシステムにするには
shunya078
1
310
Next.js のページ遷移を全力で止める
ypresto
6
3.2k
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
3
390
Segment Anything Model 2
tenten0727
3
700
株式会社EventHub・エンジニア採用資料
eventhub
0
2.9k
リアルお遍路+SORACOM IoT
ozk009
1
140
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
48
7.1k
Into the Great Unknown - MozCon
thekraken
29
1.4k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Raft: Consensus for Rubyists
vanstee
135
6.5k
The Invisible Customer
myddelton
119
13k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
8.9k
The Invisible Side of Design
smashingmag
295
50k
Designing the Hi-DPI Web
ddemaree
278
34k
Facilitating Awesome Meetings
lara
49
5.9k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
How to Ace a Technical Interview
jacobian
274
23k
Transcript
1)1ͷυΩϡϝϯτΛಡΜͰ 1)1ͷ͜ͱΛͬͱΖ͏ খ༤େ!pWFTUS 1 PHP BLT #3
খ༤େ (͓͕Θ͔ͭͻΖ) @fivestr Racing Driver (Amateur) Author of "Perfect PHP"
CTO at Ancar Inc. 2
Έͳ͞Μ1)1ͷ࠷৽ಈνΣοΫͯ͠·͔͢ʁ w 1)1ͰԿ͕৽͘͠ͳ͔ͬͨ w ࠓޙͲͷΑ͏ͳػೳ͕Ճ͞ΕΔ͔ 3
1)1 w εΧϥʔλΠϓώϯτ w ϦλʔϯλΠϓώϯτ w ԋࢉࢠ /VMM߹ମԋࢉࢠ w
ԋࢉࢠ εϖʔεγοϓԋࢉࢠ w ແ໊Ϋϥε 4
1)1&SSPS w 5ISPXBCMF w &SSPS w &YDFQUJPO w ͪͳΈʹ#BTF&YDFQUJPOͰͳ͘ͳΓ·ͨ͠ 5
use Entity\{Article, Author, Comment}; 6
ҠߦυΩϡϝϯτΛಡΈ·͠ΐ͏ w <1)1Y͔Β1)1YͷҠߦ> IUUQQIQOFUNBOVBMKBNJHSBUJPOQIQ w ֤ϝδϟʔϚΠφʔόʔδϣϯ͝ͱʹ ҠߦυΩϡϝϯτ͕͋Γ·͢ w
w υΩϡϝϯτͷτοϓ͔ΒḷΕ·͢ 7
ҠߦυΩϡϝϯτ͍͢͝ w جຊతʹͯ͢ͷมߋ͕·ͱΊΒΕ͍ͯ·͢ w ͔͍͍ͩͨ͠༁͞Ε͍ͯ·͢ w NUBLBHJ͞Μຊʹ͋Γ͕ͱ͏ 8
ࠓޙͷಈ͖Ͳ͏ͬͯݟ͍͚͍͍ͯͷʁ w ҠߦυΩϡϝϯτΛಡΊϦϦʔε͞Εͨ ใΘ͔ΔΑ͏ʹͳΓ·ͨ͠ w ͜Ε͔ΒՃ͞ΕΔػೳͱ͔ Ͳ͏ͬͯΕΑ͍ͷͰ͠ΐ͏͔ 9
1)13'$ w 3'$ͷϖʔδΛݟΔͱࠓޙͷಈ͖Λ νΣοΫͰ͖·͢ w IUUQTXJLJQIQOFUSGD 10
3'$ͷಈ͖ w %SBGU%JTDVTTJPO7PUJOH w "DDFQUFE*NQMFNFOUBUJPO w %FDMJOF w ථͷ݁Ռͷࢍ͕ͳ͍ͱ٫Լ͞ΕΔ 11
*NQMFNFOUFE 12
<>7PJE3FUVSO5ZQF w WPJE Γ͕ͳ͍ ΛϦλʔϯ λΠϓώϯτ͕ఆٛͰ͖ΔΑ͏ʹ 13
function process($data) :void { ... } 14
<>4VQQPSU$MBTT$POTUBOU7JTJCJMJUZ w ΫϥεఆʹΞΫηεम০ࢠΛ ઃఆͰ͖ΔΑ͏ʹ͢Δ 15
class Foo { private const BAR = 'baz'; } 16
"DDFQUFE 1FOEJOH*NQMFNFOUFE 17
"MMPXTQFDJGZJOHLFZTJOMJTU w MJTU Ͱ࿈ྻͷΩʔΛࢦఆͯ͠ ల։Ͱ͖ΔΑ͏ʹ͢Δ 18
list( 'type' => $type, 'value' => $value, ) = $attrs;
19
7PUJOH 20
(FOFSBMJ[FTVQQPSUPGOFHBUJWFTUSJOHP⒎TFUT w จࣈྻͷΦϑηοτࢦఆʹϚΠφεͷΛ ࢦఆͰ͖ΔΑ͏ʹ͢Δ w TVCTUSͳͲؔͰαϙʔτ͞Ε͍ͯͨ w ͍·ͷͱ͜ΖରͰ͍ͯͳ͍ͷͰ௨Γͦ͏ 21
$str = 'abcdef'; var_dump($str[-2]); // => string(1) "e" 22
6OEFS%JTDVTTJPO 23
5SBJUTXJUIJOUFSGBDFT w τϨΠτʹΠϯλʔϑΣΠεΛ ࣮Ͱ͖ΔΑ͏ʹ͢Δ w ͢Β͍͠ w ͥͻ࣮͍͖͍ͯͨͩͨ͠ 24
trait LoggerInjectTrait implements LoggerAwareInterface { protected $logger; /** @Inject */
public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } } 25
%FDMJOF 26
1SPQFSUZ"DDFTTPST4ZOUBY w ΫϥεͷϓϩύςΟͷΞΫηαఆٛ w ΊͬͪΌཉ͔ͬͨ͠ͷʹͳΜͰ 27
$MBTT.FUBEBUB "OOPUBUJPOT w ΞϊςʔγϣϯͷωΠςΟϒαϙʔτ ٫Լ͞Ε͍ͯΔ w %PDίϝϯτͷΞϊςʔγϣϯΛѻ͏ ʮ"OOPUBUJPOTJOEPDCMPDLʯ *OBDUJWFʹͳ͍ͬͯΔ 28
·ͱΊΔͱ 29
1)1υΩϡϝϯτΛಡ͏ w ҠߦΨΠυΛಡΉͱϦϦʔεͷ༰͕ ѲͰ͖·͢ w 3'$ΛಡΉͱࠓޙͷػೳՃͳͲͷಈΛ ݟΔ͜ͱ͕Ͱ͖·͢ 30
͍͞͝ʹ 31
1)1ΤϯδχΞͱ J04ΤϯδχΞͱ "OESPJEΤϯδχΞͱ σβΠφʔͱ ͱ͔͘Ұॹʹಇ͍ͯ͘ΕΔํΛืू͍ͯ͠·͢ʂʂ 32