[PHP-DEV] Re: PHP 7.1.0alpha1 is available for testing

2016-06-11 Thread Jan Ehrhardt
Davey Shafik in php.internals (Sat, 11 Jun 2016 11:38:00 +0100):
>Please test it carefully, and report any bugs in the bug system.
>Alpha 2 will be tagged on Tuesday June 21st and released on Thursday June
>23rd.

https://bugs.php.net/bug.php?id=72384
-- 
Jan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Simple Annotations

2016-06-11 Thread Rasmus Schultz
So this thread kind of died, apparently mostly due to some concerns about
possible side-effects.

I would just like to point out one thing: when it comes to
metadata/annotations, whatever you come up with, even if it's something
that allows only constant expressions and simple data-structures, as
opposed to classes, what's going to happen - like, immediately - is someone
will figure out how to map it to classes.

The thing is that, even if annotations are simple data attached to
source-code elements, someone is going to need/want things like range and
type validations for those annotations and their attributes - essentially
the only way to get that, is with code, and the most obvious way to do
that, is map annotations to classes, which is basically what every userland
annotation project is doing.

I maintain the position that simply allowing arbitrary expressions as
annotations is the simplest, most direct way to this feature.

Whatever you come up with that is more restrictive, someone will simply
figure out how to map that to the thing they really wanted, which is
objects - and then you have all the same problems and risks of
global/mutable state, side-effects, etc.

Anything directly or indirectly executable is going to allow you to create
those problems - presently that is true everywhere in PHP, literally for
everything, including files, classes, functions, even expressions can have
side-effects.

Inventing a more restrictive form of annotations will only make the road
longer and more confusing - it won't remove those risks or solve those
problems. The only real solution to those problems, is teach people how to
program.

Another concern was about optional dependency on classes for annotations.
Again, that's going to happen when people figure out how to map a more
restrictive feature to classes - and in either case, if you could somehow
ignore annotations that fail to initialize because of a missing dependency,
that would be a very bad idea; quietly ignoring a missing class would
create very strange and difficult debugging situations.

I think that this problem is exaggerated. Needing to include the
annotations you actually use is hardly a roadblock to anything. Leaving out
dependencies would be as strange to me as allowing the extends or
implements keyword to ignore a missing interface or base class. I simply
don't see the usefulness, and can only see that turning into a real
debugging nightmare.

I think that, given how simple this proposed feature really is, it's really
not likely to generate a lot of surprises for anyone - I mean, we're used
to the fact that new Foo() fails if the class Foo does not exist. In fact,
it would be a lot more surprising if you had to explain why that wasn't the
case. We're also used to the fact that such expressions fail not when
they're loaded, but when they're evaluated - like when you run a method.
That's not surprising at all.

I think that this feature is really very simple, in every sense of the word
- it's easy to explain, there are very few rules and no real surprises, it
just basically lets you insert a list of values or objects defined using
simple everyday PHP expressions, which behave, for better or for worse,
like they do every day.

I wish you wouldn't shoot down this feature on the basis of some missing
language qualities you seem to be seeking - if PHP someday supports
immutable objects, or functions without side-effects, annotations would
immediately support those too. At the moment, it does not, and I don't
believe it's going to be even the least bit surprising that annotations
don't have those language qualities either.

Nor do I think people are going to do "evil" with it - I think that for
example Symfony annotations, or annotations in C#, have all of the same
problems, just like any language with global and mutable state, and people
are quite happy and productive using them anyway.

I think that there is real value to having a very simple feature that
leverages the language as-is instead of inventing new, special syntax,
restrictions or limitations, and I'd be much less worried about "evil"
somebody might do with that, and more excited to see the interesting and
clever things people would come up with.

It seemed like there was some initial excitement about this idea.

I'm not opposed to developing the idea further, if there's any interest.
For example, one possible idea would be to allow object constructions only:

class User {
<< Length(20) >>
public $email;
}

This creates a limitation, but covers the most popular use-case of object
annotations, and that limitation would enable a reflection reader along the
lines of:

$annotations =
$reflection->getProperty("email")->getAnnotations(User::class);

This differs from what I previously proposed, since you are now required to
ask specifically for one type of annotation, which means you can have
"optional" annotations - just check first, e.g. if

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

2016-06-11 Thread Thomas Bley
Hi,

what about having "strict classes"?
A strict class would be like a database table, each property defined must have 
a type.
Each property defined must be initialized before being accessed, or have a 
default value.

e.g.
strict class Foo {
public int $id;
public bool $enabled;
public DateTime $created;
}

Regards
Thomas

Dmitry Stogov wrote on 10.06.2016 14:37:

> Hi,
> 
> 
> I hardly worked on implementation of this patch for a week, but I still don't
> like it.
> 
> It makes 15% slowdown on each property update in existing PHP code (without
> types), and I don't see a way to improve this.
> 
> Update of typed properties is going to be even more expensive.
> 
> Benchmark results are included into RFC (and not changed with the latest
> version of the patch).
> 
> 
> -1.
> 
> 
> Thanks. Dmitry.
> 
> 
> From: Joe Watkins 
> Sent: Friday, June 10, 2016 1:38:04 PM
> To: PHP internals; Phil Sturgeon
> Subject: [PHP-DEV] [RFC][Vote] Typed Properties
> 
> Afternoon internals,
> 
>The vote for typed properties has been restarted.
> 
>Please take part: https://wiki.php.net/rfc/typed-properties
> 
> Cheers
> Joe
> 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] PHP 7.1.0alpha1 is available for testing

2016-06-11 Thread Jan Ehrhardt
Remi Collet in php.internals (Sat, 11 Jun 2016 17:15:24 +0200):
>Le 11/06/2016 à 12:38, Davey Shafik a écrit :
>> The first alpha for 7.1.0 was just released and can be downloaded from:
>
>I have already built RPM of this version [1] + compatible extensions [2].
>
>From my list all extensions compatible with PHP 7.0 are ready for PHP
>7.1 (some need git snapshot, some have pending PR), excepted "taint"
>(I'm quite sure Laruence will fix it soon).

How about pthreads, swoole and yaf?

Probably you know best, but isn't ssh2 ready for PHP7+?
http://git.php.net/?p=pecl/networking/ssh2.git;a=summary

couchbase 2.2.0beta3 has some troubles with xdebug (on Windows). I will
have to find out what causes this.
-- 
Jan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] [RFC DISCUSSION] Error Storage Behavior

2016-06-11 Thread Fleshgrinder
Currently error_get_last() always contains the last error that occurred,
however, this is actually not desired if the last error was an exception
that was caught.

https://github.com/php/php-src/pull/1936

With the above change only uncaught exceptions are retrievable via
error_get_last(). This is consistent with the behavior of custom error
handlers that successfully handle the error; they are not retrievable
via error_get_last(0.

Note that this change is a breaking change since users might rely on
exactly this behavior. However, it is undocumented and there is a bug
report for it too:

https://bugs.php.net/bug.php?id=54043

-- 
Richard "Fleshgrinder" Fussenegger



signature.asc
Description: OpenPGP digital signature


[PHP-DEV] Request for Karma

2016-06-11 Thread Fleshgrinder
I would like to request Karma for the Wiki.

I would like to write RFCs for the features that I develop and help
others with their RFCs.

My Wiki username is "fleshgrinder".

-- 
Richard "Fleshgrinder" Fussenegger



signature.asc
Description: OpenPGP digital signature


Re: [PHP-DEV] PHP 7.1.0alpha1 is available for testing

2016-06-11 Thread Remi Collet
Le 11/06/2016 à 12:38, Davey Shafik a écrit :
> Hi,
> 
> The first alpha for 7.1.0 was just released and can be downloaded from:


I have already built RPM of this version [1] + compatible extensions [2].

From my list all extensions compatible with PHP 7.0 are ready for PHP
7.1 (some need git snapshot, some have pending PR), excepted "taint"
(I'm quite sure Laruence will fix it soon).


Remi.



[1] http://blog.remirepo.net/post/2016/06/10/PHP-7.1-as-Software-Collection
[2] http://blog.remirepo.net/pages/PECL-extensions-RPM-status



signature.asc
Description: OpenPGP digital signature


[PHP-DEV] [RFC DISCUSSION] var_type

2016-06-11 Thread Fleshgrinder
I changed my initial proposal for typeof() to var_type() and would like
to start the discussion on it:

https://github.com/php/php-src/pull/1935

The functionality is straight forward.
-- 
Richard "Fleshgrinder" Fussenegger



signature.asc
Description: OpenPGP digital signature


Re: [PHP-DEV] [RFC] [VOTE] Replace "Missing argument" warning with "Too few arguments" exception

2016-06-11 Thread Fleshgrinder
On 6/6/2016 12:01 PM, Rowan Collins wrote:
> I don't have a vote, but if I did I would vote against making this
> change in a minor release.
> 
> The release process RFC [1] says that for a release such as 7.1
> "Backward compatibility must be kept". This RFC gives no justification
> for being an exception to this rule, simply acknowledging that it is a
> deliberate break in compatibility.
> 
> It's a shame it didn't make it for 7.0, but in my opinion, this should
> now wait for 8.0.
> 
> [1] https://wiki.php.net/rfc/releaseprocess
> 
> Regards,

I completely agree. The policies are completely unclear. We have patch
and minor releases with BCs and at the same time clean-up of various
stuff is forbidden because of possible BCs in the next major version.
This makes absolutely no sense!

-- 
Richard "Fleshgrinder" Fussenegger



signature.asc
Description: OpenPGP digital signature


Re: [PHP-DEV] [RFC] Throw Exception on Attempt of Constant Redefinition

2016-06-11 Thread Fleshgrinder
On 6/10/2016 10:06 PM, Dmitry Stogov wrote:
> Hi internals,
> 
> 
> Please review: https://wiki.php.net/rfc/constant_redefinition
> 
> 
> Thanks. Dmitry.
> 

This would be a breaking change in a minor release again.

-1

However +1 for PHP 8.

-- 
Richard "Fleshgrinder" Fussenegger



signature.asc
Description: OpenPGP digital signature


[PHP-DEV] Re: PHP 7.1.0alpha1 is available for testing

2016-06-11 Thread Jan Ehrhardt
Davey Shafik in php.internals (Sat, 11 Jun 2016 11:38:00 +0100):
>The first alpha for 7.1.0 was just released and can be downloaded from:
>
>https://downloads.php.net/~krakjoe/

Congrats.

>The Windows binaries are available at
>
>http://windows.php.net/qa/

I have built the NTS versions with a lot of non-core extensions. For those
that want to test those:

https://phpdev.toolsforresearch.com/php-7.1.0alpha1-nts-Win32-VC14-x86.htm
https://phpdev.toolsforresearch.com/php-7.1.0alpha1-nts-Win32-VC14-x86.zip
https://phpdev.toolsforresearch.com/php-7.1.0alpha1-nts-Win32-VC14-x64.htm
https://phpdev.toolsforresearch.com/php-7.1.0alpha1-nts-Win32-VC14-x64.zip
They are built with OpenSSL 1.0.2h Fips, but that should not make a
difference.
-- 
Jan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] PHP 7.1.0alpha1 is available for testing

2016-06-11 Thread Davey Shafik
Hi,

The first alpha for 7.1.0 was just released and can be downloaded from:

https://downloads.php.net/~krakjoe/

The Windows binaries are available at

http://windows.php.net/qa/

This is the first minor release in the 7.x series, and we look forward
to a successful and smooth release process. However, 7.x is still very
new and we have lots of large features dropping in this release.

Please test it carefully, and report any bugs in the bug system.
Alpha 2 will be tagged on Tuesday June 21st and released on Thursday June
23rd.

Below is the verification information for the downloads:

php-7.1.0alpha1.tar.bz2
SHA256 hash:
d7ee8508d4699b6bc010200d91402249b808844cabe48c354ef870d3b485
PGP signature:
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAABCAAGBQJXVzcBAAoJEJZAoYTDlTxVzvQQAMmBk56p7HktmxEIqk4LwYY/
0Q3jcxv83SYJbztjzu+Nks4iclj5+xBbnVJn7TyZ7idiR8UGT0iT1Aj18DmK2j86
2MYe/qVPHGazhK1rTJObVhLjCbs+mByk9pL28j2sor55zvVv9P6g03Rqbper2Ics
HPwf4pIXNACXfOc6nlY2J2I0u2BK5McUyvG4+Dg6u2xUIY81YArQj+SSBhQJ5Kk6
c3+zU6+nrFgbS+5T4IQ4Tjc9UWrjvpvS+E9SA6v/pERGqeMl80LDbYFQ9yJb+gAP
RpC+xSo9cKfNj1YugneclGm8VNHwKtKADlja45skJ94deAvi94UbTx4vbQiG80uv
iK+8qcqBH4Eq2vm2a855iaNVP+LFVkN5hPL33Jn7AhQsyesg99jPogQzSoXAsrfj
4/tdsvIpmMDe3o3zRpMZWDo0H+mbLun4VrQk1vlPPmNfFWjAuxD9sHILYREOVb0H
Yxkm5GanB9oyAGEMBK+Ao18c0amy2ZOT/9SMyQlbsex7n13fY4KcupDc2AuCiFS6
bXXjeLvMuvxr0iMwGSD2PjnptW1hSS1rrZmkzs3R4Iv19gqZln+5MoiPU5jhTcv2
eUw321jO1mJnk5bv97yjT0TyGUWyGmZodfmyjMOtmDtLAUz7Z/gzT0wgEPSHzNPE
4eFlXnU9iMr8g+2EjR05
=hk1N
-END PGP SIGNATURE-


php-7.1.0alpha1.tar.gz
SHA256 hash:
0939678fccf91013b0a9e238b58a4766b27d2ecb78f7dc5d25b478482eab127a
PGP signature:
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAABCAAGBQJXVzcGAAoJEJZAoYTDlTxVP4IP/jdb2XzmoNKy1eGfOlGUtpkv
1hR4IykL02K7klEcCvG156ekIx3KdATkFfh1PA3/zlFQqt3q+Jn6VaXu9h+/IxPi
asJIm4gdk5dXBm3om6AWeX3Sk01hwnXClb1BDYT8c51MeW2rUROK60mvB/VKCOQb
zhcsrUeQggbBAWsS5m/eoJxkM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e3gBKVVmEM+7FFTB1Zjct3v8UxmuoxV
jJ2wEvFsz11fUfMutUYc3PqBREIX1Dffw7j4UsKLy4k8yGeeSTO3pR40NPyTKUTj
qtvblo35SmbtCDIxYVqDr0VC6Tmw+cSYL2uUzdoJO4wgcpNS+1HsWZ6nw0mL8XdW
/hvvdhZYrX4FUiNWbn58nI3W9CW+wOaWZbYe+crrcB20Z0HfCWCyTz7X5Unasqrh
EfMQIKN5l67Pg9ppjFuR/9ZwDgx1USUUUyhj+/rOfAwh9ravM+ZntoGvcMJg9eGQ
bDLUW9lhi6HkFUvP2WUX
=5MUa
-END PGP SIGNATURE-


Re: [PHP-DEV] [RFC] Throw Exception on Attempt of Constant Redefinition

2016-06-11 Thread Xinchen Hui
Hey:

On Sat, Jun 11, 2016 at 4:06 AM, Dmitry Stogov  wrote:

> Hi internals,
>
>
> Please review: https://wiki.php.net/rfc/constant_redefinition


we could also change the

#define DEFAULT_OPTIMIZATION_LEVEL  "0x7FFFBFFF" (introduced in
https://github.com/php/php-src/commit/40702799b5f08b093477098881b6e0cfcb3ea411
)

to  -1

I think it's better also include this into the patch?

thanks

>
>
> Thanks. Dmitry.
>



-- 
Xinchen Hui
@Laruence
http://www.laruence.com/