Re: [PHP-DEV] Re: [RFC] [VOTE] Short Closures

2015-09-23 Thread Marco Pivetta
Changed my vote to "no" after thinking further into it: - I don't like the usage of the tilde: `->` and `~>` are too similar and easily confused - Using `==>` would align PHP further to hacklang, which is a plus - I'm still conflicted on automatically importing all of the scope into the closure

Re: [PHP-DEV] Re: [RFC] [VOTE] Short Closures

2015-09-23 Thread Pierre Joye
On Sep 22, 2015 10:16 PM, "Andrea Faulds" wrote: > > I am unhappy with the ~> syntax choice. As I've mentioned before, it's hard to type for many people, it looks too much like ->, and it's unnecessarily different from Hack's ==>, of which this RFC would otherwise be proposing a strict subset. >

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-23 Thread Matt Ficken
Ok, I have a new PR just to unlock around Sleep(): https://github.com/php/php-src/pull/1536 Just by unlocking around Sleep() the OpenFileMapping loop will work. Holding the lock in that loop will not only block detach_segments() in other PHP processes but also reattaching in accel_startup(). Chec

Re: [PHP-DEV] Data serialization of objects, want to iterate 'sealed' properties then dynamic ones

2015-09-23 Thread Sean DuBois
On Wed, Sep 23, 2015 at 02:16:39PM -0700, j adams wrote: > Not my intention to be combative, but what about http://php.net/pcntl_fork > ? I've used that before in a robust distributed application that runs > without any intervention for months. It's my understanding that PHP is > thread safe, but n

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread François Laupretre
Le 23/09/2015 18:37, Stig Bakken a écrit : If they start replacing calls to isset()/array_key_exists() with exists(), that's their choice and it can only improve overall readability. The thing is, it won't really improve overall readability, because the name exists() is still too vague. It ma

Re: [PHP-DEV] Data serialization of objects, want to iterate 'sealed' properties then dynamic ones

2015-09-23 Thread j adams
Not my intention to be combative, but what about http://php.net/pcntl_fork ? I've used that before in a robust distributed application that runs without any intervention for months. It's my understanding that PHP is thread safe, but not itself multithreaded. I believe there are some extensions whic

[PHP-DEV] Re: Implementing Generics, and none scalar default properties.

2015-09-23 Thread Ben Scholzen 'DASPRiD'
On 23.09.2015 22:35, Dominic Grostate wrote: So far so good, but function calls are more complicated. I'm getting error: shift/reduce conflicts My guess is this due to the following scenario: (10); While the intention might be to call a "function" const_a with the generic type const_b and

[PHP-DEV] zend_parse_parameters changes not fully documented in phpng-upgrading, PR to fix existing tools

2015-09-23 Thread Sean DuBois
Hey list, 'l' had a change 'long' -> 'zend_long' and 's' had a change 'int' -> 'size_t'. These two changes are really hard to catch when porting an extension, nothing complains at compile time, you don't get segfaults when calling zend_parse* but usually later and it is platform dependent (Window

Re: [PHP-DEV] Data serialization of objects, want to iterate 'sealed' properties then dynamic ones

2015-09-23 Thread Rowan Collins
On 23 September 2015 20:48:33 BST, j adams wrote: >> PHP uses an object store. >Am I correct in understanding that the object store is a global data >structure? Wouldn't this tend to discourage any attempts at >multithreading/multiprocessing within one's PHP script--unless the >object >store is pr

[PHP-DEV] Re: Implementing Generics, and none scalar default properties.

2015-09-23 Thread Dominic Grostate
> So far I only wrote up the RFC and kicked off a discussion here on the > mailing list about it. As I wrote several times already, I'd appreciate > someone tackling the implementation side to get a patch working! > Cheers, Hi Ben, I think there is something wrong with how I set up my ML subscri

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
On 23 September 2015 20:04:57 BST, Ryan Pallas wrote: > I dislike this because it makes refactoring harder. Just like when we >rename a dynamic property, we have to search for its usage as a string >(which may be stored in a variable), and then analyze if those strings >warrant being changed. Of c

Re: [PHP-DEV] Data serialization of objects, want to iterate 'sealed' properties then dynamic ones

2015-09-23 Thread j adams
> Welcome to the jungle Thank you, Francois. Malheuresement, plus de questions... > PHP uses an object store. Am I correct in understanding that the object store is a global data structure? Wouldn't this tend to discourage any attempts at multithreading/multiprocessing within one's PHP script--u

Re: [PHP-DEV] Re: Let's discuss enums!

2015-09-23 Thread Jefferson Gonzalez
On 09/23/2015 02:19 PM, Rowan Collins wrote: The internal implementation can never be quite as simple as an IS_LONG zval if we want to provide anything at all beyond a C-style enum. I for one do not want Days::MONDAY === Months::JANUARY to return true, and nor should typeof(Days::MONDAY) return "

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Ryan Pallas
On Wed, Sep 23, 2015 at 12:27 PM, Rowan Collins wrote: > > > My suggestion (with which I believe Stig was agreeing) is this: > > variable_exists('foo'): yes (should be yes) > unset($foo); > variable_exists('foo'): no (should be no) > variable_exists('bar'): no (should be no) > > I dislike this bec

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
Lester Caine wrote on 23/09/2015 18:15: On 23/09/15 17:37, Stig Bakken wrote: I'm still in favor of having a variable_exists('varname') function though. We had it ... https://bugs.php.net/bug.php?id=24274 Actually that looks like what is currently being proposed as exists() - a swiss-army k

Re: [PHP-DEV] Re: Let's discuss enums!

2015-09-23 Thread Rowan Collins
Jefferson Gonzalez wrote on 22/09/2015 20:28: Is also worth noting that if you keep performance in mind, enums whith values represented as integers should be a much more performant/efficient implementation since it would require less cpu cycles and memory to build and read them. In the other si

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Lester Caine
On 23/09/15 17:37, Stig Bakken wrote: > I'm still in favor of having a variable_exists('varname') function though. We had it ... https://bugs.php.net/bug.php?id=24274 -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Servic

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
Stig Bakken wrote on 23/09/2015 17:37: I'm still in favor of having a variable_exists('varname') function though. [...] Why would you want to add hasitem()? FWIW, my plan was to draft one RFC, but hold separate votes for each function. I'm not even sure whether I'd vote yes myself, but it w

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Stig Bakken
On Wed, Sep 23, 2015 at 5:05 PM, François Laupretre wrote: > Le 23/09/2015 12:18, Rowan Collins a écrit : >> >> >> Clearly, people misunderstand what isset() does, but I think an exists() >> function which mimics it with a slight difference will only add to that >> confusion - people will say "oh,

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
Lester Caine wrote on 23/09/2015 13:22: NOW WE AGREE ;) Simply because I DON'T want call 'isset() and is_null()' what*I* need is is_exist() which is the missing function. THEN either of the other is redundant, but neither replaces the check that the variable actually exists and it's that which p

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
François Laupretre wrote on 23/09/2015 16:05: Le 23/09/2015 12:18, Rowan Collins a écrit : Clearly, people misunderstand what isset() does, but I think an exists() function which mimics it with a slight difference will only add to that confusion - people will say "oh, if only I had PHP 7.1" rat

Re: [PHP-DEV] Implementing Generics, and none scalar default properties.

2015-09-23 Thread Ben Scholzen 'DASPRiD'
Hey Dominic On 23.09.2015 16:53, Dominic Grostate wrote: A couple of things that would really help me in PHP are generics and the ability to set default values of properties to instances of objects or calls to static methods or functions (expressions in general). I don't know if either of these

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread François Laupretre
Le 23/09/2015 12:18, Rowan Collins a écrit : Clearly, people misunderstand what isset() does, but I think an exists() function which mimics it with a slight difference will only add to that confusion - people will say "oh, if only I had PHP 7.1" rather than looking for array_key_exists, for inst

[PHP-DEV] Implementing Generics, and none scalar default properties.

2015-09-23 Thread Dominic Grostate
A couple of things that would really help me in PHP are generics and the ability to set default values of properties to instances of objects or calls to static methods or functions (expressions in general). I don't know if either of these have experimental implementations already as I couldn't fin

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Lester Caine
On 23/09/15 11:40, Rowan Collins wrote: >> Using isset() in place of exists() is NOT a valid substitution since one >> can't then call is_null() KNOWING that the variable does exist. > > I think you're flogging a dead horse here. We all agree that isset() > does not check for variable existence. >

[PHP-DEV] Benchmark Results for PHP Master 2015-09-23

2015-09-23 Thread lp_benchmark_robot
Results for project php-src-nightly, build date 2015-09-23 10:22:12+03:00 commit: d44bb8bc3fdc933f9bdd33d356d187170fecb0cd revision_date: 2015-09-23 14:10:32+08:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
Lester Caine wrote on 23/09/2015 11:28: Yes from one point of view the problem is not with is_null() and I can agree with that. The problem is that one can't establish that a call to is_null() is going to access a valid variable while only working in the simple procedural layer. You can't estab

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Lester Caine
On 23/09/15 10:57, Rowan Collins wrote: >> array_key_exists(“var”, get_defined_vars()) && is_null($var) > > I wondered if someone would mention that, but didn't want to drift too > far from the point, which was the "prior to call is_null()" part of > Lester's sentence was redundant, since the prob

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
François Laupretre wrote on 23/09/2015 00:11: So, I thought this was going further and further away from the original idea, which was asking for 'an equivalence of isset() which would consider every value, *including* null, as set, because that's what a lot of devs intuitively assume when using

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Rowan Collins
Michael Wallner wrote on 23/09/2015 09:38: >>if the variable does not exist there is no way of testing for that >>state >>prior to calling is_null() > >Correct, there is no way of testing for that full stop. There is, though, not sure if already mentioned: array_key_exists(“var”, get_defined_v

Re: [PHP-DEV] [RFC] [VOTE] Short Closures

2015-09-23 Thread Tony Marston
"Anthony Ferrara" wrote in message news:CAAyV7nHVNGG8yOyGhTE=pkaci4gdtgrdvcs4rdxb2flmny4...@mail.gmail.com... Dmitry, On Tue, Sep 22, 2015 at 3:19 PM, Dmitry Stogov wrote: On Tue, Sep 22, 2015 at 9:20 PM, Anthony Ferrara wrote: Dmitry, On Tue, Sep 22, 2015 at 2:05 PM, Dmitry Stogov wr

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-23 Thread Dmitry Stogov
Hi Matt, It looks like with your patch, the same file may be mapped to different virtual addresses of different processes and this won't work. I think usage of vista_mapping_base_set[] in your patch is wrong. Do I understand properly, that zend_shared_alloc_unlock/lock_win32() around Sleep() is t

Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28?

2015-09-23 Thread Michael Wallner
> On 19 09 2015, at 23:22, Rowan Collins wrote: > > On 19 September 2015 15:49:55 BST, Lester Caine wrote: >> On 19/09/15 13:15, Rowan Collins wrote: >> If there was a bug with 'isset' it is that it returns false for a >> variable that IS SET to null. > > I honestly think that the only problem

RE: [PHP-DEV] Windows OpCache bug fix

2015-09-23 Thread Anatol Belski
Hi Matt, > -Original Message- > From: Matt Ficken [mailto:themattfic...@gmail.com] > Sent: Wednesday, September 23, 2015 9:10 AM > To: PHP Internals > Cc: dmi...@php.net; larue...@php.net > Subject: [PHP-DEV] Windows OpCache bug fix > > I want to increase visibility for my PR 1531, https

Re: [PHP-DEV] [RFC] [VOTE] Short Closures

2015-09-23 Thread Björn Larsson
Den 2015-09-22 kl. 03:59, skrev Bob Weinand: Hey, Thanks for all your feedback in the discussion thread! So, before I start the vote, just two quick notes: I've added two notes about the statement syntax and the single variable use. Though a few people complained, I'm not switching to the ==> o

[PHP-DEV] Windows OpCache bug fix

2015-09-23 Thread Matt Ficken
I want to increase visibility for my PR 1531, https://github.com/php/php-src/pull/1531, my patch for fixing an intermittent OpCache issue on Windows. Details, etc... are on the PR. Regards -M