Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Sara Golemon
Should I conclude that there's enough interest for this feature and move from a gist to a RFC? If so, I would definitely need someone to help out with the implementation. Without wanting to put the cart too far before the horse, I'll mention that FB is willing to offer resources (me,

[PHP-DEV] Re: Integrate HHVM into PHP (Was: Re: [PHP-DEV] Request for comments - new PHP feature: return typing)

2013-07-11 Thread Sara Golemon
If you run into issues (yes, our build system still sucks a bit) poke me in IRC freenode/#hhvm (or ptarjan or any other @ in that channel). And just to jump in front of what I detect in your comment albiet compile it. Repeat: HHVM is not a code translator anymore. Hasn't been for awhile now.

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Sara Golemon
1) HHVM isn't just running FB. A number of sites have either already started using HHVM, or intend to soon. Were could I read about those? I didn't list any because I don't know how they individually feel about sharing that info. I realize that takes the wind out of my statement, but

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Sara Golemon
changed based on the feedback received from this group. I'm on PHP's side, guys. On Thu, Jul 11, 2013 at 1:47 PM, Nikita Popov nikita@gmail.com wrote: On Thu, Jul 11, 2013 at 10:27 PM, Sara Golemon poll...@php.net wrote: I won't suggest that PHP should follow HHVM, if anything I'll

Re: [PHP-DEV] Request for comments - new PHP feature: return typing

2013-07-11 Thread Sara Golemon
@Sara: thank you for the offer, I'll send you a mail, if it's ok with you, in the next days, I'd want to make this as a tutorial and maybe me implement it with your guidance, but more on this another time. Sure thing. PHP needs more developers with deep understanding of the engine. I'd be

Re: [PHP-DEV] Feature Proposal: Allow letter decrementing

2013-07-18 Thread Sara Golemon
My question is, why specifically doesn't it? Because Perl.

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-19 Thread Sara Golemon
If run right now, it will always produce the same value (4), but it isn't *defined* to do so. What that means is that behavior is subject to change without notice, warning, or justification. This is a somewhat harsh way of saying Don't write expressions with ambiguous evaluations, that's clowny.

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-19 Thread Sara Golemon
On Fri, Jul 19, 2013 at 7:16 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: If there aren't comments, I'll rewrite the example. There were comments. I explicitly told you that that the behavior is defined as undefined. You CHOSE to ignore that comment. You CHOSE to break the documentation.

Re: [PHP-DEV] Language constructs and callability

2013-07-19 Thread Sara Golemon
I think the idea comes from a good place, but the actual, practical usefulness of it is so low that the availability of workaround negates even the very small amount of effort it would take to create (and maintain!) shadow functions for the language constructs. array_filter($arr, function($val) {

Re: [PHP-DEV] Language constructs and callability

2013-07-19 Thread Sara Golemon
Lack of parenthesis and the fact that EVERY project out there takes advantage of this affordance. So BC *nightmare*. On Fri, Jul 19, 2013 at 9:16 PM, Ryan McCue li...@rotorised.com wrote: Johannes Schlüter wrote: So, unfortunately no, language constructs have different semantics which we

Re: [PHP-DEV] Language constructs and callability

2013-07-19 Thread Sara Golemon
Well, now... to be fair... You could make them functions and use the same parser trick the backtick operator uses. to map the non-parenthesized versions feels messy though. I'd just hate to get stuck with a hacky workaround like that for the long term. On Fri, Jul 19, 2013 at 9:23 PM, Sara

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-19 Thread Sara Golemon
of evaluation will result in the same answer for this contrived expression. ++$a * $a++ is a more obviously ambiguous answer for a language which explicitly does not define an order of resolution. On Fri, Jul 19, 2013 at 9:28 PM, Yasuo Ohgaki yohg...@ohgaki.net wrote: Hi Sara, 2013/7/20 Sara

Re: [PHP-DEV] Language constructs and callability

2013-07-19 Thread Sara Golemon
, leading to weird unreproducible bug reports). -Sara On Fri, Jul 19, 2013 at 9:28 PM, Ryan McCue li...@rotorised.com wrote: Sara Golemon wrote: Well, now... to be fair... You could make them functions and use the same parser trick the backtick operator uses. to map the non-parenthesized versions

Re: [PHP-DEV] Operator precedence is undefined?

2013-07-19 Thread Sara Golemon
commits. -Sara On Fri, Jul 19, 2013 at 10:08 PM, Sherif Ramadan theanomaly...@gmail.comwrote: Sara, On Sat, Jul 20, 2013 at 12:44 AM, Sara Golemon poll...@php.net wrote: What's undefined isn't the relationship between preinc/postinc and add. What's undefined is the use of multiple preinc

Re: [PHP-DEV] [PATCH] Constification of some PHP API calls

2013-07-30 Thread Sara Golemon
At a glance, this looks awesome. There are a few changes where you introduced #ifdef WIN32 checks that I want to spend a little more time looking at... -Sara P.S. - Could I convince you to put it on a github fork to make it easier to read? No big deal if not... I just like that web view. :)

Re: [PHP-DEV] [PATCH] Constification of some PHP API calls

2013-07-31 Thread Sara Golemon
Ah, yeah, I can see that clearly now. Looks universally cool to me. Do you just need someone with engine karma to push it? On Wed, Jul 31, 2013 at 1:35 AM, Andrey Hristov p...@hristov.com wrote: Hi Sara, On 07/31/2013 12:55 AM, Sara Golemon wrote: At a glance, this looks awesome

Re: [PHP-DEV] [RFC] Constant Scalar Expressions

2013-08-15 Thread Sara Golemon
I have mixed emotions on the yes/no side of things, but on the how side, I think we can do this fairly easily. During parse, when a non-scalar const expression is encountered, the actual binding to the class is deferred, and bytecodes are emitted in the (main) function. To put it in psuedo-code

Re: [PHP-DEV] [RFC] Constant Scalar Expressions

2013-08-15 Thread Sara Golemon
if(true) return; class Foo { const halfpie = M_PI/2; } Oooh, excellent point. Wave a finger and tell the user not to do that? I wasn't going to bring this up, but an intersectional idea I had a few years ago Static Constructor. Just like an instance constructor, but called on initial

Re: [PHP-DEV] Interest in a null SAPI for embedding?

2013-08-16 Thread Sara Golemon
Apart from managing lifecycles, the SAPI is also resposible for things like directing I/O between the host application, how does null-sapi handle this? On Fri, Aug 16, 2013 at 9:36 AM, J David j.david.li...@gmail.com wrote: Hello, We recently successfully embedded PHP into our application

Re: [PHP-DEV] Interest in a null SAPI for embedding?

2013-08-17 Thread Sara Golemon
Right, gotcha. I think ideally someone should put in the grunt work to do what you suggested: Build libphp5.so all the time, then link up php/ mod_php5.so/etc... against that as a shared system library (which in turn other programs or SAPIs could link against). I'm not sure if anyone has the

Re: [PHP-DEV] Interest in a null SAPI for embedding?

2013-08-17 Thread Sara Golemon
Ah, I see. I wasn't taking null quite literally enough. :) That sounds pretty awesome to me. Assuming the implementation looks good you'd get my vote. On Fri, Aug 16, 2013 at 11:03 AM, J David j.david.li...@gmail.com wrote: On Fri, Aug 16, 2013 at 12:40 PM, Sara Golemon poll...@php.net

Re: [PHP-DEV] [VOTE] Hash_pbkdf2

2012-07-02 Thread Sara Golemon
I'd like to see hash_init() support this mode as well (for completeness). Perhaps something like the following: $ctx = hash_init(sha512, HASH_PBKDF2, $salt, array('length' = 32, 'iterations' = 5000)); The new fourth parameter being an overloadable options generic so that we don't have an

Re: [PHP-DEV] [VOTE] Hash_pbkdf2

2012-07-02 Thread Sara Golemon
On Mon, Jul 2, 2012 at 5:49 PM, Anthony Ferrara ircmax...@gmail.com wrote: Sara, On Mon, Jul 2, 2012 at 8:24 PM, Sara Golemon poll...@php.net wrote: I'd like to see hash_init() support this mode as well (for completeness). Perhaps something like the following: $ctx = hash_init(sha512

Re: [PHP-DEV] Internal iteration API

2012-07-11 Thread Sara Golemon
Love the idea. +1 On Wed, Jul 11, 2012 at 3:17 PM, Nikita Popov nikita@gmail.com wrote: Hi internals! Currently PHP does not have an internal iteration API that supports both arrays and Traversable objects. Because of that it is currently not really possible to write functions (or

Re: [PHP-DEV] Internal iteration API

2012-07-11 Thread Sara Golemon
On Wed, Jul 11, 2012 at 5:39 PM, Anthony Ferrara ircmax...@gmail.comwrote: Johannes, One thing to keep in mind when doing this is to think about consistency. I think that's a huge point not to be taken lightly. For that reason, I think that this API should not be used for any of the

[PHP-DEV] Using `throw` with expr or expr logic

2005-03-07 Thread Sara Golemon
A user was asking about why he could perform statements such as: $db = mysql_connect('localhost') or die('Unable to connect to database server'); But not: $db = new mysqli('localhost') or throw('Unable to connect to database server'); The short answer, obviously, is that throw just doesn't

Re: [PHP-DEV] Using `throw` with expr or expr logic

2005-03-07 Thread Sara Golemon
Nothing to ridicule but there's a good reason that currently throw is a statement. It has to do with us not being able to clean up properly when we're within an expression as far as memory leaks, reference counting and other locks are concerned. Ah, that makes perfect sense. With

[PHP-DEV] Re: HALT Patch

2005-03-11 Thread Sara Golemon
The attach patch implements a special token ?php HALT; ? that can be used to stop the Zend lexical parser from parsing any data after this token. +1 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] HALT Patch

2005-03-11 Thread Sara Golemon
1) while (fgets($fp) != '?php __HALT_PHP_PARSER__; ?')); Just a nudge about this code approach. #1 It doesn't detect EOF #2 It forgets about the newline returned by fgets() #3 It doesn't allow the HALT; to float within a line between other content (not that you'd do that anyway but...

Re: [PHP-DEV] HALT Patch

2005-03-12 Thread Sara Golemon
Hmm.. I was wondering if we should go one step further and also provide a stream to the data. If the most common usage of this construct is going to be reading the data after __HALT_PHP_PARSER__ then we should optimize for that case. Something like ?php $data =

[PHP-DEV] Re: crc32, md5 sha1 functions

2005-03-21 Thread Sara Golemon
crc32, md5 and sha1 functions, implemented in PHP, are widely used for computing fingerprint of any data. But current implementation has not very good limitation - there is no way to get/set current state vector of these functions. So, we have to pass whole amount of data as argument of these

Re: [PHP-DEV] zend_list_delete

2005-03-24 Thread Sara Golemon
1 ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf); 2 zend_list_delete(Z_LVAL_P(z_ftp)) 3 efree(ftp) Line three is wrong it should be zval_ptr_dtor(z_ftp) and no, it doesn't make the efree()/zval_ptr_dtor() redundant. It only frees the members but doesn't care

[PHP-DEV] Re: Showstopper? copy() broken for urls and on windows

2005-03-26 Thread Sara Golemon
Patch to fix #32160 (file truncation in copy() when source destination are the same) http://viewcvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c.diff?r1=1.398r2=1.399 broke copy() on windows alltogether it seems. It also broke copy($url, $local_file) on other platforms since it tries

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Sara Golemon
You know, I could have sworn that I only looked for a : as the separator. Not according to php_stream_locate_url_wrapper(): for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) n++; if ((*p == ':') (n 1) !strncmp(://, p, 3)) { protocol = path; } else if

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Sara Golemon
It's not 'nix you want to worry about, but systems where : identifies a drive or device; win32, vms (?), (and Amiga, if that still counts :) Doi, drive letters So yeah that can be worked around with a: #ifdef PHP_WIN32 if (p = path+1 isalpha(*path) (*p == '/' || *p == '\\')) { /* win32

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /ext/standard md5.c sha1.c

2005-04-15 Thread Sara Golemon
We can left that out. The flag to search in the include path is available to all file_* functions in PHP. Make it sense to search in the include path for example in the exif-functions? But this parameter is available there, too. So for consistency I added this parameter. Except that

[PHP-DEV] Re: == and ===

2005-04-18 Thread Sara Golemon
Just came across this: http://bugs.php.net/bug.php?id=23110 I've been programming PHP since PHP 3 and wasn't even aware of this behavior. And now you are. PHP is a loosely typed language. Odds are it's one of the things which attracted you to it in the first place. Numeric strings? What

Re: [PHP-DEV] Re: == and ===

2005-04-18 Thread Sara Golemon
?php echo '0' == '0.e0' ? 1 ?php echo '0' == 'asadoaskd' ? (nothing, false) ?php echo '0' == (int)'adasd' ? 1 That confuses me more (but understandable, and thank God PHP behave this way)... I thought 'asdasd' is 0 when [implicitly] converted to int [for comparison]? I guess I

Re: [PHP-DEV] Function proposal

2005-05-16 Thread Sara Golemon
Yes I know that this is a small function and yes I know it can be copy-paste with every new project you do but from the first day I've been using PHP until today this function follows me everywhere and I now that everyone is using it one way or the other for debugging.. ...

[PHP-DEV] Re: SID was accidently changed to CONST_CS?

2005-05-31 Thread Sara Golemon
- REGISTER_STRINGL_CONSTANT(SID, empty_string, 0, 0); + REGISTER_STRINGL_CONSTANT(SID, , 0, 1); Where flags changed from 0 to 1.. Intentional or not? Yes, the flag change was intentional in order to create an allocated empty string. The fourth

Re: [PHP-DEV] PHP 5.1

2005-06-07 Thread Sara Golemon
GSWell, point a) implied that it's a solvable problem, at least as much as it GSis when doing any sort of premature exit from a block. It's worse problem since we are going to jump to random place and not just to the end of the block. At the end of the block we could have opcode that takes

Re: [PHP-DEV] PHP 5.1

2005-06-09 Thread Sara Golemon
What about ifsetor for 5.1 ? Would anybody be interested in a parameter for ifsetor() that would treat isset() as !empty() or an alternative function that achieves this? I know I'd love to see that. I use empty() a lot more than isset(). In the interrest of KISS, I'd leave the emptiness

[PHP-DEV] Re: In regards to E_STRICT and PHP5

2005-06-16 Thread Sara Golemon
If there is any merit to E_STRICT as it stands currently I find it to be negated by the fact that it throws messages for completely acceptable code that the engine is both willing and capable of handling. If var is not acceptable, I think it should be removed as a keyword. If it is

[PHP-DEV] Re: allow_url_fopen should be INI_ALL

2005-06-26 Thread Sara Golemon
1) INI_SYSTEM disables to patch vulnerable application by adding ini_set(). ini_set('allow_url_fopen', 0); // some dangerous include/require statement ini_set('allow_url_fopen', 1); // reenable if allow_url_fopen is required $allowed_wrappers = array('php','file');

[PHP-DEV] Re: allow_url_fopen should be INI_ALL

2005-06-27 Thread Sara Golemon
It has been INI_ALL for a looong time until somebody decided to set it to INI_SYSTEM. Actually it was --enable-url-fopen for a loong time until it became runtime configurable. It was *mistakenly* set to PHP_INI_ALL, but was supposed to have been PHP_INI_SYSTEM. (In line with prior

Re: [PHP-DEV] allow_url_fopen should be INI_ALL

2005-06-29 Thread Sara Golemon
Nope. Some functions are intrinsically safe, e.g. C's atol, or strtol. It's all in the design, you see. { char badstring[3] = { '1', '0', '0' }; long not100 = atol(badstring); } Only intrinsicly safe if you've read the manual page to know that badstring should have been null terminated.

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src / NEWS /ext/ftp ftp.c /main network.c php_network.h /main/streams xp_socket.c

2005-07-13 Thread Sara Golemon
Indeed, ftp:// doesn't use the transports layer at all. I'll patch this up -Sara Nuno Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] OK. but at least it could work with 'x.x.x.x:0'. From I what I remember from the code, it always uses NULL as bindto when calling

[PHP-DEV] Re: SOAP SSL support doesn't work when allow_url_fopen is turned off

2005-07-27 Thread Sara Golemon
Two answers: (A) I do think an override is a good idea. There may be some cases where extension code may need to hook a wrapper whether allow_url_fopen is enabled or not. Granted the code could temporarily change that value, but that's a hackish approach. (B) I don't think SOAP is one of

[PHP-DEV] Re: PHP 5.5 or 6.0

2005-08-09 Thread Sara Golemon
Now that we branched it's time to rename HEAD to something else than 5.1 in order to have different version numbers. Although the name PHP 5.5 was mentioned before, I do think we should call it PHP 6.0. As the Unicode support is quite a drastic change. Going with PHP 6.0 also allows us to

[PHP-DEV] Re: [PATCH] debug_get_object_handle

2005-08-10 Thread Sara Golemon
I have cooked a patch that adds a function named debug_get_object_handle() which returns the handle id of an object. Having a function like this makes devs' live easier - no need to parse the output of var_dump(). The patch is available here:

[PHP-DEV] Re: realpath is not available in all LibCs

2005-08-11 Thread Sara Golemon
Version PHP 5.1 file main/php_init.c function int php_init_config() uses realpath. In NetWare our earlier releases of LibC SDK has no realpath implementation. I could see the following lines in TSRM/tsrm_virtual_cwd.c #ifndef HAVE_REALPATH #define realpath(x,y) strcpy(y,x) #endif Why not this

[PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-12 Thread Sara Golemon
1. Remove register_globals completely Amen! +1 2. Remove magic_quotes_* Hallelujiah! +1 3. Add input filter extension which will include a mechanism for application developers to very easily turn it off which would swap the raw GPC arrays back in case the site had it turned on by

[PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-12 Thread Sara Golemon
How about doubling integer precision to 64 bits and float/double precision to 128 bits? It's in line with 64 bit CPU capabilities, and personally, I wouldn't mind it a bit if it would make numerical processing in PHP slower on 32 bit systems. I think the advantages are much too great for that.

Re: [PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-13 Thread Sara Golemon
set short_open_tags to off in any sample php.ini we ship. Ah yes, that reminds me: 17. Nuke every alternative open tag and only have ?php Agreed (though not so much nuke as default to off). Whenever open tags comes up, I'll toss script language=php into the conversation and get

Re: [PHP-DEV] PHP 6.0 Wishlist

2005-08-13 Thread Sara Golemon
I really doubt this will change. It would be a *huge* mess in the docs and peoples scripts and brains if we did change it--it wouldn't really win anyone anything: At the risk of someone taking this as a worthwhile idea: PHP_FUNCTION(strpos) { ... /* Swap needle and haystack if they appear

Re: [PHP-DEV] PHP 6.0 Wishlist

2005-08-13 Thread Sara Golemon
PHP_FUNCTION(strpos) { ... /* Swap needle and haystack if they appear to be backwards */ if (needle_len haystack_len) { char *t; int t_len; t = needle; needle = haystack; haystack = t; t_len = needle_len; needle_len = haystack_len; haystack_len = t_len; }

Re: [PHP-DEV] PHP 6.0 Wishlist

2005-08-14 Thread Sara Golemon
?php6 ... pure PHP 6 mode ? ?php ... Some sort of BC ? []s One of the primary goal on the table is to simplify things as we go into PHP6. This is the antithesis of simplification. Not gonna happen. -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] PHP 6.0 Wishlist

2005-08-15 Thread Sara Golemon
You and the rest of the people on internals@ are not the masses nor do they represent them in any way. When a 'non-contributor' dares to voice an opinion, he's shut up because he's, well, a non-contributor. He's the one that matters, though, not you. PHP doesn't need to be a true-democracy

[PHP-DEV] Returning References from Internal Functions

2005-08-23 Thread Sara Golemon
I've got a one-line fix to allow internal functions to return by reference. What happens currently is if (*return_value_ptr)-refcount = 2 at the end of an internal function, then the _get_zval_ptr_ptr_var delrefs it down to refcount==1 (removing is_ref in the process). With userspace functions

Re: [PHP-DEV] Returning References from Internal Functions

2005-08-23 Thread Sara Golemon
We'll take a look at it as this should actually work today. That's what I'd thought coming into this, but all my attempts to return a reference failed: My Arg Info struct: static ZEND_BEGIN_ARG_INFO_EX(php_sample_retref_arginfo, 0, 1, 0) ZEND_END_ARG_INFO() My reference linking: if

Re: [PHP-DEV] Returning References from Internal Functions

2005-08-23 Thread Sara Golemon
There's some commented out code in there that refers to bug 34045: /* We shouldn't fix bad extensions here, because it can break proper ones (Bug #34045) if (!EX(function_state).function-common.return_reference) { EX_T(opline-result.u.var).var.ptr-is_ref = 0;

Re: [PHP-DEV] PHP 6.0 Wishlist

2005-08-27 Thread Sara Golemon
It would be nice if PHP could not get tripped up by ?xml tags when short_tags is on. Already included, you may have seen this feature used before, ?php :-) I gather he meant making the scanner intelligent enough to see that the ? is followed by 'xml' and just ignoring the fact that short open

[PHP-DEV] Re: omitting T_CLOSE_TAG

2005-08-29 Thread Sara Golemon
I am searching for some evidence in the PHP source code that the possibility of omitting the closing PHP tag is absolutely intentional, and in fact part of the language syntax, and therefore it is going to be supported indefinitely. Digging for T_CLOSE_TAG and similar stuff have lead me to

Re: [PHP-DEV] ZTS leak

2005-08-29 Thread Sara Golemon
As far as I can tell it's a bug. By the way, we're not talking about a leak that happens too often - unless you're spawning and killing threads very often (in which case TSRM is very inefficient regardless of anything). The leak would happen per-terminated thread. Good call. The backstory

Re: [PHP-DEV] ZTS leak

2005-08-29 Thread Sara Golemon
@@ -706,7 +707,6 @@ zend_shutdown_extensions(TSRMLS_C); free(zend_version_info); - zend_shutdown_constants(TSRMLS_C); free(GLOBAL_FUNCTION_TABLE); free(GLOBAL_CLASS_TABLE); #ifdef ZTS Are you sure it's not leaking the global constants table with the

[PHP-DEV] Re: PHP 5.1

2005-08-31 Thread Sara Golemon
For those of you who submitted patches to 5.1 since RC1 - do you believe that we need another RC or can we go ahead and roll 5.1 final and run a sanity test for 24 hours? I went over the patches, none of them appears to be too dangerous, but if any of you thinks differently, let me know.

[PHP-DEV] Re: E_NOTICE/E_STRICT/E_WARNING thrown on bad arrays initialization?

2005-09-04 Thread Sara Golemon
As you surely know, arrays are often badly initialized: ?php // $array is undefined $array['index'] = 'value'; ? Wouldn't it be such a good thing to let the programmers know that this is a bad habit, by throwing a +/- pedantic error ? I'm not sure which type would suit for it, but I think its

[PHP-DEV] Re: crc32

2005-09-06 Thread Sara Golemon
I'd suggest a set of filters as an add-on to the mhash extension: mhash.crc32 mhash.md5 mhash.sha1 mhash.sha256 etc -Sara - Original Message - From: Ron Korving [EMAIL PROTECTED] Newsgroups: php.internals To: internals@lists.php.net Sent: Tuesday, September 06, 2005 4:48 AM

[PHP-DEV] zend_list_delete() doesn't.

2005-09-07 Thread Sara Golemon
Certain things you take for granted: The sun will come up. Politicians are dishonest. Resource destruction functions (fclose(), mysql_disconnect(), etc...) will actually shutdown their resources. Guess which of those three you can't count on. Seems that zend_list_delete(), which I (and many

Re: [PHP-DEV] zend_list_delete() doesn't.

2005-09-08 Thread Sara Golemon
Stanislav Malyshev Wrote SG?php SG $fp1 = fopen('test', 'w'); SG $fp2 = $fp1; /* Still a single zval* and le-refcount == 1 */ SG $fp3 = $fp1; /* Two zval*s now and le-refcount == 2 */ SG SG fclose($fp1); I think this was discussed before, though I may be mistaken. The problem here is that you

Re: [PHP-DEV] Zend resources

2005-09-11 Thread Sara Golemon
Is there any way of getting the resource id without modifying sockets? ZEND_API int zend_fetch_list_dtor_id(char *type_name); As an implementation: In *your* socketi.c: static int le_socket = -1; PHP_RINIT(socketi) { if (le_socket == -1) { le_socket =

Re: [PHP-DEV] Zend resources

2005-09-11 Thread Sara Golemon
static int le_socket = -1; Scratch that, those instances of -1 should have been 0 (Which is what zend_fetch_list_dtor_id() returns as failure) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP6, Unicode for language functions, classes, methods, vars names

2005-09-13 Thread Sara Golemon
The language does put a limitation as it does not provide a way to show the identifiers in a neutral way. For example ACI 4D (for those who knows it) did it in the right way. All functions are localized, I can choose the language I want I will be able to read the identifiers. But I doubt we

[PHP-DEV] Re: open_basedir Issue

2005-09-14 Thread Sara Golemon
Can someone tell me what I'm doing wrong here? I'm using PHP 4.3.11 on Red Hat 5.0 (Cobalt). /home/sites/www.harvardchemclub.org is a symbolic link that points to /home/sites/site66. I've tried this with and without trailing slashes. I added a comment to a similar bug report years ago,

[PHP-DEV] Re: Segfault

2005-09-14 Thread Sara Golemon
Yeah...sure it's on line 42. How about some code to look at? A backtrace... Anything... -Sara - Original Message - From: RG [EMAIL PROTECTED] Newsgroups: php.internals To: internals@lists.php.net Sent: Wednesday, September 14, 2005 7:11 PM Subject: Segfault This is quite

[PHP-DEV] Re: Segfault

2005-09-15 Thread Sara Golemon
new_sock-bsd_socket = accept(php_sock-bsd_socket, sa, salen); In all liklihood it's that. Now In the nicest way possible, why don't I suggest that you CLEAN UP YOUR CODE NEXT TIME!?!?! You might have noticed that new_sock isn't alloc'd if it wern't for all the comments and flat-out bad

[PHP-DEV] Re: Segfault

2005-09-15 Thread Sara Golemon
That's not where it segfaults. The function works perfectly once. If I attempt to exit / die or call that function again, it segfaults. However, I have noticed that if I do not use ZEND_REGISTER_RESOURCE the program no longer segfaults. I didn't say that's where it segfaults, I said that's where

[PHP-DEV] Re: Thanks Jani

2005-09-16 Thread Sara Golemon
Gracis senor Taskinen por todos anos. Besos! - Original Message - From: John Coggeshall [EMAIL PROTECTED] Newsgroups: php.internals To: Marcus Boerger [EMAIL PROTECTED] Cc: Jani Taskinen [EMAIL PROTECTED]; Leigh Makewell [EMAIL PROTECTED]; internals@lists.php.net Sent: Friday,

Re: [PHP-DEV] Re: Segfault

2005-09-17 Thread Sara Golemon
What I meant to say was that I did use zend_fetch_list_dtor_id in RINIT at first, but I noticed that PHP was not calling RINIT. So then I migrated it MINIT, which is called when the module is loaded. Doubtful... PHP calls every module's RINIT at the start of every request. If you were

[PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-22 Thread Sara Golemon
#define GETS_FETCH_SIZE 2048000 That size doesn't seem a bit excessive to you? I thought the whole point of dumping it to a file was to avoid huge memory chunks. Not to mention the fact that reserving 2MB of stack space makes me a little twitchy... /* {{{ proto bool imap_savebody(resource

[PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-23 Thread Sara Golemon
http://dev.iworks.at/PATCHES/imap_savebody.patch.txt Thanks a lot for review; the patch has been updated with your suggestions. Additionally the whole thing is ifdef'd out in ZTS mode as the c-client gets function is a global variable. I tested the function with a 17M message saving to a

[PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-26 Thread Sara Golemon
Looks basicly alright (with a slight disagreement on how the read loop is implemented (below). In general you've got my vote (for what it's worth given my lack of experience with libc-client. unsigned long i, rest = size % GETS_FETCH_SIZE; char *buf = emalloc(GETS_FETCH_SIZE+1);

[PHP-DEV] Re: [PATCH] imap_savebody()

2005-09-26 Thread Sara Golemon
Well, unfortunately not. It seems that net_get_buffer() in mail.c is used as standard readfn_t which only returns NIL/T i.e. 0/1. Okay, take two: char buf[GETS_FETCH_SIZE]; while (size 0) { in toread = (size GETS_FETCH_SIZE) ? GETS_FETCH_SIZE : size); if (!f(stream, toread, buf))

[PHP-DEV] Re: zval passthrough?

2005-10-04 Thread Sara Golemon
I'm writing a PHP extension in C++ which need to provide a function which will take as a parameter a zval *. This zval * should, when the function has completed its task, simply be returned unmodified. How do I accomplish this? I've tried something like this: return_value = v; There are two

[PHP-DEV] Re: CLI in PHP6

2005-10-06 Thread Sara Golemon
There was once (can't remember when exactly, so it must be a long time ago) here on PHP CLI scripts in which it came forward that one should not rely on such a script to run forever. And it's true; the scripts sometimes magically and suddenly die. Now I have no clue where this instability (for

[PHP-DEV] Re: zval passthrough?

2005-10-10 Thread Sara Golemon
So that means that all the zval * I store in my map simply point to invalid memory once the request is completed? Well, that would explain some of the strange behaviour I have observed (such as string changing content between requests). Yep. The solution to this would be to allocate the zval

[PHP-DEV] Re: LDAP module patch (adding new functionality).

2005-10-11 Thread Sara Golemon
Attachments have a habbit of getting filtered out (as they did this time), can you post them online somewhere with a link? Changing the file ext to .txt usually works too... -Sara - Original Message - From: Ignacio Arenaza [EMAIL PROTECTED] Newsgroups: php.internals To: Stig Venaas

Re: [PHP-DEV] Internal class, read_property() and type == BP_VAR_W

2005-10-28 Thread Sara Golemon
Hm... maybe I made not a good start with my question, let me ty again, please: typedef struct { zend_object zo; int i; } my_obj; Would you say it's possible that one can maintain i as class property with write access through references? Nope, because PHP variables are loose typed. Say

Re: [PHP-DEV] what happened to that new isset() like language

2005-10-29 Thread Sara Golemon
Evaluating an idea based on it's syntactic similarities to other languages is complete and utter nonsense. It has nothing to with being like language Xyz. It has to do with familiarity to language constructs. One already understands the idea of 'this || that'. It's certainly I'll throw the

Re: [PHP-DEV] what happened to that new isset() like language

2005-10-30 Thread Sara Golemon
function ifsetor($var, $value) { return (isset($var)) ? $var : $value; } can be done in userspace. Perhaps, but it won't do what you think, and certainly won't do what this thread has been discussing for over half a year. -- PHP Internals - PHP Runtime Development Mailing List To

[PHP-DEV] Re: PHP 5.1.0 - sha256() and sha256_file() support

2005-11-15 Thread Sara Golemon
with MD5 and SHA1 more or less broken Overstatement much? I have hacked together sha256() and sha256_file(), The more the merrier I say... There will be another RC, but I'd prefer to reserve this feature till PHP 5.1.1. I've had implementations of sha256,384, and 512 lying about for

Re: [PHP-DEV] Overriding Default Functions

2005-11-15 Thread Sara Golemon
Specifically, you want to enable the (under-documented) runkit.internal_override INI option. It's mentioned on the reference page, but with no explanation of what it does. I need to make a language-snippet for that at some point This was added in version 0.6 (prior versions could only

Re: [PHP-DEV] PHP 5.1.0 - sha256() and sha256_file() support

2005-11-16 Thread Sara Golemon
Right, so bottom line, MD5 is showing signs of fatigue. Not broken or even significantly weak when used properly, but she's in the twlight years and it's time to send ma to the old folks home for some rest and green jello. SHA1 isn't quite the matriach yet, but despite having miles to go before

Re: [PHP-DEV] PHP 5.1.0 - sha256() and sha256_file() support

2005-11-16 Thread Sara Golemon
Right, so bottom line, MD5 is showing signs of fatigue. Not broken or even significantly weak when used properly Also there are sites hosting md5 hashes and the equivalent text for password cracking. This is exactly what I meant by used properly the problem you're describing becomes

[PHP-DEV] sha256(), sha256_file(), and other hashing algos

2005-11-18 Thread Sara Golemon
Following an offline discussion with some internals folks, I've put together a general hashing extensions which could potentially find a place in core as an enabled by default extension: ext/hash: string hash(string $algo, string $value[,$raw=false]) string hash_file(string $algo, string

[PHP-DEV] Re: sha256(), sha256_file(), and other hashing algos

2005-11-18 Thread Sara Golemon
I'm just putting on some finishing touches and will post a tarball later today. Meh... It'll be easier to discuss within CVS... It's in pecl/hash as of now. -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] sha256(), sha256_file(), and other hashing algos

2005-11-19 Thread Sara Golemon
I'm missing the functionality to get a list of registered hash functions so one can probe whether a certain hash function is available or not. There is now :) array hash_algos(void) Returns numerically indexed array of hashing engine names. And just incase anyone missed it. The proto for

[PHP-DEV] Labeled Breaks (not the G-word)

2005-11-23 Thread Sara Golemon
http://libssh2.org/patches/labeled_break.diff A few notes about the implementation: * The parser is modified slightly to catch T_BREAK T_LNUMBER ';' and T_BREAK T_STRING ';' specifically. This is in-line with the decision to remove the ability to jump to variable targets. e.g. `break $foo;`

[PHP-DEV] Re: Labeled Breaks (not the G-word)

2005-11-23 Thread Sara Golemon
Set of tests available too now: http://libssh2.org/patches/labeled_break_tests.tgz It can be untarred from the root of a PHP dist and it'll unfold into Zend/tests/break/ http://libssh2.org/patches/labeled_break.diff A few notes about the implementation: * The parser is modified slightly to

Re: [PHP-DEV] Re: Labeled Breaks (not the G-word)

2005-11-24 Thread Sara Golemon
1) The new syntax makes mess for me. 2) After (1) I don't see any reason in limitation to jump only down, Both of these items were based on the PDM meeting notes which required this specific behavior. 2) Your patch doesn't care about freeing loop variables and we got a memory leaks in the

<    1   2   3   4   5   6   7   8   9   10   >