[PHP-DEV] Another approach to timeout handling

2008-08-29 Thread Dmitry Stogov
Hi,

This is simple, fast and system independent solution for safe timeout
handling. The patch does the same as Zend Signal Handling and it does
it safer (correct me if I'm wrong).

The signal handler just set EG(timed_out) flag (as on Windows).
This flag is checked during execute() loop, but only on instructions
that may cause loops (jmp(s) and function call).

The slowdown because of additional checks is near invisible (0.5% on
bench.php according to valgrind).

The only disadvantage is inability to terminate internal functions, but
each such termination may be unsafe and cause future memory corruptions,
crashes, memory and resource leaks.

I don't persist to include it in 5.3, as it need to be discussed and may
delay release. (Personally, I'm irrelevant if it committed or not)
It just an illustration of another simple approach.

Thanks. Dmitry.
Index: Zend/zend_alloc.c
===
RCS file: /repository/ZendEngine2/zend_alloc.c,v
retrieving revision 1.144.2.3.2.43.2.16
diff -u -p -d -r1.144.2.3.2.43.2.16 zend_alloc.c
--- Zend/zend_alloc.c   15 Aug 2008 19:47:23 -  1.144.2.3.2.43.2.16
+++ Zend/zend_alloc.c   28 Aug 2008 13:44:06 -
@@ -1826,15 +1826,12 @@ static void *_zend_mm_alloc_int(zend_mm_
segment_size = heap-block_size;
}
 
-   HANDLE_BLOCK_INTERRUPTIONS();
-
if (segment_size  true_size ||
heap-real_size + segment_size  heap-limit) {
/* Memory limit overflow */
 #if ZEND_MM_CACHE
zend_mm_free_cache(heap);
 #endif
-   HANDLE_UNBLOCK_INTERRUPTIONS();
 #if ZEND_DEBUG
zend_mm_safe_error(heap, Allowed memory size of %ld 
bytes exhausted at %s:%d (tried to allocate %lu bytes), heap-limit, 
__zend_filename, __zend_lineno, size);
 #else
@@ -1849,7 +1846,6 @@ static void *_zend_mm_alloc_int(zend_mm_
 #if ZEND_MM_CACHE
zend_mm_free_cache(heap);
 #endif
-   HANDLE_UNBLOCK_INTERRUPTIONS();
 out_of_memory:
 #if ZEND_DEBUG
zend_mm_safe_error(heap, Out of memory (allocated %ld) 
at %s:%d (tried to allocate %lu bytes), heap-real_size, __zend_filename, 
__zend_lineno, size);
@@ -1878,7 +1874,6 @@ out_of_memory:
} else {
 zend_mm_finished_searching_for_block:
/* remove from free list */
-   HANDLE_BLOCK_INTERRUPTIONS();
ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_FREED);
ZEND_MM_CHECK_COOKIE(best_fit);
ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit);
@@ -1915,8 +1910,6 @@ zend_mm_finished_searching_for_block:
heap-peak = heap-size;
}
 
-   HANDLE_UNBLOCK_INTERRUPTIONS();
-
return ZEND_MM_DATA_OF(best_fit);
 }
 
@@ -1957,8 +1950,6 @@ static void _zend_mm_free_int(zend_mm_he
}
 #endif
 
-   HANDLE_BLOCK_INTERRUPTIONS();
-
heap-size -= size;
 
next_block = ZEND_MM_BLOCK_AT(mm_block, size);
@@ -1978,7 +1969,6 @@ static void _zend_mm_free_int(zend_mm_he
ZEND_MM_BLOCK(mm_block, ZEND_MM_FREE_BLOCK, size);
zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block);
}
-   HANDLE_UNBLOCK_INTERRUPTIONS();
 }
 
 static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size 
ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
@@ -2007,7 +1997,6 @@ static void *_zend_mm_realloc_int(zend_m
if (remaining_size = ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
zend_mm_free_block *new_free_block;
 
-   HANDLE_BLOCK_INTERRUPTIONS();
next_block = ZEND_MM_BLOCK_AT(mm_block, orig_size);
if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
remaining_size += 
ZEND_MM_FREE_BLOCK_SIZE(next_block);
@@ -2023,7 +2012,6 @@ static void *_zend_mm_realloc_int(zend_m
/* add the new free block to the free list */
zend_mm_add_to_free_list(heap, new_free_block);
heap-size += (true_size - orig_size);
-   HANDLE_UNBLOCK_INTERRUPTIONS();
}
ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0);
return p;
@@ -2082,7 +2070,6 @@ static void *_zend_mm_realloc_int(zend_m
size_t block_size = orig_size + 
ZEND_MM_FREE_BLOCK_SIZE(next_block);
size_t remaining_size = block_size - true_size;
 
-   HANDLE_BLOCK_INTERRUPTIONS();
zend_mm_remove_from_free_list(heap, (zend_mm_free_block 
*) next_block);
 
if (remaining_size  ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
@@ -2109,11 +2096,9 @@ static void *_zend_mm_realloc_int(zend_m
if (heap-peak  heap-size) {
heap-peak = 

Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Dmitry Stogov
Hi Matt,

I updated your patch a little bit to make it more clear (from my point
of view).
Please take a look.

Thanks. Dmitry.

Matt Wilmas wrote:
 Hi Dmitry,
 
 Well, it's been awhile since Alpha 1 :-), so I wanted to finally resend this
 before Alpha 2!  I agree that the additional optimization probably wouldn't
 happen often, as there won't be that much namespace usage right away, I
 assume.  But I think it makes sense to handle :: prefix constants, since
 they're known to have global scope, and I can see the future [online]
 optimization tip: When using namespaces, use :: for global constants to get
 compile-time substitution. ;-)
 
 The code is the same as before, just updated the patch.  It doesn't really
 seem less clear, to me, than the current code.  In zend_do_fetch_constant(),
 the check_namespace variable may be better named something like
 from_namespace according to my changes, to be more clear, but I left that
 out to make the patch as simple as possible.
 
 http://realplain.com/php/ct_const_fixes.diff
 http://realplain.com/php/ct_const_fixes_5_3.diff
 
 
 Thanks,
 Matt
 
 
 - Original Message -
 From: Dmitry Stogov
 Sent: Thursday, July 31, 2008
 
 Hi Matt,

 Now I know. :)
 Anyway, I don't think this optimization will work often.

 Send me the patch after Alpha1 release.

 Thanks. Dmitry.


 Matt Wilmas wrote:
 Hi Dmitry,

 Do you know that with your changes, no substitution will happen in a
 namespace even when using :: prefix? :-/  (That's what I would do when I
 know it's global, for optimization.)  Or is that what you meant by not
 so
 optimal?


 - Matt


 - Original Message -
 From: Dmitry Stogov
 Sent: Thursday, July 31, 2008

 Thanks Matt. I committed near the same patch.
 It's not so optimal, but little bit more clear.

 Thanks. Dmitry.

 Matt Wilmas wrote:
 Hi Dmitry,

 For the behavior change that I mentioned in the other thread, with
 this
 code:

 function foo() {
 static $a = -PHP_INT_MAX;
 }

 Which could work sometimes, and sometimes not (if in a namespace or
 ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION is set).  I changed things so
 that
 there is no substitution of constants (except with CT_SUBST flag, like
 always) for compile time constants (ZEND_CT mode).  They don't create
 a
 FETCH_CONSTANT opcode anyway. :-)

 Another thing I realized wasn't getting optimized (runtime constants),
 which
 can be, is with:

 namespace foo;
 $a = ::PHP_INT_MAX;  // :: for global scope

 So the patch allows substitution there as well.

 http://realplain.com/php/ct_const_fixes.diff
 http://realplain.com/php/ct_const_fixes_5_3.diff
 
Index: Zend/zend_compile.c
===
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.647.2.27.2.41.2.84
diff -u -p -d -r1.647.2.27.2.41.2.84 zend_compile.c
--- Zend/zend_compile.c 24 Aug 2008 18:22:33 -  1.647.2.27.2.41.2.84
+++ Zend/zend_compile.c 29 Aug 2008 09:09:48 -
@@ -1392,7 +1392,7 @@ void zend_do_begin_lambda_function_decla
zend_do_begin_function_declaration(function_token, function_name, 0, 
return_reference, NULL TSRMLS_CC);
 
result-op_type = IS_TMP_VAR;
-   result-u.var = get_temporary_variable(current_op_array);;
+   result-u.var = get_temporary_variable(current_op_array);
 
current_op = current_op_array-opcodes[current_op_number];
current_op-opcode = ZEND_DECLARE_LAMBDA_FUNCTION;
@@ -3767,7 +3767,7 @@ void zend_do_end_new_object(znode *resul
*result = CG(active_op_array)-opcodes[new_token-u.opline_num].result;
 }
 
-static zend_constant* zend_get_ct_const(const zval *const_name, int mode 
TSRMLS_DC) /* {{{ */
+static zend_constant* zend_get_ct_const(const zval *const_name, int 
all_internal_constants_substitution TSRMLS_DC) /* {{{ */
 {
zend_constant *c = NULL;
 
@@ -3786,9 +3786,8 @@ static zend_constant* zend_get_ct_const(
if (c-flags  CONST_CT_SUBST) {
return c;
}
-   if (mode == ZEND_RT 
+   if (all_internal_constants_substitution 
(c-flags  CONST_PERSISTENT) 
-   !CG(current_namespace) 
!(CG(compiler_options)  ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) 
Z_TYPE(c-value) != IS_CONSTANT 
Z_TYPE(c-value) != IS_CONSTANT_ARRAY) {
@@ -3798,9 +3797,9 @@ static zend_constant* zend_get_ct_const(
 }
 /* }}} */
 
-static int zend_constant_ct_subst(znode *result, zval *const_name, int mode 
TSRMLS_DC) /* {{{ */
+static int zend_constant_ct_subst(znode *result, zval *const_name, int 
all_internal_constants_substitution TSRMLS_DC) /* {{{ */
 {
-   zend_constant *c = zend_get_ct_const(const_name, mode TSRMLS_CC);
+   zend_constant *c = zend_get_ct_const(const_name, 
all_internal_constants_substitution TSRMLS_CC);
 
if (c) {
zval_dtor(const_name);
@@ -3827,7 +3826,7 @@ void zend_do_fetch_constant(znode *resul
zval_dtor(constant_container-u.constant);
 

Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Matt Wilmas
Hi Dmitry,

Yeah, that looks good too, and should work the same way. :-)


Thanks,
Matt


- Original Message -
From: Dmitry Stogov
Sent: Friday, August 29, 2008

 Hi Matt,

 I updated your patch a little bit to make it more clear (from my point
 of view).
 Please take a look.

 Thanks. Dmitry.

 Matt Wilmas wrote:
  Hi Dmitry,
 
  Well, it's been awhile since Alpha 1 :-), so I wanted to finally resend
this
  before Alpha 2!  I agree that the additional optimization probably
wouldn't
  happen often, as there won't be that much namespace usage right away, I
  assume.  But I think it makes sense to handle :: prefix constants, since
  they're known to have global scope, and I can see the future [online]
  optimization tip: When using namespaces, use :: for global constants to
get
  compile-time substitution. ;-)
 
  The code is the same as before, just updated the patch.  It doesn't
really
  seem less clear, to me, than the current code.  In
zend_do_fetch_constant(),
  the check_namespace variable may be better named something like
  from_namespace according to my changes, to be more clear, but I left
that
  out to make the patch as simple as possible.
 
  http://realplain.com/php/ct_const_fixes.diff
  http://realplain.com/php/ct_const_fixes_5_3.diff
 
 
  Thanks,
  Matt


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



Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Dmitry Stogov
Ok, I'm going to commit it.
Could you remember why we disabled constants substitution for ZEND_CT?

Thanks. Dmitry.

Matt Wilmas wrote:
 Hi Dmitry,
 
 Yeah, that looks good too, and should work the same way. :-)
 
 
 Thanks,
 Matt
 
 
 - Original Message -
 From: Dmitry Stogov
 Sent: Friday, August 29, 2008
 
 Hi Matt,

 I updated your patch a little bit to make it more clear (from my point
 of view).
 Please take a look.

 Thanks. Dmitry.

 Matt Wilmas wrote:
 Hi Dmitry,

 Well, it's been awhile since Alpha 1 :-), so I wanted to finally resend
 this
 before Alpha 2!  I agree that the additional optimization probably
 wouldn't
 happen often, as there won't be that much namespace usage right away, I
 assume.  But I think it makes sense to handle :: prefix constants, since
 they're known to have global scope, and I can see the future [online]
 optimization tip: When using namespaces, use :: for global constants to
 get
 compile-time substitution. ;-)

 The code is the same as before, just updated the patch.  It doesn't
 really
 seem less clear, to me, than the current code.  In
 zend_do_fetch_constant(),
 the check_namespace variable may be better named something like
 from_namespace according to my changes, to be more clear, but I left
 that
 out to make the patch as simple as possible.

 http://realplain.com/php/ct_const_fixes.diff
 http://realplain.com/php/ct_const_fixes_5_3.diff


 Thanks,
 Matt
 

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



Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Matt Wilmas
Hi Dmitry,

- Original Message -
From: Dmitry Stogov
Sent: Friday, August 29, 2008

 Ok, I'm going to commit it.
 Could you remember why we disabled constants substitution for ZEND_CT?

Yeah, it's to make sure something like  -CONST  in ZEND_CT context doesn't
work sometimes, sometimes not.  My previous message (first part):
http://marc.info/?l=php-internalsm=121750618525882w=2

 Thanks. Dmitry.

 Matt Wilmas wrote:
  Hi Dmitry,
 
  Yeah, that looks good too, and should work the same way. :-)
 
 
  Thanks,
  Matt
 
 
  - Original Message -
  From: Dmitry Stogov
  Sent: Friday, August 29, 2008
 
  Hi Matt,
 
  I updated your patch a little bit to make it more clear (from my point
  of view).
  Please take a look.
 
  Thanks. Dmitry.


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



Re: [PHP-DEV] ext/soap ctor errors

2008-08-29 Thread Lukas Kahwe Smith


On 13.08.2008, at 14:31, David Zülke wrote:

True, it indeed does since 5.3... but what about that warning; does  
it have to be raised at all? if the exceptions option is passed?


Am 08.08.2008 um 09:39 schrieb Dmitry Stogov:


Hi,

I took a quick look into the issue and I didn't found a problem.
SoapClient constructor already throws exceptions in case of WSDL  
errors.


?php
try {
new SoapClient(non-existent);
} catch (Exception $e) {
echo CATCHED: .$e-getMessage().\n;
}

Warning: SoapClient::SoapClient(): I/O warning : failed to load  
external entity non-existent in Command line code on line 1
CATCHED: SOAP-ERROR: Parsing WSDL: Couldn't load from 'non- 
existent' : failed to load external entity non-existent


SoapServer does fatal errors, but it souldn't be a problem, because  
servers use their own WSDL files which may be fixed.


Thanks. Dmitry.


Lukas Kahwe Smith wrote:

On 24.07.2008, at 14:36, Noah Fontes wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Dmitry,

SOAP generally uses php_error[_docref] everywhere for errors that  
are
not actual SOAP faults, even in exceptions mode. Is this  
intentional,
and would it be worth the BC break to change all of the  
php_errors to

exceptions?

Most of the SOAP SDL-loading php_errors are also E_ERROR, for  
reasons I
don't really understand. If we don't move to exceptions, can we  
at least

reduce the severity for some of these to E_WARNING?

e.g. (php_sdl.c:824):

if (op_name == NULL) {
  soap_error0(E_ERROR, Parsing WSDL: Missing 'name' attribute for
operation);
}

By when do you guys think you can complete the changes?
regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]







Maybe a general question (not sure if its in time to address this  
stuff for 5.3.0).


We are getting more and more extensions with an exception mode. I  
guess PDO is the rolemodel here and in absence of a discussion about  
this it seems like we have accepted this sort of behavior. But what I  
wonder is if such exception modes should mean that if an exception  
is thrown for a specific issue, if this should then disable warnings/ 
notices/errors that would be raised for the same issue.


regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]




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



Re: [PHP-DEV] alpha2 scheduled

2008-08-29 Thread Marcus Boerger
Hello Stanislav,

Thursday, August 28, 2008, 7:43:04 PM, you wrote:

 Hi!

 I'm really sorry, but I have to ask.
 Since you can detect that this is a nested namespace, why can't we allow it?

 Because that's not how model was designed and it creates all kind of

It wasn't designed to have multiple namespaces at all to begin with. But as
now have them we should at least think of what we want...

 trouble with name resolution. Basically, you get potentially infinite 
 resolution path. You don't want to go there. And frankly, there's 
 absolutely no need.

How so?

namespace foo {
  namespace bar {
class baz {}
  }
}

According to your won words it is all about name substitution. Explicitly
you were talking about simple text replacement. Now that in mind I see and
easy replacement here. That is 'bar' becomes 'foo::bar' and 'baz' obviously
becomes 'foo::bar::baz' or can you find something else?

Actually we already have this:

namespace foo;
namespace foo::bar;
class baz {}

And that does exactly what I described above. But maybe I just to stupid
:-)

Best regards,
 Marcus


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



[PHP-DEV] CVS Account Request: iodbc

2008-08-29 Thread Patrick van Kleef
Lukas Kahwe Smith asked me to register so i can update the ext/odbc code

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



Re: [PHP-DEV] Re: [PATCH] Constant expr folding (again), and other things

2008-08-29 Thread Matt Wilmas
Hi again Dmitry,

- Original Message -
From: Dmitry Stogov
Sent: Thursday, July 31, 2008

 Hi Matt,

 For now I would like to disable -CONST constant expression which
 started to work after your patch.

 Later we are able to implement the complete constant expressions support.

One more updated thing to ask about. :-)  From the last reply, I wasn't sure
if constant folding in zend_do_[binary|unary]_op() could be added (for
negative numbers, ORing function flags that were substituted, ~0, 1024 *
1024, etc.) or it was desired to wait for complete constant expressions
support (in static_scalar context), though I don't see any relation between
that, which is an actual language change, and this easy optimization that's
only internal (and more useful now with constant substitution).

So I updated the patch, which is the same code as before, but without trying
to add partial expression support to static_scalar.  Seems pretty
simple/safe, with basically just the if () {  } block added in
zend_do_[binary|unary]_op(). :-)  The rest updates the unary_op_type typedef
(was missing TSRMLS_DC), adds binary_op_type, and updates get_binary_op
(half the patch!).  The couple changes in the parser, which CAN be ignored
if desired, are mostly a cleanup, but  '+' static_scalar  now actually does
something like the unary + operator in regular contexts.  As I showed
before, it makes the following consistent:

function foo() {
static $a = -'abc'; // 0
static $b = +'abc'; // abc
$c = +'abc'; // 0
}

http://realplain.com/php/const_folding.diff
http://realplain.com/php/const_folding_5_3.diff

Well, I don't know if it can be tossed in quickly at this time, but there ya
go since I think it's pretty basic! ;^)

 Thanks. Dmitry.

Thanks,
Matt


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



Re: [PHP-DEV] ext/soap ctor errors

2008-08-29 Thread David Zülke

Am 29.08.2008 um 13:11 schrieb Lukas Kahwe Smith:


On 13.08.2008, at 14:31, David Zülke wrote:


Am 08.08.2008 um 09:39 schrieb Dmitry Stogov:


Hi,

I took a quick look into the issue and I didn't found a problem.
SoapClient constructor already throws exceptions in case of WSDL  
errors.


?php
try {
new SoapClient(non-existent);
} catch (Exception $e) {
echo CATCHED: .$e-getMessage().\n;
}

Warning: SoapClient::SoapClient(): I/O warning : failed to load  
external entity non-existent in Command line code on line 1
CATCHED: SOAP-ERROR: Parsing WSDL: Couldn't load from 'non- 
existent' : failed to load external entity non-existent


SoapServer does fatal errors, but it souldn't be a problem,  
because servers use their own WSDL files which may be fixed.


Thanks. Dmitry.


True, it indeed does since 5.3... but what about that warning; does  
it have to be raised at all? if the exceptions option is passed?



Maybe a general question (not sure if its in time to address this  
stuff for 5.3.0).


We are getting more and more extensions with an exception mode. I  
guess PDO is the rolemodel here and in absence of a discussion about  
this it seems like we have accepted this sort of behavior. But what  
I wonder is if such exception modes should mean that if an  
exception is thrown for a specific issue, if this should then  
disable warnings/notices/errors that would be raised for the same  
issue.


Yes, it should IMO.


David

smime.p7s
Description: S/MIME cryptographic signature


Re: [PHP-DEV] run-tests gsoc status?

2008-08-29 Thread Derick Rethans
On Wed, 27 Aug 2008, Travis Swicegood wrote:

 On Aug 27, 2008, at 10:30 AM, Sebastian Bergmann wrote:
 
  So the student worked on PHPT instead of run-tests.php?
 
 Yes, as we talked about earlier in the year on IRC and on the wiki.  For those
 of you who don't know what PHPT is:  It's a ground-up rewrite of the
 PEAR_RunTest code (which was based on run-tests.php) that addresses the
 short-comings in architecture that both PEAR_RunTest and run-tests.php have.
 It's about 90% of the way there to being able to completely run all of the
 .phpt files in php-src, it just needs some attention to clean up all of the
 loose ends.

This is definitely new information to me too. I expect that this is what 
you wanted to use the student for - work on your own special project - 
but this is something that GSoC is definitely not meant for. The 
original idea behind this project was a rewrite of run-tests.php, not 
something else. Now I hear that a different project was being worked on 
by the student, and even *this* didn't get anyware. I'm pretty much 
annoyed by this cause of action - we still didn't get any work done on 
run-tests, and the student's time was wasted on doing work for some 
private project.

regards,
Derick

-- 
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

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



[PHP-DEV] PECL Win32 snapshots missing.

2008-08-29 Thread Richard Quadling
Hi.

I used to get the latest PECL and PHP win32 snapshots from
http://snaps.php.net/win32.

The pecl snapshot has been missing for a while. They are present for
V6 and V5.2, but not V5.3

Am I missing something?
-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

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



Re: [PHP-DEV] PECL Win32 snapshots missing.

2008-08-29 Thread Pierre Joye
hi!

On Fri, Aug 29, 2008 at 4:42 PM, Richard Quadling
[EMAIL PROTECTED] wrote:
 Hi.

 I used to get the latest PECL and PHP win32 snapshots from
 http://snaps.php.net/win32.

 The pecl snapshot has been missing for a while. They are present for
 V6 and V5.2, but not V5.3

We already answered this question. They will be back after 5.3 (or
shortly before). They are not present for 5.2 or 6, those are simply
the last built.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

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



Re: [PHP-DEV] Re: [PATCH] Constant expr folding (again), and other things

2008-08-29 Thread Dmitry Stogov
Hi Matt,

Sorry, I just don't have time to look into it in last minute.

Thanks. Dmitry.



Matt Wilmas wrote:
 Hi again Dmitry,
 
 - Original Message -
 From: Dmitry Stogov
 Sent: Thursday, July 31, 2008
 
 Hi Matt,

 For now I would like to disable -CONST constant expression which
 started to work after your patch.

 Later we are able to implement the complete constant expressions support.
 
 One more updated thing to ask about. :-)  From the last reply, I wasn't sure
 if constant folding in zend_do_[binary|unary]_op() could be added (for
 negative numbers, ORing function flags that were substituted, ~0, 1024 *
 1024, etc.) or it was desired to wait for complete constant expressions
 support (in static_scalar context), though I don't see any relation between
 that, which is an actual language change, and this easy optimization that's
 only internal (and more useful now with constant substitution).
 
 So I updated the patch, which is the same code as before, but without trying
 to add partial expression support to static_scalar.  Seems pretty
 simple/safe, with basically just the if () {  } block added in
 zend_do_[binary|unary]_op(). :-)  The rest updates the unary_op_type typedef
 (was missing TSRMLS_DC), adds binary_op_type, and updates get_binary_op
 (half the patch!).  The couple changes in the parser, which CAN be ignored
 if desired, are mostly a cleanup, but  '+' static_scalar  now actually does
 something like the unary + operator in regular contexts.  As I showed
 before, it makes the following consistent:
 
 function foo() {
 static $a = -'abc'; // 0
 static $b = +'abc'; // abc
 $c = +'abc'; // 0
 }
 
 http://realplain.com/php/const_folding.diff
 http://realplain.com/php/const_folding_5_3.diff
 
 Well, I don't know if it can be tossed in quickly at this time, but there ya
 go since I think it's pretty basic! ;^)
 
 Thanks. Dmitry.
 
 Thanks,
 Matt
 
 

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



Re: [PHP-DEV] alpha2 scheduled

2008-08-29 Thread Stanislav Malyshev

Hi!


It wasn't designed to have multiple namespaces at all to begin with. But as


You mean multiple namespaces per file, right? Otherwise it sounds kind 
of silly. Yes, it wasn't designed to have multiple namespaces per file, 
and it's really bad idea to have multiple namespaces per file in 90% of 
the cases. In the remaining 10% it's probably a bad idea too.



How so?

namespace foo {
  namespace bar {
class baz {}
  }
}

According to your won words it is all about name substitution. Explicitly
you were talking about simple text replacement. Now that in mind I see and


No, it's not simple replacement, because hierarchy brings hierarchical 
resolution, like it is in Ruby.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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



Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Stanislav Malyshev

Hi!


Yeah, it's to make sure something like  -CONST  in ZEND_CT context doesn't
work sometimes, sometimes not.  My previous message (first part):
http://marc.info/?l=php-internalsm=121750618525882w=2


There's also a thing that now code like:
$var = 3/0;
(of course, it could be more complex - both 3 and 0 could be constants) 
does not compile, even though it may never in fact run, so there might 
be some BC issues.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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



Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Matt Wilmas
Hi Stas,

- Original Message -
From: Stanislav Malyshev
Sent: Friday, August 29, 2008

 Hi!

  Yeah, it's to make sure something like  -CONST  in ZEND_CT context
doesn't
  work sometimes, sometimes not.  My previous message (first part):
  http://marc.info/?l=php-internalsm=121750618525882w=2

 There's also a thing that now code like:
 $var = 3/0;
 (of course, it could be more complex - both 3 and 0 could be constants)
 does not compile, even though it may never in fact run, so there might
 be some BC issues.

I'm not sure what you mean, does not compile?  Nothing has been changed that
should affect any code like your example...


- Matt


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



Re: [PHP-DEV] ext/soap ctor errors

2008-08-29 Thread Hannes Magnusson
On Fri, Aug 29, 2008 at 17:08, Dmitry Stogov [EMAIL PROTECTED] wrote:
 Especially for this situation warnings are generated by libxml.
 I don't like to disable these warnings in ext/soap, because in some
 situation libxml may generate warnings and then return parsed document.
 So SoapClient() won't generate exception, but all warnings would be lost.

Hmmmh. So ext/soap does not use ext/libxml and therefore ignores my
libxml_set_stream_context() and libxml_use_internal_errors()
preferences?

-Hannes

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



Re: [PHP-DEV] alpha2 scheduled

2008-08-29 Thread Hannes Magnusson
On Thu, Aug 28, 2008 at 19:43, Stanislav Malyshev [EMAIL PROTECTED] wrote:
 Hi!

 I'm really sorry, but I have to ask.
 Since you can detect that this is a nested namespace, why can't we allow
 it?

 Because that's not how model was designed and it creates all kind of trouble
 with name resolution. Basically, you get potentially infinite resolution
 path. You don't want to go there. And frankly, there's absolutely no need.

Seems like you are answering lot of questions about namespaces lately
with that's not how the model was designed.

Guess it should have been designed in the open to begin with.

Thanks
-Hannes

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



Re: [PHP-DEV] alpha2 scheduled

2008-08-29 Thread Stanislav Malyshev

Hi!


Seems like you are answering lot of questions about namespaces lately
with that's not how the model was designed.


Not really, and it's not the reason, the reason why it wasn't designed 
that way was explained before and was explained again.



Guess it should have been designed in the open to begin with.


It was. Just a lot of people couldn't care less until it is a day before 
feature freeze and then they wake up and want whole thing rewritten from 
scratch, and don't even take time to think about what their changes 
really mean and how it is going to work with all other parts of the 
language. Namespaces is not the only case btw.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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



Re: [PHP-DEV] Re: [PATCH] Constant expr folding (again), and other things

2008-08-29 Thread Stanislav Malyshev

Hi!


static $a = -'abc'; // 0
static $b = +'abc'; // abc
$c = +'abc'; // 0
}


We could get into trouble here. Imagine:
static $a = -'12.8';

This should be -12.8, but what if locale changes and . is no longer 
decimal separator? Moreover, what if locale changes between compile and 
runtime? We get entirely different code now.



Well, I don't know if it can be tossed in quickly at this time, but there ya
go since I think it's pretty basic! ;^)


I think it's not the feature that can be tossed in quickly - it can 
have some obscure side effects, as I described in my later emails.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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



Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants

2008-08-29 Thread Stanislav Malyshev

Hi!


I'm not sure what you mean, does not compile?  Nothing has been changed that
should affect any code like your example...


Oh, I think I was confusing two constant patches - I was thinking about 
the constant evaluation patch, not constant fetching patch. Sorry.

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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



[PHP-DEV] Closing mysql_pconnects.

2008-08-29 Thread Richard Quadling
Hi.

Can someone point me to where or how PHP DOESN'T close persistent
connections (those opened using mysql_pconnect()) when mysql_close()
is called with that connection.

Sorry to ask such an obvious question, but I'm not seeing it.

Thank you.

-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

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



[PHP-DEV] Re: Closing mysql_pconnects.

2008-08-29 Thread Lupus Michaelis

Richard Quadling a écrit :

 Can someone point me to where or how PHP DOESN'T close persistent
connections


  Maybe because it is... persistent ?


(those opened using mysql_pconnect()) when mysql_close()
is called with that connection.


  See http://php.net/mysql_pconnect

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

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



Re: [PHP-DEV] Re: Closing mysql_pconnects.

2008-08-29 Thread Robert Cummings
On Sat, 2008-08-30 at 04:40 +0200, Lupus Michaelis wrote:
 Richard Quadling a écrit :
   Can someone point me to where or how PHP DOESN'T close persistent
  connections
 
Maybe because it is... persistent ?

He's probably trying to learn how to do the same. This is internals
after all and not php-general.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP-DEV] Re: Closing mysql_pconnects.

2008-08-29 Thread Lupus Michaelis

Robert Cummings a écrit :


He's probably trying to learn how to do the same. This is internals
after all and not php-general.


  Sorry for the private mail, I did't see you sent here too.

  It is in the documentation that mysql_close don't close a mysql_pconnect.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

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



Re: [PHP-DEV] Re: Closing mysql_pconnects.

2008-08-29 Thread Ronald Chmara


On Aug 29, 2008, at 7:58 PM, Robert Cummings wrote:


On Sat, 2008-08-30 at 04:40 +0200, Lupus Michaelis wrote:

Richard Quadling a écrit :

 Can someone point me to where or how PHP DOESN'T close persistent
connections


   Maybe because it is... persistent ?


He's probably trying to learn how to do the same. This is internals
after all and not php-general.


If you'd like to peruse the source, to implement a similar feature,  
one place to look is the web gui to CVS for the function:


http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c? 
revision=1.213.2.6.2.16.2.26view=markup


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