Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Debug interactively PHP BLT #7
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sota Sugiura
May 22, 2017
Technology
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
2k
20220926_セキュリティチームの今_for_Drs._Prime_公開用.pdf
sota1235
0
220
再発防止策を考える技術 / #phpconsen
sota1235
10
4.1k
How to choose the best npm module for your team?
sota1235
9
680
Realtime Database for high traffic production application
sota1235
7
4.3k
Road to migrate JP Web as a microservice
sota1235
4
1.8k
インターフェース再入門 / Think Interface again
sota1235
6
11k
再発防止策を考える技術 #phpconfuk_rej
sota1235
1
1.4k
Update around Firebase #io18
sota1235
3
4.5k
Other Decks in Technology
See All in Technology
ビジネスを止めない技術的負債の返済のための戦略とその手法 - 技術的負債と向き合う / Complexity and Simplicity
soudai
PRO
3
690
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
380
OR学会2026年秋期大会_機械学習と数理最適化の融合による、配合レシピ最適化システム開発事例
brainpadpr
0
130
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
410
今さら理解するウェブフォントver.2026
takanorip
3
660
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
0
190
パッチ更新でterraform initが落ちた日
grimoh
1
120
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
470
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
Getting Started with Google Antigravity
glaforge
0
150
大型犬好きによるPugの紹介
yamanoku
1
120
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
160
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
52k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
770
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
630
Designing for Timeless Needs
cassininazir
1
520
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Site-Speed That Sticks
csswizardry
13
1.6k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
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