[PHP-DEV] CVS Account Request: thu

2003-10-02 Thread Nguyen Thac Thu
programming

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



[PHP-DEV] array_merge_clobber

2003-10-02 Thread Lukas Smith
Hi,

Ok here is another patch written by my new intern (Ralf Willenbacher)
which adds array_merge_clobber to the set of array functions. After a
bit of pondering we think that array_merge_replace might be a better
name for it. But that is just sugar on top once we agree on the
principal.

Note: array_merge_clobber behaves a bit different than array_merge and
array_merge_recursive and different than array addition.

array array_merge_clobber ( array array1, array array2 [, array ...])

Essentially it does the following:
It copies the first array and then overwrites any values that have the
same key (numeric or string) or appends any values that have a key that
is not yet defined by working recursively over the subsequent arrays.

So values in array 2 overwrite values in array 1 that have the same key
(numeric or string). And values in array 3 overwrite values in array 2
that have the same key (numeric or string). Etc.

You can find the path here:
http://www.backendmedia.com/php_patches/mergeclobber.patch

Here is a little test script (with the implementation I made in PHP):
http://www.backendmedia.com/php_patches/array_merge_clobber.php

While working on this patch we found a bug in array_merge_recursive. But
I will submit this in a separate mail.

Regards,
Lukas Smith
[EMAIL PROTECTED] 
___ 
  BackendMedia 
  www.backendmedia.com 
  [EMAIL PROTECTED] 

  Linn Zwoch Smith GbR 
  Pariser Str. 44 
  D-10707 Berlin 

  Tel +49 30 83 22 50 00 
  Fax +49 30 83 22 50 07

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



[PHP-DEV] array_merge_recursive

2003-10-02 Thread Lukas Smith
Hi,

it seems this bug is now back in action:
http://bugs.php.net/bug.php?id=14990

Here is a patch my intern wrote:
http://www.backendmedia.com/php_patches/array_merge_rec.patch

However maybe the original patch that andrei commited was just lost
somehow?

regards,
Lukas Smith
[EMAIL PROTECTED] 
___ 
  BackendMedia 
  www.backendmedia.com 
  [EMAIL PROTECTED] 

  Linn Zwoch Smith GbR 
  Pariser Str. 44 
  D-10707 Berlin 

  Tel +49 30 83 22 50 00 
  Fax +49 30 83 22 50 07

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



[PHP-DEV] argv and argc on cliphp

2003-10-02 Thread Stanislav Malyshev
Is there any reason that PHP5 CLI does not register argc and argv in 
_SERVER like PHP4 does? There are a number of scripts that depend on it 
and just adding one more unnecessary incompatibility between PHP4 and 
PHP5. What is the problem with argv/argc being in _SERVER?

-- 
Stanislav Malyshev, Zend Products Engineer   
[EMAIL PROTECTED]  http://www.zend.com/ +972-3-6139665 ext.109

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



Re: [PHP-DEV] array_merge_recursive

2003-10-02 Thread Jani Taskinen

AFAIK, this is already fixed in CVS.
(at least the test script in bug 14990 works fine for me)

--Jani


On Thu, 2 Oct 2003, Lukas Smith wrote:

>Hi,
>
>it seems this bug is now back in action:
>http://bugs.php.net/bug.php?id=14990
>
>Here is a patch my intern wrote:
>http://www.backendmedia.com/php_patches/array_merge_rec.patch
>
>However maybe the original patch that andrei commited was just lost
>somehow?
>
>regards,
>Lukas Smith
>[EMAIL PROTECTED] 
>___ 
>  BackendMedia 
>  www.backendmedia.com 
>  [EMAIL PROTECTED] 
>
>  Linn Zwoch Smith GbR 
>  Pariser Str. 44 
>  D-10707 Berlin 
>
>  Tel +49 30 83 22 50 00 
>  Fax +49 30 83 22 50 07
>
>

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



RE: [PHP-DEV] array_merge_recursive

2003-10-02 Thread Lukas Smith
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jani
> Taskinen
> Sent: Thursday, October 02, 2003 4:12 PM
> To: Lukas Smith
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DEV] array_merge_recursive
> 
> 
> AFAIK, this is already fixed in CVS.
> (at least the test script in bug 14990 works fine for me)

Doesnt work for multidimensional arrays though ...

Should I open up a new bug report?

 'unclobbered',
'test2' => 'dontclobber',
'test3' => array(
'testarray1' => 'unclobbered2',
'testarray2' => 'dontclobber' )
);

$array2 = array(
'test1' => 'clobbered',
'test3' => array(
'testarray1' => 'clobbered2'
)
); 

echo '';
echo 'phpversion()';
echo phpversion().'';
echo 'php_uname()';
echo php_uname().'';
echo '$array1';
print_r($array1);
echo '$array2';
print_r($array2);
echo 'array_merge_recursive($array1, $array2)';
print_r(array_merge_recursive($array1, $array2));
echo '$array2';
print_r($array2);
echo '';
?>

regards,
Lukas

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



[PHP-DEV] Problems with first_module example

2003-10-02 Thread Mike
I am trying to compile the test first_module into php

I downloaded the examples.tar.gz file and then copied the directory
first_module/ into the php/ext directory

I then ran ./buildconf --force (dist source), ./configure --help showed
the extra module available, so I ran ./configure --enable-first_module

Below is the error

checking whether to enable the bundled filePro support... no
: command not found8291:
checking BOOK: whether to enable the first module... yes
: command not found8336:
: command not found8337:
./configure: line 91952: syntax error: unexpected end of file

Can anyone help?? Im completely stuck

Mike

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



[PHP-DEV] CVS Account Request: mobarmeg

2003-10-02 Thread Hassan A. Sunbul
Translating the documentation ,Maintaining www.php.net ,Developing the PHP runtime

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



Re: [PHP-DEV] argv and argc on cliphp

2003-10-02 Thread Alan Knowles
Stanislav - looks like andrei changed it - you better cc his private 
mail as I dont think he reads internals often.

Regards
Alan
Stanislav Malyshev wrote:

Is there any reason that PHP5 CLI does not register argc and argv in 
_SERVER like PHP4 does? There are a number of scripts that depend on it 
and just adding one more unnecessary incompatibility between PHP4 and 
PHP5. What is the problem with argv/argc being in _SERVER?

 

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


Re: [PHP-DEV] argv and argc on cliphp

2003-10-02 Thread Rasmus Lerdorf
Andrei and I discussed this change and at the conceptual level at least 
$_SERVER should be populated with argc and argv if variables_order 
includes "S".  If you have specifically configured your system to not 
create $_SERVER, then of course it shouldn't be there.  The change was to 
always make argc and argv available in the CLI version regardless of the 
variables_order setting.  As in, the CLI version will now always populate 
the global $argc and $argv variables. 

So, if you have "S" in your variables_order and you are not seeing 
$_SERVER['argc'] and $_SERVER['argv'] populated then something got messed 
up along the way.  It should definitely be there.

-Rasmus

On Fri, 3 Oct 2003, Alan Knowles wrote:

> Stanislav - looks like andrei changed it - you better cc his private 
> mail as I dont think he reads internals often.
> 
> Regards
> Alan
> 
> Stanislav Malyshev wrote:
> 
> >Is there any reason that PHP5 CLI does not register argc and argv in 
> >_SERVER like PHP4 does? There are a number of scripts that depend on it 
> >and just adding one more unnecessary incompatibility between PHP4 and 
> >PHP5. What is the problem with argv/argc being in _SERVER?
> >
> >  
> >
> 
> 

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



[PHP-DEV] Fix for bug #25543

2003-10-02 Thread Moriyoshi Koizumi
Hi,

Attached is a fix for bug #25543 (Error in set_error_handler() definition), 
which is caused by disordered scheduling of the garbage collection 
(zend_clean_garbage()).

With this patch I'm adding the following two inline functions, 
zend_begin_atomic() and zend_end_atomic(), to prevent GC from being 
performed at the right time. Calls to those functions are inserted 
at the beginning / end of zend_fetch_dimension_address(), 
zend_fetch_property_address(), and some other functions of the same kind.

I'll commit these shortly if you don't see any problem.

Regards,

Moriyoshi
Index: Zend/zend.c
===
RCS file: /repository/Zend/Attic/zend.c,v
retrieving revision 1.162.2.13
diff -u -r1.162.2.13 zend.c
--- Zend/zend.c 22 Sep 2003 04:22:06 -  1.162.2.13
+++ Zend/zend.c 3 Oct 2003 00:13:47 -
@@ -501,6 +501,7 @@
zend_startup_constants();
zend_set_default_compile_time_values(TSRMLS_C);
EG(user_error_handler) = NULL;
+   EG(atomic_op_count) = 0;
 #endif
zend_register_standard_constants(TSRMLS_C);
 
Index: Zend/zend_execute.c
===
RCS file: /repository/Zend/Attic/zend_execute.c,v
retrieving revision 1.316.2.22
diff -u -r1.316.2.22 zend_execute.c
--- Zend/zend_execute.c 28 Aug 2003 16:08:11 -  1.316.2.22
+++ Zend/zend_execute.c 3 Oct 2003 00:13:48 -
@@ -739,9 +739,11 @@
zval *container;
zval ***retval = &Ts[result->u.var].var.ptr_ptr;
 
+   zend_begin_atomic(TSRMLS_C);
 
if (container_ptr == NULL) {
fetch_overloaded_element(result, op1, op2, Ts, type, retval, 
OE_IS_ARRAY TSRMLS_CC);
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -750,6 +752,7 @@
if (container == EG(error_zval_ptr)) {
*retval = &EG(error_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -824,7 +827,6 @@
Ts[result->u.var].EA.type = IS_STRING_OFFSET;
FREE_OP(Ts, op2, EG(free_op2));
*retval = NULL;
-   return;
}
break;
default: {
@@ -844,6 +846,7 @@
}
break;
}
+   zend_end_atomic(TSRMLS_C);
 }
 
 
@@ -869,9 +872,11 @@
zval *container;
zval ***retval = &Ts[result->u.var].var.ptr_ptr;
 
+   zend_begin_atomic(TSRMLS_C);
 
if (container_ptr == NULL) {
fetch_overloaded_element(result, op1, op2, Ts, type, retval, 
OE_IS_OBJECT TSRMLS_CC);
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -879,6 +884,7 @@
if (container == EG(error_zval_ptr)) {
*retval = &EG(error_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -899,6 +905,7 @@

zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, 
&overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -929,6 +936,7 @@
*retval = &EG(error_zval_ptr);
}
SELECTIVE_PZVAL_LOCK(**retval, result);
+   zend_end_atomic(TSRMLS_C);
return;
}
 
@@ -939,6 +947,7 @@
}
*retval = zend_fetch_property_address_inner(Z_OBJPROP_P(container), op2, Ts, 
type TSRMLS_CC);
SELECTIVE_PZVAL_LOCK(**retval, result);
+   zend_end_atomic(TSRMLS_C);
 }
 
 
Index: Zend/zend_execute.h
===
RCS file: /repository/Zend/Attic/zend_execute.h,v
retrieving revision 1.47.2.1
diff -u -r1.47.2.1 zend_execute.h
--- Zend/zend_execute.h 31 Dec 2002 16:23:00 -  1.47.2.1
+++ Zend/zend_execute.h 3 Oct 2003 00:13:48 -
@@ -112,6 +112,15 @@
 
 void execute_new_code(TSRMLS_D);
 
+static inline void zend_begin_atomic(TSRMLS_D)
+{
+   EG(atomic_op_count)++;
+}
+
+static inline void zend_end_atomic(TSRMLS_D)
+{
+   EG(atomic_op_count)--;
+}
 
 /* services */
 ZEND_API char *get_active_function_name(TSRMLS_D);
Index: Zend/zend_execute_locks.h
===
RCS file: /repository/Zend/Attic/zend_execute_locks.h,v
retrieving revision 1.9
diff -u -r1.9 zend_execute_locks.h
--- Zend/zend_execute_locks.h   31 Aug 2001 19:32:25 -  1.9
+++ Zend/zend_execute_locks.h   3 Oct 2003 00:13:48 -
@@ -22,8 +22,10 @@
 
 static inline void zend_clean_garbage(TSRMLS_D)
 {
-   while (EG(garbage_ptr)) {
-   zval_p

Re: [PHP-DEV] Fix for bug #25543

2003-10-02 Thread Jani Taskinen

#25543 is documentation 'bug', what exactly does your
patch fix? I don't see anything wrong with set_error_handler()..

--Jani


On Fri, 3 Oct 2003, Moriyoshi Koizumi wrote:

>Hi,
>
>Attached is a fix for bug #25543 (Error in set_error_handler() definition), 
>which is caused by disordered scheduling of the garbage collection 
>(zend_clean_garbage()).
>
>With this patch I'm adding the following two inline functions, 
>zend_begin_atomic() and zend_end_atomic(), to prevent GC from being 
>performed at the right time. Calls to those functions are inserted 
>at the beginning / end of zend_fetch_dimension_address(), 
>zend_fetch_property_address(), and some other functions of the same kind.
>
>I'll commit these shortly if you don't see any problem.
>
>Regards,
>
>Moriyoshi
>

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