Re: [PHP] How can I do the opposite of property_exists(), maybe a create_property() in PHP5?

2009-02-04 Thread Stuart
2009/2/3 Daevid Vincent dae...@daevid.com: On Wed, 2009-02-04 at 08:58 +1100, Chris wrote: the question is what is __set() doing, if it's throwing an exception for undefined properties then obviously it with 'blow up'. But why should __set() even be called if I'm accessing the

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-03 Thread Jochem Maas
Edmund Hertle schreef: 2009/2/3 Daevid Vincent dae...@daevid.com Is there a way to create a new property via PHP 5.2.4? I get a hash back from an authentication server. I'm not guaranteed that someone in another department won't add new key/values to the returned hash/array. I'm trying to

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-03 Thread Daevid Vincent
On Tue, 2009-02-03 at 12:51 +0100, Jochem Maas wrote: Edmund Hertle schreef: 2009/2/3 Daevid Vincent dae...@daevid.com Is there a way to create a new property via PHP 5.2.4? I get a hash back from an authentication server. I'm not guaranteed that someone in another department won't

Re: [PHP] How can I do the opposite of property_exists(), maybe a create_property() in PHP5?

2009-02-03 Thread Nathan Nobbe
On Tue, Feb 3, 2009 at 4:19 PM, Daevid Vincent dae...@daevid.com wrote: On Wed, 2009-02-04 at 08:58 +1100, Chris wrote: the question is what is __set() doing, if it's throwing an exception for undefined properties then obviously it with 'blow up'. But why should __set() even

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-03 Thread Chris
the question is what is __set() doing, if it's throwing an exception for undefined properties then obviously it with 'blow up'. But why should __set() even be called if I'm accessing the property directly? This seems stupid. $this-oraclecustomerid = 1122; should NOT be the same as

Re: [PHP] How can I do the opposite of property_exists(), maybe a create_property() in PHP5?

2009-02-03 Thread Daevid Vincent
On Wed, 2009-02-04 at 08:58 +1100, Chris wrote: the question is what is __set() doing, if it's throwing an exception for undefined properties then obviously it with 'blow up'. But why should __set() even be called if I'm accessing the property directly? This seems stupid.

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-03 Thread Daevid Vincent
On Tue, 2009-02-03 at 08:30 +0100, Edmund Hertle wrote: 2009/2/3 Daevid Vincent dae...@daevid.com Is there a way to create a new property via PHP 5.2.4? I get a hash back from an authentication server. I'm not guaranteed that someone in another department won't add new key/values to

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-02 Thread Edmund Hertle
2009/2/3 Daevid Vincent dae...@daevid.com Is there a way to create a new property via PHP 5.2.4? I get a hash back from an authentication server. I'm not guaranteed that someone in another department won't add new key/values to the returned hash/array. I'm trying to work around that part

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 29, 2008 7:27 PM, Stut [EMAIL PROTECTED] wrote: Personally I'd use a static method in this instance. thats what i recommended. If you need to create an instance of the class you can do so in the static method and that way it will get destroyed when the function is

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jochem Maas
Stut schreef: Nathan Nobbe wrote: On Jan 29, 2008 7:27 PM, Stut [EMAIL PROTECTED] wrote: Personally I'd use a static method in this instance. thats what i recommended. If you need to create an instance of the class you can do so in the static method and that way it will get destroyed when

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Jochem Maas wrote: Stut schreef: Nathan Nobbe wrote: On Jan 29, 2008 7:27 PM, Stut [EMAIL PROTECTED] wrote: Personally I'd use a static method in this instance. thats what i recommended. If you need to create an instance of the class you can do so in the static method and that way it

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jochem Maas
Stut schreef: Jochem Maas wrote: Stut schreef: Nathan Nobbe wrote: On Jan 29, 2008 7:27 PM, Stut [EMAIL PROTECTED] wrote: Personally I'd use a static method in this instance. thats what i recommended. If you need to create an instance of the class you can do so in the static method and

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Anup Shukla
Nathan Nobbe wrote: Actually, I don't think so. I believe constructors return void, while the 'new' keyword returns a copy of the object. im pretty sure constructors return an object instance: php class Test { function __construct() {} } php var_dump(new Test()); object(Test)#1 (0) { }

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jochem Maas
Anup Shukla schreef: Nathan Nobbe wrote: Actually, I don't think so. I believe constructors return void, while the 'new' keyword returns a copy of the object. im pretty sure constructors return an object instance: php class Test { function __construct() {} } php var_dump(new Test());

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 5:56 AM, Stut [EMAIL PROTECTED] wrote: Nathan Nobbe wrote: You posted a singleton pattern. no, what i posted was a simple factory pattern. if you invoke it twice there will be 2 instances of Test in memory, eg. not singleton. $a = Test::getInstance(); $b = Test::getInstance();

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 30, 2008 10:46 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Nathan Nobbe wrote: Actually no, I mean I would *just* use a static method. If there is no reason to instantiate an object, why would you? http://stut.net/ you realize you are

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 10:46 AM, Stut [EMAIL PROTECTED] wrote: Nathan Nobbe wrote: Actually no, I mean I would *just* use a static method. If there is no reason to instantiate an object, why would you? http://stut.net/ you realize you are instantiating an class in the code you posted, right? from

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: It's fairly likely that I'd actually just use a static method here, both your and my code use static methods. it sounds to me like you are using the term 'static method' to mean a static method that has a variable with a reference to an instance of the class that it is

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jim Lucas
Stut wrote: Nathan Nobbe wrote: On Jan 30, 2008 10:53 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Nathan Nobbe wrote: I never said I wasn't creating an instance in the example I posted. then what exactly did you mean by this? Actually no, I mean I would *just*

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 30, 2008 10:53 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Nathan Nobbe wrote: I never said I wasn't creating an instance in the example I posted. then what exactly did you mean by this? Actually no, I mean I would *just* use a static

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 10:53 AM, Stut [EMAIL PROTECTED] wrote: Nathan Nobbe wrote: I never said I wasn't creating an instance in the example I posted. then what exactly did you mean by this? Actually no, I mean I would *just* use a static method. If there is no reason to instantiate an object, why

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jim Lucas
Stut wrote: Nathan Nobbe wrote: On Jan 30, 2008 10:53 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Nathan Nobbe wrote: I never said I wasn't creating an instance in the example I posted. then what exactly did you mean by this? Actually no, I mean I would *just*

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 11:21 AM, Stut [EMAIL PROTECTED] wrote: Calling a static method does not create an instance of the class. there you go again; calling a static method does create an instance of the class if you call new inside of it :P -nathan

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Jim Lucas wrote: Stut wrote: Nathan Nobbe wrote: On Jan 30, 2008 10:53 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Nathan Nobbe wrote: I never said I wasn't creating an instance in the example I posted. then what exactly did you mean by this? Actually no, I mean

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 11:31 AM, Stut [EMAIL PROTECTED] wrote: I would *just* use a static method *just* *just* *just* *just* *just* *just* *just* *just* *just* No instance. None. Grrr. here is a mod of the code you posted w/ a var_dump() of the local variable $o; ?php class Test { public

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 30, 2008 11:21 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Calling a static method does not create an instance of the class. there you go again; calling a static method does create an instance of the class if you call new inside of it :P

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 30, 2008 11:31 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I would *just* use a static method *just* *just* *just* *just* *just* *just* *just* *just* *just* No instance. None. Grrr. here is a mod of the code you posted w/ a var_dump()

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 11:58 AM, Stut [EMAIL PROTECTED] wrote: Ok, I'm going to have to assume you really are as stupid as you seem. If I need to provide an example to demonstrate what I meant I will, but I feel I made it quite clear that my comment regarding what *I* would do did not in any way

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jim Lucas
Stut wrote: Nathan Nobbe wrote: On Jan 30, 2008 11:31 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I would *just* use a static method *just* *just* *just* *just* *just* *just* *just* *just* *just* No instance. None. Grrr. here is a mod of the code you posted w/

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Nathan Nobbe wrote: On Jan 30, 2008 11:58 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ok, I'm going to have to assume you really are as stupid as you seem. If I need to provide an example to demonstrate what I meant I will, but I feel I made it quite clear that my

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
Indeed. Now, the place where you sleep... is it guarded? well it is, but.. i probly misunderstood some implication in the directions of my virtual fortress and therefore, probly not as well a i suspect ;) -nathan

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Stut
Jim Lucas wrote: Stut wrote: Nathan Nobbe wrote: On Jan 30, 2008 11:31 AM, Stut [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I would *just* use a static method *just* *just* *just* *just* *just* *just* *just* *just* *just* No instance. None. Grrr. here is a mod of the

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Richard Lynch
On Wed, January 30, 2008 9:53 am, Stut wrote: The forcing it out of scope was the crux of my point. However, if Jochem is right then it's kinda pointless with the current implementation of the GC, but may become relevant in the new GC. I dunno about the OOP instances getting GC'ed, but PHP

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Chris
I dunno about the OOP instances getting GC'ed, but PHP *definitely* reclaims memory from arrays and strings as they go out of scope, usually. Does anyone else find that funny? :) It definitely does it ... usually ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Richard Lynch
I believe the constructor returns the object created, with no chance in userland code of altering that fact, over-riding the return value, or any other jiggery-pokery to that effect. New causes the constructor to be called in the first place, and that's about it. The assignment to a variable is

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Richard Lynch
On Wed, January 30, 2008 6:19 pm, Chris wrote: I dunno about the OOP instances getting GC'ed, but PHP *definitely* reclaims memory from arrays and strings as they go out of scope, usually. Does anyone else find that funny? :) It definitely does it ... usually ;) Ah well. It definitely

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Chris
Richard Lynch wrote: On Wed, January 30, 2008 6:19 pm, Chris wrote: I dunno about the OOP instances getting GC'ed, but PHP *definitely* reclaims memory from arrays and strings as they go out of scope, usually. Does anyone else find that funny? :) It definitely does it ... usually ;) Ah

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Jochem Maas
Richard Lynch schreef: I believe the constructor returns the object created, with no chance in userland code of altering that fact, over-riding the return value, or any other jiggery-pokery to that effect. New causes the constructor to be called in the first place, and that's about it. The

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Casey
On Jan 30, 2008 4:53 PM, Jochem Maas [EMAIL PROTECTED] wrote: Richard Lynch schreef: I believe the constructor returns the object created, with no chance in userland code of altering that fact, over-riding the return value, or any other jiggery-pokery to that effect. New causes the

Re: [PHP] How can I do this -- method chaining

2008-01-30 Thread Nathan Nobbe
On Jan 30, 2008 11:29 PM, Casey [EMAIL PROTECTED] wrote: I don't think constructors return the object: im starting to think this as well. what for example happens when there is not __construct() method ? class Test { private $blah = ''; } here $blah is part of a new instance, before

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Jochem Maas
Nathan Nobbe schreef: On Jan 29, 2008 3:02 PM, Stut [EMAIL PROTECTED] wrote: Why? What exactly do you think you're saving by not putting the instance in a variable? I can't think of one good reason to do this. its an esthetic thing; and besides the simple factory method is an easy

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Nathan Nobbe
On Jan 29, 2008 3:26 PM, Jochem Maas [EMAIL PROTECTED] wrote: Nathan Nobbe schreef: On Jan 29, 2008 3:02 PM, Stut [EMAIL PROTECTED] wrote: Why? What exactly do you think you're saving by not putting the instance in a variable? I can't think of one good reason to do this. its an

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Eric Butera
On Jan 29, 2008 1:53 PM, Christoph Boget [EMAIL PROTECTED] wrote: Constructors return the object, correct? If so, how can I do this: class Bob { private $blah; _construct( $blah ) { $this-blah = $blah; } public getBlah() { return $this-blah; } } echo Bob( 'Hello!'

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Andrew Ballard
On Jan 29, 2008 1:53 PM, Christoph Boget [EMAIL PROTECTED] wrote: Constructors return the object, correct? Actually, I don't think so. I believe constructors return void, while the 'new' keyword returns a copy of the object. Andrew -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Paul Scott
On Tue, 2008-01-29 at 14:17 -0500, Eric Butera wrote: http://www.travisswicegood.com/index.php/2007/10/26/fluent_api_here_i_come Looks like a repurpose of one of my posts: http://fsiu.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=gen9Srv59Nme5_7092_1182404204 --Paul All Email

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Richard Heyes
Christoph Boget wrote: Constructors return the object, correct? If so, how can I do this: class Bob { private $blah; _construct( $blah ) { $this-blah = $blah; } public getBlah() { return $this-blah; } } echo Bob( 'Hello!' )-getBlah(); When I try that, I get the message

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Nathan Nobbe
On Jan 29, 2008 2:27 PM, Andrew Ballard [EMAIL PROTECTED] wrote: On Jan 29, 2008 1:53 PM, Christoph Boget [EMAIL PROTECTED] wrote: Constructors return the object, correct? Actually, I don't think so. I believe constructors return void, while the 'new' keyword returns a copy of the object.

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Nathan Nobbe
On Jan 29, 2008 2:37 PM, Paul Scott [EMAIL PROTECTED] wrote: Looks like a repurpose of one of my posts: http://fsiu.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=gen9Srv59Nme5_7092_1182404204 actually, this is slightly different; here we are talking about being able to immediately

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Christoph Boget
On Jan 29, 2008 2:37 PM, Paul Scott [EMAIL PROTECTED] wrote: Looks like a repurpose of one of my posts: http://fsiu.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=gen9Srv59Nme5_7092_1182404204 actually, this is slightly different; here we are talking about being able to immediately

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Jochem Maas
Christoph Boget schreef: Constructors return the object, correct? If so, how can I do this: class Bob { private $blah; _construct( $blah ) { $this-blah = $blah; } public getBlah() { return $this-blah; } } echo Bob( 'Hello!' )-getBlah(); When I try that, I get the message

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Stut
On 29 Jan 2008, at 19:43, Christoph Boget [EMAIL PROTECTED] wrote: On Jan 29, 2008 2:37 PM, Paul Scott [EMAIL PROTECTED] wrote: Looks like a repurpose of one of my posts: http://fsiu.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=gen9Srv59Nme5_7092_1182404204 actually, this is

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Nathan Nobbe
On Jan 29, 2008 3:02 PM, Stut [EMAIL PROTECTED] wrote: Why? What exactly do you think you're saving by not putting the instance in a variable? I can't think of one good reason to do this. its an esthetic thing; and besides the simple factory method is an easy workaround to achieve it. as the

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Stut
On 29 Jan 2008, at 20:08, Nathan Nobbe [EMAIL PROTECTED] wrote: On Jan 29, 2008 3:02 PM, Stut [EMAIL PROTECTED] wrote: Why? What exactly do you think you're saving by not putting the instance in a variable? I can't think of one good reason to do this. its an esthetic thing; and besides the

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Nathan Nobbe
On Jan 29, 2008 7:27 PM, Stut [EMAIL PROTECTED] wrote: Personally I'd use a static method in this instance. thats what i recommended. If you need to create an instance of the class you can do so in the static method and that way it will get destroyed when the function is done. Otherwise the

Re: [PHP] How can i do refresh my web since java script?

2005-04-09 Thread Marek Kilimajer
Tomás Rodriguez Orta wrote: input name=refrescar type=submit class=btn id=refresh onClick=sendrefresch() value=Refrescar script language=JavaScript type=text/JavaScript !-- function sendrefresch() { How can I do for refresch my web, by the button Refresh? } Why do you want to use javascript? You

Re: [PHP] How can I do this correctly? Trying to get gd to work...

2002-01-08 Thread João P. Bragança
You must change extension_ dir php.ini. Also Re: [PHP] Question about Php/Mysql. Unsure if it's enabled. Those are enabled by default, also in your php.ini At 03:22 1/8/02 -0500, you wrote: with dl() function. Thanks for your time. Even though I read php.net's support on dl, I still cannot get

RE: [PHP] how can I do this !!

2001-10-25 Thread Boget, Chris
i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that Copy the file to .phps and access that page

Re: [PHP] how can I do this !!

2001-10-25 Thread Richard S. Crawford
What do you mean, colorized code? At 02:26 PM 10/25/2001, Alawi wrote: i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code ..

RE: [PHP] how can I do this !!

2001-10-25 Thread Andrew Braund
show_source(basename($PHP_SELF)); At 02:26 PM 10/25/2001, Alawi wrote: i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to

Re: [PHP] how can I do this !! color text in html

2001-10-25 Thread Michael J. Seely
This should work. You can also use html code to use a style sheet ref. ? ECHO FONT COLOR='#2378A0' SIZE='3'Hello Word/FONT; ? i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that

Re: [PHP] How can I do this?? :((

2001-02-05 Thread Steve Werby
"Sandeep Hundal" [EMAIL PROTECTED] wrote: Now what I want to do is have another query which asks the second table the number of comments per each section id, for that section, (and I think QUERY2 does this fine). But I need the answers to integrate with the information pulled from first