PsySH is a PHP runtime development platform, interactive debugger and Read-Eval-Print Loop (REPL). To put it simply, it's just like you use firebug's console to debug your JavaScript code. Next, the editor will introduce PsySH to you.
Official website
https://psysh.org/
Github address
https://github .com/bobthecow/...
Install
Use wget to install
$ wget https://git.io/psysh $ chmod +x psysh $ ./psysh
Use composer to install
$ composer g require psy/psysh:@stable $ psysh
Command
wtf Print Recent error prompts
history Display execution command
clear Clear command
doc Display function usage document
dump Print variable
ls Display variables
show Display function constants Class methods
When using the doc command, you need to install the file locally
PsySH documentation is stored in ~/.local/share/psysh/ . (The windows system is stored in C:\Users\{username}\AppData\Roaming\PsySH\)
$ cd ~/.local/share $ mkdir psysh $ cd psydh $ wget http://psysh.org/manual/zh/php_manual.sqlite
Configuration
Osx ~/.config/psysh/config.php (or C :\Users\{USER}\AppData\Roaming\PsySH\config.php on Windows).
<?php return [ 'commands' => [ new \Psy\Command\ParseCommand, ], 'defaultIncludes' => [ __DIR__ . '/include/bootstrap.php', //这里可以加载自己平时常用的类库 ], 'startupMessage' => sprintf('<info>%s</info>', shell_exec('uptime')), ];
<img src='https://gitee.com/smallsha/upic/raw/master/uPic/下载 (2).png' alt='下载(2)' style="max-width:90%" />
Recommended learning: php video tutorial
The above is the detailed content of How to use psysh debugging code snippet tool for PHP. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools
