php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #26493 documentation example causes error
Submitted: 2003-12-01 15:19 UTC Modified: 2003-12-02 04:20 UTC
From: patterson at computer dot org Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.0.0b2 (beta2) OS: RH Linux 9.0
Private report: No CVE-ID: None
 [2003-12-01 15:19 UTC] patterson at computer dot org
Description:
------------
I tried to execute the example for interfaces in PHP 5.0.0b (beta 2) and got this result:

Fatal error: Cannot redeclare class exception in /home/billy/public_html/php5/interface.php on line 6

When I changed the word "Exception" to "Exception1" the code ran without a problem.

Probably the example needs to be changed, but I am not sure.

Bill Patterson

Reproduce code:
---------------
<?php
interface Throwable {
   public function getMessage();
}

class Exception implements Throwable {
   public function getMessage() {
       // ...
   }
}
?>


Expected result:
----------------
expect a blank page

Actual result:
--------------
Fatal error: Cannot redeclare class exception in /home/billy/public_html/php5/interface.php on line 6

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-02 04:20 UTC] didou@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The problem was on http://www.php.net/zend-engine-2.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 13 15:00:01 2025 UTC