|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28641 Instance of Interface
Submitted: 2004-06-05 11:25 UTC Modified: 2004-06-05 17:00 UTC
From: clemens at gutweiler dot net Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.0.0RC2 OS: Linux 2.6.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: clemens at gutweiler dot net
New email:
PHP Version: OS:


 [2004-06-05 11:25 UTC] clemens at gutweiler dot net
Its possible to create an instance of an interface
PHP Version: 5.0.0RC3RC2

Reproduce code:
	class foo {
		public $member = 'value';
	session_start( );
	$_SESSION['foo'] = new foo;
<a href="php5-2.php">next</a>

	interface foo {
	function __autoload( $name ) {
		var_dump( '__autoload(): '.$name );
	session_start( );
	var_dump( $_SESSION );

Expected result:
the following should occur:
- call __autoload()
- if class foo isnt available: display error: Cannot instantiate interface foo at sesstion_start() or something

Actual result:
array(1) {
  object(foo)#1 (1) {
    string(5) "value"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-05 17:00 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC