473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

BUG IN PHP? (class member undefined)

error_reporting(E_ALL);
class cls{
var $val;
function cls(){
$this->$val = 999;
}
}
$c = new cls;

With error_reporting set to E_ALL PHP floods me with notifications that
class variables are undifined, whenever I try to use them. WTF???

Dec 28 '06 #1
7 1243
no
$ sign is used for variables, not objects

use
$this->val = 999;

not
$this->$val = 999;
Dec 28 '06 #2
Thanks!
Damn, I hate this crap called php language...

Dec 28 '06 #3

"Tamagafk" <ta******@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
Thanks!
Damn, I hate this crap called php language...
If you hate it so much then don't use it. If you HAVE to use it then do the
intelligent thing and READ THE F*CKING MANUAL!!!! You will screw up in any
language if you don't get the syntax right.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Dec 28 '06 #4
Tony Marston wrote:

[snip]
If you hate it so much then don't use it. If you HAVE to use it then do the
intelligent thing and READ THE F*CKING MANUAL!!!! You will screw up in any
language if you don't get the syntax right.
Don't feed the troll, it's a waste of valuable time.

Peter.

Dec 28 '06 #5
Pal, I don't have such problems in any other languages I know. Sytnax
have to be logical. Programming in php is constant stumbling over its
ugly syntax.

"""Tony Marston ÐÉÓÁÌ(Á):
"""
"Tamagafk" <ta******@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
Thanks!
Damn, I hate this crap called php language...

If you hate it so much then don't use it. If you HAVE to use it then do the
intelligent thing and READ THE F*CKING MANUAL!!!! You will screw up in any
language if you don't get the syntax right.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Dec 28 '06 #6
Tamagafk wrote:
"""Tony Marston ÐÉÓÁÌ(Á):
"""
>>"Tamagafk" <ta******@gmail.comwrote in message
news:11**********************@79g2000cws.googleg roups.com...
>>>Thanks!
Damn, I hate this crap called php language...

If you hate it so much then don't use it. If you HAVE to use it then do the
intelligent thing and READ THE F*CKING MANUAL!!!! You will screw up in any
language if you don't get the syntax right.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


Pal, I don't have such problems in any other languages I know. Sytnax
have to be logical. Programming in php is constant stumbling over its
ugly syntax.
(Top posting fixed)

Pal, I don't have any problem with PHP syntax. I find it quite logical
- more so than at least half of the 15-20 languages I've used over the
years.

As Tony said - if you hate it so much, don't use it. There are many
other languages out there which can do what you want. Or at least RTFM.

And please don't top post.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 28 '06 #7
..oO(Tamagafk)
>Pal, I don't have such problems in any other languages I know. Sytnax
have to be logical.
PHP's syntax is quite logical and reasonable. Both

$obj->var
$obj->$var

are completely different things. If you don't understand them, improve
your knowledge by reading the manual instead of complaining about "ugly
syntax".

Micha
Dec 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul Jackson | last post by:
I have the following situation: class Y; class Z; class X { public: Y y; Z* z; };
2
by: DELORME Frederic | last post by:
I've the class CNode where there is a static Member m_BaseNode: The declaration file is : cnode.h <code> ----------------------------------------------------------- #include <iostream>...
4
by: KriS | last post by:
Hi, I have two simple questions: 1) Do I have to write storage-class-specifier, when I want to declare a class as friend: class Bar {}; class Foo { friend ??? Bar; };
5
by: Steven T. Hatton | last post by:
If find the following excerpt from the Standard a bit confusing: <quote> 3.3.6 - Class scope -1- The following rules describe the scope of names declared in classes. 1) The potential scope...
8
by: Per Bull Holmen | last post by:
Hey Im new to c++, so bear with me. I'm used to other OO languages, where it is possible to have class-level initialization functions, that initialize the CLASS rather than an instance of it....
15
by: Victor Bazarov | last post by:
Hello, Take a look at this program: ----------------------------------- class B { B(const B&); B& operator=(const B&); public: B(int);
8
by: nishit.gupta | last post by:
I was having a problem with template class memer function definition , so i serched the net and find that template class member fuction definition should be in header file else compilation will...
3
by: massysett | last post by:
Greetings, Having classes with member objects that have STL containers of objects whose definitions are incomplete results in undefined behavior. See for example: ...
4
by: James Kanze | last post by:
On Aug 13, 5:32 am, Jack Klein <jackkl...@spamcop.netwrote: While you've made a number of important points: In other words, according to the C standard, any signal
16
by: John Doe | last post by:
Hi, I wrote a small class to enumerate available networks on a smartphone : class CNetwork { public: CNetwork() {}; CNetwork(CString& netName, GUID netguid): _netname(netName),...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.