<?php
  error_reporting(E_ALL);
  require('C.class.php');
  /*
  class C {
    function __construct($arg) {
      echo "__construct($arg)\n";
    }
    
    function __destruct() {
      echo "__destruct()\n";
    }
  }
  */
  
  class D extends C {
    function __construct($arg) {
      echo "D::__construct($arg)\n";
      parent::__construct($arg."+");
    }
    
    function func($str) {
      echo "D::func($str)\n";
      parent::func($str."+");
    }
  }
  
  class E extends D {
  
  }
  
  class F extends E {
  
  }
  
  // In unpatched ZE2, D::__construct and D::func will be called once for each
  // child class of D - of course, it should only be called once
  foreach (range('C', 'F') as $name) {
    echo str_repeat('-', 72)."\n";
    $obj= new $name($name);
    $obj->func('string');
    var_dump($obj, get_parent_class($obj));
    delete $obj;
  }
?>
