Download the PHP package apphp/pretty-print without Composer

On this page you can find all versions of the php package apphp/pretty-print. 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 pretty-print

Pretty Pprint

GitHub stars Last commit License Link Check Coverage

Callable pretty-printer for PHP arrays with Python-like formatting. PrettyPrint is a small, zero-dependency PHP utility that formats arrays in a clean, readable, PyTorch-inspired style. It supports aligned 2D tables, 3D tensors, summarized tensor views, and flexible output options – making it ideal for ML experiments, debugging, logging, and educational projects.

Installation

Usage

Note: When used in web (non-CLI) environments, output is automatically wrapped in <pre> to preserve spacing. In CLI, no wrapping is applied. When you request a string to be returned (see return option), no auto-wrapping is applied.

Import functions

All examples below assume you have imported the helper functions from the Apphp\PrettyPrint namespace, for example:

or simply

Global helper functions

Print scalars/strings

Print 1D arrays

Compare two arrays with a difference matrix

Compare two arrays by printing both matrices (stacked) with colored cells

Label + 2D matrix

2D tensor-style formatting

Custom label instead of "tensor"

2D tensor-style formatting with summarization

3D tensor with head/tail blocks (PyTorch-like)

Select specific rows/columns

Print numeric-only column summaries

Postfix and prefix control

Return the formatted string instead of printing

Print and then exit the script

As an object

Objects with asArray() / toArray()

If you pass an object that exposes an asArray() or toArray() method, pprint / PrettyPrint will automatically convert it to an array before formatting:

If asArray() is not present but toArray() is, toArray() will be used instead.

Associative rows and strings in arrays/tensors

Running tests

Notes:

Benchmark

A CLI benchmark script is available at benchmarks/benchmark.php for measuring matrix build/format time and peak memory usage.

Examples:

Notes:

Options reference

All options can be passed as:

Defaults

Limits

Positional policy:


All versions of pretty-print with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 apphp/pretty-print contains the following files

Loading the files please wait ...