[PHP-DEV] Re: vsprintf returns int not char*

2005-01-04 Thread Kamesh Jayachandran
Hi Derick, Sorry I have seen this PHP-5.0.3 bundle. The change is there on December 17 commit on PHP5_0. Still I feel this should be replaced if (!ret) return -1; by if (ret<0) return -1; As the document for vsprintf states as follows, If an output error is encountered, a negative

Re: [PHP-DEV] PHP_SHLIB_SUFFIX not being properly set on MacOSX

2005-01-04 Thread Jani Taskinen
How exactly did you run the phpize and the generated configure? What are the autoconf, libtool and automake versions in your system? Checking configure generated on my machine, it's impossible for $host_alias to be empty unless you specify it to be empty with --host="" or someth

Re: [PHP-DEV] Re: CONSTANT names...

2005-01-04 Thread Andi Gutmans
There are plenty of such examples in many languages. As Johannes mentions, some ppl might even be "abusing" it already :) Anyway, I don't think adding necessary checks for such things, and slowing define() down (even if it's negligible) is warranted in such cases. Andi At 12:29 AM 1/5/2005 +0100

[PHP-DEV] Re: CONSTANT names...

2005-01-04 Thread Johannes Schlueter
Hi Jochem, you can get the valu of that constant with the constant() function and use such a constant with defined() so forbidding this would at least be a BC break. btw. the same goes for reserved words so define('echo', 42); is valid too but "echo echo;" doesn't work :-) johannes Jochem Maas

[PHP-DEV] CONSTANT names...

2005-01-04 Thread Jochem Maas
hi guys, I was mucking around and noticed the following: define("404_SKIP", 1); does not give an error and you can successfully get the value of the constant by doing: constant("404_SKIP"); where as doing: echo 404_SKIP; gives an error. as I understand it, i.e. what the docs say, is that the foll

[PHP-DEV] PHP_SHLIB_SUFFIX not being properly set on MacOSX

2005-01-04 Thread Brad House
Just tried to phpize an extension, and it appears as though there is a problem on MacOSX. PHP_SHLIB_SUFFIX defaults to .so because a check is run on $host_alias, which is set to "". Attached is a patch to use $host_os instead which fixes the problem. This is against php-4.3.10 by the way. I have

Re: [PHP-DEV] bit of an odd bug

2005-01-04 Thread Jochem Maas
Wez Furlong wrote: If you want to do this kind of thing, why not do it properly? $foo = new $scanning_class; $foo->scanBuffer($input); that is, after all, what "extends" is all about. --Wez hihi, that why Wez get the 'King' prefix and everyone doesn't :-) ... -- PHP Internals - PHP Runtime Develo

Re: [PHP-DEV] bit of an odd bug

2005-01-04 Thread Wez Furlong
If you want to do this kind of thing, why not do it properly? $foo = new $scanning_class; $foo->scanBuffer($input); that is, after all, what "extends" is all about. --Wez On Tue, 04 Jan 2005 15:01:32 +, Gareth Ardron <[EMAIL PROTECTED]> wrote: > Jason Sweat wrote: > > >Hi Gareth, > > > >I

Re: [PHP-DEV] extract(EXTR_REFS) and pass-by-reference

2005-01-04 Thread Andi Gutmans
At 06:26 PM 1/4/2005 +0900, Moriyoshi Koizumi wrote: On 2005/01/02, at 21:23, Marcus Boerger wrote: while i tried to improve performance of the array functions i developed a new pass type - pass as const which doesn't touch the passed variable at all and is compatible with temp vars, too. Maybe you

Re: [PHP-DEV] bit of an odd bug

2005-01-04 Thread Gareth Ardron
Jason Sweat wrote: Hi Gareth, In addition to the other options people have mentioned, you could also use the old standby of: eval("\$result = $scanning_class::scanBuffer(\$input);"); Cheers for all the replies, people. I may have a bit of a prod at the internals this evening though, as this is

[PHP-DEV] Re: vsprintf returns int not char*

2005-01-04 Thread Derick Rethans
On Tue, 4 Jan 2005, Kamesh Jayachandran wrote: > Hi Derick, > in php-src/main/php_sprintf.c > PHPAPI int > php_sprintf (char*s, const char* format, ...) > { > va_list args; > char *ret; //ret should be of type integer as vsprintf returns int rather > than char* It is already an int, please u

Re: [PHP-DEV] bit of an odd bug

2005-01-04 Thread Jason Sweat
On Tue, 04 Jan 2005 02:59:22 +, Gareth Ardron <[EMAIL PROTECTED]> wrote: > Ok, I'm in need of a sanity check here. > > step one: > $input = "foo"; > $scanning_class = "clamav"; > $result = $scanning_class::scanBuffer($input); > now this fails with a "Parse error: parse error, unexpected > T_PA

Re: [PHP-DEV] extract(EXTR_REFS) and pass-by-reference

2005-01-04 Thread Moriyoshi Koizumi
On 2005/01/02, at 21:23, Marcus Boerger wrote: while i tried to improve performance of the array functions i developed a new pass type - pass as const which doesn't touch the passed variable at all and is compatible with temp vars, too. Maybe your problem here is a reason to really implement that

[PHP-DEV] vsprintf returns int not char*

2005-01-04 Thread Kamesh Jayachandran
Hi Derick, in php-src/main/php_sprintf.c PHPAPI int php_sprintf (char*s, const char* format, ...) { va_list args; char *ret; //ret should be of type integer as vsprintf returns int rather than char* va_start (args, format); s[0] = '\0'; ret = vsprintf (s, format, args); va_end (args)