
No magic you can't step through.
Generated code shouldn't mean hidden behavior. The framework produces readable PHP you can inspect, diff, debug and step through with your usual tools.
Nothing hidden between your code and PHP
What runs is plain PHP you can read, step through and ask questions about.
Readable woven code
Your class becomes a trait and a small proxy with your class name: ordinary PHP files you can open and read top to bottom.
Follow one classDebug it like your own
In debug mode breakpoints fire in your original file, the stack keeps your class name, and you can step into the behavior.
Step through itAsk the weaver
Console commands list every behavior class, show which methods each one reaches, and weave the cache ahead of time.
See the commands
Your class, and what actually runs
One report service with a caching behavior, and the two files the framework writes for it. These are the real files from the session you can step through below.
Your source
A caching behavior is attached with #[Cacheable]. This is the file you open, read and set breakpoints in.
<?php
declare(strict_types=1);
namespace App\Report;
use App\Attribute\Cacheable;
class ReportService
{
public function __construct(private OrderRepository $orders) {}
#[Cacheable(ttl: 300)]
caching behavior attached
public function monthlyRevenue(string $month): int
{
$total = 0;
a breakpoint here fires
foreach ($this->orders->forMonth($month) as $order) {
$total += $order->cents;
}
return $total;
}
}
Woven source
Your class body as a trait. Only the declaration line changes, so every line number stays. In debug mode PHP loads it under your original path, so the debugger stops in src/Report/ReportService.php.
<?php
declare(strict_types=1);
namespace App\Report;
use App\Attribute\Cacheable;
trait ReportServiceOriginalTrait
was: class ReportService
{
public function __construct(private OrderRepository $orders) {}
#[Cacheable(ttl: 300)]
public function monthlyRevenue(string $month): int
{
$total = 0;
foreach ($this->orders->forMonth($month) as $order) {
$total += $order->cents;
}
return $total;
}
}
include_once AOP_CACHE_DIR . '/Report/ReportService.php';
Proxy class
The class PHP loads, with your class name, so stack traces name ReportService. The middleware is one readable method: build the joinpoint once, then run it.
<?php
declare(strict_types=1);
namespace App\Report;
use Go\Aop\Framework\InterceptorInjector;
use Go\Aop\Framework\Interceptor;
use Go\Aop\Framework\The;
use App\Aspect\CachingAspect;
use Go\Aop\Intercept\DynamicMethodInvocation;
use App\Attribute\Cacheable as Cacheable;
class ReportService implements \Go\Aop\Proxy
your class name
{
use ReportServiceOriginalTrait {
your class body
ReportServiceOriginalTrait::monthlyRevenue as private monthlyRevenueOriginalAlias;
}
#[\App\Attribute\Cacheable(ttl: 300)]
public function monthlyRevenue(string $month): int
{
/** @var DynamicMethodInvocation<self, int> $__joinPoint */
static $__joinPoint = InterceptorInjector::forMethod(
built once, on the first call
self::class,
'monthlyRevenue',
[
Interceptor::around(The::aspect(CachingAspect::class)->cache(...)),
Ctrl-click opens CachingAspect::cache()
],
$this->monthlyRevenueOriginalAlias(...),
your original method
);
return $__joinPoint->__invoke($this, [$month]);
runs the middleware
}
}
Debug it like code you wrote
A real debugging session of the same class, recorded and replayed in your browser. Step into the call, set breakpoints in the gutter, open any frame. The guide says what happens at each step.
Frames
Variables
Console timed under the debugger
Ask the weaver what it did
The console that ships with the framework answers questions about your kernel: which behavior classes it has and what each one reaches. It also weaves the cache ahead of time. Scroll through the commands; the terminal shows their real output for the app above.
Run the app
php bin/report.phpThe same app, without the debugger. The first call runs the slow query; the second comes from the caching behavior in a hundredth of a millisecond.
List the behavior classes
vendor/bin/aspect debug:aspect bootstrap.phpEvery behavior class (an aspect, in the API) your kernel registers, the file it is defined in, and the advisors it declares. The loader file only boots the kernel; it must not handle a request.
List the advisors
vendor/bin/aspect debug:advisor bootstrap.phpEach advisor with its pointcut. Here there is one:
cache(), for every method marked#[Cacheable].See what an advisor reaches
vendor/bin/aspect debug:advisor bootstrap.php --advisor='App\Aspect\CachingAspect->cache'Analyzes every file below the include paths and lists the members the advisor matches:
monthlyRevenue(), and nothing else.Weave ahead of time
vendor/bin/aspect cache:warmup:aop bootstrap.phpWeaves every file at deploy time, so production serves the prebuilt cache. It fails when a file can’t be woven;
--workers=8weaves in parallel.
2026-10: 21199 cents in 156.16 ms 2026-10: 21199 cents in 0.01 ms
Aspect debug information ======================== App\AppKernel has following enabled aspects: App\Aspect\CachingAspect ------------------------ Defined in: /app/src/Aspect/CachingAspect.php Pointcuts and advices --------- --------------------------------- Type Identifier --------- --------------------------------- Advisor App\Aspect\CachingAspect->cache --------- ---------------------------------
Advisor debug information ========================= List of registered advisors in the container --------------------------------- ------------------------------------- Id Expression --------------------------------- ------------------------------------- App\Aspect\CachingAspect->cache @execution(App\Attribute\Cacheable) --------------------------------- ------------------------------------- If you want to query an information about concrete advisor, then just query it by adding --advisor="Advisor\Name" to the command
Advisor debug information ========================= Total 6 files to analyze. -> matching method App\Report\ReportService->monthlyRevenue
Total 6 files to process. [DONE]: Total processed 6, 0 errors in 5 ms.
Build behaviors. Keep everything debuggable.
Most frameworks ask you to trust the magic. Here you can open, inspect and step through every line that runs.
Everything else in the box
- Pure PHPNo extensions. No black boxes. Just PHP.
- Intercept anythingNo method is off limits.
- Property hooksIntercept every property read and write.
- PerformanceZero cost without behaviors, under 1 µs with them.
- Pointcut languageSelect exactly the code you mean, and try it live.
- Class extensionsNew interfaces and traits for existing classes.
- Works with your stackSymfony, Laravel, Yii3 and your AI coding agent.