php-general Digest 19 Sep 2011 03:24:19 -0000 Issue 7485
Topics (messages 314927 through 314933):
Re: Bug?
314927 by: Robert Stone
Re: ATmail
314928 by: Daniel Brown
Search for string followed by whitespace
314929 by: Tim Streater
Installing extensions
314930 by: tamouse mailing lists
314931 by: Gregor Mitzka
314932 by: Benjamin Hawkes-Lewis
314933 by: Sharl.Jimh.Tsin
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 ---
________________________________
De: Igor Escobar <[email protected]>
Para: "<[email protected]>" <[email protected]>
Enviadas: Sexta-feira, 16 de Setembro de 2011 7:07
Assunto: [PHP] Bug?
Anyone can explain this?
https://gist.github.com/1220404
Part of the code are in portuguese so...
iguais = equal
diferentes = different
Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar <http://www.twitter.com/igorescobar>
The person who posted this (andersonfraga) has set up four "string" comparison
tests.
It was commented by augustohp who said:-
float_a.php
Existe uma configuração no php.ini da precisão de números de ponto flutuante.
Acima desse número, todos são arredondados.
There is a configuration setting in php.ini that determines the precision of
floating point numbers. A "number" greater than that setting causes rounding.
float_b.php
Com a bcmath você não está comparando tipos especializados
de dados, mas sim dados binários. É mais demorado, mas é extremamente
preciso, sempre.
With bcmath you are doing a binary comparison. It is slower but precise, always.
string_a.php
Quando você usa "==" você não compara os tipos, e não força o
interpretador a respeitar o tipo de dado fornecido. O que acontece
então!? O PHP converte o tipo para o tipo de dado mais apropriado em uma
condição: boolean, inteiro, etc ...
Se você converter para inteiro, vai ver que os números são iguais.
When you use the "==" operator you don't compare data types and don't force the
interpreter to respect the data type supplied. What happens then? PHP converts
the type to the most appropriate data type and returns a boolean. (I assume he
means "casting". I always thought that you had to cast the variables implicitly
in order to use "==".)
I think he is saying in the next sentence that if you cast them to integers,
"you'll see that the numbers are equal". Doesn't make any sense to me, but
then, I'm no "expert".
string_b.php
Aqui sim você compara strings, garante que elas não sofram cast para outro tipo
de dado. Você pode atingir isso usando "===" também, sem essa função de
comparação de strings.
Here you compare strings, and guarantee that they don't suffer casting to
another data type. You can achieve the same thing by using the "===" operator
also, without (using) this string comparison function.
Hope this helps.
Cheers,
Robert
--- End Message ---
--- Begin Message ---
On Sun, Sep 18, 2011 at 07:03, [email protected] <[email protected]> wrote:
> I have installed ATmail http://atmail.org/ webmail interface went OK,
> when I try to login I get empty login..
>
> [root@server1 log]# php -version
> PHP 5.3.3 (cli) (built: Jan 21 2011 09:39:13)
While it may not necessarily be the cause of your issue, note the
above: it's the CLI version only. That has nothing to do with the web
side.
[snip!]
> I have downloaded this atmail version
> http://sourceforge.net/projects/atmailopen/files/atmailopen/1.03/atmailopen1_03.tgz
Contact them to find out why. Asking this on a PHP list would be
like asking on a C/C++/Assembly mailing list why you're seeing a
Windows BSoD.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
At the moment, I'm doing this:
$start = stripos ($body, "<a ", $loc);
You'll note the space after the '<a'. But I really need to search in $body for
'<a' followed by any whitespace char, at least one, starting at the $loc'th
character, and returning the location of the string in $start.
I had a look at the PCRE and POSIX regexp functions to no avail. Is there a
slick way of doing this with one function call or should I just search for '<a'
and brute-force check that the next char is ' ' or '\t' or '\n'?
Thanks,
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
I'm having a bit of trouble installing PHP extensions.
I have the following in php.ini:
extension_dir =
".:/usr/local/lib/php/extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
In /usr/local/lib/php/extensions/no-debug-non-zts-20090626, i have the
following:
-rwxr-xr-x 1 root wheel 25652 Sep 18 13:04 geoip.so*
-rwxr-xr-x 1 root wheel 115536 Jul 13 16:55 iconv.a*
-rwxr-xr-x 1 root wheel 40556 Jul 13 16:55 iconv.so*
but if I do php -i | grep -E '(iconv|geoip)' , i get nothing.
So apparently the extensions aren't being added as I thought.
System info:
Mac OSX 10.5.8
php 5.3.6
Any clues will be greatly appreciated!
--
Tamara Temple
-- aka tamouse__
"May you never see a stranger's face in the mirror."
--- End Message ---
--- Begin Message ---
Why don't you use MacPorts? There you can extension in a quite simple way.
Gregor Mitzka
2011/9/18 tamouse mailing lists <[email protected]>
> I'm having a bit of trouble installing PHP extensions.
>
> I have the following in php.ini:
>
> extension_dir =
>
> ".:/usr/local/lib/php/extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
>
> In /usr/local/lib/php/extensions/no-debug-non-zts-20090626, i have the
> following:
>
> -rwxr-xr-x 1 root wheel 25652 Sep 18 13:04 geoip.so*
> -rwxr-xr-x 1 root wheel 115536 Jul 13 16:55 iconv.a*
> -rwxr-xr-x 1 root wheel 40556 Jul 13 16:55 iconv.so*
>
> but if I do php -i | grep -E '(iconv|geoip)' , i get nothing.
>
> So apparently the extensions aren't being added as I thought.
>
> System info:
> Mac OSX 10.5.8
> php 5.3.6
>
> Any clues will be greatly appreciated!
>
> --
> Tamara Temple
> -- aka tamouse__
>
> "May you never see a stranger's face in the mirror."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Sun, Sep 18, 2011 at 8:21 PM, tamouse mailing lists
<[email protected]> wrote:
> I'm having a bit of trouble installing PHP extensions.
>
> I have the following in php.ini:
>
> extension_dir =
> ".:/usr/local/lib/php/extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
>
> In /usr/local/lib/php/extensions/no-debug-non-zts-20090626, i have the
> following:
>
> -rwxr-xr-x 1 root wheel 25652 Sep 18 13:04 geoip.so*
> -rwxr-xr-x 1 root wheel 115536 Jul 13 16:55 iconv.a*
> -rwxr-xr-x 1 root wheel 40556 Jul 13 16:55 iconv.so*
>
> but if I do php -i | grep -E '(iconv|geoip)' , i get nothing.
>
> So apparently the extensions aren't being added as I thought.
>
> System info:
> Mac OSX 10.5.8
> php 5.3.6
"extension_dir" controls where PHP looks for extensions that _could_
be dynamically loaded.
It does not dictate which extensions it loads at startup - that's "extension".
http://php.net/manual/en/ini.core.php
http://www.php.net/manual/en/install.pecl.intro.php
--
Benjamin Hawkes-Lewis
--- End Message ---
--- Begin Message ---
在 2011-09-18日的 14:21 -0500,tamouse mailing lists写道:
> I'm having a bit of trouble installing PHP extensions.
>
> I have the following in php.ini:
>
> extension_dir =
> ".:/usr/local/lib/php/extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
>
> In /usr/local/lib/php/extensions/no-debug-non-zts-20090626, i have the
> following:
>
> -rwxr-xr-x 1 root wheel 25652 Sep 18 13:04 geoip.so*
> -rwxr-xr-x 1 root wheel 115536 Jul 13 16:55 iconv.a*
> -rwxr-xr-x 1 root wheel 40556 Jul 13 16:55 iconv.so*
>
> but if I do php -i | grep -E '(iconv|geoip)' , i get nothing.
>
> So apparently the extensions aren't being added as I thought.
>
> System info:
> Mac OSX 10.5.8
> php 5.3.6
>
> Any clues will be greatly appreciated!
>
> --
> Tamara Temple
> -- aka tamouse__
>
> "May you never see a stranger's face in the mirror."
>
well,i know less about MacOS,is the extension *.so lib only work under
GNU/Linux & BSD series?
--
Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)
Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?10073.
signature.asc
Description: This is a digitally signed message part
--- End Message ---