Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Mihamina Rakotomandimby
On 08/15/2012 11:28 AM, phplist wrote: This relates to a minor dilemma I come across from time and time, and I'm looking for advice [...] Within a site I have a User object, and within page code would like to have if ($crntUser->isASubscriber) {...} [...] if ($crntUser->isASubscriber()) {...} [.

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
On Wed, Aug 15, 2012 at 3:24 PM, Tedd Sperling wrote: > Your points are well taken -- thanks. I've seen a lot of people code that way, so it's easy to miss. In your original code, that first statement was calling session_start() 1,000 times. This is because the first time through, SID is undefine

Re: [PHP] PHP session variables

2012-08-15 Thread Robert Cummings
On 12-08-15 03:19 PM, Tedd Sperling wrote: Rob: Again thanks. Sorry, I totally missed your point. In my "defense" I commonly use the value returned from microtime() as a string and not as a float. The code that followed my "microtime( false );" demo broke the string and recombined it into a

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
Andrew: Your points are well taken -- thanks. However, my only concern is given this: > for($i=1; $i < 1000; $i++) >{ >if (!defined('SID')) > { > echo __LINE__, '::session_start()'; > session_start(); > } >} The php manual ( http:

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
On Aug 14, 2012, at 11:01 AM, Robert Cummings wrote: > > I'm not sure if you're making a joke, but your changes have no effect. You've > merely explicitly stated the optional parameter's default value. What I had > meant was to change the following: > > > $starttime = microtime(); > $startar

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread David Harkness
On Wed, Aug 15, 2012 at 1:28 AM, phplist wrote: > I can have a User object method "getSubscriberStatus()" which sets > $this->isASubscriber. But to use this I would have to run the method just > before the if statement. > > Or I could have a method "isASubscriber()" which returns the result, > me

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
On Fri, Aug 10, 2012 at 11:56 AM, Tedd Sperling wrote: > On Aug 10, 2012, at 11:45 AM, Tedd Sperling wrote: > >> On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: >>> You are relying on PHP's loose typing. This is a poor check. >>> >>> session_id() returns a string, not boolean. >>> >>> You should d

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Andrew Ballard
On Wed, Aug 15, 2012 at 11:33 AM, Paul M Foster wrote: > On Wed, Aug 15, 2012 at 09:28:28AM +0100, phplist wrote: > >> This relates to a minor dilemma I come across from time and time, >> and I'm looking for advice on pros and cons and best practice. Last >> night I encountered it again. >> >> Wit

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Paul M Foster
On Wed, Aug 15, 2012 at 09:28:28AM +0100, phplist wrote: > This relates to a minor dilemma I come across from time and time, > and I'm looking for advice on pros and cons and best practice. Last > night I encountered it again. > > Within a site I have a User object, and within page code would lik

Re: [PHP] Reading class variable value always returns NULL

2012-08-15 Thread Philipp Gysin
As a little clarification: The Apache server in question is configured as a MPM prefork. On Wed, Aug 15, 2012 at 4:28 PM, Reto Kaiser wrote: > So here's some new observations on the instance variables being NULL. > As far as we found out this is the sequence of events: > > 1. Apache (MPM) recei

Re: [PHP] Reading class variable value always returns NULL

2012-08-15 Thread Reto Kaiser
So here's some new observations on the instance variables being NULL. As far as we found out this is the sequence of events: 1. Apache (MPM) received request A which executes a php script. 2. Within this script during the unserialization of an object an exception is thrown. 3. This exception is ca

Re: [PHP] How to catch an exception using SoapClient.

2012-08-15 Thread Ellis Antaya
like any other exception ... using a try catch block ;) Ellis 110010100001 " Unfortunately, no one can be told what The Matrix is. You have to see it for yourself. " twitter.com/floverdevel facebook.com/ellis.antaya google.com/profiles/ellis.antaya linkedin.com/in/ellisantaya On Mon, Aug 6

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Sebastian Krebs
Hi, 2012/8/15 phplist > This relates to a minor dilemma I come across from time and time, and I'm > looking for advice on pros and cons and best practice. Last night I > encountered it again. > > Within a site I have a User object, and within page code would like to have > if ($crntUser->isASubs

[PHP] Two ways to obtain an object property

2012-08-15 Thread phplist
This relates to a minor dilemma I come across from time and time, and I'm looking for advice on pros and cons and best practice. Last night I encountered it again. Within a site I have a User object, and within page code would like to have if ($crntUser->isASubscriber) {...} There seems to be