|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-26 20:03 UTC] sniper@php.net
[2004-01-27 03:07 UTC] siggi at junesystems dot com
[2004-01-29 21:12 UTC] magnus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Description: ------------ When creating a class that contains a class variable array being filled (in this case in the wrong way) like: $this->$Variable[] = "whatever"; (!! notice second $ ) PHP produces no output and no error message ($Variable is empty BTW, does not exist). In a script with a couple of hundred of lines of code it is a nightmare trying to locate a typo like this with no help from PHP. Reproduce code: --------------- class Test { var $Variable = Array(); function Test(){ $this->$Variable[] = "Test string"; } } $object = new Test(); Expected result: ---------------- Error message. Actual result: -------------- No output (this comes from PHP): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY></HTML>