Posted By

martin_rusev on 06/29/09


Tagged

class return


Versions (?)

Class returning boolean value


 / Published in: PHP
 

  1. class Test
  2. {
  3.  
  4. public $result;
  5.  
  6. function __construct()
  7. {
  8.  
  9.  
  10.  
  11. $this->result = TRUE;
  12.  
  13.  
  14.  
  15. }
  16.  
  17. public function __toString()
  18. {
  19.  
  20. return (string)$this->result;
  21.  
  22. }
  23. }
  24.  
  25. $test = new Test();
  26. var_dump($test->result);

Report this snippet  

You need to login to post a comment.