On 28/06/12 23:45, Sebastian Krebs wrote:
> Hi,
>
> 2012/6/28 David Muir
>
>> I'd assume that array_map() only works with arrays, while list
>> comprehension should work with anything traversable.
>>
> That sounds more like a "bug" (better: "Missing feature") in array_map()
> and less a missing la
On 29/06/12 14:06, minwei zhou wrote:
> On Thu, Jun 28, 2012 at 6:48 PM, Nikita Popov wrote:
>> Hi internals!
>>
>> Python and several other languages include support for list
>> comprehensions and generator expressions and I'd like to see something
> why PHP should going to like other language?
On Thu, Jun 28, 2012 at 6:48 PM, Nikita Popov wrote:
> Hi internals!
>
> Python and several other languages include support for list
> comprehensions and generator expressions and I'd like to see something
why PHP should going to like other language?
> similar in PHP too.
>
> I created a hacky pr
Johannes,
> I haven't looked at your patch. But if it has to call another
> PHP_FuNCTION then it's not good. crypt implementation should be
> accessible via C.
I've refactored crypt() slightly to expose a PHP_API crypt_execute()
function that does just about everything except the argument parsing
On Wed, Jun 27, 2012 at 2:19 PM, Nikita Popov wrote:
> I looked at a few other error functions (of which we by the way we
> have *loads*, which is a bad sign) and indeed it seems that they all
> use a separate function to get the error message. Most use a
> xyz_errno() + xyz_error() pair.
>
> So i
> No mention of yielding keys in the comprehensions. Presume that would
> work?
Yup, that works too. I also included an example in the mail:
$firstNames = [foreach ($users as $user) yield $user->id =>
$user->firstName];
This creates a map from ids to first names.
> The simplest example I cou
On Thu, Jun 28, 2012 at 2:43 PM, Sebastian Krebs wrote:
> Hi,
>
> Whats the difference to the (already existing) function array_map() (except
> the syntax and one more new keyword)?
>
>> $firstNames = array_map(function($user){return $user->firstname;},
> $users);
>
> Don't want to rewrite every e
Currently, if you recursively call getDocNamespaces on any SimpleXML node
it retrieves ALL the namespaces for the entire document, regardless of what
node you call it on. This patch adds a second bool argument called
`from_root` that allows you to specify if you want all the namespaces from
the roo
Saying that "the exception handler shouldn't have called resume" in
the case where the exception was originally thrown in a deeper stack
frame sounds good until you consider that this requires exception
handlers to know whether the code preceding them has been refactored
or not, which makes it toug
Hi,
2012/6/28 David Muir
> I'd assume that array_map() only works with arrays, while list
> comprehension should work with anything traversable.
>
That sounds more like a "bug" (better: "Missing feature") in array_map()
and less a missing language feature...
Regards,
Sebastian
>
> David
>
> -Original Message-
> From: Nikita Popov [mailto:nikita@gmail.com]
> Sent: 28 June 2012 11:49
> To: PHP internals
> Subject: [PHP-DEV] List comprehensions and generator
> expressions for PHP
>
> Hi internals!
>
> Python and several other languages include support for list
> comp
I'd assume that array_map() only works with arrays, while list comprehension
should work with anything traversable.
David
On 28/06/2012, at 10:43 PM, Sebastian Krebs wrote:
> Hi,
>
> Whats the difference to the (already existing) function array_map() (except
> the syntax and one more new key
Hi,
Whats the difference to the (already existing) function array_map() (except
the syntax and one more new keyword)?
> $firstNames = array_map(function($user){return $user->firstname;},
$users);
Don't want to rewrite every example you gave, but you probably see my point.
Regards,
Sebastian
20
Heya,
> So, what do you think? Do we want something like this in PHP?
I think it looks great, especially the generator functions would be
useful to avoid having to create a full blown iterator for simple stuff.
Cheers
--
Jordi Boggiano
@seldaek - http://nelm.io/jordi
--
PHP Internals - PHP
Hi internals!
Python and several other languages include support for list
comprehensions and generator expressions and I'd like to see something
similar in PHP too.
I created a hacky proof of concept implementation here:
https://github.com/nikic/php-src/tree/addListComprehensions. It's
really dir
Hi,
2012/6/28 Rasmus Lerdorf :
> On 06/27/2012 08:45 PM, Yasuo Ohgaki wrote:
>> Hi,
>>
>> I forgot to mention MySQL's query cache.
>> This change may have negative performance impact, since prepared
>> query is not cached and native prepared query may not be used by
>> other requests.
>
> That's n
What is the state here with regard to merge into php-src?
On Sun, Apr 22, 2012 at 5:48 AM, Clint M Priest wrote:
>
>
> > -Original Message-
> > From: Stas Malyshev [mailto:smalys...@sugarcrm.com]
> > Sent: Saturday, April 21, 2012 10:33 PM
> > To: Clint M Priest
> > Cc: internals@lists.p
On Wed, 2012-06-27 at 22:00 -0400, Anthony Ferrara wrote:
> Johannes,
>
> > Some comments on the "error behavior" part:
> >
> >E_WARNING - When CRYPT is not included in core (was disabled
> >compile-time, or is listed in disabled_functions declaration)
> >
> > Disabling a different functio
Hi Anthony!
On Thu, Jun 28, 2012 at 4:00 AM, Anthony Ferrara wrote:
> Hrm. Well, then I guess I could re-implement against crypt internally.
> That would take either a slight re-implementation of the crypt()
> internals, or slight refactoring of the PHP_FUNCTION(crypt) function
> to enable c cal
19 matches
Mail list logo