Download the PHP package eloquent/depict without Composer

On this page you can find all versions of the php package eloquent/depict. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package depict

No longer maintained

This package is no longer maintained. See this statement for more info.

Depict

A fast, recursion-safe, and succinct replacement for var_dump/var_export/print_r.

Current version image Current build status image Current Windows build status image Tested against HHVM Current coverage status image

Installation

Usage

What is Depict?

Depict is a var_dump()/var_export()/print_r() replacement that focuses on performance, succinctness, and recursion safety. In contrast to many of the available libraries providing similar functionality, Depict is designed specifically for command line output (not HTML).

Depict is based on the exporter used by Phony, and is essentially the same code, with the Phony-specific parts removed.

Exporters

Depict currently implements only one exporter, the InlineExporter. More exporters may be implemented in future. Exporters implement a very simple Exporter interface.

InlineExporter

This exporter is designed for single-line output of values. To create an inline exporter, use InlineExporter::create():

InlineExporter::create() can also accept an options array to customize its output:

Available options for InlineExporter::create():

Option Description Default
depth An integer that determines the depth to which Depict will export before truncating output. Negative values are treated as infinite depth. -1
breadth An integer that determines the number of sub-values that Depict will export before truncating output. Negative values are treated as infinite breadth. -1
useShortNames When true, Depict will omit namespace information from exported symbol names. true
useShortPaths When true, Depict will export only the basename of closure paths. false

The export format

Depict generates a concise, unambiguous, human-readable representation of any PHP value, including recursive objects and arrays:

Input value Exporter output
null 'null'
true 'true'
false 'false'
111 '111'
1.11 '1.110000e+0'
'1.11' '"1.11"'
"a\nb" '"a\nb"'
STDIN 'resource#1'
[1, 2] '#0[1, 2]'
['a' => 1, 'b' => 2] '#0["a": 1, "b": 2]
(object) ['a' => 1, 'b' => 2] '#0{a: 1, b: 2}'
new ClassA() 'ClassA#0{}'

Export identifiers and references

Exported arrays, and objects include a numeric identifier that can be used to identify repeated occurrences of the same value. This is represented as a number sign (#) followed by the identifier:

When a value appears multiple times, its internal structure will only be described the first time. Subsequent appearances will be indicated by a reference to the value's identifier. This is represented as an ampersand (&) followed by the identifier:

Export reference types

Array references appear followed by brackets (e.g. &0[]), and object references appear followed by braces (e.g. &0{}):

This is necessary in order to disambiguate references, because arrays and other types can sometimes have the same identifier:

Export reference exclusions

As well as excluding the content, object references exclude the class name, for brevity:

Export identifier persistence

Identifiers for objects are persistent across invocations of an exporter, and share a single sequence of numbers:

But due to PHP's limitations, array identifiers are only persistent within a single exporter invocation:

Exporting recursive values

If a recursive value is exported, the points of recursion are exported as [references], in the same way that multiple instances of the same value are handled:

Exporter special cases

For certain types of values, exporters will exhibit special behavior, in order to improve the usefulness of its output, or to improve performance in common use cases.

Exporting closures

When a closure is exported, the file path and start line number are included in the output:

Note that the class name will always be exported as Closure, even for runtimes such as HHVM that use different class names for closures.

Exporting exceptions

When an exception is exported, some internal PHP details are stripped from the output, including file path, line number, and stack trace:

Additionally, when the message is '', the code is 0, and/or the previous exception is null, these values are excluded for brevity:

Export depth and breadth

For complicated nested structures, exporting the entire structure is not always desirable. Depict can set limits on how much depth and breadth of the supplied value it will export.

When a value is beyond the export depth, and has sub-values, its contents will be replaced with a special notation that simply indicates how many sub-values exist within that value:

When the breadth limit of a value has been reached, a similar notation is used to indicate how many sub-values remain unexported:


All versions of depict with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eloquent/depict contains the following files

Loading the files please wait ....