- var_dump: documentation ( source)
- json_encode: documentation ( source)
- escapeshellarg: documentation ( source)
<?php
$obj = new StdClass();
$obj->foo = "foo";
$objects = array();
for ($i = 0; $i < 5; $i++) {
$objects[] = clone $obj;
}
$string = json_encode($objects);
var_dump(array($string, escapeshellarg($string)));