Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Nikita Nefedov
On Mon, 23 May 2016 22:52:18 +0300, Levi Morrison wrote: On Mon, May 23, 2016 at 1:19 PM, Nikita Nefedov wrote: On 23 May 2016, at 19:31, Levi Morrison wrote: A quick question before I vote: do callable prototypes allow for default

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Jesse Schalken
I'm curious, what is it about $this that makes it special in the first place? Can't it be a normal local variable that happens to already be assigned at the start of a method? On Tue, May 24, 2016 at 6:24 AM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > >

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Xinchen Hui
Hey: On Tue, May 24, 2016 at 4:24 AM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > > It proposes to fix all known inconsistencies related to handling of > special $this variable. > in section static this, actually, the codes doesn't work in 7.0

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Dan Ackroyd
Hi Nikita, On 23 May 2016 at 15:27, Nikita Nefedov wrote: > With this message I'd like to go to vote > with the Callable prototypes RFC targeted at 7.1: > https://wiki.php.net/rfc/callable-types To explain my vote - I think we definitely need to be able to specify the

[PHP-DEV] Re: "finally" handling refactoring (Bug #72213)

2016-05-23 Thread Nikita Popov
On Mon, May 23, 2016 at 11:36 PM, Dmitry Stogov wrote: > Hi, > > On 05/23/2016 07:24 PM, Nikita Popov wrote: > > On Mon, May 23, 2016 at 1:25 PM, Dmitry Stogov wrote: > >> Thanks for review. >> >> Both problems should be fixed now >>

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread James Gilliland
In the section "Disable ability to re-assign $this indirectly through $$" it looks like there is a typo. It only makes sense if you mean $$a instead of $aa.

[PHP-DEV] Re: "finally" handling refactoring (Bug #72213)

2016-05-23 Thread Dmitry Stogov
Hi, On 05/23/2016 07:24 PM, Nikita Popov wrote: On Mon, May 23, 2016 at 1:25 PM, Dmitry Stogov > wrote: Thanks for review. Both problems should be fixed now https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330 Do you see

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Dmitry Stogov
good point. I'll update RFC and patch to support extract() and get_defined_vars(). From: Nikita Popov Sent: Monday, May 23, 2016 11:46:35 PM To: Dmitry Stogov Cc: internals; Nikita Popov; Bob Weinand; Xinchen Hui Subject: Re: [PHP-DEV]

Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Nikita Popov
On Mon, May 23, 2016 at 10:24 PM, Dmitry Stogov wrote: > Hi internals, > > > Please review the RFC. > > It proposes to fix all known inconsistencies related to handling of > special $this variable. > > > https://wiki.php.net/rfc/this_var > > > Thanks. Dmitry. > How does this

[PHP-DEV] [RFC] Fix inconsistent behavior of $this variable

2016-05-23 Thread Dmitry Stogov
Hi internals, Please review the RFC. It proposes to fix all known inconsistencies related to handling of special $this variable. https://wiki.php.net/rfc/this_var Thanks. Dmitry.

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Markus Fischer
Hello Nikita, On 23.05.16 21:27, Nikita Nefedov wrote: > When you pass an `int` to a `string` type parameter in weak mode > it's being coerced to the needed type (not just directly passed). > > This is quite complex, because you'd need to copy zend_function > and all its members (without

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Levi Morrison
On Mon, May 23, 2016 at 1:19 PM, Nikita Nefedov wrote: > >> On 23 May 2016, at 19:31, Levi Morrison wrote: >> >>> On Mon, May 23, 2016 at 8:27 AM, Nikita Nefedov wrote: >>> Evening internals, >>> >>> With this message I'd like to go to vote

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Nikita Nefedov
Hi Bob, When you pass an `int` to a `string` type parameter in weak mode it's being coerced to the needed type (not just directly passed). This is quite complex, because you'd need to copy zend_function and all its members (without changing the original zend_function). I would love to support

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Nikita Nefedov
> On 23 May 2016, at 19:31, Levi Morrison wrote: > >> On Mon, May 23, 2016 at 8:27 AM, Nikita Nefedov wrote: >> Evening internals, >> >> With this message I'd like to go to vote >> with the Callable prototypes RFC targeted at 7.1: >>

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Bob Weinand
Hey, I have a question regarding strict/weak types. Currently, you cannot pass a callable function(string $foo) {} to a signature requiring (callable(int)), if I understood the code correctly. But weak types actually should allow that as it's totally fine to pass an integer to a string in

Re: [PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Levi Morrison
On Mon, May 23, 2016 at 8:27 AM, Nikita Nefedov wrote: > Evening internals, > > With this message I'd like to go to vote > with the Callable prototypes RFC targeted at 7.1: > https://wiki.php.net/rfc/callable-types > > We've renamed it (previously was "Callable types") as RFC

[PHP-DEV] Re: "finally" handling refactoring (Bug #72213)

2016-05-23 Thread Nikita Popov
On Mon, May 23, 2016 at 1:25 PM, Dmitry Stogov wrote: > Thanks for review. > > Both problems should be fixed now > https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330 > > Do you see any other problems or a better way to fix this? > Your fix for DISCARD_EXCEPTION

[PHP-DEV] [RFC] [Vote] Callable types (now: Callable prototypes)

2016-05-23 Thread Nikita Nefedov
Evening internals, With this message I'd like to go to vote with the Callable prototypes RFC targeted at 7.1: https://wiki.php.net/rfc/callable-types We've renamed it (previously was "Callable types") as RFC names often dictate how users will call the feature and I want it to be more

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
Yeah "float". It works :) From: Niklas Keller Sent: Monday, May 23, 2016 4:46:59 PM To: Dmitry Stogov; Joe Watkins; PHP internals; Phil Sturgeon Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties Dmitry Stogov

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Niklas Keller
Dmitry Stogov schrieb am Mo., 23. Mai 2016 14:48: > Should this work? > > class C { > public double $x; > } > $o = new C; > $o->x = 5; > ?> > > Currently this leads to PHP Fatal error: Uncaught TypeError: Typed > property C::$x must be an instance of double, integer

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2016-05-23

2016-05-23 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-05-23 06:28:15+03:00 commit: 0d62dfd previous commit:4f077ae revision date: 2016-05-22 00:05:06+02: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] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
Should this work? x = 5; ?> Currently this leads to PHP Fatal error: Uncaught TypeError: Typed property C::$x must be an instance of double, integer used in /home/dmitry/php/php-master/CGI-DEBUG/prop.php:6 From: Joe Watkins

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
Hi Joe, Unfortunately your solution with IS_TYPE_VERIFIED is not acceptable, because you update the source zval. If the assigned value is a literal you change read-only memory and crash (with opcache.ptotect_memory=1) a = 5; ?> Thanks. Dmitry. From:

[PHP-DEV] Re: "finally" handling refactoring (Bug #72213)

2016-05-23 Thread Dmitry Stogov
Thanks for review. Both problems should be fixed now https://gist.github.com/dstogov/0a809891c6a3ac3fac4bd0d9711dd330 Do you see any other problems or a better way to fix this? Thanks. Dmitry. From: Nikita Popov Sent: Friday, May 20,

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Rowan Collins
On 20/05/2016 07:05, Joe Watkins wrote: Morning internals, Since we have our answer on nullable types, typed properties can now go to vote. https://wiki.php.net/rfc/typed-properties#vote Note that, support for nullability as RFC'd will be merged when the implementation for

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Joe Watkins
Morning internals, I have improved the performance of the patch a little, here's the results of a bad run: krakjoe@fiji:/usr/src/php-src$ sapi/cli/php -n prop.php empty_loop 0.064 write_prop1() 0.0880.025 write_prop2() 0.0790.016 write_prop3()

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Julien Pauli
On Mon, May 23, 2016 at 11:09 AM, Stanislav Malyshev wrote: > Hi! > >> The performance effect of this implementation is terrible. >> >> Assignment to typed property is 2.3 times slower. >> Assignment to untyped property in a class with typed properties is 1.8 times >>

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Ivan Enderlin
I vote no for the same performance reason, but the whole Hoa's community is agree with the RFC. Thanks for the hard work! On 23/05/16 11:02, Dmitry Stogov wrote: I appreciate the work done by Joe, but I vote "no", because the implementation is not good enough yet - it's incompatible with

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Stanislav Malyshev
Hi! > The performance effect of this implementation is terrible. > > Assignment to typed property is 2.3 times slower. > Assignment to untyped property in a class with typed properties is 1.8 times > slower. > > See the benchmark >

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
I appreciate the work done by Joe, but I vote "no", because the implementation is not good enough yet - it's incompatible with opcache (may be it's not a big problem to fix this) - typed properties assignment is going to be 2-3 times slower ($obj->x += 2; is 3 times slower) - the patch makes

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
Hi Joe, The performance effect of this implementation is terrible. Assignment to typed property is 2.3 times slower. Assignment to untyped property in a class with typed properties is 1.8 times slower. See the benchmark https://gist.github.com/dstogov/1b678712adeee51665cdd829195bb800 Thanks.

Re: [PHP-DEV] Exception::getLine()

2016-05-23 Thread Julien Pauli
On Sat, May 21, 2016 at 8:16 PM, Rasmus Schultz wrote: > Alright, so forget my comparison with other languages. > > My other points remain: > > Presently, "throw new" is treated as though it was one statement. > That's not the case. We have deferred throws and factory methods

Re: [PHP-DEV] PHP 7 CSPRNG - block on /dev/random?

2016-05-23 Thread Julien Pauli
On Sun, May 22, 2016 at 7:04 AM, Stanislav Malyshev wrote: > Hi! > >> Question: Is there a nonzero chance of a PHP application running at boot >> time on an older GNU/Linux machine? If so, should we adopt this "unseeded >> CSPRNG" mitigation employed by libsodium for ancient

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-23 Thread Dmitry Stogov
The patch "corrupts" opcache shared memory. PHP crashes with opcache.protect_memory=1. $ USE_ZEND_ALLOC=0 valgrind sapi/cli/php -d opcache.protect_memory=1 ../Zend/tests/type_declarations/typed_properties_027.php ==900== Memcheck, a memory error detector ==900== Copyright (C) 2002-2015, and GNU

Re: [PHP-DEV] base64_decode is buggy, what to fix?

2016-05-23 Thread Niklas Keller
Completely missing padding shouldn't fail, it's often removed to save space or when base64 is converted to base64url. Joe Watkins schrieb am Mo., 23. Mai 2016 06:59: > Morning, > > Would it be possible to open a PR that fixes the programming errors, > such as oob