When php_stream_cast is passed any of the _AS_FD-like options, what is
the ret argument supposed to point to? This does not seem to be decided
consistently; from a quick survey:
ext/openssl/xp_ssl.c:
php_openssl_sockop_cast() presumes that *ret has sizeof(void *)
ext/soap/php_http.c:
stream_alive() presumes that *ret has sizeof(long)
ext/standard/streamfuncs.c:
stream_array_from_fd_set() presumes that *ret has sizeof(php_socket_t)
main/streams/xp_socket.c:
php_sockop_cast() presumes that *ret has sizeof(int)
On 64-bit platforms, of course, at least half of these cases will break,
since sizeof(int) != sizeof(long).
This issue is the cause of http://bugs.php.net/bug.php?id=32979, where a
64-bit value is being written to an pointer to a 32-bit value on the
stack, and trashing whatever follows it.
joe
Hey guys,
I don’t know whether to post this as a bug or not. But I was tricked when programming today.
It seems that the character "*" is non-strictly equivalent to 0. Is this the correct behavior or am I missing something?
Test case:
<?php
var_dump('*' == 0);
?>
Shows boolean(true).
I was unable to find any documentation as to why this would be the case.
Regards,
Scott
Hey guys,
I don’t know whether to post this as a bug or not. But I was tricked when programming today.
It seems that the character "*" is non-strictly equivalent to 0.
Is this the correct behavior or am I missing something?
http://www.php.net/manual/en/language.operators.comparison.php
Ask such questions in php-general@, please. Thank you.
--
Wbr,
Antony Dovgal