PHP class inheritance bug?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I can't explain it better than to show you my thread

Environments: PHP 4.1.2 and 4.3.2


I have a script ../ which serves as a "JAR" file of PHP
classes that pertain to the entire application at application-level
scope.  The script consists of about 25 different classes, of which
any class that extends OptionsView fails and produces this error:

Fatal error: Class fooview: Cannot inherit from undefined class
optionsview in /classes/ in line 2836

Here is code that consists of line 2836:


class AlbumOptionsView extends PaginationView {    // THIS ONE IS JUST


class FooView extends OptionsView {      // BOMBS THIS IS LINE 2836


class OptionsView extends PaginationView {


class BlahView extends OptionsView {   // THIS ONE IS JUST FINE


class Blah2View extends PaginationView { // THIS ONE IS FINE TOO!


class PaginationView extends View {


However, if any class exists *physically placed after* OptionsView in
the script, and it extends OptionsView, everything is ok.

NOTE: This does not occur with any other class.  If any class extends
any other class in the same script, no matter where it's placed,
everything is just fine.

I went so far as to literally strip out all code from OptionsView - to
no avail, same error.

Re: PHP class inheritance bug?

Phil Powell wrote:

Quoted text here. Click to load it

Define OptionsView *before* FooView.

Site Timeline