zendframework/zend-debug
zend-debug provides debugging utilities for Zend Framework apps, including variable dumping, debug messages, and helpers to inspect execution during development. Useful for troubleshooting and profiling in legacy ZF-based projects.
zend-debug package is a relic from Zend Framework 1 (ZF1), designed for debugging PHP applications in a pre-Laravel, pre-composer era. Laravel’s ecosystem (Laravel Debugbar, Tideways, Laravel Telescope, Xdebug) has evolved significantly since 2018, offering deeper integration with Laravel’s service container, middleware stack, and event system.Debugbar hooks into HTTP lifecycle).zend-debug relies on manual output buffering and template overrides, which conflict with Laravel’s abstraction layers (e.g., Blade, Facades, Service Providers).zend-debug into Laravel, a TPM would need to:
Illuminate\Foundation\Application, Illuminate\Http\Request) to intercept output and inject debug data. This violates Laravel’s conventions and risks breaking updates.@debug, @dump) to route output through zend-debug's Debug::dump().zend-debug's Debug::dumpSql().composer.json and PSR-4 autoloading, requiring manual classmap generation or hacky autoload.php includes.zend-debug's reflection-based introspection.Zend_Loader, Zend_Log) could expose the app to CVEs.zend-debug's output buffering and template parsing add latency, unlike Laravel Debugbar’s lazy-loading approach.Why Reject Modern Alternatives?
zend-debug (e.g., memory profiling, legacy ZF1 integration) are unavailable in Laravel Debugbar/Telescope?zend-debug’s output to tools like Xdebug + IDE debugging or Laravel Telescope?Legacy Constraints
zend-debug the only viable option, or could a custom debug middleware be built on top of Zend_Debug?Zend_Amf, Zend_Soap) that require zend-debug for inspection?Migration Path
zend-debug be gradually replaced by a wrapper layer (e.g., a ZendDebugAdapter for Laravel Debugbar)?Licensing/Compliance
zend-debug is designed for:
Response or StreamedResponse).zend-debug in a separate micro-service (e.g., a /debug route with its own bootstrap) to avoid polluting the Laravel app.zend-debug-powered endpoint (high latency).zend-debug usage in legacy code (e.g., Debug::dump(), Debug::enable()).Debugbar for variables, Telescope for queries).zend-debug via composer.json with a custom autoload block:
"autoload": {
"psr-4": { "App\\": "app/" },
"classmap": ["vendor/zendframework/zend-debug/library/"]
}
Zend_Debug in Laravel’s container:
public function register() {
$this->app->singleton('zend-debug', function () {
return new \Zend_Debug();
});
}
AppServiceProvider to hook into zend-debug:
public function boot() {
if ($this->app->environment('local')) {
\Zend_Debug::enable();
// Override Blade @debug directive
\Blade::directive('debug', function () {
return "<?php \Zend_Debug::dump(";
});
}
}
Debug::dump() with dd() or Debugbar::info().DB::enableQueryLog() + Debugbar::addTiming().HandleIncomingRequest).monolog/monolog (both may try to write to PHP_ERROR_LOG).laravel/debugbar (duplicate JavaScript/CSS assets).zend-debug in development-only mode via a feature flag.Debug::dump() functionality.zend-debug usage with Laravel-native tools.zend-debug pulls in Zend_Loader, Zend_Log, etc., which may conflict with Laravel’s illuminate/log.Zend_Log uses PHP_ERROR_LOG by default, while Laravel uses Monolog.zend-debug fails, there’s no Laravel-native way to inspect its internals (e.g., no Telescope integration).zend-debug throws Zend_Debug_Exception for errors, which Laravel’s error handler may not recognize.zend-debug calls in try-catch blocks.zend-debug.zend-debug's output buffering adds ~10–50ms per request in development (measured in legacy ZF1 apps).if (app()->environment('local'))).How can I help you explore Laravel packages today?