|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27977 PHP object creation crashes
Submitted: 2004-04-13 09:54 UTC Modified: 2004-04-13 10:13 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: wolfgang dot forstmeier at siemens dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: Irrelevant OS: All
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: wolfgang dot forstmeier at siemens dot com
New email:
PHP Version: OS:


 [2004-04-13 09:54 UTC] wolfgang dot forstmeier at siemens dot com

if you create an object befor you had described your class this will let crash your php code.
If you create the object after you had described your class code all is fine.

Reproduce code:
File 1 with Class 1
class f {
 var $f = null;
 function f() {
 	$this->f = 5;
File 2 with Class 2
$b = new xy();
class xy extends f{
	function xy() {
		echo $this->f;

Expected result:
The output had to be 5 

Actual result:
Fatal error: Cannot instantiate non-existent class: xy in c:\server_scripts\htdocs\scripts\test.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-13 10:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

You need to declared classes before use if you inherit them.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 01:01:31 2024 UTC