[PHP-DEV] [RFC] Union Types

2016-04-13 Thread Levi Morrison
As alluded to in an earlier email today[1] I am now moving the Union Types RFC[2] to the discussion phase. The short summary of the RFC is that it permits a type declaration to be one of several enumerated types. For example, this is a potential signature for a multi-type map routine:

[PHP-DEV] [RFC] Nullable Types

2016-04-13 Thread Levi Morrison
As alluded to in an earlier email today[1] I am now moving the Nullable Types RFC[2] to the discussion phase. In a nutshell this RFC proposes syntax for declaring a type to alternatively be null. There is a decision that needs to be made: does the question mark go before or after the type name?

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Zeev Suraski
> On 14 באפר׳ 2016, at 7:14, Larry Garfield wrote: > >> On 4/13/16 3:24 PM, Stanislav Malyshev wrote: >> Hi! >> >>> May I suggest you the following article (more of a starting point into >>> Ceylon actually) regarding this topic: >> There was a time where PHP was

Re: [PHP-DEV] Final properties

2016-04-13 Thread Stanislav Malyshev
Hi! > var class ?!? > var function ?!? > var const ?!? > var static ?!? Ah, of course not. "var" is for vars. > I did not say that a userland developer should care I only stated that > it is one difference between a constant and a final property. ;) This is not a difference that is important.

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Larry Garfield
On 4/13/16 3:24 PM, Stanislav Malyshev wrote: Hi! May I suggest you the following article (more of a starting point into Ceylon actually) regarding this topic: There was a time where PHP was considered a good beginner's language. Now it seems we want to pivot and target category theory PhDs

Re: [PHP-DEV] Final properties

2016-04-13 Thread Fleshgrinder
On 4/13/2016 10:18 PM, Stanislav Malyshev wrote: > How exactly it isn't? Except for "static"/"const" thing (which is really > a parser glitch and could be easily fixed if anybody cared) I don't see > a difference. Pretending like that static/const thing is a serious issue > that warrants some deep

Re: [PHP-DEV] Improving PHP's type system

2016-04-13 Thread Stanislav Malyshev
Hi! > Types are designed in a way enhancing the languages experience while > avoiding nearly every impact for people who want to ignore them. This is not true. If it's in language, you have to understand it to be able to use the language. Nobody writes code in vacuum - there are libraries,

Re: [PHP-DEV] Improving PHP's type system

2016-04-13 Thread Bob Weinand
> Am 13.04.2016 um 22:24 schrieb Stanislav Malyshev : > > Hi! > >> May I suggest you the following article (more of a starting point into >> Ceylon actually) regarding this topic: > > There was a time where PHP was considered a good beginner's language. > Now it seems we

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Fleshgrinder
On 4/13/2016 10:24 PM, Stanislav Malyshev wrote: > Hi! > >> May I suggest you the following article (more of a starting point into >> Ceylon actually) regarding this topic: > > There was a time where PHP was considered a good beginner's language. > Now it seems we want to pivot and target

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Stanislav Malyshev
Hi! > May I suggest you the following article (more of a starting point into > Ceylon actually) regarding this topic: There was a time where PHP was considered a good beginner's language. Now it seems we want to pivot and target category theory PhDs instead? :) -- Stas Malyshev

Re: [PHP-DEV] Final properties

2016-04-13 Thread Stanislav Malyshev
Hi! > Well, no. The differences are well explained in the deprecation RFC: > > https://wiki.php.net/rfc/var_deprecation "var is currently a simple alias for public. " > The documentation states the *var* is a substitute for *public* but in > reality it isn't. How exactly it isn't? Except for

[PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Stephen Coakley
On Wed, 13 Apr 2016 10:53:13 -0600, Levi Morrison wrote: > Continued (hit send by hotkey accident): > > On Wed, Apr 13, 2016 at 10:50 AM, Levi Morrison wrote: >> First, some background: several versions of PHP ago authors of >> functions and methods could only restrict types to

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Fleshgrinder
On 4/13/2016 9:57 PM, Levi Morrison wrote: > On Wed, Apr 13, 2016 at 1:10 PM, Fleshgrinder wrote: >> Nothing to add other than +1, however, didn't you already write those? >> >> https://wiki.php.net/rfc/nullable_types >> https://wiki.php.net/rfc/union_types >> >> Or is this

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Levi Morrison
On Wed, Apr 13, 2016 at 1:10 PM, Fleshgrinder wrote: > Nothing to add other than +1, however, didn't you already write those? > > https://wiki.php.net/rfc/nullable_types > https://wiki.php.net/rfc/union_types > > Or is this just an announcement that these will be finalized

Re: [PHP-DEV] Final properties

2016-04-13 Thread Fleshgrinder
On 4/13/2016 6:42 AM, Stanislav Malyshev wrote: > Hi! > >> The *var* keyword is not going to be deprecated and its meaning is >> currently kind of ambiguous. I tried to assign it a new meaning in >> the > > Why is it ambiguous? It's pretty well defined, it's the same as public. > Well, no.

Re: [PHP-DEV] Re: Typed properties patch

2016-04-13 Thread Stanislav Malyshev
Hi! > Because if you unset() a property it's type is not guaranteed anymore. Can't we fix it? I mean, when we unset property on an object, we're still keeping the definition in the class, right? Can't we use it? > > class Foo () { > int $a = 0; > } > $a = new Foo(); > $b = $a->x + 5; /* we

[PHP-DEV] Wiki

2016-04-13 Thread Adler Luiz Pereira Freitas
Hello, I would like to help in php documentation translation, my username is *adlerluiz* -- Adler Luiz

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Fleshgrinder
Nothing to add other than +1, however, didn't you already write those? https://wiki.php.net/rfc/nullable_types https://wiki.php.net/rfc/union_types Or is this just an announcement that these will be finalized now? Btw. I am in favor of having the question mark as a suffix and not as a prefix

Re: [PHP-DEV] [RFC] IntlCharsetDetector

2016-04-13 Thread Fleshgrinder
On 4/12/2016 1:25 AM, Sara Golemon wrote: > On Mon, Apr 11, 2016 at 4:09 PM, Stanislav Malyshev > wrote: >> The API looks a bit strange - new IntlCharsetDetector($text) and then >> detect(). Can't we just have detect([$text])? >> > I went with a direct wrapping of the

Re: [PHP-DEV] Re: Typed properties patch

2016-04-13 Thread Dmitry Stogov
We are talking only about unsettling of typed properties From: guilhermebla...@gmail.com Sent: Wednesday, April 13, 2016 16:08 To: Dmitry Stogov Cc: Nikita Popov; Stanislav Malyshev; internals; Joe Watkins; Zeev Suraski Subject: Re:

Re: [PHP-DEV] [RFC] [Discussion] Octal overflow detection

2016-04-13 Thread Fleshgrinder
On 4/13/2016 4:38 AM, Sara Golemon wrote: > https://wiki.php.net/rfc/octal.overload-checking > Because having this expression evaluate to true makes me sad: ("\000" > === "\400") > > -Sara > +1 from my side right away. We all settled with the fact that "==" is completely useless but at least

[PHP-DEV] Re: Improving PHP's type system

2016-04-13 Thread Levi Morrison
Continued (hit send by hotkey accident): On Wed, Apr 13, 2016 at 10:50 AM, Levi Morrison wrote: > First, some background: several versions of PHP ago authors of > functions and methods could only restrict types to the array type or a > class/interface type. We slowly added some

[PHP-DEV] Improving PHP's type system

2016-04-13 Thread Levi Morrison
First, some background: several versions of PHP ago authors of functions and methods could only restrict types to the array type or a class/interface type. We slowly added some other types such as callable and primitive types. These tools have been invaluable to those who care about restricting

Re: [PHP-DEV] Proposal: Startup snapshot for optimizing app load time

2016-04-13 Thread Larry Garfield
On 4/13/16 10:55 AM, Lin Yo-An wrote: Hi internals, The javascript engine V8 uses a strategy called "startup snapshot" to optimize app load time (see http://v8project.blogspot.tw/2015/09/custom-startup-snapshots.html for more details) The approach used by V8 creates a snapshot from heap, so

Re: [PHP-DEV] Proposal: Startup snapshot for optimizing app load time

2016-04-13 Thread Marco Pivetta
While this seems interesting, how would it address storing any context information of extension? The code above (in your examples) only stores information about the autoload stack, but anything that would rely on any extension (core or pecl or custom) would have to serialize information that is

[PHP-DEV] Proposal: Startup snapshot for optimizing app load time

2016-04-13 Thread Lin Yo-An
Hi internals, The javascript engine V8 uses a strategy called "startup snapshot" to optimize app load time (see http://v8project.blogspot.tw/2015/09/custom-startup-snapshots.html for more details) The approach used by V8 creates a snapshot from heap, so the V8Context could be reused directly

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2016-04-13

2016-04-13 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-04-13 06:35:32+03:00 commit: 60b1441 previous commit:a186ac0 revision date: 2016-04-07 10:26:32+09: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] Re: Typed properties patch

2016-04-13 Thread guilhermebla...@gmail.com
Hi, Unsetting properties is used by a range of libraries I am aware of, including Doctrine (actually any project that relies on proxy generation). Breaking this "feature" would be a catastrophe to a lot of projects. There is an alternative though, which would help: property getter/setter would

Re: [PHP-DEV] [RFC][DISCUSSION] Session ID without hashing

2016-04-13 Thread Yasuo Ohgaki
Hi Stas, On Wed, Apr 13, 2016 at 12:50 PM, Stanislav Malyshev wrote: >> Yes and no. >> Patch uses php_random_bytes(), so it uses appropriate PRNG for the system. >> php_random_bytes() is supposed to be available always. > > True, but is it always OK to export its state to

Re: [PHP-DEV] Re: Typed properties patch

2016-04-13 Thread Dmitry Stogov
On 04/13/2016 07:33 AM, Stanislav Malyshev wrote: Hi! Thanks for your time reviewing the patch, appreciated. > 1) nullable properties I agree that we need a way to that, but I would rather see it covered by nullable types rfc. I think this is an attempt to achieve more type