473,322 Members | 1,232 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,322 software developers and data experts.

Symbols used in classes.

Hi all.,
Probably an old quesion, but im pretty new to php, and have not had
great success in searching.

Ive looking over some code which contains the following terms

$this
->
::

And have not clue as to what they mean. I have been looking at the php
documentation for classes and they appear there, but they are not well
explained. Can someone point me a good resource for explaining these,
or post me some explaination.s

Many thanks.
Jul 31 '08 #1
4 1488
*** Gerry escribió/wrote (Thu, 31 Jul 2008 08:58:06 -0700 (PDT)):
Probably an old quesion, but im pretty new to php, and have not had
great success in searching.

Ive looking over some code which contains the following terms

$this
->
::
http://www.php.net/manual/en/language.oop5.php
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
Jul 31 '08 #2
..oO(Gerry)
>Probably an old quesion, but im pretty new to php, and have not had
great success in searching.

Ive looking over some code which contains the following terms

$this
Refers to the current object, which invoked the method you're in.
>->
Used to access non-static members (methods and properties) of an object,
e.g.

$foo = new TFoo();
$foo->somePublicMethod();

(Inside the method somePublicMethod() $this would refer to $foo as the
object that called the method.)
>::
Scope resolution operator, used mainly to access static members of a
class, e.g.

TBar::someClassMethod();
print TBar::SOME_CLASS_CONSTANT;

Micha
Jul 31 '08 #3
On Jul 31, 6:20*pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Gerry)
Probably an old quesion, but im pretty new to php, and have not had
great success in searching.
Ive looking over some code which contains the following terms
$this

Refers to the current object, which invoked the method you're in.
->

Used to access non-static members (methods and properties) of an object,
e.g.

$foo = new TFoo();
$foo->somePublicMethod();

(Inside the method somePublicMethod() $this would refer to $foo as the
object that called the method.)
::

Scope resolution operator, used mainly to access static members of a
class, e.g.

TBar::someClassMethod();
print TBar::SOME_CLASS_CONSTANT;

Micha
Many thanks Micha, Great answer, so when in instantiate te class, i
have a choice of either the name eg $foo, or $this, while in scope.

Just one more question then. What's the diference between a 'static'
and a non static member of the class object.

Cheers.
Aug 1 '08 #4
Thank ou also Alvaro.
With Micha's answer, the section on Classes and Objecjects you
referred to is starting to make sense.

Aug 1 '08 #5

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

Similar topics

7
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of...
1
by: aerobar2 | last post by:
When I debug my application I get "no symbols loaded" ================= 'DefaultDomain': Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'MHSFire': Loaded...
5
by: eScrewDotCom | last post by:
www.eScrew.com eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
1
by: aerobar2 | last post by:
When I debug my application I get "no symbols loaded" ================= 'DefaultDomain': Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'MHSFire': Loaded...
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.