PHPackages                             friendsofhyperf/tinker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. friendsofhyperf/tinker

ActiveLibrary[CLI &amp; Console](/categories/cli)

friendsofhyperf/tinker
======================

The Powerful REPL for Hyperf.

v3.2.1(3w ago)7146.4k↓20.4%4MITPHP

Since May 21Pushed 1w ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/tinker)[ Packagist](https://packagist.org/packages/friendsofhyperf/tinker)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-tinker/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (18)Versions (115)Used By (4)

Tinker
======

[](#tinker)

[中文说明](README_CN.md)

[![Latest Stable Version](https://camo.githubusercontent.com/4bfa04a2480fddc625f52e073dace9f8ec03adba69f7ed54a08b46f11075303d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667269656e64736f666879706572662f74696e6b6572)](https://packagist.org/packages/friendsofhyperf/tinker)[![Total Downloads](https://camo.githubusercontent.com/8b5493d879c03eb8a9f6caba9324ff4784df6a68d971311212e965aa2e6e927d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667269656e64736f666879706572662f74696e6b6572)](https://packagist.org/packages/friendsofhyperf/tinker)[![License](https://camo.githubusercontent.com/8e6b141134cfdcc998a3704e6d520ff6384dd1c260e3265b9565994d3064863c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f667269656e64736f666879706572662f74696e6b6572)](https://github.com/friendsofhyperf/tinker)

The Powerful REPL for Hyperf.

Installation
------------

[](#installation)

```
composer require friendsofhyperf/tinker
```

Publish Config
--------------

[](#publish-config)

```
php bin/hyperf.php vendor:publish friendsofhyperf/tinker
```

Usage
-----

[](#usage)

```
php bin/hyperf.php tinker
```

Commands
--------

[](#commands)

- Run command

```
Psy Shell v0.10.4 (PHP 7.3.11 — cli)
>>> $a=1
=> 1
>>> $a
=> 1
>>> define('VERSION', 'v1.0.1')
=> true
>>> VERSION
=> "v1.0.1"
>>>
```

- The help command

```
>>> help
  help             Show a list of commands. Type `help [foo]` for information about [foo].      Aliases: ?
  ls               List local, instance or class variables, methods and constants.              Aliases: dir
  dump             Dump an object or primitive.
  doc              Read the documentation for an object, class, constant, method or property.   Aliases: rtfm, man
  show             Show the code for an object, class, constant, method or property.
  wtf              Show the backtrace of the most recent exception.                             Aliases: last-exception, wtf?
  whereami         Show where you are in the code.
  throw-up         Throw an exception or error out of the Psy Shell.
  timeit           Profiles with a timer.
  trace            Show the current call stack.
  buffer           Show (or clear) the contents of the code input buffer.                       Aliases: buf
  clear            Clear the Psy Shell screen.
  edit             Open an external editor. Afterwards, get produced code in input buffer.
  sudo             Evaluate PHP code, bypassing visibility restrictions.
  history          Show the Psy Shell history.                                                  Aliases: hist
  exit             End the current session and return to caller.                                Aliases: quit, q
  clear-compiled   Remove the compiled class file
  down             Put the application into maintenance mode
  env              Display the current framework environment
  optimize         Cache the framework bootstrap files
  up               Bring the application out of maintenance mode
  migrate          Run the database migrations
  inspire          Display an inspiring quote
```

- Get the ENV

```
Psy Shell v0.10.4 (PHP 7.2.34 — cli)
>>> env("APP_NAME")
=> "skeleton"
>>>
```

- Query the database

```
➜  t.hyperf.com git:(master) ✗ php bin/hyperf.php tinker
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Config\Listener\RegisterPropertyHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Paginator\Listener\PageResolverListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ExceptionHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\DbConnection\Listener\RegisterConnectionResolverListener listener.
Psy Shell v0.10.4 (PHP 7.2.34 — cli) by Justin Hileman
Unable to check for updates
>>> $user = App\Model\User::find(1)
[DEBUG] Event Hyperf\Database\Model\Events\Booting handled by Hyperf\ModelListener\Listener\ModelHookEventListener listener.
[DEBUG] Event Hyperf\Database\Model\Events\Booting handled by Hyperf\ModelListener\Listener\ModelEventListener listener.
[DEBUG] Event Hyperf\Database\Model\Events\Booted handled by Hyperf\ModelListener\Listener\ModelHookEventListener listener.
[DEBUG] Event Hyperf\Database\Model\Events\Booted handled by Hyperf\ModelListener\Listener\ModelEventListener listener.
[DEBUG] Event Hyperf\Database\Events\QueryExecuted handled by App\Listener\DbQueryExecutedListener listener.
[DEBUG] Event Hyperf\Database\Model\Events\Retrieved handled by Hyperf\ModelListener\Listener\ModelHookEventListener listener.
[DEBUG] Event Hyperf\Database\Model\Events\Retrieved handled by Hyperf\ModelListener\Listener\ModelEventListener listener.
=> App\Model\User {#81816
     +incrementing: true,
     +exists: true,
     +wasRecentlyCreated: false,
     +timestamps: true,
   }
>>> var_dump($user)
object(App\Model\User)#81816 (28) {
  ["table":protected]=>
  string(5) "users"
  ["fillable":protected]=>
  array(2) {
    [0]=>
    string(2) "id"
    [1]=>
    string(4) "name"
  }
  ["casts":protected]=>
  array(0) {
  }
  ["incrementing"]=>
  bool(true)
  ["exists"]=>
  bool(true)

  ["attributes":protected]=>
  array(4) {
    ["id"]=>
    int(1)
    ["name"]=>
    string(5) "arvin"
    ["created_at"]=>
    string(19) "2020-11-23 18:38:00"
    ["updated_at"]=>
    string(19) "2020-11-23 18:38:03"
  }
  ["original":protected]=>
  array(4) {
    ["id"]=>
    int(1)
    ["name"]=>
    string(5) "arvin"
    ["created_at"]=>
    string(19) "2020-11-23 18:38:00"
    ["updated_at"]=>
    string(19) "2020-11-23 18:38:03"
  }

}
=> null
```

- Show doc

```
>>> doc md5
function md5($str, $raw_output = unknown)

PHP manual not found
    To document core PHP functionality, download the PHP reference manual:
    https://github.com/bobthecow/psysh/wiki/PHP-manual
>>>
```

- Show class

```
>>> show App\Model\User
 7: /**
 8:  */
 9: class User extends Model
10: {
11:     /**
12:      * The table associated with the model.
13:      *
14:      * @var string
15:      */
16:     protected $table = 'users';
17:     /**
18:      * The attributes that are mass assignable.
19:      *
20:      * @var array
21:      */
22:     protected $fillable = ['id','name'];
23:     /**
24:      * The attributes that should be cast to native types.
25:      *
26:      * @var array
27:      */
28:     protected $casts = [];
29: }

>>>
```

Contact
-------

[](#contact)

- [Twitter](https://twitter.com/huangdijia)
- [Gmail](mailto:huangdijia@gmail.com)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance97

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~52 days

Total

114

Last Release

9d ago

Major Versions

v2.0.9 → v3.0.0-beta52022-05-24

v2.0.10 → v3.0.0-beta252022-06-24

v2.0.19 → v3.0.0-rc.162022-09-21

v2.0.24 → v3.0.0-rc.462022-12-14

v2.0.28 → v3.0.62023-01-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8337659?v=4)[Deeka Wong](/maintainers/huangdijia)[@huangdijia](https://github.com/huangdijia)

---

Top Contributors

[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (84 commits)")[![tw2066](https://avatars.githubusercontent.com/u/24579418?v=4)](https://github.com/tw2066 "tw2066 (1 commits)")

---

Tags

phpTinkerswoolehyperfv3.2

### Embed Badge

![Health badge](/badges/friendsofhyperf-tinker/health.svg)

```
[![Health](https://phpackages.com/badges/friendsofhyperf-tinker/health.svg)](https://phpackages.com/packages/friendsofhyperf-tinker)
```

###  Alternatives

[hyperf/database

A flexible database library.

192.9M322](/packages/hyperf-database)[hyperf/http-server

A HTTP Server for Hyperf.

103.0M372](/packages/hyperf-http-server)[hyperf/crontab

A crontab component for Hyperf.

131.7M77](/packages/hyperf-crontab)[hyperf/database-pgsql

A pgsql handler for hyperf/database.

12321.2k22](/packages/hyperf-database-pgsql)[hyperf/validation

hyperf validation

122.2M199](/packages/hyperf-validation)[hyperf/watcher

Hot reload watcher for Hyperf

17904.9k31](/packages/hyperf-watcher)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
