Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Var Dumper Laravel Package

ffi/var-dumper

Adds Symfony VarDumper support for PHP FFI types so dd() and dump() render structs, arrays, pointers, and more in a readable form. Includes “unsafe access” detection for risky pointer reads, with an env flag (VAR_DUMPER_FFI_UNSAFE=1) to fully inspect data.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Debugging & Observability: Enables deeper inspection of FFI (Foreign Function Interface) types in Laravel/PHP applications, improving debugging for C/C++/Rust integrations (e.g., performance-critical extensions, system libraries, or hardware interactions).
  • Roadmap for FFI Adoption: Justifies expanding use of PHP-FFI in the stack (e.g., interfacing with legacy C libraries, high-performance modules, or native extensions) by providing native debugging parity with Symfony’s var_dumper.
  • Build vs. Buy: Avoids reinventing wheel for FFI debugging; leverages existing Symfony ecosystem (MIT-licensed, battle-tested) instead of custom solutions.
  • Use Cases:
    • Debugging memory layouts of C structs/arrays in PHP.
    • Validating pointer safety (e.g., null pointers, dangling references) via VAR_DUMPER_FFI_UNSAFE.
    • Integrating with Laravel Telescope or Sentry for structured error reporting of FFI-related crashes.
    • Supporting hybrid PHP/C++ microservices where FFI bridges are used for interop.

When to Consider This Package

  • Adopt if:
    • Your team uses PHP-FFI for performance-critical integrations (e.g., calling C libraries, hardware APIs, or Rust extensions).
    • Debugging complex FFI types (structs, unions, pointers) is a pain point (e.g., var_dump() shows FFI\CData without context).
    • You need Symfony-level debugging for FFI without coupling to full Symfony framework.
    • Your stack includes Laravel + FFI and you want to align with Symfony’s debugging tools.
  • Look elsewhere if:
    • You don’t use PHP-FFI (this package is FFI-specific).
    • Your debugging needs are simple (e.g., basic dd() for PHP types suffices).
    • You’re constrained by PHP < 8.1 (hard requirement).
    • You need real-time profiling (consider Xdebug + custom FFI breakpoints instead).

How to Pitch It (Stakeholders)

For Executives: "This package lets us debug C/C++ integrations in PHP as easily as we debug native PHP code. For example, if we’re using FFI to call a high-performance library (e.g., for image processing or hardware control), we’ll now see structured dumps of C structs/pointers—just like Symfony’s dd()—instead of cryptic FFI\CData objects. This reduces debugging time for critical integrations by 30–50%, justifying the investment in FFI-based performance optimizations."

For Engineering: *"This is a drop-in replacement for Symfony’s var_dumper but specialized for FFI types. Key benefits:

  • dd($ffiStruct) now shows human-readable C struct layouts (e.g., struct { float x: 3.14 }).
  • Pointer safety checks: Marks unsafe access (e.g., null pointers) and lets you toggle full dumps via env vars.
  • Zero framework lock-in: Works with Laravel, Lumen, or vanilla PHP.
  • Future-proof: Actively maintained (Symfony 7/8 support), MIT-licensed. Use case: If we’re building a Laravel service that interfaces with a C library (e.g., for ML inference or device drivers), this will save hours of manual pointer debugging."*

For Developers: *"Install it with composer require ffi/var-dumper, and suddenly:

$ffiStruct = FFI::new('struct { int id; char* name; }');
dd($ffiStruct); // Shows: struct { id<int>: 42, name<char*>: "Alice" }

No more guessing what’s in your FFI objects—just like var_dump() but for C types. Even handles edge cases like unsafe pointers (toggle with VAR_DUMPER_FFI_UNSAFE=1)."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity