Re: [PHP] classes and variables

2010-05-03 Thread Israel Ekpo
You do not need to access $DB as a global variable Since $db_database is a property of search_helper, you can initialize it by passing a value via the constructor like this class search_helper extends AjaxACApplication { protected $db_database; public function __construct($database_nam

Re: [PHP] Classes and Functions

2009-11-02 Thread Martin Scotta
On Sun, Nov 1, 2009 at 6:46 PM, Larry Garfield wrote: > On Sunday 01 November 2009 2:50:55 pm Daniel Kolbo wrote: > > Hello, > > > > Is there a way to see what objects and functions a script > > loaded/required/used? > > > > I could recursively loop through the globals, but if objects were unset,

Re: [PHP] Classes and Functions

2009-11-01 Thread Larry Garfield
On Sunday 01 November 2009 2:50:55 pm Daniel Kolbo wrote: > Hello, > > Is there a way to see what objects and functions a script > loaded/required/used? > > I could recursively loop through the globals, but if objects were unset, > then i may miss some. > > I could make a 'tracking' object and ever

Re: [PHP] Classes and Functions

2009-11-01 Thread Mathieu Rochette
On Sun, Nov 1, 2009 at 9:50 PM, Daniel Kolbo wrote: > Hello, > > Is there a way to see what objects and functions a script > loaded/required/used? > I don't think it's possible to that in PHP code. > > I could recursively loop through the globals, but if objects were unset, > then i may miss som

Re: [PHP] classes

2008-02-19 Thread Richard Lynch
On Mon, February 18, 2008 2:25 pm, nihilism machine wrote: > if i declare an instance of a class in the top of my php file, then > have html, then later on user $myClassInstance->myMethod(); -- > myMethod() does not execute, only when i have the instantiation of the > class right before the call to

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Nick Stinemates wrote: > Shawn McKenzie wrote: >>> What part of my example was unclear? >>> >>> >> All of it, since I posted just a couple minutes after you and I hadn't >> seen your post yet. >> >> > I'm sorry, I thought were were responding WHAT?!? to me. > > I'm going to blame thunderbi

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Shawn McKenzie wrote: >> What part of my example was unclear? >> >> > All of it, since I posted just a couple minutes after you and I hadn't > seen your post yet. > > I'm sorry, I thought were were responding WHAT?!? to me. I'm going to blame thunderbird for looking like you responded to m

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Nick Stinemates wrote: > Shawn McKenzie wrote: >> Jay Blanchard wrote: >> >>> [snip] >>> if i declare an instance of a class in the top of my php file, then >>> have html, then later on user $myClassInstance->myMethod(); -- >>> myMethod() does not execute, only when i have the instantiation

RE: [PHP] classes

2008-02-18 Thread Jay Blanchard
[snip] > http://www.php.net/flush Huh, what?!?! to both of you: [/snip] My bad...I had a total brain fart and 'combined' some concepts that I was speaking to someone about off-list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Shawn McKenzie wrote: > Jay Blanchard wrote: > >> [snip] >> if i declare an instance of a class in the top of my php file, then >> have html, then later on user $myClassInstance->myMethod(); -- >> myMethod() does not execute, only when i have the instantiation of the >> class right before

Re: [PHP] classes

2008-02-18 Thread Shawn McKenzie
Jay Blanchard wrote: > [snip] > if i declare an instance of a class in the top of my php file, then > have html, then later on user $myClassInstance->myMethod(); -- > myMethod() does not execute, only when i have the instantiation of the > class right before the call to the method does it wor

Re: [PHP] classes

2008-02-18 Thread Stut
nihilism machine wrote: if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance->myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas?

Re: [PHP] classes

2008-02-18 Thread Nick Stinemates
Jay Blanchard wrote: > [snip] > if i declare an instance of a class in the top of my php file, then > have html, then later on user $myClassInstance->myMethod(); -- > myMethod() does not execute, only when i have the instantiation of the > class right before the call to the method does it wor

RE: [PHP] classes

2008-02-18 Thread Jay Blanchard
[snip] if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance->myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas? [/snip] You are

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Monday 15 October 2007, Nathan Nobbe wrote: > > On 10/15/07, tedd <[EMAIL PROTECTED]> wrote: > > > I understand the class concept. But, I am not familiar with autoload. > > > > > > Stut also made mention of that, so I shall investigate p

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Larry Garfield
On Monday 15 October 2007, Nathan Nobbe wrote: > On 10/15/07, tedd <[EMAIL PROTECTED]> wrote: > > I understand the class concept. But, I am not familiar with autoload. > > > > Stut also made mention of that, so I shall investigate post haste. > > __autoload is pretty tight; but if you dont want to

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, tedd <[EMAIL PROTECTED]> wrote: > > I understand the class concept. But, I am not familiar with autoload. > > Stut also made mention of that, so I shall investigate post haste. __autoload is pretty tight; but if you dont want to have all your class files in the same directory, i sugg

RE: [PHP] Classes - Dumb question

2007-10-15 Thread tedd
At 5:42 AM -0500 10/15/07, Jay Blanchard wrote: [snip] With a class you can inherit all of the base class functionality into a new customer type. You do not have to break open the base class to add a case, you just have to create an extension class. Documentation is unique to each class. No ma

Re: [PHP] Classes - Dumb question

2007-10-15 Thread Nathan Nobbe
On 10/15/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > [snip] > >With a class you can inherit all of the base class functionality > >into a new customer type. You do not have to break open the base > >class to add a case, you just have to create an extension class. > >Documentation is unique to

RE: [PHP] Classes - Dumb question

2007-10-15 Thread Jay Blanchard
[snip] >With a class you can inherit all of the base class functionality >into a new customer type. You do not have to break open the base >class to add a case, you just have to create an extension class. >Documentation is unique to each class. No matter what, you have to break something open t

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Christian Hänsel
""Jay Blanchard"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] [snip] First of all what you call "normal" is procedural or functional programming. There is nothing wrong with doing things this way and may be especially quick and efficient when doing basic web sites and

RE: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 9:03 AM -0500 10/12/07, Jay Blanchard wrote: tedd said: In either case, I still have to write more code to accommodate scaling. And, if I have more customer types, then it's a simple matter to add more customer functions and addition case statements to the initial customer function. I don't s

Re: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 2:44 PM +0100 10/12/07, Stut wrote: You can limit the need to add more code like so... function customer($whatWas, $customertype, $whatAdditional) { /* do "what was" (i.e., common to all) */ /* then do what's additional unique to type */ $func = strtolower($customertype).'Customer

RE: [PHP] Classes - Dumb question

2007-10-12 Thread Jay Blanchard
[snip] > First of all what you call "normal" is procedural or functional > programming. There is nothing wrong with doing things this way and may be > especially quick and efficient when doing basic web sites and applications. > Document well and you will have no problem maintaining your code. One

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Nathan Nobbe
On 10/12/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: > > No doubt. (are you by chance continuing the other argument, re: > interfaces?), but you have to break open the original tested function, add > code to it, test it, etc. Every time you add a new case you have to break > open the existing func

RE: [PHP] Classes - Dumb question

2007-10-12 Thread Jay Blanchard
[snip] Yes, but I could do that procedurally from within the customer function by simply adding a customer type (needed regardless) and using a switch to direct and collect the additional data needed. In either case, I still have to write more code to accommodate scaling. And, if I have

Re: [PHP] Classes - Dumb question

2007-10-12 Thread Stut
tedd wrote: function customer($whatWas, $customertype, $whatAdditional) { /* do "what was" (i.e., common to all) */ /* then do what's additional unique to type */ switch(1) { case $customertype =='Commercial': commercialCustomer($whatAdditional); break; ..

RE: [PHP] Classes - Dumb question

2007-10-12 Thread tedd
At 7:36 AM -0500 10/11/07, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the "normal" functions all the time. I have never even bothered working with classes, but now I

Re: [PHP] Classes - Dumb question

2007-10-11 Thread Nathan Nobbe
On 10/12/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Thursday 11 October 2007, Jay Blanchard wrote: > > [snip] > > okay, this is really (!) embarassing, but I have to ask: > > > > Why would I want to use classes in PHP? > > > > I have been using PHP for years now and writing the "normal" f

Re: [PHP] Classes - Dumb question

2007-10-11 Thread Larry Garfield
On Thursday 11 October 2007, Jay Blanchard wrote: > [snip] > okay, this is really (!) embarassing, but I have to ask: > > Why would I want to use classes in PHP? > > I have been using PHP for years now and writing the "normal" functions all > the time. I have never even bothered working with classe

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Jay Blanchard
[snip] Not trying to hijack the thread... Hopefully this is related enough, if not I apologize. Would a good use of a class be to write a generic database connection script? and then feed in the different variables, such as customer login, database, stuff like that? something like class DBCo

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Robert Cummings
On Thu, 2007-10-11 at 07:36 -0500, Jay Blanchard wrote: > [snip] > okay, this is really (!) embarassing, but I have to ask: > > Why would I want to use classes in PHP? > > I have been using PHP for years now and writing the "normal" functions all > the time. I have never even bothered working wi

Re: [PHP] Classes - Dumb question

2007-10-11 Thread Jason Pruim
On Oct 11, 2007, at 8:36 AM, Jay Blanchard wrote: [snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the "normal" functions all the time. I have never even bothered working with classes, but

RE: [PHP] Classes - Dumb question

2007-10-11 Thread Jay Blanchard
[snip] okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the "normal" functions all the time. I have never even bothered working with classes, but now I would love to know what makes the classes so sp

Re: [PHP] Classes and access to outside variables

2007-10-01 Thread Nathan Nobbe
On 10/1/07, Merlin <[EMAIL PROTECTED]> wrote: > > Hello everybody, > > thank you for all your answers. I am sorry but I just realized that > there is an huge difference between PHP5 and PHP4 considering OOP. > Unfortunatelly I am still running PHP4.x and cant change this over > night. However I sti

Re: [PHP] Classes and access to outside variables

2007-09-30 Thread Martin Alterisio
That's incorrectly syntactically. Won't run. Ok, let's write some code to show how this can be done: class SearchHelper extends AjaxACApplication { private $dbh; public function __construct() { $this->dbh = $GLOBALS['dbh']; } } Better yet, pass the database host in the cons

Re: [PHP] Classes and access to outside variables

2007-09-29 Thread Nathan Nobbe
On 9/30/07, 潘志彬 <[EMAIL PROTECTED]> wrote: > > $dbh = 'test'; > > class search_helper extends AjaxACApplication > { > /** > * Database connection details > */ > >// announce global variable before use it >global $dbh; > > $db_hostname = $dbh;

Re: [PHP] Classes and access to outside variables

2007-09-29 Thread 潘志彬
$dbh = 'test'; class search_helper extends AjaxACApplication { /** * Database connection details */ // announce global variable before use it global $dbh; $db_hostname = $dbh; ... Regards, Ryu 2007/9/29, Merlin <[EMAIL PROTECTED]>:

Re: [PHP] Classes and access to outside variables

2007-09-29 Thread Nathan Nobbe
Merlin, if you are using php5 the var keyword is no longer valid; that was used in classes in php4. if you want to structure your classes properly you need to study PPP (public, private, protected) access modifiers. typically member variables are declared to be private or protected, if there will

Re: [PHP] Classes and access to outside variables

2007-09-29 Thread Martin Alterisio
Refer to the global on the constructor. Anyway, using a global like that is not a good practice. Just pass the variable to the constructor. 2007/9/29, Merlin <[EMAIL PROTECTED]>: > > Hi there, > > I am new to PHP classes and I do want to access a variable outside the > class, but somehow that doe

Re: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Jochem Maas
Martin Alterisio wrote: > Forgot to mention that calling a non-static function this way should > generate an E_STRICT warning. and IIRC it will eventually be made a fatal error in php6, somebody please correct me if I'm wrong! > > 2007/1/16, Martin Alterisio <[EMAIL PROTECTED]>: >> >> Backward c

Re: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Martin Alterisio
Forgot to mention that calling a non-statical function this way should generate an E_STRICT warning. 2007/1/16, Martin Alterisio <[EMAIL PROTECTED]>: Backward compatibility with PHP4, where member functions couldn't be declared as static. Any member function could be called statically providing

Re: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Martin Alterisio
Backward compatibility with PHP4, where member functions couldn't be declared as static. Any member function could be called statically providing a static context instead of an object instance. 2007/1/16, Cheseldine, D. L. <[EMAIL PROTECTED]>: Hi I'm stuck on The Basics page of the php5 Object

RE: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Jay Blanchard
[snip] http://uk.php.net/manual/en/language.oop5.basic.php The top example has the code: A::foo(); even though foo is not declared static in its class. How does it get called statically without being declared static? [/snip] foo() is a function and would not be static, it can be public (defau

Re: [PHP] Classes and OOP

2006-03-07 Thread Anthony Ettinger
On 3/7/06, Wolf <[EMAIL PROTECTED]> wrote: > I'm looking for a couple of good books or online sources where I can get > a lot better grasp of Classes and OOP programming in general. Mostly I > use PHP so that is the best option. > > Thanks, > Robert > PHP5 - Objects, Patterns, and Best Practices

Re: [PHP] Classes and OOP

2006-03-07 Thread Kim Hunter
PHP5 Objects, Patterns and Practice 1590593804 - Matt Zandstra - Apress This is a good way to get a good grasp of object-oriented programming covers the basics of uml as well as using decent examples to explain the use of objective programming (unlike all the web sites out there that i tried to

Re: [PHP] classes and return values

2006-02-27 Thread Jochem Maas
Jason Gerfen wrote: I am attempting to work up a class and because I am unfamiliar with some of the code flow I am only able to get a return value of 'object'. How can I pull the data out of a class? which data? It doesn't seem as if anyone knows what your trying to do. (try to explain it aga

RE: [PHP] Classes/Objects - Books/Links?

2005-12-06 Thread Mark Steudel
I took a look at a lot of books at Barnes and Noble and this I thought was the best intro to classes. I think it does a good job of letting you know both how to do things in HP4 and 5. Professional PHP 5 Publisher: Wrox -Original Message- From: Michael Hulse [mailto:[EMAIL PROTECTED] Se

Re: [PHP] Classes/Objects - Books/Links?

2005-12-06 Thread Michael Hulse
On Dec 6, 2005, at 6:39 PM, Chris Shiflett wrote: Adam Trachtenberg's Upgrading to PHP 5 (O'Reilly) is a good book. It covers all of the new features in PHP 5 (so it's not just OOP, sorry), but the chapter on objects is excellent. Hi Chris, thanks for the quick response. :) That book sounds g

Re: [PHP] Classes/Objects - Books/Links?

2005-12-06 Thread Chris Shiflett
Michael Hulse wrote: Any books that you could suggest that specifically address just classes/objects? Adam Trachtenberg's Upgrading to PHP 5 (O'Reilly) is a good book. It covers all of the new features in PHP 5 (so it's not just OOP, sorry), but the chapter on objects is excellent. Chris -

Re: [PHP] Classes and Functions and If's (Problems Again)

2005-11-03 Thread Robin Vickery
On 11/4/05, Unknown Unknown <[EMAIL PROTECTED]> wrote: > Hi everyone, i have some code that proccesses a login form. i have an object > $DB which works only in SOME areas, this is the code: > [...] > $DB="membersp"; > $SQL="SELECT ID FROM membersonline WHERE ID='$ID' "; > $DB->Query($SQL); [...] >

Re: [PHP] Classes and Functions and If's (Problems Again)

2005-11-03 Thread Jasper Bryant-Greene
On Thu, 2005-11-03 at 18:37 -0500, Unknown Unknown wrote: > Hi everyone, i have some code that proccesses a login form. i have an object > $DB which works only in SOME areas, this is the code: > > require_once("Include.php"); > global $DB; There is no need to global $DB here. You are already in

RE: [PHP] Classes and Functions

2005-11-03 Thread Shaw, Chris - Accenture
STFW >-Original Message- >From: Unknown Unknown [mailto:[EMAIL PROTECTED] >Sent: 03 November 2005 00:05 >To: Jasper Bryant-Greene >Cc: php-general@lists.php.net >Subject: Re: [PHP] Classes and Functions > > >Oh thanks agai

Re: [PHP] Classes and Functions

2005-11-03 Thread Jochem Maas
Robert Cummings wrote: On Thu, 2005-11-03 at 12:15, Jasper Bryant-Greene wrote: On Wed, 2005-11-02 at 19:05 -0500, Unknown Unknown wrote: Oh thanks again and what does RTFM mean? Read The [insert your favourite word beginning with F here] Manual. "Fondu"?? *licks lips* you missed an '

Re: [PHP] Classes and Functions

2005-11-02 Thread Robert Cummings
On Thu, 2005-11-03 at 12:15, Jasper Bryant-Greene wrote: > On Wed, 2005-11-02 at 19:05 -0500, Unknown Unknown wrote: > > Oh thanks again > > and what does RTFM mean? > > Read The [insert your favourite word beginning with F here] Manual. "Fondu"?? *licks lips* Cheers, Rob. -- .

Re: [PHP] Classes and Functions

2005-11-02 Thread Jasper Bryant-Greene
On Wed, 2005-11-02 at 19:05 -0500, Unknown Unknown wrote: > Oh thanks again > and what does RTFM mean? Read The [insert your favourite word beginning with F here] Manual. -- Jasper Bryant-Greene General Manager Album Limited e: [EMAIL PROTECTED] w: http://www.album.co.nz/ b: http://jbg.name/ p:

Re: [PHP] Classes and Functions

2005-11-02 Thread Unknown Unknown
Oh thanks again and what does RTFM mean?

Re: [PHP] Classes and Functions

2005-11-02 Thread Unknown Unknown
A thanks, i tried that before didn't seem to work, now it works Thanks again!

Re: [PHP] Classes and Functions

2005-11-02 Thread Manish Marathe
On 11/2/05, Unknown Unknown <[EMAIL PROTECTED]> wrote: > > Hi everybody i have a class that i reference with: > $DB= new DBInterface; > outside a function it works fine, but using $DB inside a function changes > the data type i think... i get an error saying i'm using a method on a > non-object...

Re: [PHP] Classes and Functions

2005-11-02 Thread Jasper Bryant-Greene
On Wed, 2005-11-02 at 18:56 -0500, Unknown Unknown wrote: > Hi everybody i have a class that i reference with: > $DB= new DBInterface; > outside a function it works fine, but using $DB inside a function changes > the data type i think... i get an error saying i'm using a method on a > non-object...

Re: [PHP] Classes or functions

2005-10-19 Thread Brent Baisley
It's really a matter of comfort level and opinion. There can be strong arguments either way. Using just functions will be faster, although the speed difference may be minimal and not noticeable. Using just functions can be easier and quicker to develop, especially for small projects. But,

Re: [PHP] Classes, Constructors, References and Recursion

2005-04-20 Thread Evert | Rooftop Solutions
Jochem Maas wrote: also I believe print_r() and var_dump() have a few odditities regarding display of recursion with regard to objects... internals mailinglist archive might tell you more on that. I think I have the answer, when I pass a var to print_r it isn't passed by reference, so there will

Re: [PHP] Classes, Constructors, References and Recursion

2005-04-20 Thread Jochem Maas
Evert|Rooftop Solutions wrote: Hi, I have this piece of code: class test1 { var $data = 'hi', $node = false; function test1() { $this->node =& new test2($this); } } class test2 { var $data = 'yoyo',

[PHP] Re: PHP Classes

2005-03-16 Thread Jason Barnett
You know... we talked about this several times before. Please search the archives for the PHP list's answers. Hint: STFA tutorial class object -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http:/

Re: [PHP] Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 23:30:51 +, Alister Bulman <[EMAIL PROTECTED]> wrote: > On Mon, 14 Mar 2005 19:14:37 +0530, Zareef Ahmed <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > I have a function to load the classes and return the object. > > > > function LoadClass($ClassName) > > { > > require_once

Re: [PHP] Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 09:03:00 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > I have a function to load the classes and return the object. > > > > function LoadClass($ClassName) > > { > > require_once("Class.$ClassName.inc"); > > return new $ClassName(); > > } > > > >

Re: [PHP] Classes code completion and Zend Studio

2005-03-14 Thread Richard Lynch
> Hi All, > > I have a function to load the classes and return the object. > > function LoadClass($ClassName) > { > require_once("Class.$ClassName.inc"); > return new $ClassName(); > } > > Its working fine. > > But Zend Studio's Code completion is not working for this type of > object, Any hints?

Re: [PHP] Classes and parents.

2005-01-24 Thread Richard Lynch
Dmitry wrote: > Greetings. > > If i run this code (php5): > -- > class a { > function say() { echo "A"; } > function run() { $this->say(); } > } > class b extends a { //> function say() { echo "B"; } function say() { parent::say(); echo "B";} > func

Re: [PHP] Classes and parents.

2005-01-21 Thread Jochem Maas
had to better myself... Jochem Maas wrote: Dmitry wrote: Greetings. If i run this code (php5): -- class a { function say() { echo "A"; } function run() { $this->say(); } } class b extends a { function say() { echo "B"; } function run() { parent::run(); }

Re: [PHP] Classes and parents.

2005-01-21 Thread Jochem Maas
Dmitry wrote: Greetings. If i run this code (php5): -- class a { function say() { echo "A"; } function run() { $this->say(); } } class b extends a { function say() { echo "B"; } function run() { parent::run(); } } $obj = new b; $obj->run(); --

Re: [PHP] Classes and parents.

2005-01-21 Thread Matthew Fonda
the run function in b overrides the run function in a, thats why it echo's "B" On Fri, 2005-01-21 at 18:37, Dmitry wrote: > Greetings. > > If i run this code (php5): > -- > class a { > function say() { echo "A"; } > function run() { $this->say(); } > } >

Re: [PHP] Classes and Functions

2004-12-12 Thread Rory Browne
your question is hard to answer. The difference between classes and functions is like the difference between a toolbox, and a spanner. A class is a container, that contains functions, and variables, or as they are called in Object-Oriented-Speak(methods, and properties). A method is a function tha

Re: [PHP] Classes and Functions

2004-12-11 Thread Robby Russell
On Sat, 2004-12-11 at 13:03 -0500, R. Van Tassel wrote: > Can someone give me a distinction between the two and when to use / not use > them? > > > > I want to thank everyone who replied about my"For" loop question. All the > answers were VERY helpful! Thanks very much. You might want to pick

Re: [PHP] classes and variable scope

2004-12-01 Thread Richard Lynch
Josh Howe wrote: > > Hi all, > > If I have the following code: > > $some_global_variable; > > Class foo { > > Function test() { > set_global(); > echo $some_global_variable; > } > > Function set_global () { > $some_global_variable = "abcd"; > echo $some_g

Re: [PHP] classes in php5

2004-09-29 Thread Daniel Watrous
Thank you all for your responses. It was indeed an error elsewhere in my code. Daniel Watrous - Original Message - From: "Matthew Fonda" <[EMAIL PROTECTED]> To: "Curt Zirzow" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, Septem

Re: [PHP] classes in php5

2004-09-28 Thread Matthew Fonda
Works fine for me. It still works if you add methods or properties to Foo as well, I'm not sure why it wouldn't work for you, possibly you have another error along the lines somewhere. I am on PHP 5.0.1 BTW On Tue, 2004-09-28 at 19:42, Curt Zirzow wrote: > * Thus wrote Daniel Watrous: > > Hello

Re: [PHP] classes in php5

2004-09-28 Thread Curt Zirzow
* Thus wrote Daniel Watrous: > Hello all, > > I have a class Foo. In PHP4 I could create an instance of Foo in the following > manner: > $className = "Foo"; > $fooInstance = new $className; > > This would yield the same result as: > $fooInstance = new Foo; Can you provide the definition of you

Re: [PHP] classes in php5

2004-09-28 Thread Curt Zirzow
* Thus wrote Maciek Ruckgaber Bielecki: > you are just missing the (); it wont work either in php4 or php5 that > way. > > > $className = "Foo"; > $fooInstance = new $className(); $a = new Foo; Is perfectly valid. Curt -- The above comments may offend you. flame at will. -- PHP General

Re: [PHP] classes in php5

2004-09-28 Thread Maciek Ruckgaber Bielecki
you are just missing the (); it wont work either in php4 or php5 that way. $className = "Foo"; $fooInstance = new $className(); Cheers On Tue, Sep 28, 2004 at 01:46:27PM -0600, Daniel Watrous wrote: > Hello all, > > I have a class Foo. In PHP4 I could create an instance of Foo in the follow

Re: [PHP] classes in php5

2004-09-28 Thread Andrew Kreps
On Tue, 28 Sep 2004 13:46:27 -0600, Daniel Watrous <[EMAIL PROTECTED]> wrote: > In my efforts to port this over to PHP5 I am having trouble. Not only do I not get > back an > instance of my Foo class, but the script execution stops entirely without so much as > a > warning. My first suggesti

Re: [PHP] Classes, instances and NULL

2004-07-29 Thread Justin Patrin
On Thu, 29 Jul 2004 14:41:57 +0200, Oliver Hitz <[EMAIL PROTECTED]> wrote: > Hi all, > > I have stumbled across something odd related to classes, instances and > NULL in PHP 4. Apparently, an instance of a class that doesn't contain > any variables is always equal to NULL. > > class MyClass { >

Re: [PHP] Classes and their members

2004-04-22 Thread Tom Rogers
Hi, Friday, April 23, 2004, 1:00:34 PM, you wrote: DN> I'm having a problem using classes. The problem stemed from DN> using arrays to store a bunch of users and their usage times. DN> I have an object with two members, $name and $onlineSecs. No DN> matter how hard I try...$name always gets mod

Re: [PHP] Classes & Objects.

2004-03-14 Thread Marco Schuler
Hi Am So, 2004-03-14 um 03.55 schrieb Elliot J. Balanza: > Anybody knows a good on line tutorial for objects & classes on PHP. Sure! Google is your friend or http://www.phppatterns.com/index.php/link/category/1/ for example. -- Regards Marco -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Classes Tutorials

2003-09-22 Thread jsWalter
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Although i dont code for pear standards, i must recommend learning the pear > code, its how i taught myself classes. I concur. It is how I am learning this stuff. That and my stupid questions to this list (see previous posts just yes

Re: [PHP] Classes Tutorials

2003-09-21 Thread daniel
Although i dont code for pear standards, i must recommend learning the pear code, its how i taught myself classes. > Hi, > > I'm want to master the art of programming in Classes and worked through > some elementary tutorials. > > Are there perhaps a bit more advanced tutorials than Devshed? > > Th

Re: [PHP] classes v. functions

2003-07-24 Thread Joel Rees
> Hi, > > am Wednesday 23 July 2003 11:48 schrieb Joel Rees: > > > (You know that $accesses->count and $accesses->resetCounter() are at > > least declared in the same class declaration. $accesses_count and > > accesses_resetCounter() could be declared in entirely unrelated include > > files for e

Re: [PHP] classes v. functions

2003-07-23 Thread Mike Migurski
>> Execution speed isn't all that matters. In fact, speed is not the point >> at all. > >Then you must be an PHPNuke or Typo3-programmer, beeing lucky to get at >least 1 request per second ;). Don't take it hard, but If you had ever >been in computer-science [school|college|...] you would know tha

Re: [PHP] classes v. functions

2003-07-23 Thread Sam Baum
Hi, am Wednesday 23 July 2003 11:48 schrieb Joel Rees: > (You know that $accesses->count and $accesses->resetCounter() are at > least declared in the same class declaration. $accesses_count and > accesses_resetCounter() could be declared in entirely unrelated include > files for entirely differen

Re: [PHP] classes v. functions

2003-07-23 Thread Joel Rees
> Say I have a database class with all kinds of functions for connection, > data manipulation, errors, etc: > > $db = new db_sql; > $db->connect(); > $db->do_this(); > $db->do_that(); > > How would that be different from an include file with a bunch of functions > doing the same thing? As far

Re: [PHP] classes v. functions

2003-07-19 Thread Justin French
Whether it's the right move or not, I've put off my learning of PHP classes and OOP methods until PHP5.x, so I guess the time in near :) However, *especially* if you're the only programmer on a project, you can take the ideas & benefits behind OOP (for me, having clear, clean code that can be r

Re: [PHP] classes v. functions

2003-07-19 Thread Andu
Thanks to all for your input. Regards, Andu Novac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] classes v. functions

2003-07-19 Thread Tom Rogers
Hi, Saturday, July 19, 2003, 7:08:55 AM, you wrote: A> This may show my ignorance or my refusal to take for granted something I A> don't fully understand but I have a hard time figuring out the advantage of A> using classes as opposed to just functions. I am certainly new to php and A> at first

Re: [PHP] classes v. functions

2003-07-18 Thread Curt Zirzow
Andu <[EMAIL PROTECTED]> wrote: > > > --On Friday, July 18, 2003 14:28:02 -0700 Chris Shiflett <[EMAIL PROTECTED]> > wrote: > > >--- Andu <[EMAIL PROTECTED]> wrote: > >>This may show my ignorance or my refusal to take for granted > >>something I don't fully understand but I have a hard time > >

Re: [PHP] classes v. functions

2003-07-18 Thread Robert Cummings
On Fri, 2003-07-18 at 18:19, Andu wrote: > > Say I have a database class with all kinds of functions for connection, > data manipulation, errors, etc: > > $db = new db_sql; > $db->connect(); > $db->do_this(); > $db->do_that(); > > How would that be different from an include file with a bunch of

Re: [PHP] classes v. functions

2003-07-18 Thread Andu
--On Friday, July 18, 2003 14:28:02 -0700 Chris Shiflett <[EMAIL PROTECTED]> wrote: --- Andu <[EMAIL PROTECTED]> wrote: This may show my ignorance or my refusal to take for granted something I don't fully understand but I have a hard time figuring out the advantage of using classes as opposed t

Re: [PHP] classes v. functions

2003-07-18 Thread Brad Bonkoski
Chris Shiflett wrote: > --- Andu <[EMAIL PROTECTED]> wrote: > > This may show my ignorance or my refusal to take for granted > > something I don't fully understand but I have a hard time > > figuring out the advantage of using classes as opposed to just > > functions. > > They are entirely diffe

Re: [PHP] classes v. functions

2003-07-18 Thread Chris Shiflett
--- Andu <[EMAIL PROTECTED]> wrote: > This may show my ignorance or my refusal to take for granted > something I don't fully understand but I have a hard time > figuring out the advantage of using classes as opposed to just > functions. They are entirely different. While OO fans will find my over-

Re: [PHP] Classes within classes

2003-06-27 Thread Lars Torben Wilson
On Fri, 2003-06-27 at 03:09, Dave Alger wrote: > Hiya, > > It would be useful for me to be able to use a class within another class and > I don't know if that's permissable in PHP. Hi there! It is indeed possible. However, that's not the problem here. The problem is that class attribute initiali

Re: [PHP] Classes and Objects

2003-06-10 Thread Frank Keessen
Don, Are you using phpmailer of http://phpmailer.sourceforge.net/ ??? Looks like: require("class.phpmailer.php"); this is not properly configured! Please check if the path is going alright.. Regards, Frank - Original Message - From: "Don" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PR

Re: [PHP] Classes vs. functions?

2003-06-03 Thread olinux
Here is an excellent article describing classes/objects - what they are and are not. http://phpmag.net/itr/online_artikel/psecom,id,284,nodeid,114.html olinux > > Can someone please explain to me when is a class > useful over a set of > > functions? __ Do you Y

  1   2   >