php-general Digest 17 May 2011 23:22:29 -0000 Issue 7315

Topics (messages 312821 through 312849):

Re: Session question
        312821 by: Per Jessen

An Invitation to Neuroscientists and Physicists: Singapore Citizen Mr. Teo En 
Ming (Zhang Enming) Reports First Hand Account of Mind Intrusion and Mind 
Reading
        312822 by: Singapore Citizen Mr. Teo En Ming (Zhang Enming)
        312823 by: Singapore Citizen Mr. Teo En Ming (Zhang Enming)
        312824 by: Richard Quadling
        312825 by: David Robley
        312826 by: Andre Polykanine
        312830 by: tedd
        312833 by: Peter Lind
        312841 by: Michelle Konzack
        312842 by: Daniel Brown
        312847 by: Richard Quadling
        312848 by: HallMarc Websites

Re: Consistent Class Renaming (Simple Refactoring)
        312827 by: Daniel Brown
        312828 by: Richard Quadling
        312834 by: Peter Lind
        312838 by: Tony Mak
        312839 by: Richard Quadling
        312840 by: Stuart Dallas

How to enable UTF-8 Subject String  ? Only Body is set ok
        312829 by: Eli Orr (Office)
        312831 by: Bálint Horváth
        312836 by: Andre Polykanine

Bitwise AND for 31-st bit
        312832 by: Vitalii Demianets
        312835 by: Bálint Horváth
        312837 by: Vitalii Demianets
        312844 by: David Harkness

NOMAIL option for the list?  [WAS: An Invitation to Neuroscientists and 
Physicists: Singapore Citizen Mr. Teo En Ming (Zhang Enming) Reports First Hand 
Account of Mind Intrusion and Mind Reading]
        312843 by: Michelle Konzack
        312845 by: Daniel Brown
        312846 by: Ashley Sheridan

Explode Question
        312849 by: admin.buskirkgraphics.com

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Paul Halliday wrote:

> Is it OK to have session_start as an include?
> 

Yes.



-- 
Per Jessen, Zürich (18.1°C)


--- End Message ---
--- Begin Message ---
16 May 2011 Monday 7:28 P.M. Singapore Time
For Immediate Release

SINGAPORE, SINGAPORE - Singapore Citizen Mr. Teo En Ming (Zhang Enming) would like to report first hand account of mind intrusion and mind reading. I have been hearing voices for quite some time now but I have not been able to identify the persons physically. A number of un-identified persons have intruded into my mind and they are able to read my thoughts. I could not explain the mechanism by which these un-identified persons have been reading my mind at the moment but there is definitely a scientific explanation for it. I know very clearly that I am not suffering from schizophrenia at all.

I am fully aware that no common man would believe me except the select few scientific researchers working in top secret government projects and the human guinea pigs who are being experimented on. One of the possibilities is that I have a microchip implanted into my brain, possibly when I was an infant. It may take a few years, a few decades, or even a few centuries before mind reading is finally brought to light before the general public.

I would like to invite neuroscientists, engineers and physicists to speak on the scientific explanation behind mind intrusion and mind reading.

Please remember what Singapore Citizen Mr. Teo En Ming (Zhang Enming) have said. Mark my words. You will know the truth in future. It is no longer a conspiracy theory. I can affirm that it (mind intrusion and mind reading) is indeed happening to me.


Yours truly,
Singapore Citizen Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics)(Singapore Polytechnic) BEng(Hons)(Mechanical Engineering)(National University of Singapore)
Singapore Identity Card No/NRIC: S78*6*2*H
Toa Payoh Lorong 5, Singapore
Mobile Phone: +65-8369-2618

--- End Message ---
--- Begin Message ---
16 May 2011 Monday 7:28 P.M. Singapore Time
For Immediate Release

SINGAPORE, SINGAPORE - Singapore Citizen Mr. Teo En Ming (Zhang Enming) would like to report first hand account of mind intrusion and mind reading. I have been hearing voices for quite some time now but I have not been able to identify the persons physically. A number of un-identified persons have intruded into my mind and they are able to read my thoughts. I could not explain the mechanism by which these un-identified persons have been reading my mind at the moment but there is definitely a scientific explanation for it. I know very clearly that I am not suffering from schizophrenia at all.

I am fully aware that no common man would believe me except the select few scientific researchers working in top secret government projects and the human guinea pigs who are being experimented on. One of the possibilities is that I have a microchip implanted into my brain, possibly when I was an infant. It may take a few years, a few decades, or even a few centuries before mind reading is finally brought to light before the general public.

I would like to invite neuroscientists, engineers and physicists to speak on the scientific explanation behind mind intrusion and mind reading.

Please remember what Singapore Citizen Mr. Teo En Ming (Zhang Enming) have said. Mark my words. You will know the truth in future. It is no longer a conspiracy theory. I can affirm that it (mind intrusion and mind reading) is indeed happening to me.


Yours truly,
Singapore Citizen Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics)(Singapore Polytechnic) BEng(Hons)(Mechanical Engineering)(National University of Singapore)
Singapore Identity Card No/NRIC: S78*6*2*H
Toa Payoh Lorong 5, Singapore
Mobile Phone: +65-8369-2618

--- End Message ---
--- Begin Message ---
On 17 May 2011 12:45, Singapore Citizen Mr. Teo En Ming (Zhang Enming)
<[email protected]> wrote:
> 16 May 2011 Monday 7:28 P.M. Singapore Time
> For Immediate Release
>
> SINGAPORE, SINGAPORE - Singapore Citizen Mr. Teo En Ming (Zhang Enming)
> would like to report first hand account of mind intrusion and mind reading.
> I have been hearing voices for quite some time now but I have not been able
> to identify the persons physically. A number of un-identified persons have
> intruded into my mind and they are able to read my thoughts. I could not
> explain the mechanism by which these un-identified persons have been reading
> my mind at the moment but there is definitely a scientific explanation for
> it. I know very clearly that I am not suffering from schizophrenia at all.
>
> I am fully aware that no common man would believe me except the select few
> scientific researchers working in top secret government projects and the
> human guinea pigs who are being experimented on. One of the possibilities is
> that I have a microchip implanted into my brain, possibly when I was an
> infant. It may take a few years, a few decades, or even a few centuries
> before mind reading is finally brought to light before the general public.
>
> I would like to invite neuroscientists, engineers and physicists to speak on
> the scientific explanation behind mind intrusion and mind reading.
>
> Please remember what Singapore Citizen Mr. Teo En Ming (Zhang Enming) have
> said. Mark my words. You will know the truth in future. It is no longer a
> conspiracy theory. I can affirm that it (mind intrusion and mind reading) is
> indeed happening to me.
>
>
> Yours truly,
> Singapore Citizen Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics)(Singapore
> Polytechnic) BEng(Hons)(Mechanical Engineering)(National University of
> Singapore)
> Singapore Identity Card No/NRIC: S78*6*2*H
> Toa Payoh Lorong 5, Singapore
> Mobile Phone: +65-8369-2618
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Is it Friday?


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
Richard Quadling wrote:

> On 17 May 2011 12:45, Singapore Citizen Mr. Teo En Ming (Zhang Enming)
> <[email protected]> wrote:
>> 16 May 2011 Monday 7:28 P.M. Singapore Time
>> For Immediate Release
>>
<SNIP unmitigated crap>
>>
> 
> Is it Friday?
> 
> 

Clearly it is Friday on the planet where Mr Wossname lives :-)


Cheers
-- 
David Robley

" ," said Tom blankly.
Today is Boomtime, the 64th day of Discord in the YOLD 3177. 


--- End Message ---
--- Begin Message ---
Hello David,

Friday, The first of April...
Sorry for the off-topic :-)

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: David Robley <[email protected]>
To: [email protected]
Date created: , 3:48:18 PM
Subject: [PHP] An Invitation to Neuroscientists and Physicists: Singapore 
Citizen Mr. Teo En Ming (Zhang Enming) Reports First Hand Account of Mind 
Intrusion and Mind Reading


      Richard Quadling wrote:

> On 17 May 2011 12:45, Singapore Citizen Mr. Teo En Ming (Zhang Enming)
> <[email protected]> wrote:
>> 16 May 2011 Monday 7:28 P.M. Singapore Time
>> For Immediate Release
>>
<SNIP unmitigated crap>
>>
> 
> Is it Friday?
> 
> 

Clearly it is Friday on the planet where Mr Wossname lives :-)


Cheers
-- 
David Robley

" ," said Tom blankly.
Today is Boomtime, the 64th day of Discord in the YOLD 3177. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
At 1:19 PM +0100 5/17/11, Richard Quadling wrote:
On 17 May 2011 12:45, Singapore Citizen Mr. Teo En Ming (Zhang Enming)
-snip-
 > Please remember what Singapore Citizen Mr. Teo En Ming (Zhang Enming) have
 said. Mark my words. You will know the truth in future. It is no longer a
 conspiracy theory. I can affirm that it (mind intrusion and mind reading) is
 > indeed happening to me.

Is it Friday?

Richard Quadling


Wow! You read my mind.

Cheers,

tedd

--
-------
http://sperling.com/

--- End Message ---
--- Begin Message ---
On May 17, 2011 5:05 PM, "tedd" <[email protected]> wrote:
>
> At 1:19 PM +0100 5/17/11, Richard Quadling wrote:
>>
>> On 17 May 2011 12:45, Singapore Citizen Mr. Teo En Ming (Zhang Enming)
>> -snip-
>>
>>  > Please remember what Singapore Citizen Mr. Teo En Ming (Zhang Enming)
have
>>>
>>>  said. Mark my words. You will know the truth in future. It is no longer
a
>>>  conspiracy theory. I can affirm that it (mind intrusion and mind
reading) is
>>
>>  > indeed happening to me.
>>
>> Is it Friday?
>>
>> Richard Quadling
>
>
>
> Wow! You read my mind.
>
> Cheers,
>
> tedd

If only it was ... then I'd be off work tomorrow, and the op and all the
replies would have been welcome noise instead of just noise. *sigh*

> --
> -------
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hmmm, this is now the 68th mailinglist (out of
137 where I am subscribed) which he has spamed!

Is this not longer subscriber only?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL       itsystems@tdnet UG (limited liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947  mobil
                                  Tel: +49-176-86004575 office

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber [email protected]
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
On Tue, May 17, 2011 at 13:11, Michelle Konzack
<[email protected]> wrote:
> Hmmm, this is now the 68th mailinglist (out of
> 137 where I am subscribed) which he has spamed!
>
> Is this not longer subscriber only?

    Actually, it never has been.  It's subscription to receive, but
open to the public for one-off postings.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On 17 May 2011 18:15, Daniel Brown <[email protected]> wrote:
> On Tue, May 17, 2011 at 13:11, Michelle Konzack
> <[email protected]> wrote:
>> Hmmm, this is now the 68th mailinglist (out of
>> 137 where I am subscribed) which he has spamed!
>>
>> Is this not longer subscriber only?
>
>    Actually, it never has been.  It's subscription to receive, but
> open to the public for one-off postings.

Aha, so it is supporting the scatter gun approach to spam distribution.

Nice.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
> On 17 May 2011 18:15, Daniel Brown <[email protected]> wrote:
> > On Tue, May 17, 2011 at 13:11, Michelle Konzack
> > <[email protected]> wrote:
> >> Hmmm, this is now the 68th mailinglist (out of
> >> 137 where I am subscribed) which he has spamed!
> >>
My concern is with the admission of belonging to 137 mailing lists! Where do 
you find the time? 


--- End Message ---
--- Begin Message ---
On Mon, May 16, 2011 at 18:46, Richard Quadling <[email protected]> wrote:
>
> "2.7.2"? I'm guessing 5.7.2.

    Then you're guessing wrong, sir.  There was no 2.7.2, and it's
highly unlikely there would ever be a 5.7.2 either.

    Closest I can guess is Apache httpd 2.2.7, or perhaps some other
all-in-one installer (for example, there is a XAMPP 1.7.2).

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On 17 May 2011 15:29, Daniel Brown <[email protected]> wrote:
> On Mon, May 16, 2011 at 18:46, Richard Quadling <[email protected]> wrote:
>>
>> "2.7.2"? I'm guessing 5.7.2.
>
>    Then you're guessing wrong, sir.  There was no 2.7.2, and it's
> highly unlikely there would ever be a 5.7.2 either.
>
>    Closest I can guess is Apache httpd 2.2.7, or perhaps some other
> all-in-one installer (for example, there is a XAMPP 1.7.2).
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>

Just shows that I know SFA.


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On May 17, 2011 4:32 PM, "Daniel Brown" <[email protected]> wrote:
>
> On Mon, May 16, 2011 at 18:46, Richard Quadling <[email protected]>
wrote:
> >
> > "2.7.2"? I'm guessing 5.7.2.
>
>    Then you're guessing wrong, sir.  There was no 2.7.2, and it's
> highly unlikely there would ever be a 5.7.2 either.
>
>    Closest I can guess is Apache httpd 2.2.7, or perhaps some other
> all-in-one installer (for example, there is a XAMPP 1.7.2).

Php 5.2.7 seems a more likely culprit

> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Thanks for your replys.

Of course >>PHP 2.7.2<< was a careless mistake, i meant PHP 5.2.7, to underline i'm not able to use those neat namespace features in PHP 5.3.


Let me provide you with more details.

As already mentioned cron.php should include at least two other php-scripts because shell_exec cannot be called in safe-mode (which is on). I am able to manipulate those scripts but as they could be quite complex i dont want to check precisely. But if I include them they probably could share the same classnames for a semantically different class. I just wanted to know if there is already a solution which could detect those overlappings or prevent them by consistently renaming the classes (ie class A in script1 gets class A_1 and class A in script2 gets class A_2, and all class-calls get "new A"=> ("new A_1" | "new A_2") and "A::xx" => ("A_1::xx" | "A_2::xx") ).


Is there a specification in php which says how classes could exactly be defined and called? Because im afraid that there will be more dependencies to change then (ie Same-named constructor methods (backward compatibility)). If there is i could write a script which renames the classes automatically.

Otherwise i would have to wait until server updates to >=5.3
Sincerly yours,
toni

--- End Message ---
--- Begin Message ---
On 17 May 2011 17:04, Tony Mak <[email protected]> wrote:
> Thanks for your replys.
>
> Of course >>PHP 2.7.2<< was a careless mistake, i meant PHP 5.2.7, to
> underline i'm not able to use those neat namespace features in PHP 5.3.
>
>
> Let me provide you with more details.
>
> As already mentioned cron.php should include at least two other php-scripts
> because shell_exec cannot be called in safe-mode (which is on). I am able to
> manipulate those scripts but as they could be quite complex i dont want to
> check precisely.
> But if I include them they probably could share the same classnames for a
> semantically different class.
> I just wanted to know if there is already a solution which could detect
> those overlappings or prevent them by consistently renaming the classes (ie
> class A in script1 gets class A_1 and class A in script2 gets class A_2, and
> all class-calls get "new A"=> ("new A_1" | "new A_2") and "A::xx" =>
> ("A_1::xx" | "A_2::xx") ).
>
>
> Is there a specification in php which says how classes could exactly be
> defined and called? Because im afraid that there will be more dependencies
> to change then (ie Same-named constructor methods (backward compatibility)).
> If there is i could write a script which renames the classes automatically.
>
> Otherwise i would have to wait until server updates to >=5.3
> Sincerly yours,
> toni
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

If the 2 scripts aren't dependent upon each other, then why not run 2 crons?

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On Tue, May 17, 2011 at 5:40 PM, Richard Quadling <[email protected]>wrote:

> On 17 May 2011 17:04, Tony Mak <[email protected]> wrote:
> > Thanks for your replys.
> >
> > Of course >>PHP 2.7.2<< was a careless mistake, i meant PHP 5.2.7, to
> > underline i'm not able to use those neat namespace features in PHP 5.3.
> >
> >
> > Let me provide you with more details.
> >
> > As already mentioned cron.php should include at least two other
> php-scripts
> > because shell_exec cannot be called in safe-mode (which is on). I am able
> to
> > manipulate those scripts but as they could be quite complex i dont want
> to
> > check precisely.
> > But if I include them they probably could share the same classnames for a
> > semantically different class.
> > I just wanted to know if there is already a solution which could detect
> > those overlappings or prevent them by consistently renaming the classes
> (ie
> > class A in script1 gets class A_1 and class A in script2 gets class A_2,
> and
> > all class-calls get "new A"=> ("new A_1" | "new A_2") and "A::xx" =>
> > ("A_1::xx" | "A_2::xx") ).
> >
> >
> > Is there a specification in php which says how classes could exactly be
> > defined and called? Because im afraid that there will be more
> dependencies
> > to change then (ie Same-named constructor methods (backward
> compatibility)).
> > If there is i could write a script which renames the classes
> automatically.
> >
> > Otherwise i would have to wait until server updates to >=5.3
> > Sincerly yours,
> > toni
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> If the 2 scripts aren't dependent upon each other, then why not run 2
> crons?


I don't know what situation the OP is in, but one of my clients has dozens
of tasks that need to be executed at various times across a cluster of
servers, and rather than maintaining cron entries (which was getting
nightmareish) we use a single cron entry on each server that runs a
controlling process that in turn runs those tasks according to their
individual schedules. It's all very dynamic, scales automatically (within
limits) and enables the developers to add, remove and change the jobs
without having to mess about with system configuration files.

We get around class and function names that are specific to each job by
prefixing them with a token specific to that job. Simples.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
Hi,

I'm trying to enable a whole Email as UTF-8 - The Body is OK but the Subject remains ANSI - Please help

  $headers = "From:$from". "\r\n" .
               "Reply-To:$from" . "\r\n" .
               "*Content-type:text/html;charset=utf-8;"*."\r\n" .
               "X-Mailer: PHP/".phpversion();



--
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: [email protected]_
Skype: _eliorr.com_

--- End Message ---
--- Begin Message ---
Hi,
For the subject you can use sg. like this:

<?php

function mail_utf8($to, $subject = '(No subject)', $message = '', $header =
'') {
  $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain;
charset=UTF-8' . "\r\n";
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ .
$header);
}

?>

So first you have to try encode your string to set as subject.
Could be utf8_encode or base64_encode...

http://php.net/manual/en/function.utf8-encode.php
http://php.net/manual/en/function.mail.php

*Valentine*

On Tue, May 17, 2011 at 4:59 PM, Eli Orr (Office) <[email protected]>wrote:
>
>> Hi,
>>
>> I'm trying to enable a whole Email as UTF-8 - The Body is OK but the
>> Subject remains ANSI - Please help
>>
>>  $headers = "From:$from". "\r\n" .
>>               "Reply-To:$from" . "\r\n" .
>>               "*Content-type:text/html;charset=utf-8;"*."\r\n" .
>>               "X-Mailer: PHP/".phpversion();
>>
>>
>>
>> --
>> Best Regards,
>>
>> *Eli Orr*
>> CTO & Founder
>> *LogoDial Ltd.*
>> M:+972-54-7379604
>> O:+972-74-703-2034
>> F: +972-77-3379604
>>
>> Plaut 10, Rehovot, Israel
>> Email: [email protected]_
>> Skype: _eliorr.com_
>>
>
>

--- End Message ---
--- Begin Message ---
Hello Eli,

      I'm using this code:

private function HeaderEncode ($str) {
// For the compatibility with PHP versions lower than 5.3.0
if (!function_exists ('quoted_printable_encode')) {
function quoted_printable_encode ($str) {
$res=str_replace ("+", "_", str_replace ("%", "=", urlencode($str)));
return $res;
}
}
$result='=?utf-8?Q?'.quoted_printable_encode($str).'?=';
return $result;
}

If  you  want  to  send  mail through an SMTP server, consider using a
class written by myself :-):
http://hkc.im/Y
The class is documented and ships with examples.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Eli Orr (Office) <[email protected]>
To: [email protected]
Date created: , 5:59:26 PM
Subject: [PHP] How to enable UTF-8 Subject String  ? Only Body is set ok


      
Hi,

I'm trying to enable a whole Email as UTF-8 - The Body is OK but the 
Subject remains ANSI - Please help

   $headers = "From:$from". "\r\n" .
                "Reply-To:$from" . "\r\n" .
                "*Content-type:text/html;charset=utf-8;"*."\r\n" .
                "X-Mailer: PHP/".phpversion();



-- 
Best Regards,

*Eli Orr*
CTO & Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: [email protected]_
Skype: _eliorr.com_


--- End Message ---
--- Begin Message ---
Hello, all!

I've encountered odd behavior of PHP regarding bitwise AND operation when 
dealing with 31-st bit, and kindly ask to give me some pointers.
Consider the following snippet:

$tst1 = (1 << 31);
$tst2 = 0x80000000;
$tst1_eq = $tst1 & 0x80000000;
$tst2_eq = $tst2 & 0x80000000;
print "tst1=$tst1, tst1_eq=$tst1_eq, tst1_type=".gettype($tst1)."\n";
print "tst2=$tst2, tst2_eq=$tst2_eq, tst2_type=".gettype($tst2)."\n";

The output is:

tst1=-2147483648, tst1_eq=0, tst1_type=integer
tst2=2147483647, tst2_eq=2147483647, tst2_type=integer

And I totally can not  understand, why in the hell tst1_eq=0 ?
(BTW I'm using PHP 5.2.14 on 32-bit CPU, if that matters)

Sorry if this is well-known feature and have discussed before. In such a case 
please point me to the URL of the discussion.

-- 
Vitalii Demianets

--- End Message ---
--- Begin Message ---
Hi,
Hmm.. interesting...
"tst1=-2147483648, tst1_eq=-2147483648, tst1_type=integer tst2=2147483648,
tst2_eq=-2147483648, tst2_type=double" at me...
PHP Version 5.3.3-1ubuntu9.5 (Apache 2.0 - i686)
Valentine

On Tue, May 17, 2011 at 5:19 PM, Vitalii Demianets
<[email protected]>wrote:

> Hello, all!
>
> I've encountered odd behavior of PHP regarding bitwise AND operation when
> dealing with 31-st bit, and kindly ask to give me some pointers.
> Consider the following snippet:
>
> $tst1 = (1 << 31);
> $tst2 = 0x80000000;
> $tst1_eq = $tst1 & 0x80000000;
> $tst2_eq = $tst2 & 0x80000000;
> print "tst1=$tst1, tst1_eq=$tst1_eq, tst1_type=".gettype($tst1)."\n";
> print "tst2=$tst2, tst2_eq=$tst2_eq, tst2_type=".gettype($tst2)."\n";
>
> The output is:
>
> tst1=-2147483648, tst1_eq=0, tst1_type=integer
> tst2=2147483647, tst2_eq=2147483647, tst2_type=integer
>
> And I totally can not  understand, why in the hell tst1_eq=0 ?
> (BTW I'm using PHP 5.2.14 on 32-bit CPU, if that matters)
>
> Sorry if this is well-known feature and have discussed before. In such a
> case
> please point me to the URL of the discussion.
>
> --
> Vitalii Demianets
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Tuesday 17 May 2011 18:31:00 Bálint Horváth wrote:
> Hi,
> Hmm.. interesting...
> "tst1=-2147483648, tst1_eq=-2147483648, tst1_type=integer tst2=2147483648,
> tst2_eq=-2147483648, tst2_type=double" at me...
> PHP Version 5.3.3-1ubuntu9.5 (Apache 2.0 - i686)

That is what I expected too.
There are 2 possibilities:
1) There was a bug in 5.2.14 which is fixed in 5.3.3;
2) There still is a bug in latest version of PHP which manifest itself only on 
ARM CPU (which I am working on).

The worst thing is that I can not compile PHP 5.3.x for my board at the 
moment. So, I think, I should live with it, until I manage somehow to upgrade 
PHP installation for that board.

-- 
Vitalii Demianets

--- End Message ---
--- Begin Message ---
It appears that PHP is truncating the constant 0x80000000 to be within
MIN_INT and MAX_INT instead of as a bit field, but when shifting 1 << 31 it
doesn't do apply any constraints. That's pretty typical of bit-manipulation:
it will merrily slide 1 bits off either end. This explains why & produces 0
as it's doing 0x80000000 & 0x7FFFFFFF. It also explains the second tests.

On 64-bit 5.3.3 I get

    tst1=2147483648, tst1_eq=2147483648, tst1_type=integer
    tst2=2147483648, tst2_eq=2147483648, tst2_type=integer

If I try the 64-bit-equivalent code I get

    tst1=-9223372036854775808, tst1_eq=-9223372036854775808,
tst1_type=integer
    tst2=9.22337203685E+18, tst2_eq=-9223372036854775808, tst2_type=double

David

--- End Message ---
--- Begin Message ---
Hello Daniel Brown,

Am 2011-05-17 13:15:50, hacktest Du folgendes herunter:
> On Tue, May 17, 2011 at 13:11, Michelle Konzack
> <[email protected]> wrote:
> > Is this not longer subscriber only?
>     Actually, it never has been.  It's subscription to receive, but
> open to the public for one-off postings.

Hmmm, when I tried to post to the List without subscribtion, any  of  my
post where rejected and I had to subscribe...

Unfortunately the messages are all coming into my CellPhone and  I  have
to /dev/null it on my server.

Ist there a way to set my account to NOMAIL option?

This extra traffic annoying and must not be.

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL       itsystems@tdnet UG (limited liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947  mobil
                                  Tel: +49-176-86004575 office

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber [email protected]
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
On Tue, May 17, 2011 at 15:00, Michelle Konzack
<[email protected]> wrote:
>
> Ist there a way to set my account to NOMAIL option?

    To stop receiving emails you mean?  As in unsubscribing?

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Tue, 2011-05-17 at 15:07 -0400, Daniel Brown wrote:

> On Tue, May 17, 2011 at 15:00, Michelle Konzack
> <[email protected]> wrote:
> >
> > Ist there a way to set my account to NOMAIL option?
> 
>     To stop receiving emails you mean?  As in unsubscribing?
> 
> -- 
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
> 


Hang about, we're not all mind readers ;)

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
I need to explode an array with an array.

$one = array(0 =>'golf', 1 => 'field');
$two = array(0 => "On the golf course or in the field of clover");


$array_exp = explode($one, $two);

print_r('<pre>');
print_r($array_exp);
print_r('</pre>');

Notice: Array to string conversion.


I have done this before but it is slipping my memory how I did it.
I do NOT want to foreach over the initial array and read the second array for 
each position.
I am not even sure I used the explode function.


Richard L. Buskirk


--- End Message ---

Reply via email to