TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-02-2008, 10:50 PM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 14
Thanks: 2
owenj2o is on a distinguished road
Default Question

Right I have a question.

PHP Code:
class frame {

    private static 
$instance;
    
    public function 
frame() {
        
self::instance &= $this;
    }
    
    static function 
getInstance() {
        return 
self::instance;
    }
}

function 
getInstance() {
    
$intstance frame::getInstance;
    return 
$instance;
}

class 
B expands frame {
    
    public function 
Foo() {
        echo(
'Foo');
    }
    
// Other Functions

If getInstance was ran would I ba able to access class B;
PHP Code:
$blah &= getInstance();
$blah->foo
Many Thanks,
Owen =)
owenj2o is offline  
Reply With Quote
Old 02-03-2008, 07:21 PM   #2 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 14
Thanks: 2
owenj2o is on a distinguished road
Default

-- Nevermind :)
owenj2o is offline  
Reply With Quote
Old 02-03-2008, 09:43 PM   #3 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

woot?

this one's good:
PHP Code:
class B expands frame 
but this is even better:
PHP Code:
class B stretches frame 

__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 02-03-2008, 09:52 PM   #4 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Just a tip for next time, explain what you need help with in the title. You wont get many people with "question" because no one knows if it will be worth their time.
__________________

Village Idiot is offline  
Reply With Quote
Old 02-03-2008, 10:25 PM   #5 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 14
Thanks: 2
owenj2o is on a distinguished road
Default

What is class stretching and What advantages do I have with stretching a class instead of expanding it.
owenj2o is offline  
Reply With Quote
Old 02-03-2008, 10:34 PM   #6 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

lol. there's no such keyword as stretching, and there is no expanding, either. A class can be extended, and that's about it. The code above is invalid. This one is valid, though:

PHP Code:
class extends frame {...} 
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:47 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design