RE: [PHP] Watch out for automatic type casting

2012-03-29 Thread Arno Kuhl
-Original Message- From: Simon Schick [mailto:simonsimc...@googlemail.com] Sent: 29 March 2012 07:19 PM To: a...@dotcontent.net Cc: php-general@lists.php.net Subject: Re: [PHP] Watch out for automatic type casting Hi, Arno FYI: I found a page in the php-manual that's exactly for that: ht

[PHP] PHP 5.4.1 RC1 Released

2012-03-29 Thread Stas Malyshev
Hi! We would like to announce the first RC of the 5.4.1 version. This will be mainly a bugfix version, including all bugfixes that did not make the cut for 5.4.0 and new issues since then. Please test it and notify us of any problems you may encounter. The full list of the fixes is as always in th

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
That's EXACTLY what I was looking for. Thanks! Don't know why my Google-Fu failed me... :-) On Mar 29, 2012, at 5:26 PM, Don Wieland wrote: > First Google+ (Google Plus) status update bot in PHP > http://360percents.com/posts/first-google-google-plus-status-update-bot-in-php/ > Is that what you

Re: [PHP] Updating Google Plus

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 22:44, Brian Dunning wrote: > Anyone know a way to update Google Plus via the 33669 SMS number? > > Yes, I have seen the popular how-to instructions to get the secret email > address by using Google Voice and forcing the error message, but I'd prefer a > legit non-hack way to

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Sorry, I did not mention the implied "using PHP". Since everything I do & eat & breathe is PHP, it didn't even occur to me to state the obvious. :-) :-) On Mar 29, 2012, at 2:46 PM, Stuart Dallas wrote: > Err, what has this got to do with PHP?!? -- PHP General Mailing List (http://www.php.ne

Re: [PHP] Updating Google Plus

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 22:44, Brian Dunning wrote: > Anyone know a way to update Google Plus via the 33669 SMS number? > > Yes, I have seen the popular how-to instructions to get the secret email > address by using Google Voice and forcing the error message, but I'd prefer a > legit non-hack way to

[PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Anyone know a way to update Google Plus via the 33669 SMS number? Yes, I have seen the popular how-to instructions to get the secret email address by using Google Voice and forcing the error message, but I'd prefer a legit non-hack way to do it. I'd even be happy to pay for an SMS gateway rather

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
I will try posix_setsid(). Both machines were accessed via a ssh client (e.g. putty or ssh from a other linux box). Thanks for your advice. Am 29. März 2012 23:08 schrieb Stuart Dallas : > On 29 Mar 2012, at 20:49, Ralf Gnädinger wrote: > > > i got some trouble with a PHP script using pcntl_fork

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
development os is Debian GNU/Linux 6.0 test os is SUSE LINUX 10.1 (i586) Am 29. März 2012 23:02 schrieb Jim Lucas : > On 03/29/2012 12:49 PM, Ralf Gnädinger wrote: > >> Hi, >> >> i got some trouble with a PHP script using pcntl_fork do run some work in >> background. >> Runnig my script on my dev

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 20:49, Ralf Gnädinger wrote: > i got some trouble with a PHP script using pcntl_fork do run some work in > background. > Runnig my script on my development system (PHP version 5.3.3-7) it behaves > like > intended. But running it on my production test system (PHP version PHP > 5

Re: [PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Jim Lucas
On 03/29/2012 12:49 PM, Ralf Gnädinger wrote: Hi, i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my development system (PHP version 5.3.3-7) it behaves like intended. But running it on my production test system (PHP version PHP 5.1.2), i

[PHP] pcntl_fork behavior with php version 5.1.2

2012-03-29 Thread Ralf Gnädinger
Hi, i got some trouble with a PHP script using pcntl_fork do run some work in background. Runnig my script on my development system (PHP version 5.3.3-7) it behaves like intended. But running it on my production test system (PHP version PHP 5.1.2), i got some strange results. The problem is, that

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 12:19 PM, Stuart Dallas wrote: > On 29 Mar 2012, at 17:57, Arno Kuhl wrote: > >> I found automatic typecasting can be a bit of a gotcha. >> >> >> >> $sText = "this.is.a.test.text"; >> >> if ( $pos = strpos($sText, "test") !== FALSE) { >> >>                echo  substr($sTex

Re: [PHP] DateTime wierdness

2012-03-29 Thread tamouse mailing lists
2012/3/29 Martín Marqués : > El día 29 de marzo de 2012 14:14, David OBrien escribió: >> actually this would work well ... compare what they send with the output of >> the formatdate >> >> function checkDateTime($data) { >>     if (date('Y-m-d H:i:s', strtotime($data)) == $data) { >>         retur

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 1:30 PM, tamouse mailing lists wrote: > On Thu, Mar 29, 2012 at 1:17 PM, tamouse mailing lists > wrote: >> On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh wrote: >>> Hi Guys, >>> >>> Given below is a PHP script. Can someone help me with the output of the >>> code. According

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 1:17 PM, tamouse mailing lists wrote: > On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh wrote: >> Hi Guys, >> >> Given below is a PHP script. Can someone help me with the output of the >> code. According to my understanding the output should be 3, 50, 20, 10. Can >> someone

[PHP] Re: [PHP-DB] Flow of PHP testClass

2012-03-29 Thread tamouse mailing lists
On Thu, Mar 29, 2012 at 9:57 AM, Rikin Parekh wrote: > Hi Guys, > > Given below is a PHP script. Can someone help me with the output of the > code. According to my understanding the output should be 3, 50, 20, 10. Can > someone elaborate on the same and provide me an explanation on the flow? > > T

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
El día 29 de marzo de 2012 14:14, David OBrien escribió: > actually this would work well ... compare what they send with the output of > the formatdate > > function checkDateTime($data) { >     if (date('Y-m-d H:i:s', strtotime($data)) == $data) { >         return true; >     } else { >         re

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Stuart Dallas
On 29 Mar 2012, at 17:57, Arno Kuhl wrote: > I found automatic typecasting can be a bit of a gotcha. > > > > $sText = "this.is.a.test.text"; > > if ( $pos = strpos($sText, "test") !== FALSE) { > >echo substr($sText, 0, $pos)."<".substr($sText, $pos, > strlen("test")).">".subs

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Simon Schick
Hi, Arno FYI: I found a page in the php-manual that's exactly for that: http://www.php.net/manual/en/language.operators.precedence.php p.s. some of them were also new to me Thanks for getting me to read it. Bye Simon 2012/3/29 Simon Schick : > Hi, Arno > > I don't know if this is written s

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
actually this would work well ... compare what they send with the output of the formatdate function checkDateTime($data) { if (date('Y-m-d H:i:s', strtotime($data)) == $data) { return true; } else { return false; } } 2012/3/29 David OBrien > http://www.php.net/manual

Re: [PHP] Watch out for automatic type casting

2012-03-29 Thread Simon Schick
Hi, Arno I don't know if this is written somewhere in the php-manual, but I really like this table: http://en.wikipedia.org/wiki/Order_of_operations#Programming_languages I do not really understand why this has some special stuff to do with typecasting ... This is just an order like the operators

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
http://www.php.net/manual/en/function.checkdate.php 2012/3/29 Martín Marqués > OK. So what would be a good way to validate a date? > > El día 29 de marzo de 2012 14:04, David OBrien > escribió: > > > > echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); > > > > this outputs "02-14-13" also so my

Re: [PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
OK. So what would be a good way to validate a date? El día 29 de marzo de 2012 14:04, David OBrien escribió: > > echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); > > this outputs "02-14-13" also so my guess is that it is being interpreted the > same as  "12/14/2012 +2 months" > > echo date("m-d-

Re: [PHP] DateTime wierdness

2012-03-29 Thread David OBrien
echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012)); this outputs "02-14-13" also so my guess is that it is being interpreted the same as "12/14/2012 +2 months" echo date("m-d-y",mktime(0, 0, 0, 1, 45, 2012)); outputs "02-14-12" which is 1/1/12 +45 days 2012/3/29 Martín Marqués > Can someone

[PHP] Watch out for automatic type casting

2012-03-29 Thread Arno Kuhl
I found automatic typecasting can be a bit of a gotcha. $sText = "this.is.a.test.text"; if ( $pos = strpos($sText, "test") !== FALSE) { echo substr($sText, 0, $pos)."<".substr($sText, $pos, strlen("test")).">".substr($sText, $pos+strlen("test")); } The code seems logical

[PHP] DateTime wierdness

2012-03-29 Thread Martín Marqués
Can someone explain to me this weierdness I see when using the DateTime module of PHP. Here I send 14/14/2012 which is not a valid date, and I would expect to recieve false, but instead, it looks like it wrapping to the next year, as if 14 monthas are 1 year and 2 months. That isn't what's suppose