title: custom var_dump output for my class
body: <p>is it possible to override var_dump output for a custom class?
  I want something like this:</p>
  
  <pre><code>class MyClass{
      public $foo;
      public $bar;
      //pseudo-code
      public function __dump($foo, $bar)
      {
          return 'Foo:$foo, bar:$bar';
      }
  }
  
  var_dump(array($instanceOfMyClass));
  //it should output this:
  array(1) {
    [0] =&gt;
    class MyClass#1 (2) {
      Foo:valueOfFoo, bar:valueOfBar
    }
  }
  </code></pre>
  
  <p>I know I can use some 3rd-party var_dump alternatives, but I want to customize behavior for var_dump in my library project.</p>
  
  <p>Thanks.</p>