Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.41 KB

File metadata and controls

33 lines (25 loc) · 1.41 KB

phpeek

A live terminal view of how PHP runs a script (opcodes, source, variables, memory, call stack, zend_execute_data), stepped under phpdbg.

Layout

  • phpeek — the whole tool. One self-contained bash script; all logic lives here.
  • examples/simple.php, loop.php, classes.php.
  • README.md, demo.gif, demo.tape (VHS source), LICENSE.

Run & test

phpeek                      # dashboard — lists examples/ to pick from
phpeek <script.php>         # dashboard on a script
phpeek watch <script.php>   # jump straight into the live stepper
phpeek check                # report each dependency + how to fix it
  • Finds php/phpdbg on PATH or a php-src build tree; override with --php= / --phpdbg= or $PHPEEK_PHP / $PHPEEK_PHPDBG.
  • bash -n phpeek to syntax-check — but on macOS use the container's bash, since the host's bash 3.2 wrongly rejects bash-4 syntax (coproc).
  • The watch UI needs a real TTY; a plain pipe can't drive it. To exercise it in tests, run it in a tmux pane and use tmux send-keys / capture-pane.

Conventions

  • One bash file. bash 4+ required (macOS ships 3.2, which lacks coproc/mapfile).
  • Keep it portable across Linux + macOS: prefer POSIX-ish tooling, a literal ESC=$(printf '\033') for ANSI (BSD sed has no \x1b), and narrow ASCII only in the UI (>, ...) — ambiguous-width glyphs break the column math.