Professional Web Applications Themes

#39758 [NEW]: Error message on extending a class that implements a interface - PHP Bugs

From: bacher at bash-it dot de Operating system: Linux Ubuntu 6.0 PHP version: 5.2.0 PHP Bug Type: Class/Object related Bug description: Error message on extending a class that implements a interface Description: ------------ If one tries to extend a class that implements a Interface, php5 produces a error message: Fatal error: Class 'Bar' not found in foo.php on line xx I use the CLI Version of php. PHP 5.1.2 (cli) (built: Nov 2 2006 12:29:42) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Reproduce code: --------------- <?php class Bar extends Foo { } interface ...

  1. #1

    Default #39758 [NEW]: Error message on extending a class that implements a interface

    From: bacher at bash-it dot de
    Operating system: Linux Ubuntu 6.0
    PHP version: 5.2.0
    PHP Bug Type: Class/Object related
    Bug description: Error message on extending a class that implements a interface

    Description:
    ------------
    If one tries to extend a class that implements a Interface, php5 produces
    a error message:
    Fatal error: Class 'Bar' not found in foo.php on line xx

    I use the CLI Version of php.
    PHP 5.1.2 (cli) (built: Nov 2 2006 12:29:42)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies



    Reproduce code:
    ---------------
    <?php
    class Bar extends Foo {
    }
    interface i {
    }
    class Foo implements i {
    }
    ?>


    Expected result:
    ----------------
    started on the commandline with the command:
    php5 foo.php it should return simply nothing. But it throws an error.
    if you just extend the class after you defined it it does not throw the
    error:
    <?php
    interface i {
    }
    class Foo implements i {
    }
    class Bar extends Foo {
    }
    ?>
    Since this behaviour is not reproducable with a missing Interface, i think
    this is a Error on Interfaces.

    Actual result:
    --------------
    The error message
    Fatal error: Class 'Bar' not found in foo.php on line xx

    --
    Edit bug report at [url]http://bugs.php.net/?id=39758&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39758&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39758&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39758&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39758&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=39758&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=39758&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39758&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=39758&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=39758&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=39758&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=39758&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=39758&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=39758&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39758&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=39758&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=39758&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39758&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=39758&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39758&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39758&r=mysqlcfg[/url]
    bacher at bash-it dot de Guest

  2. #2

    Default #39758 [Opn->Asn]: Error message on extending a class that implements a interface

    ID: 39758
    Updated by: [email]tony2001php.net[/email]
    Reported By: bacher at bash-it dot de
    -Status: Open
    +Status: Assigned
    Bug Type: Class/Object related
    Operating System: Linux Ubuntu 6.0
    PHP Version: 5.2.0
    -Assigned To:
    +Assigned To: dmitry


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-06 16:34:35] bacher at bash-it dot de

    Sorry, just while reading. The error Message is not:
    Fatal error: Class 'Bar' not found in foo.php on line xx

    but
    Fatal error: Class 'Foo' not found in foo.php on line xx

    sorry for that. i hope you can reproduce it.

    ------------------------------------------------------------------------

    [2006-12-06 16:31:45] bacher at bash-it dot de

    Description:
    ------------
    If one tries to extend a class that implements a Interface, php5
    produces a error message:
    Fatal error: Class 'Bar' not found in foo.php on line xx

    I use the CLI Version of php.
    PHP 5.1.2 (cli) (built: Nov 2 2006 12:29:42)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies



    Reproduce code:
    ---------------
    <?php
    class Bar extends Foo {
    }
    interface i {
    }
    class Foo implements i {
    }
    ?>


    Expected result:
    ----------------
    started on the commandline with the command:
    php5 foo.php it should return simply nothing. But it throws an error.
    if you just extend the class after you defined it it does not throw the
    error:
    <?php
    interface i {
    }
    class Foo implements i {
    }
    class Bar extends Foo {
    }
    ?>
    Since this behaviour is not reproducable with a missing Interface, i
    think this is a Error on Interfaces.

    Actual result:
    --------------
    The error message
    Fatal error: Class 'Bar' not found in foo.php on line xx


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39758&edit=1[/url]
    tony2001@php.net Guest

  3. #3

    Default #39758 [Asn->WFx]: Error message on extending a class that implements a interface

    ID: 39758
    Updated by: [email]dmitryphp.net[/email]
    Reported By: bacher at bash-it dot de
    -Status: Assigned
    +Status: Wont fix
    Bug Type: Class/Object related
    Operating System: Linux Ubuntu 6.0
    PHP Version: 5.2.0
    Assigned To: dmitry
    New Comment:

    This is not a bug.
    PHP always declares classes those implement interfaces at run-time. So
    in your example you cannot declare "Bar" because "Foo" is not declared
    yet.
    Your report may be categorised as "feature request", but it cannot be
    fixed in 5.2.* anyway, because of binary compatibility.


    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-06 16:34:35] bacher at bash-it dot de

    Sorry, just while reading. The error Message is not:
    Fatal error: Class 'Bar' not found in foo.php on line xx

    but
    Fatal error: Class 'Foo' not found in foo.php on line xx

    sorry for that. i hope you can reproduce it.

    ------------------------------------------------------------------------

    [2006-12-06 16:31:45] bacher at bash-it dot de

    Description:
    ------------
    If one tries to extend a class that implements a Interface, php5
    produces a error message:
    Fatal error: Class 'Bar' not found in foo.php on line xx

    I use the CLI Version of php.
    PHP 5.1.2 (cli) (built: Nov 2 2006 12:29:42)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies



    Reproduce code:
    ---------------
    <?php
    class Bar extends Foo {
    }
    interface i {
    }
    class Foo implements i {
    }
    ?>


    Expected result:
    ----------------
    started on the commandline with the command:
    php5 foo.php it should return simply nothing. But it throws an error.
    if you just extend the class after you defined it it does not throw the
    error:
    <?php
    interface i {
    }
    class Foo implements i {
    }
    class Bar extends Foo {
    }
    ?>
    Since this behaviour is not reproducable with a missing Interface, i
    think this is a Error on Interfaces.

    Actual result:
    --------------
    The error message
    Fatal error: Class 'Bar' not found in foo.php on line xx


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39758&edit=1[/url]
    dmitry@php.net Guest

Similar Threads

  1. Replies: 0
    Last Post: December 6th, 04:34 PM
  2. Replies: 1
    Last Post: November 11th, 12:00 AM
  3. Replies: 2
    Last Post: June 2nd, 07:40 AM
  4. Replies: 0
    Last Post: April 1st, 11:12 PM
  5. error message for Shell class
    By s moon in forum Ruby
    Replies: 2
    Last Post: August 1st, 02:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139