home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / PHP.EXE / pear / tests / pear1.phpt < prev    next >
Encoding:
Text File  |  2000-09-09  |  839 b   |  40 lines

  1. --TEST--
  2. PEAR constructor/destructor test
  3. --SKIPIF--
  4. --FILE--
  5. <?php
  6.  
  7. require_once "PEAR.php";
  8.  
  9. class TestPEAR extends PEAR {
  10.     function TestPEAR($name) {
  11.     $this->_debug = true;
  12.     $this->name = $name;
  13.     $this->PEAR();
  14.     }
  15.     function _TestPEAR() {
  16.     print "This is the TestPEAR($this->name) destructor\n";
  17.     $this->_PEAR();
  18.     }
  19. }
  20.  
  21. print "test class TestPEAR\n";
  22. $o = new TestPEAR("test1");
  23. $p = new TestPEAR("test2");
  24. var_dump(get_class($o));
  25. var_dump(get_class($p));
  26.  
  27. ?>
  28. --GET--
  29. --POST--
  30. --EXPECT--
  31. test class TestPEAR
  32. PEAR constructor called, class=testpear
  33. PEAR constructor called, class=testpear
  34. string(8) "testpear"
  35. string(8) "testpear"
  36. This is the TestPEAR(test1) destructor
  37. PEAR destructor called, class=testpear
  38. This is the TestPEAR(test2) destructor
  39. PEAR destructor called, class=testpear
  40.