Webmaster SEO Forum - Google, Yahoo and MSN SEO

      Back to Search Engine Optimization

Go Back   Webmaster SEO Forum - Google, Yahoo and MSN SEO > Freelance Jobs > Programmers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2009, 05:31 PM
amber.long83 amber.long83 is offline
Junior Member
 
Join Date: Mar 2009
Posts: 8
Default Variable overloading issue in PHP

Hi friends

Thanks for visiting my post.

I have a issue in object inheritance in php. I have two classes which extends other. There is one common variable name used in both the class. So it's creating a conflict while accessing the parent class variable. Let me explain this by example
PHP Code:
First Class
class 
{
    public 
$email    =    "a@a.com";    
}

class 
extends {
    public 
$email    =    "b@b.com";    
}

$obj    =    new b();
echo    
$obj->email;    // this will print b@b.com but i want to print a@a.com 
Can anyone guide me?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:55 PM.


Search Engine Optimization

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

| Partners: Free slots | No Deposit Casinos | Free Casinos | Seo Tools |