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 or die
Search
Kosuke Ogawa
January 22, 2021
Technology
0
210
PHP or die
Webナイト宮崎 Vol.12 ~てげPHP学びたい~ - connpass
https://tegehoge.connpass.com/event/199828/
Kosuke Ogawa
January 22, 2021
Tweet
Share
More Decks by Kosuke Ogawa
See All by Kosuke Ogawa
TypeScript リテラル型について
koogawa
1
220
Nuxt.js で非同期なデータを取得するときのポイント
koogawa
0
230
Vue 入門者が日報ツールを作ってみた
koogawa
1
290
地方に住むエンジニアがこの先生きのこるには
koogawa
0
1k
Firestore のデータ設計について
koogawa
0
540
はじめてウェブサイトで Firebase を使ってみた
koogawa
1
360
iOSアプリ開発におけるJavaScript
koogawa
1
340
Stack Overflow活動 その後の活動報告
koogawa
1
170
「まりも」と iOS の 6年間
koogawa
4
6.7k
Other Decks in Technology
See All in Technology
LLMプロダクト事業の立ち上げにおける挑戦
layerx
PRO
7
1.5k
AWS アーキテクチャクイズ
yuu26
2
700
オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection
ytake
0
340
統計的学習理論読み Chapter 2
kmatsui
1
290
戦略的DDDを実践するための跳躍力 / OOC 2024
pictiny
6
4.2k
LLM + RAG を使った SORACOM Support Bot の裏側の歴史
soracom
PRO
1
640
大規模なアジャイル開発の現場と技術負債 / Technical Debt
yoshiitaka
21
4.1k
Code Smells @Voxxed Bucharest 24
victorrentea
1
190
今さら聞けない!? AWSの生成AIサービス Amazon Bedrock入門!
minorun365
PRO
11
2.7k
Introducing Pkl
enomotok
0
240
Castor - Symfony Live 2024 - Paris
lyrixx
1
110
10分でわかるfreeeのQA
freee
0
260
Featured
See All Featured
Pencils Down: Stop Designing & Start Developing
hursman
115
11k
Embracing the Ebb and Flow
colly
78
4.1k
For a Future-Friendly Web
brad_frost
170
8.9k
In The Pink: A Labor of Love
frogandcode
137
21k
GitHub's CSS Performance
jonrohan
1023
450k
Building Better People: How to give real-time feedback that sticks.
wjessup
350
18k
Why Our Code Smells
bkeepers
PRO
330
56k
Rails Girls Zürich Keynote
gr2m
91
13k
We Have a Design System, Now What?
morganepeng
42
6.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
A designer walks into a library…
pauljervisheath
199
23k
How to Ace a Technical Interview
jacobian
272
22k
Transcript
PHP OR DIE WebφΠτٶ࡚ Vol.12
ࣗݾհ ➤0HBXB,PTVLFʢ!LPPHBXBʣ ➤Ξϧגࣜձࣾ ➤ٶ࡚͔Β౦ژʹϑϧϦϞʔτ ➤J04 4XJGU "OESPJE ,PUMJO 5ZQF4DSJQU
$44 7VFKT /VYUKTͳͲ ➤ݸਓ։ൃͰ1)1ʢࣝ7FSY Ͱࢭ·ͬͯΔʣ
Α͘ݟΔʁίʔυ
ಉ͡ϊϦͰ͜͏͔ͨͬͨ͠ PHP Parse error: syntax error, unexpected 'return'
https://stackoverflow.com/questions/14393173/in-php-why-does-or-die-work-but-or-return-doesnt
ͭ·Γɺreturn ʮࣜʯͰͳ͍
“ࣜɺPHP ʹ͓͚Δ࠷ॏཁͳϏϧσΟϯάϒ ϩοΫͰ͢ɻPHPʹ͓͍ͯɺ΄ͱΜͲશͯͷ ͷࣜͰهड़͞Ε·͢ɻ ࠷؆୯Ͱ࠷ਖ਼֬ͳ ࣜͷఆٛɺ"͕͋Δͷશͯ"Ͱ͢ɻ ࣜͱ - PHPϚχϡΞϧ
ࣜͷྫ ➤$a = 5 ➤5 5 ͱ͍͏Λ༗͢Δʮࣜʯ ➤$b =
$a ➤$a 5 ͱ͍͏Λ࣋ͭʮࣜʯ ➤$c = foo(); ➤foo() ԿΒ͔ͷΛฦ͢ʮࣜʯ
࠷ॳͷྫΛࢥ͍ग़ͯ͠ΈΔ ➤ $fp = false or die(“hoge”); ΤϥʔʹͳΒͳ͍ ➤ $fp
= false or return 0; PHP Parse error: syntax error, unexpected ‘return' $fp = ࣜ1 or ࣜ2
݁ɿΑͬͯɺ࣍ͷίʔυΤϥʔʹͳΔ PHP Parse error: syntax error, unexpected 'return'
RETURN ➤ ੍ޚߏͷͻͱͭ
͋Γ͕ͱ͏ ͍͟͝·ͨ͠