Re: [PHP-DEV] Re: Moving to an AST-based parsing/compilation process

2012-09-06 Thread Morgan L. Owens
On 2012-09-06 10:39, Stas Malyshev wrote: Hi! ... and no real benefit for average PHP user. Well, apart from perhaps leaving them with a simpler language that doesn't have the inconsistencies and corner cases that currently exist (and documented ad nauseum) not because of any design decision

[PHP-DEV] Re: Moving to an AST-based parsing/compilation process

2012-09-05 Thread Morgan L. Owens
On 2012-09-05 07:57, Nikita Popov wrote: Hey folks! Some people asked me what the advantages of using an AST-based parsing/compilation process are, so I put together a few quick notes in an RFC: https://wiki.php.net/rfc/ast_based_parsing_compilation_process It would be nice to get a few

Re: [PHP-DEV] $obj-attr::method() is not allowed

2012-09-04 Thread Morgan L. Owens
is _also_ an r_variable, so does that mean I can't write $a-b-c = 1;? Morgan L. Owens -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DEV] $obj-attr::method() is not allowed

2012-09-03 Thread Morgan L. Owens
) and '$a-b-c' (26 nodes, including base_variable_with_function_calls)). Morgan L. Owens -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DEV] Support negative indexes for arrays and strings

2012-09-01 Thread Morgan L. Owens
On 2012-09-01 21:23, Sherif Ramadan wrote: $array[0] = 'first element'; $array[9] = 'second element'; var_dump($array); /* array(2) { [9]= string(14) second element [0]= string(13) first element } */ Just correcting this as it was a copy/paste fail... The above code would

Re: Re: [PHP-DEV] Support negative indexes for arrays and strings

2012-09-01 Thread Morgan L. Owens
On 2012-09-01 20:17, Kris Craig wrote: This discussion kinda reminds me of some of the debates over AUTO_INCREMENT behavior in the MySQL community. Specifically, they end up having to tackle the same funcamental, conceptual dilemma: If I assign/insert/whatever an arbitrary value to a

Re: Re: [PHP-DEV] [VOTE] Generators

2012-08-30 Thread Morgan L. Owens
On 2012-08-30 20:39, Derick Rethans wrote: On Wed, 29 Aug 2012, Gustavo Lopes wrote: On Wed, 29 Aug 2012 22:10:52 +0200, Derick Rethans der...@php.net wrote: Nothing in the core throws an exception, why would this?! This is not accurate. All the iterators throw exceptions on similar

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-23 Thread Morgan L. Owens
On 2012-08-23 02:03, Lester Caine wrote: I accept your point about not caring about how the data was created, but on the other side, if the data creation is handling a lot more data than the consumer needs there is an amount of processing time that is wasted. The quick way of doing something

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-23 Thread Morgan L. Owens
On 2012-08-23 00:10, Lester Caine wrote: Then the next example is an 'iterator' ... which you are right ... I do not appreciate either, because they require an insane amount of overhead for what would be easy if the first example had been done right! I did try them, in the past, but the

Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-22 Thread Morgan L. Owens
On 2012-08-22 19:45, Lester Caine wrote: Personally I'm looking for a 'Official Userland Library' that provides EXAMPLES of how to do operations rather than yet another downloadable library. This is also the sort of thing I would like to see. The examples within the manual are written for

Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-22 Thread Morgan L. Owens
On 2012-08-22 19:45, Lester Caine wrote: Personally I'm looking for a 'Official Userland Library' that provides EXAMPLES of how to do operations rather than yet another downloadable library. This is also the sort of thing I would like to see. The examples within the manual are written for

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-21 Thread Morgan L. Owens
On 2012-08-22 04:35, Lester Caine wrote: John LeSueur wrote: Again, the case you've cited is probably not a case where generators give much advantage. But anytime the logic to produce some data becomes more complicated (Imagine that you needed to skip some of the lines in the .csv file based on

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-21 Thread Morgan L. Owens
Oh, yes... On 2012-08-22 04:35, Lester Caine wrote: and doesn't seem to provide any outstanding advantages? As I wrote in an earlier post: On 2012-08-09 15:30, Morgan L. Owens wrote: I for one am lazy, and would much prefer writing: ?php function append_iterator($first, $second

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Morgan L. Owens
On 2012-08-21 01:10, Lester Caine wrote: For the third one ... I'm still waiting for some clarification on how yield is SUPPOSED to work anyway? If you are using a 'generator' to return a sequence of data elements, then just what does happen between each call to the generator ... DOES the

Re: Re: [PHP-DEV] removing an item from an array

2012-08-19 Thread Morgan L. Owens
On 2012-08-19 04:08, Levi Morrison wrote: On Sat, Aug 18, 2012 at 12:42 AM, Alexey Zakhlestin indey...@gmail.com wrote: On 16.08.2012, at 0:18, Rasmus Schultz ras...@mindplay.dk wrote: How come there is no straight-foward obvious way to simply remove a given value from an array? Well, this

[PHP-DEV] re: removing an item from an array

2012-08-18 Thread Morgan L. Owens
Rasmus Schultz wrote: I disagree - this is (or should be) a simple, atomic operation... yet, you've got a function-call, an intermediary variable, a boolean test, and an unset statement repeating the name of the array you're deleting from. This should be a simple statement or

Re: [PHP-DEV] re: removing an item from an array

2012-08-18 Thread Morgan L. Owens
On 2012-08-19 10:25, Andrew Faulds wrote: On 18/08/12 14:52, Morgan L. Owens wrote: How simple is it? Does it: 1) Remove one occurrence of the element (presumably the first) or all? 2) Reindex the array (as someone else argued was necessary to make it properly indexed afterwards) or not? 3

Re: [PHP-DEV] removing an item from an array

2012-08-16 Thread Morgan L. Owens
On 2012-08-16 17:55, Sherif Ramadan wrote: That doesn't make any sense. What if the values are present more than once? array_flip will cause the keys to be overwritten. Not to mention converting all of the array's elements to strings and/or integers. Now your array is something completely

Re: Re: [PHP-DEV] removing an item from an array

2012-08-15 Thread Morgan L. Owens
On 2012-08-16 08:27, Nikita Popov wrote: On Wed, Aug 15, 2012 at 10:22 PM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! How come there is no straight-foward obvious way to simply remove a given value from an array? Just look at the number of horrible ways people solve this obvious problem:

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
Mike Ford wrote: The signposting needn't even be as in-your-face as a generator keyword (either instead of or in addition to function): I could get behind a variation such as: function f($x, $y) yields { ... yield $z; ... } Or even (stretching a bit to re-use an existing keyword!):

Re: [PHP-DEV] Generators in PHP

2012-08-09 Thread Morgan L. Owens
hakre wrote: Also, currently yield looks very similar to return and I think this is a nice thing as it is similar semantically. yield($foo) would give it different semantics, imho. I love this point a lot. Return is very common and yield is some kind of return. I agree also: yield behaves

Re: Re: [PHP-DEV] Re: Generators in PHP

2012-08-08 Thread Morgan L. Owens
On 2012-08-09 14:25, Larry Garfield wrote: On 07/27/2012 07:23 AM, Lester Caine wrote: Nikita - I am looking for a well reasoned argument as to why generator has to be added at all! 'Just because it can be' is not a valid argument, but perhaps you could add to the RFC the performance

Re: Re: [PHP-DEV] Generators in PHP

2012-08-08 Thread Morgan L. Owens
On 2012-08-09 08:42, Nikita Popov wrote: Without parenthesis their behavior in array definitions and nested yields is ambigous: array(yield $key = $value) // can be either array((yield $key) = $value) // or array((yield $key = $value)) yield yield $key = $value; // can be either yield (yield

Re: Re: [PHP-DEV] PHP 5.x Documentend End Of Life Dates

2012-08-02 Thread Morgan L. Owens
On 2012-08-02 19:56, Peter Cowburn wrote: On 2 August 2012 07:35, Adam Harvey ahar...@php.net wrote: Thoughts? (Do we even want to auto-fill this from $OLDRELEASES, or would we rather have a manual array?) Specific notes on vulnerabilities to add to branches? Better versions of the copy in the

Re: [PHP-DEV] PHP 5.x Documentend End Of Life Dates

2012-08-02 Thread Morgan L. Owens
On 2012-08-02 20:42, Peter Cowburn wrote: On 2 August 2012 09:36, Morgan L. Owens pack...@nznet.gen.nz wrote: Just as each release announcement dated with detailed kept on a distinct page (linked in that list), all that's needed there is a date when support ended, with (any available

Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST

2012-07-21 Thread Morgan L. Owens
On 2012-07-21 12:19, Stas Malyshev wrote: Hi! So when I have a function that has a two- or multi-part result then - instead of having one part as the return value and the others by reference - in Python I'd return a tuple. PHP functions can return arrays and some do - e.g. pathinfo(). But

Re: Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST

2012-07-20 Thread Morgan L. Owens
On 2012-07-21 10:28, Stas Malyshev wrote: Hi! If I understand this correctly, this is like what Python let's you do with tuples. It's handy for getting vector components, hostnames and port numbers, etc. (I apologise for the Python comparison, it is just the language where I usually encounter

Re: Re: [PHP-DEV] [proposal + pull request] Replace logo GUIDs with data URIs

2012-07-15 Thread Morgan L. Owens
On 2012-07-15 09:48, Stas Malyshev wrote: Hi! And I actually know of websites using the functions to display the logo.. Is there some way we could provide a BC function for it somehow? Maybe rather then removing the functions, make then return the data uris? Having the functions to get the

Re: Re: [PHP-DEV] 6.0 And Moving Forward

2012-07-14 Thread Morgan L. Owens
On 2012-07-14 04:12, jpauli wrote: On Fri, Jul 13, 2012 at 5:33 PM, Anthony Ferrara ircmax...@gmail.com wrote: 4. Rewrite the entire parser completely. I keep hearing about how bad PHP's parser is, and how it's growing out of control. Perhaps this is a good time to rewrite it (perhaps changing

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-27 Thread Morgan L. Owens
On 2012-06-26 07:22, Ben Ramsey wrote: However, in Prototype.js and Underscore.js, pluck seems behave more like array_map() in PHP: http://api.prototypejs.org/language/Enumerable/prototype/pluck/ http://documentcloud.github.com/underscore/#pluck Nevertheless, it would technically have the

Re: Re: [PHP-DEV] [DRAFT] RFC - array_column() function

2012-06-25 Thread Morgan L. Owens
On 2012-06-25 04:19, Ralph Schindler wrote: The term 'column' makes a lot of sense for PDO working with database columns, but there is no concept of a 'column' in the array structure or PHP as a whole, outside of database related functions. In the case of this addition, I do indeed like

Re: Re: [PHP-DEV] concatenation operator

2012-06-14 Thread Morgan L. Owens
On 2012-06-15 04:00, Ángel González wrote: On 13/06/12 05:26, Morgan L. Owens wrote: After reading the performance improvements RFC about interned strings, and its passing mention of a special data structure (e.g. zend_string) instead of char*, I've been thinking a little bit about

Re: Re: [PHP-DEV] concatenation operator

2012-06-12 Thread Morgan L. Owens
On 2012-06-08 08:18, Johannes Schlüter wrote: On Thu, 2012-06-07 at 12:53 -0700, Adi Mutu wrote: Ok Johannes, thanks for the answer. I'll try to look deeper. I basically just wanted to know what happens when you concatenate two strings? what emalloc/efree happens. This depends. As always. As

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-10 Thread Morgan L. Owens
Wez Furlong wrote: On Apr 9, 2005 6:07 AM, Morgan L. Owens [EMAIL PROTECTED] wrote: Really? Can you guarantee that your user-space code to sniff out the path is going to work 100% of the time on all platforms? Who said user-space? I meant in the implementation of fopen(). fopen

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-09 Thread Morgan L. Owens
Wez Furlong wrote: Really? Can you guarantee that your user-space code to sniff out the path is going to work 100% of the time on all platforms? Who said user-space? I meant in the implementation of fopen(). It's not just 1 letter. There are 3 letter special device names too. Natch; yeah.

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-06 Thread Morgan L. Owens
If there's something that looks like a scheme (i.e., a well-formed sequence of characters followed by ':'), see if it's registered; if it is, the appropriate wrapper should be used. Otherwise, on platforms where ':' has significance, try it again as a file path. Otherwise, it fails due

[PHP-DEV] Scheme identification in stream wrappers

2005-04-05 Thread Morgan L. Owens
It was suggested I post this here. In PHP, the character sequence :// separates the protocol name from the protocol-specific part of a stream name. Clearly, the intention is that these stream names are URLs (i.e., URIs that actually provide a location for the identified resource). However, the