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
Debug interactively PHP BLT #7
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Sota Sugiura
May 22, 2017
Technology
1.5k
2
Share
Debug interactively PHP BLT #7
Sota Sugiura
May 22, 2017
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.9k
20220926_セキュリティチームの今_for_Drs._Prime_公開用.pdf
sota1235
0
190
再発防止策を考える技術 / #phpconsen
sota1235
10
4.1k
How to choose the best npm module for your team?
sota1235
9
650
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.4k
Update around Firebase #io18
sota1235
3
4.4k
Other Decks in Technology
See All in Technology
パワポ作るマンをMCP Apps化してみた
iwamot
PRO
0
300
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.3k
ハーネスエンジニアリング×AI適応開発
aictokamiya
3
1.4k
第26回FA設備技術勉強会 - Claude/Claude_codeでデータ分析 -
happysamurai294
0
380
非同期・イベント駆動処理の分散トレーシングの繋げ方
ichikawaken
1
270
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
OCI技術資料 : 証明書サービス概要
ocise
1
7.2k
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
140
来期の評価で変えようと思っていること 〜AI時代に変わること・変わらないこと〜
estie
0
140
ログ基盤・プラグイン・ダッシュボード、全部整えた。でも最後は人だった。
makikub
1
110
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
17k
OpenClaw初心者向けセミナー / OpenClaw Beginner Seminar
cmhiranofumio
0
290
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
170
Leo the Paperboy
mayatellez
6
1.6k
Are puppies a ranking factor?
jonoalderson
1
3.2k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
240
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
Ethics towards AI in product and experience design
skipperchong
2
250
Into the Great Unknown - MozCon
thekraken
40
2.3k
Tell your own story through comics
letsgokoyo
1
880
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
140
Building the Perfect Custom Keyboard
takai
2
720
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