|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-03 04:42 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ This problem occurs in both PHP 4.3.5RC3 and in PHP 5.0.0b4. The constructor function of the child class does not have the proper var's set in it from the parent class. Reproduce code: --------------- class parentclass { public $var = 'test'; function parentclass() { $this->var = 'test2'; } } class childclass extends parentclass { function childclass() { print $this->var; } } $obj = new parentclass; $obj2 = new childclass; Expected result: ---------------- Well I expected it to print "test2". Actual result: -------------- But instead it prints the value that the public var was initialized as "test".