[phpa] Obscure bugs

  • From: Nick Lindridge <nick@xxxxxxxxxxxxxxxxx>
  • To: phpa@xxxxxxxxxxxxx
  • Date: Fri, 2 Nov 2001 01:37:01 +0000

Hi,

I've tracked down a few obscure bugs that emerged in the current release,
and these will be fixed in release 1.2

The main one is that a derived class with no constructor fails to
correctly inherit the constructor from its base class in some cases. 
It actually does inherit it but with the wrong name, and this generates 
the warnings about failing to add a method. 

This is because it's adding the base class constructor twice with the same 
name, rather than once with its real name and then with an alias of the 
derived classes name.

A workaround is to make either or both of the base and derived classes
conditionally compiled, e.g.

if (1) {
  class A
  {
      function A()
      {
         echo 'A::A()<br>';
      }
  }

  class B extends A
  {
      function x()
      {
      }
  }
}

$b = new B();

will work, but without the if (1) { ... } the example will fail.

Nick

------------------------------------------------------------------------
  www.php-accelerator.co.uk           Home of the free PHP Accelerator

To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe


Other related posts: