"Terry R. Lacey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm also trying to Build php5ts using the VC6 Build Tools as recommended
in
> the file README.WIN32-BUILD-SYSTEM because I seem to be getting absolutely
> nowhere using the GUI. When I open the Tools Command Prompt, th
crc32, md5 and sha1 functions, implemented in PHP, are widely used for
computing "fingerprint" of any data. But current implementation has not very
good limitation - there is no way to get/set current state vector of these
functions. So, we have to pass whole amount of data as argument of these
fun
> After applying the change to ext/standard/string.c in PHP4 the following
> Test failed:
> Bug #4 (implode changes object references in array)
> [ext/standard/tests/strings/bug4.phpt]
>
> Regards,
> Christian Stadler
I understood my fault. I didn't notice condition
if (!(*ppzv)->is_ref)
mt_srand() is used to seed initialisation vector (IV) for Mersenne Twister
pseudorandom generator. But there is a "little" problem: the actual length
of IV is 19968 bits, but mt_srand() accepts only 32-bit integers, which
even
reduced to 31 bit in function php_mt_srand() at /ext/standard/rand.c a
I've posted patch last summer http://www.zend.com/zend/week/pat/pat5.txt
which imporves performance of implode() function in PHP4, but nobody
doesn't
commit it yet. Can anybody explain the reason?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP Internals - PHP Runti
there is such code in the php_implode() function:
[snip]
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr),
(void **) &tmp,
&pos) == SUCCESS) {
SEPARATE_ZVAL(tmp);
convert_to_string(*tmp);
[snip
There is a header file with PHP type's definition:
/Zend/zend_types.h
It consists following types:
---
typedef unsigned char zend_bool;
typedef unsigned char zend_uchar;
typedef unsigned int zend_uint;
typedef unsigned long zend_ulong;
typedef unsigned short zend_ushort;
On Wed, 16 Jun 2004 07:05:32 -0700 (Pacific Standard Time), Rasmus Lerdorf
<[EMAIL PROTECTED]> wrote:
As Alexander's initial re-implementation of crc32() was broken on 64-bit
architectures, I think this is a very good point.
And his stripslashes() "improvement" actually broke backward
compatib
On Wed, 16 Jun 2004 16:35:04 +0200, Ard Biesheuvel <[EMAIL PROTECTED]> wrote:
Alexander Valyalkin wrote:
On Wed, 16 Jun 2004 12:03:36 +0200, Ard Biesheuvel <[EMAIL PROTECTED]>
wrote:
Have you tested my initial re-implementation of crc32() on 64-bit
architectures?
No, but I d
Today I've revised strrchr() function in PHP4.3.7 sources.
It wasn't binary-safe. For example:
1) strrpos('abcd', '') returns 4. Expected FALSE
2) strrpos("a\0abcde", 'a') returns 6. Expected 2
3) strrpos("a\0bcde", "\0") returns 6. Expected 1
4) strrpos('', '\0') returns 0. Expected FALSE
My versi
On Wed, 16 Jun 2004 12:03:36 +0200, Ard Biesheuvel <[EMAIL PROTECTED]> wrote:
As Alexander's initial re-implementation of crc32() was broken on 64-bit
architectures, I think this is a very good point.
Have you tested my initial re-implementation of crc32() on 64-bit
architectures?
--
Using Opera
On Wed, 16 Jun 2004 12:11:07 +0400, Antony Dovgal <[EMAIL PROTECTED]>
wrote:
On Wed, 16 Jun 2004 11:06:31 +0300
"Alexander Valyalkin" <[EMAIL PROTECTED]> wrote:
I can't find any serious reason to apply the pathes into the current
PHP4 and PHP5 versions.
Yup. Me too.
On Wed, 16 Jun 2004 00:41:19 +0300, Andrey Hristov <[EMAIL PROTECTED]> wrote:
Privet Alex,
is it possible to show some results from benchmarking?
Thanks a lot,
Andrey
Just compile my standalone test & view results :)
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP In
On Tue, 15 Jun 2004 21:56:37 +0100, Lester Caine <[EMAIL PROTECTED]>
wrote:
Once PHP5 is out - THEN the sorts of fixes Alexander is suggesting could
be looked at - but not until then.
Once PHP5 is out - THEN all of my fixes will safely forgotten, on my
opinion :)
I can't find any serious reaso
On Tue, 15 Jun 2004 22:48:35 +0200, Bert Slagter <[EMAIL PROTECTED]> wrote:
Thomas Goyne wrote:
As a user, I personally see placing new features over making old
features work better a large mistake. Perhaps that was necessary back
in the days of PHP3, but its been a very long time since I've
On Tue, 15 Jun 2004 12:47:29 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]>
wrote:
On Tue, 15 Jun 2004, Alexander Valyalkin wrote:
Today I checked file /win32/readdir.c
Below you can view its source with my comments.
Just a little notice that you succesfully made it into my killfilter.
My versions of strspn() & strcspn() use faster and clear algorithm.
Below I provide simple test application, which compares speed and
results of old strspn() with new one & unified diff in the bottom.
===cut==
#include
#include
#include /* for _rdtsc() */
#define S1_L
Below I provide my version of readdir.c file
unified diff
cut===
--- readdir.c Tue Jan 28 04:51:26 2003
+++ readdir_new.c Tue Jun 15 13:35:43 2004
@@ -22,40 +22,80 @@
DIR *opendir(const char *dir)
{
DIR *dp;
- char *filespec;
+char *filespec, *tmp_ptr;
long h
Today I checked file /win32/readdir.c
Below you can view its source with my comments.
begin of /win32/readdir.c source===
DIR *opendir(const char *dir)
{
DIR *dp;
char *filespec;
long handle;
/* - [index] must have (size_t) type (see it usage below)
*
Here is patch for basename() function, which prevents possible
memory access violation:
=cut=
--- string.cThu May 13 20:44:32 2004
+++ string_basename.c Mon Jun 14 20:43:33 2004
@@ -1079,9 +1079,9 @@
/* strip trailing slashes */
- while (*c == '/'
+while (c >= s && *
On Mon, 14 Jun 2004 13:49:16 +0200, Ard Biesheuvel <[EMAIL PROTECTED]> wrote:
Alexander Valyalkin wrote:
:) Are you sure? I'm not. Look on declaration of [nr] variable:
int nr;
And answer, please, which value will be assigned to nr, if length of
a string will be greater than 0x7ff
I've read CODING_STANDARDS (thanks to Christian Schneider) and corrected
my code according to your standards.
Also I've improved speed of algorithm. Now it is not duplicate the
string value of array item, if it is has string type already:
if (Z_TYPE_PP(tmp) != IS_STRING) {
/* create new ins
The implode() function uses very bad algorithm, which uses memory
reallocation very often. The speed of functions falls quickly with
increase of length of imploded array & data in it.
My version of implode() uses much better algorithm:
1) counts the amount of memory needed to result string
2) alloc
On Mon, 14 Jun 2004 11:00:33 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]>
wrote:
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr)
==
FAILURE) {
return;
}
/* !!! there is no error check nr < 0 */
Of course not, that's pointless as a string can never
On Sun, 13 Jun 2004 23:10:04 +, Curt Zirzow <[EMAIL PROTECTED]> wrote:
* Thus wrote Alexander Valyalkin ([EMAIL PROTECTED]):
Here is improved version of crc32() function.
Features:
1) Automatic initialization of crc32tab[] at first call.
So, the file crc32.h with definition of this
On Sun, 13 Jun 2004 11:24:12 +0200, Ard Biesheuvel <[EMAIL PROTECTED]> wrote:
First of all, crc32tab is no longer in the .text segment, so it will not
be shared between forked processes, taking more memory space than
necessary. Each process will have to initialise it as well, so the init
loop
On Fri, 11 Jun 2004 10:55:20 -0400, Ilia Alshanetsky <[EMAIL PROTECTED]>
wrote:
Read your memcpy manpages
"The memcpy() function copies n bytes from memory area src to memory
area dest. The memory areas may not overlap."
Well, I've read my manpages:
The memcpy() function copies n bytes
Here is improved version of crc32() function.
Features:
1) Automatic initialization of crc32tab[] at first call.
So, the file crc32.h with definition of this tab is not
nessesary any more now.
2) Speed is improved on large amount of data.
3) Less source size. Current verison has near 6.5Kb le
On Fri, 11 Jun 2004 17:00:03 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]>
wrote:
On Fri, 11 Jun 2004, Alexander Valyalkin wrote:
Read it:
void *memmove(void *s1, const void *s2, size_t n);
If s1 and s2 overlap, all bytes are copied in a preserving manner
(unlike
memcpy())
And anw
Read it:
void *memmove(void *s1, const void *s2, size_t n);
If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike
memcpy())
And anwer the question: are s1 and s2 overlap in the str_repeat() ?
Why don't use memcpy() instead of memmove() ?
===cut=
--- string
Some bugs have been fixed in this version:
1) All [#include] directives moved to the top. Just copy'n'compile sources
to
test it :)
2) Renamed php_strip_all_tags() to php_strip_tags() with the same
interface as
in the current version.
3) Fixed php_tag_find(). Allowable tags is case and or
On Thu, 10 Jun 2004 16:33:13 +0300, Alexander Valyalkin <[EMAIL PROTECTED]>
wrote:
Today I wrote the new version of strip_tags().
Yes, it is not ideal, but it is much better than current version.
Below is my complete version of strip_tags() with testcases. You can add /
change
any tes
What sense of the [allowable_tags] parameter in strip_tags()?
According docs, "You can use the optional second parameter to specify
tags which should not be stripped".
Ok. Suppose, I have a PHP-guestbook and use strip_tags() to filter all
tags, excepting ,, in users' messages. Then a "cool-hacker"
On Thu, 10 Jun 2004 11:56:26 +0400, Antony Dovgal <[EMAIL PROTECTED]>
wrote:
Ok, my version of stripslashes() is faster, clearer, works correctly
with old
tests and solves mentioned bugs. Are you still doubt? Try to compare
the old
(current) code to new one.
Faster is ok, but you'd better read
On Wed, 9 Jun 2004 14:20:01 +0200, Moshe Doron <[EMAIL PROTECTED]>
wrote:
in addition, i want to remind that when magic mode is on, this function
been
used by each script to manipulate the $_REQUEST vars so playing with this
peace of code have
1. big codes breaking potential.
2. big security p
On Thu, 10 Jun 2004 00:47:09 -0700 (PDT), Rasmus Lerdorf <[EMAIL PROTECTED]>
wrote:
Uh, what are you guys talking about? That test case is bogus.
$s = 'c:\\windows\\system32';
This means that the base string we are working with is
c:\windows\system32
here before any sort of stripslashes. If
On Wed, 9 Jun 2004 15:56:10 +0400, Antony Dovgal <[EMAIL PROTECTED]>
wrote:
If you think it's wrong - prove it.
There are quite detailed reasons why those bugs were considered to
be bogus.
I'm ok if you're going to improve stripslashes() efficiency and/or to
make it just faster, this could be ve
On Thu, 10 Jun 2004 00:50:46 +1200, Jevon Wright <[EMAIL PROTECTED]> wrote:
'c:\\windows\\system32' becomes 'c:\windows\system32' in memory (the
slashes are stripped).
I know it :)
stripslashes() will make it 'c:windowssystem32'. Thus the above tests
will fail.
Yes. The current version of stri
On Wed, 9 Jun 2004 15:00:30 +0400, Antony Dovgal <[EMAIL PROTECTED]>
wrote:
On Wed, 09 Jun 2004 13:52:42 +0300
"Alexander Valyalkin" <[EMAIL PROTECTED]> wrote:
On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), Derick Rethans
<[EMAIL PROTECTED]> wrote:
Ok. First of all, my
On Tue, 8 Jun 2004 16:03:19 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]>
wrote:
You'll have to proof that by writing testcases, for example try it with
the test cases in the current source and write new ones for things that
we don't have a test case for yet.
-PHPAPI void php_stripslashes(cha
On Tue, 08 Jun 2004 12:51:33 +0200, Morten K. Poulsen
<[EMAIL PROTECTED]> wrote:
On Tue, 2004-06-08 at 11:32, Alexander Valyalkin wrote:
+/* get the length of local file connected to descriptor fd */
fstat(fd, &sbuf);
[snip]
+if (errno) {
Oh-oh! You need to
Today I checked stripslashes() function.
My version of the function if faster, more clearer and bugs free (I hope
:))
Below you can see the source and unified diff:
source=
PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC)
{
char *s, *t;
size_t l;
On Mon, 7 Jun 2004 20:02:54 +0400, Antony Dovgal <[EMAIL PROTECTED]>
wrote:
On Mon, 07 Jun 2004 18:55:52 +0300
"Alexander Valyalkin" <[EMAIL PROTECTED]> wrote:
On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]>
wrote:
> Can you send a unifie
On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> wrote:
Can you send a unified diff?
==cut=
1065,1066c1065,1066
< size_t bcount = 0;
< int ready = 0;
---
size_t bcount = 0; /* counter of printed out bytes */
int is_mapped = 0;
1067a106
On Mon, 7 Jun 2004 10:19:09 -0400, Ilia Alshanetsky <[EMAIL PROTECTED]>
wrote:
IMO Adding additional error reporting is a good idea, but we should keep
MAP_SHARED as the mmap mode. In Apache environment if the file is mapped
by
more then one process the memory needed to map the file is shared,
On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> wrote:
Can you send a unified diff?
At 02:08 PM 6/7/2004 +0300, Alexander Valyalkin wrote:
No, because I dont know how create it :)
Please, explain how can I create unified diff under windows.
I'm newbie in PHP source
When I try to print huge files (greate than 500Mb) using readfile()
function, my computer crashes.
Why? I found in the PHP 4.3.7 sources the file /main/strems.c and function
_php_stream_passthru() in it. The readfile() uses this function to print
content of the file.
Below you can see source
47 matches
Mail list logo