[PHP] static variables inside static methods

2011-07-06 Thread Дмитрий Степанов
Hello, everybody. While working with static variables inside static class' methods, I have found this very interesting (at least for me) behavior of PHP. Consider the following class definitions (example #1): class X { public final static function test() { static $i; return ++$i; } } class Y ex

Re: [PHP] static variables inside static methods

2011-07-06 Thread Andrew Williams
I think you are confusing scope visibility level of the variable within method and the class. Variable within the method is going to 1 because it was declare within the test method and there no link to the one declared outside the test method. The second case is referencing the varible of the cl

[PHP] Re: Installing PHP

2011-07-06 Thread David Robley
Jim Giner wrote: > Eureka! > > The whole problem was my unfamiliarity with the php download page. To > others - read the choices there very carefully (which I thought I did!) to > be sure you get the "thread-safe" version. > > Thanks to all who contributed, but David gets the kudos for telling

RE: [PHP] Top Posting

2011-07-06 Thread Ford, Mike
On 2011-07-05, Stuart Dallas penned the words: > On Tue, Jul 5, 2011 at 3:29 PM, wrote: > >> Anyone know how to make Outlook changes its reply position. > > Google delivers... > http://sourceforge.net/apps/mediawiki/macros4outlook/index.php?title > =QuoteFix_Macro Many thanks for that link, St

[PHP] Constants in strings

2011-07-06 Thread Dave Wilson
Hi all, OK. We all know that constants cannot be accessed directly via their name in double-quoted or heredoc strings. I knew this already but a read of the PHP manual got me thinking. The manual states that to get the $$ value of a variable, the form "{${var}}" should be used. Therefore, I wonde

RE: [PHP] Foreach question

2011-07-06 Thread Dajka Tamás
And that's exactly how I did it :) Since 'for' is traditionally pre-testing with excetuting the condition prior looping it's working well :) Thanks for all the help! Cheers, Tamas -Original Message- From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com] Sent: Tuesday, J

Re: [PHP] Constants in strings

2011-07-06 Thread Curtis Maurand
On 7/6/2011 7:07 AM, Dave Wilson wrote: Output - {XYZ} Attempt 2: Output - {{XYZ}} No luck there. I did encounter one oddity though: Output: PHP Notice: Undefined variable: ABC in /home/wilsond/testScripts/l7.php on line 3 Which appears to mean that PHP is able to pick up the value of the

Re: [PHP] Constants in strings

2011-07-06 Thread Stuart Dallas
On Wed, Jul 6, 2011 at 12:07 PM, Dave Wilson wrote: > Hi all, > > OK. We all know that constants cannot be accessed directly via their name > in double-quoted or heredoc strings. I knew this already but a read of > the PHP manual got me thinking. > > The manual states that to get the $$ value of

Re: [PHP] Constants in strings

2011-07-06 Thread Ashley Sheridan
>> Any ideas? >> >echo XYZ . "\n"; > > > >--Curtis > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Which doesn't answer the original question Dave asked... Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone wit

[PHP] Re: Constants in strings

2011-07-06 Thread Geoff Lane
On Wednesday, July 6, 2011, Dave Wilson wrote: > OK. We all know that constants cannot be accessed directly via their > name in double-quoted or heredoc strings. FWIW, this looked like it might be a right royal PITA for me ATM. However, I've got a work-around. With about a dozen scripts written

Re: [PHP] vend-bot?

2011-07-06 Thread Stuart Dallas
On Wed, Jul 6, 2011 at 3:01 AM, Kirk Bailey wrote: > > > On 7/3/2011 4:53 PM, Stuart Dallas wrote: > >> Only allowing them to access the URL once is a bad idea. If their download >> fails, is corrupt, or any number of other things go wrong (think >> accelerators, browser accelerators, etc) then you

Re: [PHP] vend-bot?

2011-07-06 Thread Steve Staples
> What do you think you gain by limiting the link to a single use? If you > think you're preventing them from passing it on to other people, then yes > you are, but if you do that then they'll simply send the digital file > instead so you're actually trading a poor user experience and increased > s

[PHP] Re: Self-whitelisting (WAS: Top Posting)

2011-07-06 Thread Jim Giner
"George Langley" wrote in message news:841bbd90-9cd4-4df5-9a38-ff61638f7...@shaw.ca... On 2011-07-05, at 8:52 PM, Jim Giner wrote: > Huh? You have a problem with a person having a spam filter that requires > one valid response to ensure that the mail from an address is from a real > person ONE

Re: [PHP] Constants in strings

2011-07-06 Thread Dave Wilson
On Wed, 06 Jul 2011 12:56:21 +0100, Stuart Dallas wrote: > My guess is that the preceding $ causes PHP to interpret the next token > "{XYZ}" as a variable or a constant, but without that preceding $ it has > no way to know you're trying to use a constant. As Curtis points out, > the only way to ins

Re: [PHP] Re: Self-whitelisting (WAS: Top Posting)

2011-07-06 Thread George Langley
On 2011-07-06, at 8:02 AM, Jim Giner wrote: > > "George Langley" wrote : >> On 2011-07-05, at 8:52 PM, Jim Giner wrote: >> >>> Huh? You have a problem with a person having a spam filter that requires >>> one valid response to ensure that the mail from an address is from a real >>> person ONE TI

RE: [PHP] Constants in strings

2011-07-06 Thread admin
> -Original Message- > From: Dave Wilson [mailto:dai_bac...@hotmail.com] > Sent: Wednesday, July 06, 2011 10:11 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Constants in strings > > On Wed, 06 Jul 2011 12:56:21 +0100, Stuart Dallas wrote: > > My guess is that the preceding $ cau

RE: [PHP] Constants in strings

2011-07-06 Thread Ashley Sheridan
> >define('DIR_JAVA', '/js/'); > >When you need to use the JavaScript directory you can do this. > > >There is no true need for the curly brackets to echo out the value of >the constant. > Except for when you're using heredoc, much like in the OPs first post... Thanks, Ash http://www.ashleysher

RE: [PHP] Constants in strings

2011-07-06 Thread Curtis Maurand
Yeah, that was my answer and I was rebuked for that. ad...@buskirkgraphics.com wrote: >> -Original Message- >> From: Dave Wilson [mailto:dai_bac...@hotmail.com] >> Sent: Wednesday, July 06, 2011 10:11 AM >> To: php-general@lists.php.net >> Subject: Re: [PHP] Constants in strings >> >> O

RE: [PHP] Constants in strings

2011-07-06 Thread admin
> -Original Message- > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > Sent: Wednesday, July 06, 2011 10:49 AM > To: ad...@buskirkgraphics.com; 'Dave Wilson'; php-general@lists.php.net > Subject: RE: [PHP] Constants in strings > > > > > > >define('DIR_JAVA', '/js/'); > > > >Wh

Re: [PHP] Constants in strings

2011-07-06 Thread Robert Williams
On 2011-07-6 08:09, "ad...@buskirkgraphics.com" wrote: >I use constants in my OOP and I never use the heredoc syntax. Now I am >fearing that I have not taken advantage of something. >My understanding of heredoc syntax as of 5.3 is just a string quoting >right? >Is there an advantage of using th

Re: [PHP] vend-bot?

2011-07-06 Thread Kirk Bailey
On 7/6/2011 9:31 AM, Stuart Dallas wrote: On Wed, Jul 6, 2011 at 3:01 AM, Kirk Bailey mailto:kbai...@howlermonkey.net>> wrote: On 7/3/2011 4:53 PM, Stuart Dallas wrote: Only allowing them to access the URL once is a bad idea. If their download fails, is corrupt, or any n

Re: [PHP] vend-bot?

2011-07-06 Thread Kirk Bailey
because some emails do not permit large attachments. On 7/6/2011 9:47 AM, Steve Staples wrote: What do you think you gain by limiting the link to a single use? If you think you're preventing them from passing it on to other people, then yes you are, but if you do that then they'll simply send th

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Jim Lucas
On 7/5/2011 7:52 PM, Jim Giner wrote: > And what do you use to cut down on spam in your in-box? This is completely off topic, but here it goes... When I received an email the other day from your mail server, I had created this crazy ass reply to your automatic request for a reply. But in turn,

Re: [PHP] Constants in strings

2011-07-06 Thread Jim Giner
I LOVE the heredocs tool. I only learned about it a couple of months ago - what a find! It makes generating my html for my web pages so much easier and allows me to include my php vars within the html with much less confusion and simplifies the intermixing of html and php vars - no more s

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Jim Giner
> You are currently listed in my /etc/postfix/helo_checks file as > > 64.118.87.45 REJECT Your mail server is a source of SPAM. Fix it! > My mail server is my isp's. It is a shared server and not under my control. They are aware that is listed but cannot get to the bottom of why it is flagged.

Re: [PHP] Constants in strings

2011-07-06 Thread Robert Cummings
On 11-07-06 02:59 PM, Jim Giner wrote: I LOVE the heredocs tool. I only learned about it a couple of months ago - what a find! It makes generating my html for my web pages so much easier and allows me to include my php vars within the html with much less confusion and simplifies the intermi

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Stuart Dallas
On 6 Jul 2011, at 20:03, "Jim Giner" wrote: > Frankly, I don't know why you are getting mail from me - I'm not sending you > any. FFS and for the last time... THIS IS A MAILING LIST which you access through a newsgroup gateway. It is NOT a newsgroup! -Stuart -- Stuart Dallas 3ft9 Ltd http://

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Jim Giner
"Stuart Dallas" wrote in message news:e73bd95e-0524-4743-92be-ae211b57e...@3ft9.com... On 6 Jul 2011, at 20:03, "Jim Giner" wrote: > Frankly, I don't know why you are getting mail from me - I'm not sending > you > any. FFS and for the last time... THIS IS A MAILING LIST which you access throu

Re: Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Tim Streater
On 06 Jul 2011 at 20:03, Jim Giner wrote: >> You are currently listed in my /etc/postfix/helo_checks file as >> >> 64.118.87.45 REJECT Your mail server is a source of SPAM. Fix it! >> > My mail server is my isp's. It is a shared server and not under my control. > They are aware that is listed

Re: Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Tim Streater
On 06 Jul 2011 at 20:03, Jim Giner wrote: > Frankly, I don't know why you are getting mail from me - I'm not sending you > any. You're sending mail to all of us. Here's what I got from you: To: php-general@lists.php.net From:Jim Giner Subject: Re: [PHP] Re: Re: Top Posting Date:W

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Daniel Brown
On Wed, Jul 6, 2011 at 15:25, Jim Giner wrote: > > Forgive me for not being a know-it-all.  I don't even know what FFS means. Took me a minute to figure it out as well, and I was just getting ready to Google it when I thought to myself, "what is it that Stut would mean by that?" The key word

Re: Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Jim Giner
"Tim Streater" wrote in message news:e5.d2.37602.f96b4...@pb1.pair.com... On 06 Jul 2011 at 20:03, Jim Giner wrote: > As for your solution to spam. What is Postfix? Rather than rely on heuristics, I wrote a Bayesian filter for my e-mail app. Let the spammer, by sending you the mail, indicate

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Stuart Dallas
On Wed, Jul 6, 2011 at 8:25 PM, Jim Giner wrote: > > "Stuart Dallas" wrote in message > news:e73bd95e-0524-4743-92be-ae211b57e...@3ft9.com... > On 6 Jul 2011, at 20:03, "Jim Giner" wrote: > > Frankly, I don't know why you are getting mail from me - I'm not sending > > you > > any. > > FFS and fo

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Paul M Foster
On Wed, Jul 06, 2011 at 03:03:44PM -0400, Jim Giner wrote: [snip] > > As for your solution to spam. What is Postfix? > Postfix is a *nix program which can be connected to whatever program you use to grab mail with. With postfix, you write "recipes" which dictate what will be done with a piece

Re: [PHP] vend-bot?

2011-07-06 Thread Stuart Dallas
On Wed, Jul 6, 2011 at 6:16 PM, Kirk Bailey wrote: > ** > > On 7/6/2011 9:31 AM, Stuart Dallas wrote: > > On Wed, Jul 6, 2011 at 3:01 AM, Kirk Bailey wrote: >> >> >> On 7/3/2011 4:53 PM, Stuart Dallas wrote: >> >>> Only allowing them to access the URL once is a bad idea. If their >>> download fail

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Tamara Temple
On Jul 6, 2011, at 3:19 PM, Paul M Foster wrote: Postfix is a *nix program which can be connected to whatever program you use to grab mail with. With postfix, you write "recipes" which dictate what will be done with a piece of incoming mail, based on whatever characteristics you choose. Think

Re: [PHP] Spam filtering (was Top Posting)

2011-07-06 Thread Simon J Welsh
On 7/07/2011, at 5:50 AM, Jim Lucas wrote: > On 7/5/2011 7:52 PM, Jim Giner wrote: >> And what do you use to cut down on spam in your in-box? > > This is completely off topic, but here it goes... > > When I received an email the other day from your mail server, I had created > this > crazy ass

Re: [PHP] static variables inside static methods

2011-07-06 Thread Дмитрий Степанов
>> The second case is referencing the varible of the class. Maybe you are right. However, I don't really think that there is a true "reference" to the class var in example #2. PHP documentation of static keywords does not unambiguously explain behavior of "static" variables inside methods in examp

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Paul M Foster
On Wed, Jul 06, 2011 at 04:24:29PM -0500, Tamara Temple wrote: > > On Jul 6, 2011, at 3:19 PM, Paul M Foster wrote: > >Postfix is a *nix program which can be connected to whatever > >program you > >use to grab mail with. With postfix, you write "recipes" which dictate > >what will be done with a

Re: [PHP] static variables inside static methods

2011-07-06 Thread David Harkness
2011/7/6 Дмитрий Степанов > PHP documentation of static keywords does not unambiguously explain > behavior > of "static" variables inside methods in example #1. I believe that in > example #1 the exactly same instance of function (method) is used > irregarding of how you call it (X::test() or Y::

Re: [PHP] vend-bot?

2011-07-06 Thread Stuart Dallas
Please include the list when replying. On Wed, Jul 6, 2011 at 10:20 PM, Kirk Bailey wrote: > Um, assuming dishonest intent on the customers part, why would the token > NOT be shared? > I meant shared within your system between customers. Whether you lock the URL or not, if customers want to shar

Re: [PHP] vend-bot?

2011-07-06 Thread Stuart Dallas
Again, please include the list when replying. On Thu, Jul 7, 2011 at 1:06 AM, Kirk Bailey wrote: > ** > > > On 7/6/2011 6:08 PM, Stuart Dallas wrote: > > Please include the list when replying. > > On Wed, Jul 6, 2011 at 10:20 PM, Kirk Bailey wrote: > >> Um, assuming dishonest intent on the custom

[PHP] Re: Re: Top Posting

2011-07-06 Thread Michelle Konzack
Hello Jim Giner, Am 2011-07-05 22:52:39, hacktest Du folgendes herunter: > Huh? You have a problem with a person having a spam filter that requires > one valid response to ensure that the mail from an address is from a real > person ONE TIME ONLY? The problem is, that 1) I read the messages o

Re: [PHP] Re: Re: Top Posting

2011-07-06 Thread Hans Åhlin
2011/7/6 Stuart Dallas : > On Wed, Jul 6, 2011 at 8:25 PM, Jim Giner wrote: > >> >> "Stuart Dallas" wrote in message >> news:e73bd95e-0524-4743-92be-ae211b57e...@3ft9.com... >> On 6 Jul 2011, at 20:03, "Jim Giner" wrote: >> > Frankly, I don't know why you are getting mail from me - I'm not sendin