<?php class x { public function __toString() { return 'test'; } } $x = new x; echo json_encode($x);
You have javascript disabled. You will not be able to edit any code.