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
260
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
240
Nuxt.js で非同期なデータを取得するときのポイント
koogawa
0
300
Vue 入門者が日報ツールを作ってみた
koogawa
1
330
地方に住むエンジニアがこの先生きのこるには
koogawa
0
1.1k
Firestore のデータ設計について
koogawa
0
710
はじめてウェブサイトで Firebase を使ってみた
koogawa
1
430
iOSアプリ開発におけるJavaScript
koogawa
1
410
Stack Overflow活動 その後の活動報告
koogawa
1
190
「まりも」と iOS の 6年間
koogawa
4
7.2k
Other Decks in Technology
See All in Technology
Explainable Software Engineering in the Public Sector
avandeursen
0
370
OPENLOGI Company Profile
hr01
0
61k
RAGの基礎から実践運用まで:AWS BedrockとLangfuseで実現する構築・監視・評価
sonoda_mj
0
440
DevOps文化を育むQA 〜カルチャーバブルを生み出す戦略〜 / 20250317 Atsushi Funahashi
shift_evolve
1
110
PostgreSQL Unconference #52 pg_tde
nori_shinoda
1
230
Vision Language Modelを活用した メルカリの類似画像レコメンドの性能改善
yadayuki
9
1.3k
Keynote - KCD Brazil - Platform Engineering on K8s (portuguese)
salaboy
0
130
AI・LLM事業部のSREとタスクの自動運転
shinyorke
PRO
0
300
問題解決に役立つ数理工学
recruitengineers
PRO
7
2.2k
Agile TPIを活用した品質改善事例
tomasagi
0
340
Symfony in 2025: Scaling to 0
fabpot
2
200
Restarting_SRE_Road_to_SRENext_.pdf
_awache
0
170
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building an army of robots
kneath
304
45k
Documentation Writing (for coders)
carmenintech
69
4.7k
Designing for Performance
lara
606
69k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Navigating Team Friction
lara
184
15k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
Become a Pro
speakerdeck
PRO
27
5.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
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 ➤ ੍ޚߏͷͻͱͭ
͋Γ͕ͱ͏ ͍͟͝·ͨ͠