2017 © Pedro Peláez
 

library dumpling

Like print_r, but depth limited and cyclic reference safe.

image

jacobstr/dumpling

Like print_r, but depth limited and cyclic reference safe.

  • Friday, February 27, 2015
  • by jacobstr
  • Repository
  • 2 Watchers
  • 2 Stars
  • 28,900 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

Dumpling

A small utility for generating variable dumps. PHP's built-in print_r goes haywire when using complex object graphs. It also outputs directly to stdout by default., (*1)

Originally based off the code here: http://ca2.php.net/print_r#78851. Wrapped up and packaged for the composer era., (*2)

Usage

Dumpling, (*3)

>> echo Dumpling::d($cyclical_line_point_object);

Dumpling\Tests\Line Object (
    [points] => Array (
        [0] => Dumpling\Tests\Point Object (
            [x] => 5
            [y] => 10
            [line] => Nested Dumpling\Tests\Line Object
        )
    )
)

>> echo Dumpling::d(array_slice(debug_backtrace(),0,2),2);

Array (
    [0] => Array (
        [function] => should_dump_a_recursive_object_at_depth_2
        [class] => Dumpling\Tests\DumplingTest
        [object] => Nested Dumpling\Tests\DumplingTest Object
        [type] => ->
        [args] => Nested Array
    )
    [1] => Array (
        [file] => /Users/jacob/Work/dumpling/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php
        [line] => 983
        [function] => invokeArgs
        [class] => ReflectionMethod
        [object] => Nested ReflectionMethod Object
        [type] => ->
        [args] => Nested Array
    )
)

Tests

composer install
vendor/bin/phpunit tests/DumplingTest.php

The Versions

27/02 2015

dev-master

9999999-dev

Like print_r, but depth limited and cyclic reference safe.

  Sources   Download

MIT

The Development Requires

by Avatar jacobstr

10/05 2014

v0.0.3

0.0.3.0

Like print_r, but depth limited and cyclic reference safe.

  Sources   Download

MIT

The Development Requires

by Avatar jacobstr

07/04 2014

v0.0.2

0.0.2.0

Like print_r, but depth limited and cyclic dependency safe.

  Sources   Download

MIT

The Development Requires

by Avatar jacobstr