operator overloading

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ranjitbd
Forum Newbie
Posts: 24
Joined: Sun May 03, 2009 1:59 pm

operator overloading

Post by ranjitbd »

hi,
can anyone give me a nice short document to read to understand operator overloading concept in OOP(object oriented programming)
with one or two example...
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: operator overloading

Post by requinix »

PHP doesn't have operator overloading.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: operator overloading

Post by Eran »

there's SPL which provides some overloading for arrays - http://www.php.net/~helly/php/ext/spl/
And also the PECL extension Operator which provides more overloading capabilities but it's highly experimental - http://pecl.php.net/package/operator
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: operator overloading

Post by Darhazer »

Read "The C++ progragramming language" by Bjarne Stroustrup and you'll get much better understanding of the OO concepts.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: operator overloading

Post by Darhazer »

pytrin wrote: And also the PECL extension Operator which provides more overloading capabilities but it's highly experimental - http://pecl.php.net/package/operator
Pretty interesting, I'll give it a try. Thank you.
Post Reply