PHPackages                             sk/object-to-string - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sk/object-to-string

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sk/object-to-string
===================

\_\_toString on steroids.

v1.0.0(9y ago)027MITPHPPHP &gt;=5.5.9

Since Nov 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/skroczek/object-to-string)[ Packagist](https://packagist.org/packages/sk/object-to-string)[ RSS](/packages/sk-object-to-string/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Object To String
================

[](#object-to-string)

[![Build Status](https://camo.githubusercontent.com/aafdc38ff84d235d93a8fa9c7057585550961a6d2042a46691f88c65519dacd4/68747470733a2f2f7472617669732d63692e6f72672f736b726f637a656b2f6f626a6563742d746f2d737472696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/skroczek/object-to-string) [![SensioLabsInsight](https://camo.githubusercontent.com/603dc2fdc75a2f467775d66c7bf660be3a69c0976b0518b42f3a4be1059a04bb/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39313664383433332d363838382d343932342d613436382d3432373661626232303438642f6d696e692e706e67)](https://insight.sensiolabs.com/projects/916d8433-6888-4924-a468-4276abb2048d) [![Coverage Status](https://camo.githubusercontent.com/2a434afef8e36c41620b3a42e921fc40e72c6485858feab5ff287f7eef349e45/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736b726f637a656b2f6f626a6563742d746f2d737472696e672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/skroczek/object-to-string?branch=master)

Just like the php \_\_toString() method, but with the power of the [symfony expression language](http://symfony.com/doc/current/components/expression_language.html).

Installation
------------

[](#installation)

### Download the Library

[](#download-the-library)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require sk/object-to-string "dev-master"
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Usage
-----

[](#usage)

Before you can use the power of this library you have to initialize it. Depending on your needs, activate the driver you want. Here is a full example with all available driver:

```
