PHPackages                             simivar/reverse-print-r - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. simivar/reverse-print-r

ActiveLibrary

simivar/reverse-print-r
=======================

Library to reverse print\_r output to PHP objects, arrays and scalar values.

v1.0.1(6y ago)151.1k1[2 issues](https://github.com/simivar/reverse-print-r/issues)MITPHPPHP ^7.1

Since Mar 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/simivar/reverse-print-r)[ Packagist](https://packagist.org/packages/simivar/reverse-print-r)[ RSS](/packages/simivar-reverse-print-r/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Reverse print\_r
================

[](#reverse-print_r)

This library provides six different handlers for reversing output of PHP's `print_r` function back to original variables. If there's no handler available for a type it's returned as `string`.

Assumptions
-----------

[](#assumptions)

- all values should be type-casted, not returned as `string`
- empty string (`""`) is treated as `null` (see `NullHandler`)
- integers are treated as integers (no `boolean` support)
- multi-level `array` MUST be supported with type-casting
- `public`, `protected` and `private` properties of Objects MUST be supported with type-casting

Known issues
------------

[](#known-issues)

- no support for Object Inheritance

Installation
============

[](#installation)

Package is available via [Composer](https://getcomposer.org/).

```
composer require simivar/reverse-print-r

```

Usage
=====

[](#usage)

```
