$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Debug interactively PHP BLT #7
Search
Sota Sugiura
May 22, 2017
Technology
2
1.4k
Debug interactively PHP BLT #7
Sota Sugiura
May 22, 2017
Tweet
Share
More Decks by Sota Sugiura
See All by Sota Sugiura
内製したSlack Appで頑張るIncident Response@Waroom Meetup #1 / Incident Response with Slack App in 10X
sota1235
0
1.8k
20220926_セキュリティチームの今_for_Drs._Prime_公開用.pdf
sota1235
0
160
再発防止策を考える技術 / #phpconsen
sota1235
10
4k
How to choose the best npm module for your team?
sota1235
9
620
Realtime Database for high traffic production application
sota1235
7
4.2k
Road to migrate JP Web as a microservice
sota1235
4
1.7k
インターフェース再入門 / Think Interface again
sota1235
6
11k
再発防止策を考える技術 #phpconfuk_rej
sota1235
1
1.3k
Update around Firebase #io18
sota1235
3
4.4k
Other Decks in Technology
See All in Technology
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
210
直接メモリアクセス
koba789
0
240
pmconf2025 - 他社事例を"自社仕様化"する技術_iRAFT法
daichi_yamashita
0
690
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
510
安いGPUレンタルサービスについて
aratako
2
2.5k
【CEDEC+KYUSHU2025】学生・若手必見!テクニカルアーティスト 大全 ~仕事・スキル・キャリアパス、TAの「わからない」を徹底解剖~
cygames
PRO
0
120
Ruby で作る大規模イベントネットワーク構築・運用支援システム TTDB
taketo1113
1
110
知っていると得する!Movable Type 9 の新機能を徹底解説
masakah
0
230
AI活用によるPRレビュー改善の歩み ― 社内全体に広がる学びと実践
lycorptech_jp
PRO
1
140
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
0
150
Design System Documentation Tooling 2025
takanorip
2
970
Claude Code はじめてガイド -1時間で学べるAI駆動開発の基本と実践-
oikon48
45
27k
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
380
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
Faster Mobile Websites
deanohume
310
31k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
How GitHub (no longer) Works
holman
316
140k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
KATA
mclloyd
PRO
32
15k
Optimizing for Happiness
mojombo
379
70k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
Debug interactively @sota1235
var_dump($sota1235); • @sota1235 • Call me ‘kirin’ • PHP &
JavaScript • Mercari, Inc.
http://sota1235.hatenablog.com/entry/2017/01/01/175228
I did it
Today’s theme
Debug
Debugging method • Using var_dump, echo • php -a •
Writing tests • IDE • etc…
Debugging method • Using var_dump, echo • php -a •
Writing tests • IDE • etc…
Using REPL (php -a) • Easy to use • Can
load files • Good integration with CLI
Is it the best way? • Bother to require autoloader
• Reset state every time • Not good for many autoloader files…
None
psysh http://psysh.org/
psysh • Rich CLI • Customizable • We can make
own REPL
Rich REPL • Auto complete (with Tab key) • Useful
commands • history, documentation, show properties • Rich UI
Customizable • We can place config file • ~/.config/psysh/psysh.php •
We can do anything if PHP can
<?php // Automatically autoload Composer dependencies if (is_file(getcwd() . '/vendor/autoload.php'))
{ require_once(getcwd() . '/vendor/autoload.php'); } Load composer automatically
<?php // Use local config, if available if (is_file(getcwd() .
'/.psysh.php')) { return require(getcwd() . '/.psysh.php'); } // Fall back to global config return [ 'startupMessage' => '<info>Using global config</info>', 'commands' => [ new \Psy\Command\ParseCommand, ], ]; Load local config
<?php $default_includes = []; // Automatically autoload Composer dependencies if
(is_file(getcwd() . '/vendor/autoload.php')) { $default_includes[] = getcwd() . '/vendor/autoload.php'); } if (array_pop(explode('/', getcwd())) === '') { $default_includes[] = getcwd() . 'lecacy_autoloader.php'; } return [ 'defaultIncludes' = $default_includes, ]; Legacy project? No problem☺
Thank you