[PHP-DEV] [HEAD] Notice error undefined constant PEAR_CONFIG_SYSCONFDIR

2002-12-13 Thread Markus Fischer
Installed current CVS checkout from a few minutes ago:

./configure --prefix=/home/mfischer/php4 --enable-debug
[...no errors or whatsoever...]
$ pear remote-list

Notice: Use of undefined constant PEAR_CONFIG_SYSCONFDIR - assumed 
'PEAR_CONFIG_SYSCONFDIR' in Config.php on line 177

Notice: Use of undefined constant PEAR_CONFIG_SYSCONFDIR - assumed 
'PEAR_CONFIG_SYSCONFDIR' in Config.php on line 408

- Markus

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




[PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Michael Bretterklieber
Hi,

I would like to distribute also binaries of my (our) radius PECL for
windows, because Windows users usualy don't have visualstudio to compile
the PECL.

I would like to make a bin subdirectory and then for each php-version
also a subdirectory:
PECL/radius/bin
PECL/radius/bin/php4.2.3/php_radius.dll

My question is this allowed?

Are there any other ideas howto distribute binaries of PECL's?

bye,

--
--- --
Michael Bretterklieber- [EMAIL PROTECTED]
JAWA Management Software GmbH - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-93 96 698
Tel: ++43-(0)316-403274-12  E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10  http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more
expected... - Dennis Ritchie and Ken Thompson, June 1972




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




Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Edin Kadribasic
Hi,

We already bundle several pecl extensions in the win32 distro
(printer, iisfunc, etc.) I could add radius to the list.

Edin

- Original Message -
From: Michael Bretterklieber [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 12:29 PM
Subject: [PHP-DEV] distributing windows binaries (dll's) of PECL's


 Hi,

 I would like to distribute also binaries of my (our) radius PECL
for
 windows, because Windows users usualy don't have visualstudio to
compile
 the PECL.

 I would like to make a bin subdirectory and then for each
php-version
 also a subdirectory:
 PECL/radius/bin
 PECL/radius/bin/php4.2.3/php_radius.dll

 My question is this allowed?

 Are there any other ideas howto distribute binaries of PECL's?

 bye,

 --
 --- --
 Michael Bretterklieber- [EMAIL PROTECTED]
 JAWA Management Software GmbH - http://www.jawa.at
 Liebenauer Hauptstr. 200-- privat 
 A-8041 GRAZ GSM: ++43-(0)676-93 96 698
 Tel: ++43-(0)316-403274-12  E-mail:   [EMAIL PROTECTED]
 Fax: ++43-(0)316-403274-10  http://www.inode.at/mbretter
 --- --
 ...the number of UNIX installations has grown to 10, with more
 expected... - Dennis Ritchie and Ken Thompson, June 1972




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





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




Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Michael Bretterklieber
Hi,

Edin Kadribasic schrieb:

Hi,

We already bundle several pecl extensions in the win32 distro
(printer, iisfunc, etc.) I could add radius to the list.

that would be great!

But how can I provide upgrades of the PECL?
then the user has to wait until a new php-version is released.

bye,



Edin

- Original Message -
From: Michael Bretterklieber [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 12:29 PM
Subject: [PHP-DEV] distributing windows binaries (dll's) of PECL's




Hi,

I would like to distribute also binaries of my (our) radius PECL


for


windows, because Windows users usualy don't have visualstudio to


compile


the PECL.

I would like to make a bin subdirectory and then for each


php-version


also a subdirectory:
PECL/radius/bin
PECL/radius/bin/php4.2.3/php_radius.dll

My question is this allowed?

Are there any other ideas howto distribute binaries of PECL's?

bye,

--
--- --
Michael Bretterklieber- [EMAIL PROTECTED]
JAWA Management Software GmbH - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-93 96 698
Tel: ++43-(0)316-403274-12  E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10  http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more
expected... - Dennis Ritchie and Ken Thompson, June 1972




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





--
--- --
Michael Bretterklieber  - [EMAIL PROTECTED]	
JAWA Management Software GmbH   - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-84 03 15 712
Tel: ++43-(0)316-403274-12	E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10 	http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more expected...
	   - Dennis Ritchie and Ken Thompson, June 1972


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




Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Edin Kadribasic
  We already bundle several pecl extensions in the win32 distro
  (printer, iisfunc, etc.) I could add radius to the list.
 that would be great!

 But how can I provide upgrades of the PECL?
 then the user has to wait until a new php-version is released.

That is a larger question. I'm afraid that there are no satisfactory
aswers to it yet. PECL infrastructure is still pretty much
non-existent. But you're welcome to help defining and implementing
it :)

Edin


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




Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Michael Bretterklieber
Hi,

Edin Kadribasic schrieb:

We already bundle several pecl extensions in the win32 distro
(printer, iisfunc, etc.) I could add radius to the list.


that would be great!

But how can I provide upgrades of the PECL?
then the user has to wait until a new php-version is released.



That is a larger question. I'm afraid that there are no satisfactory
aswers to it yet. PECL infrastructure is still pretty much
non-existent. But you're welcome to help defining and implementing
it :)


My idea is to move the responsibility for stable PECL's to the 
maintainers of the PECL's. The maintainers should provide stable 
versions of PECL for the different php-versions, therefore I would like 
to make a bin directory in each PECL-dir.
pecl/radius/bin
and then
pecl/radius/bin/php4.2.3/win32/php_radius.dll
or
pecl/radius/bin/php4.2.3/freebsd4/radius.so
pecl/radius/bin/php4.2.3/linux-glibc21/radius.so
and so on.
Or maybe its better to make a cvs tag instead of different subdirs for 
different php versions?

If the distribution is generated, then its not needed to compile every 
PECL, the distributors just take the version from the appropriate dir. 
If no files are found, then the PECL is not included into the distr.

This would also help if users download the PECL from the pear-web, 
because they then have also binaries and they don't need to compile it.
.. and the pear web can be used for providing updates of PECL's.

bye,
--
--- --
Michael Bretterklieber  - [EMAIL PROTECTED]	
JAWA Management Software GmbH   - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-84 03 15 712
Tel: ++43-(0)316-403274-12	E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10 	http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more expected...
	   - Dennis Ritchie and Ken Thompson, June 1972


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



Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Derick Rethans
On Fri, 13 Dec 2002, Michael Bretterklieber wrote:

 My idea is to move the responsibility for stable PECL's to the 
 maintainers of the PECL's. The maintainers should provide stable 
 versions of PECL for the different php-versions, therefore I would like 
 to make a bin directory in each PECL-dir.
 pecl/radius/bin
 and then
 pecl/radius/bin/php4.2.3/win32/php_radius.dll
 or
 pecl/radius/bin/php4.2.3/freebsd4/radius.so
 pecl/radius/bin/php4.2.3/linux-glibc21/radius.so
 and so on.
 Or maybe its better to make a cvs tag instead of different subdirs for 
 different php versions?

I'm very against generated binaries in CVS; CVS is not meant for that. 
We don't put tarballs of PECL classes in CVS either.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread Michael Bretterklieber
Hi,

Derick Rethans schrieb:

On Fri, 13 Dec 2002, Michael Bretterklieber wrote:



My idea is to move the responsibility for stable PECL's to the 
maintainers of the PECL's. The maintainers should provide stable 
versions of PECL for the different php-versions, therefore I would like 
to make a bin directory in each PECL-dir.
pecl/radius/bin
and then
pecl/radius/bin/php4.2.3/win32/php_radius.dll
or
pecl/radius/bin/php4.2.3/freebsd4/radius.so
pecl/radius/bin/php4.2.3/linux-glibc21/radius.so
and so on.
Or maybe its better to make a cvs tag instead of different subdirs for 
different php versions?


I'm very against generated binaries in CVS; CVS is not meant for that. 
We don't put tarballs of PECL classes in CVS either.

Of course having binaries in CVS is not a good solution (we (my company) 
also don't make this in our projects)

But are there any other ideas how to provide binaries of PECL's outside 
the php distributions?

Can I add the binaries to the .tgz, by adding it to the package.xml 
file, before I'm going to upload the package into the pear web?

bye,
--
--- --
Michael Bretterklieber  - [EMAIL PROTECTED]	
JAWA Management Software GmbH   - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-84 03 15 712
Tel: ++43-(0)316-403274-12	E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10 	http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more expected...
	   - Dennis Ritchie and Ken Thompson, June 1972


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



[PHP-DEV] Do --with-sybase/Linux and --with-mssql/Win differ in functionality?

2002-12-13 Thread Markus Wolff
Hi there,

just a quick question: I was wondering if the Sybase extension on
Linux and the MSSQL extension on Windows really provide the same
functionality?

From what I´ve read in the docs, the mssql_* functions should be
accessible on a Linux box when I compile using --with-sybase.

That´s true in principle, but I´ve noticed that the following mssql
functions are undefined:

- mssql_fetch_assoc()
- mssql_field_length()
- mssql_field_name()
- mssql_field_type()

...while I can still use mssql_connect(), mssql_select_db(),
mssql_query() and mssql_fetch_array().

How can it be that some functions are there and some are not? Is this
a bug? Is it my system? Or is it just me?

Regards,
  Markus

-- 
*21st Media*| Consulting, Konzeption, Produktion für die Bereiche:
Markus Wolff| Internet, Intranet, eCommerce, Content Management,
Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming
http://21st.de  | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1


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




[PHP-DEV] downgrade undefined function from fatal error

2002-12-13 Thread Dave [Hawk-Systems]
reviewed and did a couple of searches on this prior to signing up to this
particular list...

Is this a reasonable consideration for changes to PHP's handling of undefined
functions?

Currently, calling a previously undefined function generates an E_ERROR, and
halts the script as a cirtical failure meaning we can't handle the error as we
do others (this is clearly documented).

What I am not clear on is why an undefined function should necessarily be a
fatal error with no change to code the script to handle the error.  For example

?php
function eh($type, $msg, $file, $line, $context){
# code to parse $msg for /undefined\040function:\040(.*)\(\)/,$match
# check specified directory for the function:
# include the file if exists (./functions/$match[1].php)
# try to resume
# if we can't find it, halt with die()
}

error_reporting(0);
set_error_handler(eh);

undefined_function();
?

This would seem much more intuitive, and allow collection of massive amounts of
sharable and accessible functions to be contained in shared directories, and not
have to worry about identifying them all at the head of all pages, or including
functionsthat would not be required.

Currently as a workaround we are using the following logic;

?PHP
function func($f_name){
if(!function_exists($f_name)){
# function doesn't exists, needs to be included
require('/path/to/functions/'.$f_name.'.php');
}else{
# function already exists, no action required
}
return $f_name;
}

$database=call_user_func(func('DatabaseConnect'),'var1','var2');
?

But this results in code that isn't quite as intuitive.

Thoughts? Comments? You are nuts?

Dave



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




Re: [PHP-DEV] downgrade undefined function from fatal error

2002-12-13 Thread Derick Rethans
On Fri, 13 Dec 2002, Dave [Hawk-Systems] wrote:

...

 ?PHP
 function func($f_name){
   if(!function_exists($f_name)){
   # function doesn't exists, needs to be included
   require('/path/to/functions/'.$f_name.'.php');
   }else{
   # function already exists, no action required
   }
   return $f_name;
 }
 
 $database=call_user_func(func('DatabaseConnect'),'var1','var2');
 ?
 
 But this results in code that isn't quite as intuitive.
 
 Thoughts? Comments? You are nuts?

You are nuts (read the archives, this was discussed before)

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




[PHP-DEV] RE: [PEAR-DEV] Re: [PHP-DEV] distributing windows binaries (dll's) of PECL's

2002-12-13 Thread LIMBOURG Arnaud
 But are there any other ideas how to provide binaries of 
 PECL's outside 
 the php distributions?

There was plan to add a package homepage URL on the pear website. Therefore
you could provide a binary of your package on your own webpage.

Would that be a good solution to you ?
 
 Can I add the binaries to the .tgz, by adding it to the package.xml 
 file, before I'm going to upload the package into the pear web?
 
 bye,



[PHP-DEV] PHP building on Linux: A question on configure script!

2002-12-13 Thread Ananth Kesari
Hi,

I am involved in porting PHP for NetWare.

We are now looking at and trying to understand how PHP is built on Linux. I have a 
question for the same. It could be a newbie question on configure script since we are 
new to Linux. Please help.

The question is like this:

On NetWare:
We generate mod_php executable as the Apache module which Apache loads when 
appropriately configured. This in turn will use the phplib executable which has the 
TSRM, ZEND, all the standard extensions and libraries built into it. Then we have 
separate executables for extensions like MySQL, LDAP, XML etc.

On Linux:
We are trying to look at building a similar binaries on Linux also. Is that how it is 
done on Linux also?

To build for Apache on Unix, it appears that we have to use the following options in 
the configure script to get the equivalent of what I mentioned above:

--with-apache=Path to Apache source --disable-posix 
--with-mysql=shared --with-ldap=shared --enable-ftp --enable-bcmath 
--enable-calendar

The problem in this approach is that we seem to be getting a static library (xxx.a) as 
an output. We are not clear what we are supposed to do with this library! Perhaps this 
needs to be then built along with Apache into the Apache executable.

There is an option called:

--with-apxs=path to the apxs script of Apache

which seems to produce a DSO which doesn't seem to work on Linux. The build fails 
due to errors in the apxs script.

So, isn't it possible to produce on Linux, the equivalent of what I mentioned above 
for NetWare? If so, what options do we need to use for the configure process? We need 
to understand whether we are not using the right options or whether it is simply not 
possible to do so with what we have. The latter meaning that we need to make the 
necessary modifications to the input files to get what we want.

Your early reply on this is highly appreciated.

Thanks,
Ananth.



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




Re: [PHP-DEV] PHP building on Linux: A question on configure script!

2002-12-13 Thread Derick Rethans
Hi,

On Fri, 13 Dec 2002, Ananth Kesari wrote:

 To build for Apache on Unix, it appears that we have to use the
 following options in the configure script to get the equivalent of
 what I mentioned above:
 
 --with-apache=Path to Apache source --disable-posix 
 --with-mysql=shared --with-ldap=shared --enable-ftp --enable-bcmath 
 --enable-calendar
 
 The problem in this approach is that we seem to be getting a static
 library (xxx.a) as an output. We are not clear what we are supposed to
 do with this library! Perhaps this needs to be then built along with
 Apache into the Apache executable.

Yup, you're correct with that statement.

 
 There is an option called:
 
 --with-apxs=path to the apxs script of Apache
 
 which seems to produce a DSO which doesn't seem to work on Linux.
 The build fails due to errors in the apxs script.

--with-apxs would be the way to go, what errors do you get? Are you
using Apache 1.3 or a 2.0 series?

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




[PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Brian Moon
This is of really low importance, but I found it interesting.  A new guy on
the Phorum dev team decided to convert all double quotes to single quotes
for speed in CVS.  The common assumption is that single quotes are faster
than double quotes.  However, I am of the mind set of using double always as
it creates less headaches later to add a variable to the string.  In an
attempt to show him the marginal savings of this, I did some benchmarks.
The results were confusing.

$var=This is test number $x; was really slow.

but,

$var=This is test number .$x;

and

$var='This is test number '.$x;

we basically identical.

Andi, Zeev, if you want waste some energy on exanding on why this is and if
anything in ZE2 will change it I would find it a good read.

Brian Moon
dealnews.com




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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Andrey Hristov
See this :
http://phpxpath.sourceforge.net/benchmark/phpBench.php

And show it to the guy.

Andrey

- Original Message -
From: Brian Moon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 6:29 PM
Subject: [PHP-DEV] Single quotes VS. Double quotes


 This is of really low importance, but I found it interesting.  A new guy
on
 the Phorum dev team decided to convert all double quotes to single quotes
 for speed in CVS.  The common assumption is that single quotes are
faster
 than double quotes.  However, I am of the mind set of using double always
as
 it creates less headaches later to add a variable to the string.  In an
 attempt to show him the marginal savings of this, I did some benchmarks.
 The results were confusing.

 $var=This is test number $x; was really slow.

 but,

 $var=This is test number .$x;

 and

 $var='This is test number '.$x;

 we basically identical.

 Andi, Zeev, if you want waste some energy on exanding on why this is and
if
 anything in ZE2 will change it I would find it a good read.

 Brian Moon
 dealnews.com




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



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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Brian Moon
Man, I wish that answered my question, but it does not address string
concatenation vs. variables in double quoted strings anywhere on there.

Thanks for trying.

Brian Moon
dealnews.com


- Original Message -
From: Andrey Hristov [EMAIL PROTECTED]
To: Brian Moon [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 10:35 AM
Subject: Re: [PHP-DEV] Single quotes VS. Double quotes


| See this :
| http://phpxpath.sourceforge.net/benchmark/phpBench.php
|
| And show it to the guy.
|
| Andrey
|
| - Original Message -
| From: Brian Moon [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]
| Sent: Friday, December 13, 2002 6:29 PM
| Subject: [PHP-DEV] Single quotes VS. Double quotes
|
|
|  This is of really low importance, but I found it interesting.  A new guy
| on
|  the Phorum dev team decided to convert all double quotes to single
quotes
|  for speed in CVS.  The common assumption is that single quotes are
| faster
|  than double quotes.  However, I am of the mind set of using double
always
| as
|  it creates less headaches later to add a variable to the string.  In an
|  attempt to show him the marginal savings of this, I did some benchmarks.
|  The results were confusing.
| 
|  $var=This is test number $x; was really slow.
| 
|  but,
| 
|  $var=This is test number .$x;
| 
|  and
| 
|  $var='This is test number '.$x;
| 
|  we basically identical.
| 
|  Andi, Zeev, if you want waste some energy on exanding on why this is and
| if
|  anything in ZE2 will change it I would find it a good read.
| 
|  Brian Moon
|  dealnews.com
| 
| 
| 
| 
|  --
|  PHP Development Mailing List http://www.php.net/
|  To unsubscribe, visit: http://www.php.net/unsub.php
| 
|
|
|


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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread George Schlossnagle
What version of php did you try this with Brian?  There were some lexer 
changes implemented (that I believe are only in HEAD for ZE1 and ZE2 
and not in 4.3) that should equalize this difference.  There was a 
thread about this on php-dev not long ago that explains why this occurs 
- search the archives for ZEND_ADD_STRING.

George

On Friday, December 13, 2002, at 11:35  AM, Andrey Hristov wrote:

See this :
http://phpxpath.sourceforge.net/benchmark/phpBench.php

And show it to the guy.

Andrey

- Original Message -
From: Brian Moon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 6:29 PM
Subject: [PHP-DEV] Single quotes VS. Double quotes



This is of really low importance, but I found it interesting.  A new 
guy
on

the Phorum dev team decided to convert all double quotes to single 
quotes
for speed in CVS.  The common assumption is that single quotes are
faster

than double quotes.  However, I am of the mind set of using double 
always
as

it creates less headaches later to add a variable to the string.  In 
an
attempt to show him the marginal savings of this, I did some 
benchmarks.
The results were confusing.

$var=This is test number $x; was really slow.

but,

$var=This is test number .$x;

and

$var='This is test number '.$x;

we basically identical.

Andi, Zeev, if you want waste some energy on exanding on why this is 
and
if

anything in ZE2 will change it I would find it a good read.

Brian Moon
dealnews.com




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




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




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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Derick Rethans
On Fri, 13 Dec 2002, Brian Moon wrote:

 Man, I wish that answered my question, but it does not address string
 concatenation vs. variables in double quoted strings anywhere on there.

This was recently fixed in PHP. Single quotes and double quotes wont 
have that much of a speed difference from (I believe) PHP 4.3.0.

Derick

 - Original Message -
 From: Andrey Hristov [EMAIL PROTECTED]
 To: Brian Moon [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, December 13, 2002 10:35 AM
 Subject: Re: [PHP-DEV] Single quotes VS. Double quotes
 
 
 | See this :
 | http://phpxpath.sourceforge.net/benchmark/phpBench.php
 |
 | And show it to the guy.
 |
 | Andrey
 |
 | - Original Message -
 | From: Brian Moon [EMAIL PROTECTED]
 | To: [EMAIL PROTECTED]
 | Sent: Friday, December 13, 2002 6:29 PM
 | Subject: [PHP-DEV] Single quotes VS. Double quotes
 |
 |
 |  This is of really low importance, but I found it interesting.  A new guy
 | on
 |  the Phorum dev team decided to convert all double quotes to single
 quotes
 |  for speed in CVS.  The common assumption is that single quotes are
 | faster
 |  than double quotes.  However, I am of the mind set of using double
 always
 | as
 |  it creates less headaches later to add a variable to the string.  In an
 |  attempt to show him the marginal savings of this, I did some benchmarks.
 |  The results were confusing.
 | 
 |  $var=This is test number $x; was really slow.
 | 
 |  but,
 | 
 |  $var=This is test number .$x;
 | 
 |  and
 | 
 |  $var='This is test number '.$x;
 | 
 |  we basically identical.
 | 
 |  Andi, Zeev, if you want waste some energy on exanding on why this is and
 | if
 |  anything in ZE2 will change it I would find it a good read.
 | 
 |  Brian Moon
 |  dealnews.com
 | 
 | 
 | 
 | 
 |  --
 |  PHP Development Mailing List http://www.php.net/
 |  To unsubscribe, visit: http://www.php.net/unsub.php
 | 
 |
 |
 |
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Brian Moon
I am using 4.2.2-dev.  Must be a stable build from snaps.php.net.  I will
read the archives.

Brian Moon
dealnews.com


- Original Message -
From: George Schlossnagle [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: Brian Moon [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 10:40 AM
Subject: Re: [PHP-DEV] Single quotes VS. Double quotes


| What version of php did you try this with Brian?  There were some lexer
| changes implemented (that I believe are only in HEAD for ZE1 and ZE2
| and not in 4.3) that should equalize this difference.  There was a
| thread about this on php-dev not long ago that explains why this occurs
| - search the archives for ZEND_ADD_STRING.
|
| George
|
| On Friday, December 13, 2002, at 11:35  AM, Andrey Hristov wrote:
|
|  See this :
|  http://phpxpath.sourceforge.net/benchmark/phpBench.php
| 
|  And show it to the guy.
| 
|  Andrey
| 
|  - Original Message -
|  From: Brian Moon [EMAIL PROTECTED]
|  To: [EMAIL PROTECTED]
|  Sent: Friday, December 13, 2002 6:29 PM
|  Subject: [PHP-DEV] Single quotes VS. Double quotes
| 
| 
|  This is of really low importance, but I found it interesting.  A new
|  guy
|  on
|  the Phorum dev team decided to convert all double quotes to single
|  quotes
|  for speed in CVS.  The common assumption is that single quotes are
|  faster
|  than double quotes.  However, I am of the mind set of using double
|  always
|  as
|  it creates less headaches later to add a variable to the string.  In
|  an
|  attempt to show him the marginal savings of this, I did some
|  benchmarks.
|  The results were confusing.
| 
|  $var=This is test number $x; was really slow.
| 
|  but,
| 
|  $var=This is test number .$x;
| 
|  and
| 
|  $var='This is test number '.$x;
| 
|  we basically identical.
| 
|  Andi, Zeev, if you want waste some energy on exanding on why this is
|  and
|  if
|  anything in ZE2 will change it I would find it a good read.
| 
|  Brian Moon
|  dealnews.com
| 
| 
| 
| 
|  --
|  PHP Development Mailing List http://www.php.net/
|  To unsubscribe, visit: http://www.php.net/unsub.php
| 
| 
| 
|  --
|  PHP Development Mailing List http://www.php.net/
|  To unsubscribe, visit: http://www.php.net/unsub.php
| 
|
|
|


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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread George Schlossnagle
Oops, contrary to my earlier statement, the lexer patch for this 
problem seems to be in 4.3.0rc2 and 4.3.0rc3.

George

On Friday, December 13, 2002, at 11:43  AM, Brian Moon wrote:

I am using 4.2.2-dev.  Must be a stable build from snaps.php.net.  I 
will
read the archives.

Brian Moon
dealnews.com


- Original Message -
From: George Schlossnagle [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: Brian Moon [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 10:40 AM
Subject: Re: [PHP-DEV] Single quotes VS. Double quotes


| What version of php did you try this with Brian?  There were some 
lexer
| changes implemented (that I believe are only in HEAD for ZE1 and ZE2
| and not in 4.3) that should equalize this difference.  There was a
| thread about this on php-dev not long ago that explains why this 
occurs
| - search the archives for ZEND_ADD_STRING.
|
| George
|
| On Friday, December 13, 2002, at 11:35  AM, Andrey Hristov wrote:
|
|  See this :
|  http://phpxpath.sourceforge.net/benchmark/phpBench.php
| 
|  And show it to the guy.
| 
|  Andrey
| 
|  - Original Message -
|  From: Brian Moon [EMAIL PROTECTED]
|  To: [EMAIL PROTECTED]
|  Sent: Friday, December 13, 2002 6:29 PM
|  Subject: [PHP-DEV] Single quotes VS. Double quotes
| 
| 
|  This is of really low importance, but I found it interesting.  A 
new
|  guy
|  on
|  the Phorum dev team decided to convert all double quotes to single
|  quotes
|  for speed in CVS.  The common assumption is that single quotes 
are
|  faster
|  than double quotes.  However, I am of the mind set of using double
|  always
|  as
|  it creates less headaches later to add a variable to the string.  
In
|  an
|  attempt to show him the marginal savings of this, I did some
|  benchmarks.
|  The results were confusing.
| 
|  $var=This is test number $x; was really slow.
| 
|  but,
| 
|  $var=This is test number .$x;
| 
|  and
| 
|  $var='This is test number '.$x;
| 
|  we basically identical.
| 
|  Andi, Zeev, if you want waste some energy on exanding on why this 
is
|  and
|  if
|  anything in ZE2 will change it I would find it a good read.
| 
|  Brian Moon
|  dealnews.com
| 
| 
| 
| 
|  --
|  PHP Development Mailing List http://www.php.net/
|  To unsubscribe, visit: http://www.php.net/unsub.php
| 
| 
| 
|  --
|  PHP Development Mailing List http://www.php.net/
|  To unsubscribe, visit: http://www.php.net/unsub.php
| 
|
|
|


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



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




[PHP-DEV] Re: #20993 [Ver]: Element value changes without asking

2002-12-13 Thread Moriyoshi Koizumi
It would be easy to resolve this problem if we were allowed to break 
backwards compatibilities, as long as the results of following script can 
be said to be expected.

?php
$foo = array(1, 2, 3);
$bar = array();

$i = count($foo);
while (--$i = 0) {
$bar[$i] = $foo[$i];
}

$foo_ref = $foo;
$bar_ref = $bar;
$foo_copy = $foo;
$bar_copy = $bar;

$foo_copy[1] = '?';

echo 'foo: '; debug_zval_dump($foo);
echo 'foo_ref: '; debug_zval_dump($foo_ref);
echo 'foo_copy: '; debug_zval_dump($foo_copy);
echo 'bar: '; debug_zval_dump($bar);
echo 'bar_ref: '; debug_zval_dump($bar_ref);
echo 'bar_copy: '; debug_zval_dump($bar_copy);
?

Is this a kind of Won't fix thing?

Moriyoshi

[EMAIL PROTECTED] wrote:

  ID:   20993
  Updated by:   [EMAIL PROTECTED]
  Reported By:  [EMAIL PROTECTED]
  Status:   Verified
  Bug Type: Variables related
  Operating System: Any
  PHP Version:  4.0CVS-2002-12-13
  New Comment:
 
 Verified with 4.2.3
 
 
 
 Previous Comments:
 
 
 [2002-12-13 12:42:22] [EMAIL PROTECTED]
 
 Verified and added testcase to CVS
 
 
 
 [2002-12-13 12:01:33] [EMAIL PROTECTED]
 
 I create an array an then a reference to an element of that array.
 Then the array is passed to a function (by value!) which changes the
 value of the element.
 After that, the global array has also another value.
 
 I would expect this behaviour if I passed the array by reference but I
 do not.
 
 ?php
 
 $array = array(1);
 
 $reference = $array[0];
 
 echo $array[0], 'br';
 theFunction($array);
 
 echo $array[0], 'br';
 
 function theFunction($array) {
 $array[0] = 2;
 }
 
 ?
 
 
 
 [2002-12-13 12:00:37] [EMAIL PROTECTED]
 
 I create an array an then a reference to an element of that array.
 Then the array is passed to a function (by value!) which changes the
 value of the element.
 After that, the global array has also another value.
 
 I would expect this behaviour if I passed the array by reference but I
 did not.
 
 ?php
 
 $array = array(1);
 
 $reference = $array[0];
 
 echo $array[0], 'br';
 theFunction($array);
 
 echo $array[0], 'br';
 
 function theFunction($array) {
 $array[0] = 2;
 }
 
 ?
 
 
 
 
 -- 
 Edit this bug report at http://bugs.php.net/?id=20993edit=1
 


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




Re: [PHP-DEV] Re: #20993 [Ver]: Element value changes without asking

2002-12-13 Thread Moriyoshi Koizumi
This is a pretty well known issue indeed.
I should have read the archive carefully.

Related reports:
http://bugs.php.net/bug.php?id=6417
http://bugs.php.net/bug.php?id=7412
http://bugs.php.net/bug.php?id=7515
http://bugs.php.net/bug.php?id=15025

Moriyoshi

Moriyoshi Koizumi [EMAIL PROTECTED] wrote:

 It would be easy to resolve this problem if we were allowed to break 
 backwards compatibilities, as long as the results of following script can 
 be said to be expected.
 
 ?php
 $foo = array(1, 2, 3);
 $bar = array();
 
 $i = count($foo);
 while (--$i = 0) {
 $bar[$i] = $foo[$i];
 }
 
 $foo_ref = $foo;
 $bar_ref = $bar;
 $foo_copy = $foo;
 $bar_copy = $bar;
 
 $foo_copy[1] = '?';
 
 echo 'foo: '; debug_zval_dump($foo);
 echo 'foo_ref: '; debug_zval_dump($foo_ref);
 echo 'foo_copy: '; debug_zval_dump($foo_copy);
 echo 'bar: '; debug_zval_dump($bar);
 echo 'bar_ref: '; debug_zval_dump($bar_ref);
 echo 'bar_copy: '; debug_zval_dump($bar_copy);
 ?
 
 Is this a kind of Won't fix thing?
 
 Moriyoshi
 
 [EMAIL PROTECTED] wrote:
 
   ID:   20993
   Updated by:   [EMAIL PROTECTED]
   Reported By:  [EMAIL PROTECTED]
   Status:   Verified
   Bug Type: Variables related
   Operating System: Any
   PHP Version:  4.0CVS-2002-12-13
   New Comment:
  
  Verified with 4.2.3
  
  
  
  Previous Comments:
  
  
  [2002-12-13 12:42:22] [EMAIL PROTECTED]
  
  Verified and added testcase to CVS
  
  
  
  [2002-12-13 12:01:33] [EMAIL PROTECTED]
  
  I create an array an then a reference to an element of that array.
  Then the array is passed to a function (by value!) which changes the
  value of the element.
  After that, the global array has also another value.
  
  I would expect this behaviour if I passed the array by reference but I
  do not.
  
  ?php
  
  $array = array(1);
  
  $reference = $array[0];
  
  echo $array[0], 'br';
  theFunction($array);
  
  echo $array[0], 'br';
  
  function theFunction($array) {
  $array[0] = 2;
  }
  
  ?
  
  
  
  [2002-12-13 12:00:37] [EMAIL PROTECTED]
  
  I create an array an then a reference to an element of that array.
  Then the array is passed to a function (by value!) which changes the
  value of the element.
  After that, the global array has also another value.
  
  I would expect this behaviour if I passed the array by reference but I
  did not.
  
  ?php
  
  $array = array(1);
  
  $reference = $array[0];
  
  echo $array[0], 'br';
  theFunction($array);
  
  echo $array[0], 'br';
  
  function theFunction($array) {
  $array[0] = 2;
  }
  
  ?
  
  
  
  
  -- 
  Edit this bug report at http://bugs.php.net/?id=20993edit=1
  
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




Re: [PHP-DEV] Single quotes VS. Double quotes

2002-12-13 Thread Maxim Maletsky

Brian Moon [EMAIL PROTECTED] wrote... :

 This is of really low importance, but I found it interesting.  A new guy on
 the Phorum dev team decided to convert all double quotes to single quotes
 for speed in CVS.  The common assumption is that single quotes are faster
 than double quotes.  However, I am of the mind set of using double always as
 it creates less headaches later to add a variable to the string.  In an
 attempt to show him the marginal savings of this, I did some benchmarks.
 The results were confusing.
 
 $var=This is test number $x; was really slow.
 
 but,
 
 $var=This is test number .$x;
 
 and
 
 $var='This is test number '.$x;
 
 we basically identical.
 
 Andi, Zeev, if you want waste some energy on exanding on why this is and if
 anything in ZE2 will change it I would find it a good read.

Actually, I've benchmarked this long time ago on v4.0.x and my results
were completely meaningless.

Don't remember right now, but I guess I ended up believing that both
parsing's (a dot in single and a variable in double) were having their
own tiny delays with minimal difference. Only non-concatenated strings were
resulting faster for some miserable particle of a millisecond with single
quotes (what, seems to be optimized/normalized in PHP v4.3.0).

Whatever the result is, even with thousands loops, the speed gained by
optimizing concatenations will generally be times less than the overall
execution of the script that uses so many strings - it's proportional.

IMHO, the only reasons to care about this are the code readability and
coding standards within a team. If that makes sense to be so much
restrictive.


--
Maxim Maletsky
[EMAIL PROTECTED]

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




Re: [PHP-DEV] Re: #20993 [Ver]: Element value changes without asking

2002-12-13 Thread Melvyn Sopacua
At 21:43 13-12-2002, Moriyoshi Koizumi wrote:


This is a pretty well known issue indeed.
I should have read the archive carefully.

Related reports:
http://bugs.php.net/bug.php?id=6417
http://bugs.php.net/bug.php?id=7412
http://bugs.php.net/bug.php?id=7515
http://bugs.php.net/bug.php?id=15025


I wouldn't like to call it 'well-known'.

And I don't like the implications of 1 perfectly valid statement, impacting
the scope of an array in a non-documented and plain wrong manner.

IF this can't be fixed short term, we surely could detect the statement and
issue a warning?

I wouldn't want to debug this, when statement is in line 5 and function in
other file, line 4032.

With kind regards,

Melvyn Sopacua
?php include(not_reflecting_employers_views.txt); ?


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




Re: [PHP-DEV] php.exe - php-cgi.exe

2002-12-13 Thread Yasuo Ohgaki
Sebastian Nohn wrote:
(B Jan Schneider schrieb:
(B 
(BI know this thread is ridden to death but I want to add
(Bone argument for
(Bcompleteness: If the cgi's name will be changed,
(Bthousands of administrators
(Bneed to fix their servers. But if the cli's name will be
(Bchanged thousands
(Bof "end users" of php cli scripts will have to change the
(Bscripts' shebang line.
(B
(BI have no idea if there are more administrators who have
(Bto care about php
(Bcgi or users who use php cli. But at least the first
(Bgroup will have less
(Bproblems fixing the name change than the latter.
(B
(B 
(B 
(B PHP-CLI was experimental so far, so anyone who uses it has to be aware
(B of any changes that can happen. PHP-CGI is very far from being
(B experimental. I have no problem with all that renaming thing, but if we
(B rename the CGI-PHP to php-cgi we should do it with php5, because more
(B people will realize that a lot of things change between 4.x and 5.x.
(B For psychological numbering-reasons people don't see any change between
(B 4.2 and 4.3.
(B
(BI guess Jan is trying to say, people are using CGI binary for
(Bgeneral scripting. If they want to switch to CLI for general
(Bscripting, they have to rename binary to use CLI.
(B
(Bi.e. from "#!/usr/local/bin/php -q" to "#!/usr/local/bin/php-cli"
(B
(BBTW, people may want to add ini_set('implicit_flush','off);
(Bto all of their CLI scripts to prevent needless/redundant
(Bflushing anyway, though. (CLI flushes on every output by
(Bdefault not like CGI)
(B
(Be.g. ?php echo "Hello world\n" ? makes system flush output
(Btwice on char devices, once for block devices.
(B
(BAdding needless flushing is stupid, since flushing is rather
(Bexpensive as some of you know.
(B
(B--
(BYasuo Ohgaki
(B
(B
(B-- 
(BPHP Development Mailing List http://www.php.net/
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: #20993 [Ver]: Element value changes withoutasking

2002-12-13 Thread Moriyoshi Koizumi
 This is a pretty well known issue indeed.
 I should have read the archive carefully.
 
 Related reports:
 http://bugs.php.net/bug.php?id=6417
 http://bugs.php.net/bug.php?id=7412
 http://bugs.php.net/bug.php?id=7515
 http://bugs.php.net/bug.php?id=15025
 
 I wouldn't like to call it 'well-known'.

Misleading words? What I meant was this turned out to be a pretty well 
known issue... hardly had I noticed this problem until I saw this report, 
I found several related reports during the investigation. So I regarded it 
as a kind of them.

 And I don't like the implications of 1 perfectly valid statement, impacting
 the scope of an array in a non-documented and plain wrong manner.

Is it okay to always perform separation on all the elements of passed 
arrays? If so, the attached patch should work.

 IF this can't be fixed short term, we surely could detect the statement and
 issue a warning?

AFAIK possible. We'll have to trade off performance against usability.

Moriyoshi

Index: zend_execute.c
===
RCS file: /repository/Zend/zend_execute.c,v
retrieving revision 1.316.2.2
diff -u -r1.316.2.2 zend_execute.c
--- zend_execute.c  17 Nov 2002 22:00:32 -  1.316.2.2
+++ zend_execute.c  14 Dec 2002 07:29:19 -
@@ -65,6 +65,7 @@
 static void zend_extension_statement_handler(zend_extension *extension, zend_op_array 
*op_array TSRMLS_DC);
 static void zend_extension_fcall_begin_handler(zend_extension *extension, 
zend_op_array *op_array TSRMLS_DC);
 static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array 
*op_array TSRMLS_DC);
+static int _zval_array_disref(zval **ppz);
 
 #define RETURN_VALUE_USED(opline) (!((opline)-result.u.EA.type  EXT_TYPE_UNUSED))
 
@@ -1816,6 +1817,7 @@
} else if (PZVAL_IS_REF(*param)) {

zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(EX(opline)-result, EX(Ts), 
BP_VAR_W), param, NULL TSRMLS_CC);
} else {
+   _zval_array_disref(param);
zend_assign_to_variable(NULL, 
EX(opline)-result, NULL, *param, IS_VAR, EX(Ts) TSRMLS_CC);
}
}
@@ -2480,4 +2482,57 @@
}
}
zend_error(E_ERROR, Arrived at end of main loop which shouldn't happen);
+}
+
+static int _zval_ref_check(zval **p, void *flag)
+{
+   if ((*p)-is_ref) {
+   *(int *)flag = 1;
+   }
+   _zval_array_disref(p);
+   return ZEND_HASH_APPLY_KEEP;
+}
+
+static void zval_dis_ref(zval **p)
+{
+   if ((*p)-is_ref) {
+   zval *newzv;
+   ALLOC_ZVAL(newzv);
+   *newzv = **p;
+   zval_copy_ctor(newzv);
+   newzv-refcount = 1;
+   newzv-is_ref = 0;
+   if ((*p)-refcount = 1) {
+   zval_dtor((*p));
+   FREE_ZVAL(*p);
+   }
+   *p = newzv;
+   } else {
+   ((*p))-refcount++;
+   }
+}
+
+static int _zval_array_disref(zval **ppz)
+{
+   TSRMLS_FETCH();
+   if ((*ppz)-type == IS_ARRAY) {
+   int flag = 0;
+   if ((*ppz)-value.ht == EG(symbol_table)) {
+   return SUCCESS;
+   }
+   zend_hash_apply_with_argument((*ppz)-value.ht, (apply_func_arg_t) 
+_zval_ref_check, (void *)flag TSRMLS_CC);
+   if (flag) {
+   zval *newzv, *tmp;
+   ALLOC_ZVAL(newzv);
+   *newzv = **ppz;
+   ALLOC_HASHTABLE(newzv-value.ht);
+   zend_hash_init(newzv-value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+   zend_hash_copy(newzv-value.ht, Z_ARRVAL_PP(ppz), 
+(copy_ctor_func_t) zval_dis_ref, (void *) tmp, sizeof(zval *));
+   zval_ptr_dtor(ppz);
+   *ppz = newzv;
+   newzv-is_ref = 0;
+   newzv-refcount = 1;
+   }
+   } 
+   return SUCCESS;
 }

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