PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #37753 Classes implementing interfaces may not be initiated before declaration
Submitted:8 Jun 2006 9:20pm UTC Modified: 8 Jun 2006 9:26pm UTC
From:rollercoaster397 at gmail dot com Assigned to:
Status:Bogus Category:Class/Object related
Version:5.1.4 OS:Any
View/Vote Developer Edit Submission

Welcome! If you don't have a SVN 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.
SVN Username: SVN Password:
Quick Fix:
Status: Assign to:
Category:
Summary:
From: rollercoaster397 at gmail dot com
New email:
Version: OS:
New/Additional Comment:

[8 Jun 2006 9:20pm UTC] rollercoaster397 at gmail dot com
Description:
------------
When a Class implements an interface, the class may not be initialized
before the declaration of this class.

Reproduce code:
---------------
$test = new Test;
echo $test;

interface Something {
	function increment ();
}

class Test implements Something {
	public $value = 0;
	
	function increment () {
		$this->value++;
		return $this->value;
	}
}

Expected result:
----------------
Object id #1

Actual result:
--------------
Fatal error: Class 'Test' not found in *path*/testcast.php on line 3
[8 Jun 2006 9:26pm UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC