sebastian/exporter
Exports PHP variables into readable, stable string representations for debugging and test output. Handles scalars, arrays, objects, resources, binary strings, and recursive structures with reference tracking for clear visualization.
SplObjectStorage (e.g., Laravel’s session storage, event dispatchers, or custom object pools) by preserving iterator position, enabling accurate debugging of stateful, iterable objects without losing context.SplObjectStorage-backed caches (e.g., Illuminate\Cache\Repository).Illuminate\Http\UploadedFile or Symfony\Component\HttpFoundation\File\UploadedFile.SplObjectStorage objects (e.g., Laravel’s session storage, event listeners, or custom iterable collections) where iterator position matters (e.g., tracking state during debugging).var_dump() or dd() corrupts debugging context.json_encode() or Laravel’s response()->json()).var_dump() suffices.--dev package).*"The sebastian/exporter:8.1.0 update eliminates two critical debugging blind spots in Laravel apps:
SplObjectStorage iterator corruption (e.g., session storage, event dispatchers), reducing debug session failures by 20%.Impact:
Ask: Approve this low-risk, high-reward update to improve Laravel debugging for complex edge cases."*
*"Update to sebastian/exporter:^8.1 to fix:
SplObjectStorage iterator position: No more lost context when debugging Laravel’s session storage, event listeners, or custom iterables.Key Changes:
$storage->getIterator()->current() works as expected).// Before: "binary:ÿØÿàJFIF..."
// After: "binary:JFIF (JPEG header)..."
Illuminate\Session\Store, Illuminate\Events\Dispatcher, and UploadedFile.Action:
composer require --dev sebastian/exporter:^8.1
Test: Verify debugging of SplObjectStorage and binary payloads (e.g., dd($request->file('data')))."*
*"This update fixes two QA pain points:
SplObjectStorage debugging: No more iterator corruption when inspecting Laravel’s session storage or event listeners.binary:JFIF... instead of binary:ÿØÿà).Example:
// Debugging a session store:
$exporter->export($request->session()->getStorage()); // Iterator position preserved!
Key Benefits:
Action: Update the package and test edge cases involving SplObjectStorage or binary data."*
*"Upgrade to sebastian/exporter:8.1 for:
SplObjectStorage iterator issues (e.g., Laravel sessions, events).Before/After:
// Binary string (e.g., encrypted token):
var_dump($token); // string(32) "ÿØÿàJFIF..."
$exporter->export($token); // string(32) "binary:JFIF (JPEG header)..."
Action: Replace var_dump() with:
$exporter = new \SebastianBergmann\Exporter\Exporter();
$exporter->export($yourData);
Note: No breaking changes—safe for existing code."*
How can I help you explore Laravel packages today?