RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-16 Thread François Laupretre
De : Netroby [mailto:hufeng1...@gmail.com] We do not have Scalar type hints for years. we code in php for years without any type check. it's ok. not the primary things. Look at other dynamic programming language, they may not have the type check either. It is ok, and it is fine.

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-15 Thread Nikita Popov
On Sun, Feb 15, 2015 at 7:43 PM, Dmitry Stogov dmi...@zend.com wrote: Hi Anthony, If you are working on JIT, you should understand that declare() switch to strict typing can't improve anything, because it works on caller side and in each function you now will have to generate code for both

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-15 Thread Anthony Ferrara
Dmitry, On Sun, Feb 15, 2015 at 1:43 PM, Dmitry Stogov dmi...@zend.com wrote: Hi Anthony, If you are working on JIT, you should understand that declare() switch to strict typing can't improve anything, because it works on caller side and in each function you now will have to generate code

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-15 Thread Pascal MARTIN, AFUP
Le 05/02/2015 21:14, Andrea Faulds a écrit : Voting starts today (2015-02-05) and ends in two weeks’ time (2015-02-19). In addition to the vote on the main RFC, there is also a vote on the type aliases issue, and a vote to reserve the type names for future RFCs’ sake if this RFC fails. The

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-15 Thread Netroby
We do not have Scalar type hints for years. we code in php for years without any type check. it's ok. not the primary things. Look at other dynamic programming language, they may not have the type check either. It is ok, and it is fine. Besides php, there be always other choice. If you really

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-14 Thread Lester Caine
On 14/02/15 01:16, Andrea Faulds wrote: - About the 'numeric' type you would introduce in a future RFC, would you (in strict mode) allow everything accepted by is_numeric() or is it just a shortcut for 'int|float’ ? The idea is just int or float (except in weak mode of course, where it needs

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Patrick ALLAERT
Le Thu Feb 05 2015 at 21:15:45, Andrea Faulds a...@ajf.me a écrit : Good evening, At long last, I’m going to put the RFC to a vote. It’s been long enough - I don’t think there needs to be, or will be, much further discussion. I’d like to make sure that everyone voting understands the RFC

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Pavel Kouřil
On Thu, Feb 12, 2015 at 3:31 PM, Andrea Faulds a...@ajf.me wrote: Hi Pavel, On 12 Feb 2015, at 13:48, Pavel Kouřil pajou...@gmail.com wrote: C# does have dynamic typing. No it doesn’t, it’s a statically-typed language. I don’t understand why you say it has dynamic typing - there is some

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Pavel Kouřil
On Thu, Feb 12, 2015 at 6:01 PM, François Laupretre franc...@tekwire.net wrote: Hi Robert, De : Robert Stoll [mailto:p...@tutteli.ch] There are several programming languages which do support dynamic typing and method overloading somehow (Clojure, Erlang, Prolog, Cecil and certainly more).

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Yasuo Ohgaki
Hi all, On Fri, Feb 13, 2015 at 6:37 PM, Patrick ALLAERT patrickalla...@php.net wrote: Voted no because of the reasons already mentioned by a bunch of others here. Weak type hint as presented earlier: +1 (and very good job Andrea about that!). declare(strict_types=1): -1, not only about

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Zeev Suraski
On 13 בפבר׳ 2015, at 13:13, Andrea Faulds a...@ajf.me wrote: Hi, On 13 Feb 2015, at 09:37, Patrick ALLAERT patrickalla...@php.net wrote: Voted no because of the reasons already mentioned by a bunch of others here. Weak type hint as presented earlier: +1 (and very good job Andrea

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Patrick ALLAERT
Le Fri Feb 13 2015 at 12:34:29, Zeev Suraski z...@zend.com a écrit : On 13 בפבר׳ 2015, at 13:13, Andrea Faulds a...@ajf.me wrote: Hi, On 13 Feb 2015, at 09:37, Patrick ALLAERT patrickalla...@php.net wrote: Voted no because of the reasons already mentioned by a bunch of others here.

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Anthony Ferrara
Zeev, On Fri, Feb 13, 2015 at 6:34 AM, Zeev Suraski z...@zend.com wrote: On 13 בפבר׳ 2015, at 13:13, Andrea Faulds a...@ajf.me wrote: Hi, On 13 Feb 2015, at 09:37, Patrick ALLAERT patrickalla...@php.net wrote: Voted no because of the reasons already mentioned by a bunch of others here.

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread François Laupretre
De : Dennis Birkholz [mailto:den...@birkholz.biz] I did not follow the DoC-discussion so far but from a quick glance at the list there are at least cases that need a further look: 1. There is no float (without !) in the list. It should be IS_LONG = yes (if value does not exceed float

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Matteo Beccati
On 13/02/2015 17:58, Matteo Beccati wrote: On 13/02/2015 17:29, Benjamin Eberlei wrote: Wait i almost forgot, it *does* have an effect on me, especially around callback handling: https://gist.github.com/schmittjoh/778e044deacc6f1fe516 Essentially callbacks are evaluated in the mode they are

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Benjamin Eberlei
: PHP Internals Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints On 02/10/2015 07:57 PM, Xinchen Hui wrote: am I wrong?! seems I am wrong with this, it's a false alarm... it can restore automatically. Yeah, declare() doesn't span files so that isn't a problem. My worry is still

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Andrea Faulds
Hi, On 13 Feb 2015, at 16:18, Benjamin Eberlei kont...@beberlei.de wrote: Wait i almost forgot, it *does* have an effect on me, especially around callback handling: https://gist.github.com/schmittjoh/778e044deacc6f1fe516 Essentially callbacks are evaluated in the mode they are

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Matteo Beccati
On 13/02/2015 17:29, Benjamin Eberlei wrote: Wait i almost forgot, it *does* have an effect on me, especially around callback handling: https://gist.github.com/schmittjoh/778e044deacc6f1fe516 Essentially callbacks are evaluated in the mode they are called in, not in the one they are defined.

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Zeev Suraski
With that said, there's nothing stopping you from putting up your time to create a competing proposal and patch. If you really believe that weak types are the better way forward, why not codify that? If only one of the RFCs passes, then you have your answer. If both pass, we can simply have

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Pierre Joye
On Sat, Feb 14, 2015 at 1:20 AM, Zeev Suraski z...@zend.com wrote: With that said, there's nothing stopping you from putting up your time to create a competing proposal and patch. If you really believe that weak types are the better way forward, why not codify that? If only one of the RFCs

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Nikita Nefedov
On 13 Feb 2015 19:37, Benjamin Eberlei kont...@beberlei.de wrote: Wait i almost forgot, it *does* have an effect on me, especially around callback handling: https://gist.github.com/schmittjoh/778e044deacc6f1fe516 Essentially callbacks are evaluated in the mode they are called in, not in

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Benjamin Eberlei
On Fri, Feb 13, 2015 at 5:59 PM, Andrea Faulds a...@ajf.me wrote: Hi, On 13 Feb 2015, at 16:18, Benjamin Eberlei kont...@beberlei.de wrote: Wait i almost forgot, it *does* have an effect on me, especially around callback handling:

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Anthony Ferrara
Zeev, On Fri, Feb 13, 2015 at 1:20 PM, Zeev Suraski z...@zend.com wrote: With that said, there's nothing stopping you from putting up your time to create a competing proposal and patch. If you really believe that weak types are the better way forward, why not codify that? If only one of the

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread Zeev Suraski
-Original Message- From: Anthony Ferrara [mailto:ircmax...@gmail.com] Sent: Friday, February 13, 2015 9:34 PM To: Zeev Suraski Cc: PHP Internals Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints Zeev, You said you disagreed with my post (meaning claims I made). I didn't ask why

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-13 Thread F N Laupretre
Hi Andrea, After carefully reading the RFC again, and despite the fact that I globally agree, here are some suggestions and comments that were not discussed yet (sorry for this huge post) : - The 'resource' hint does not exist 'as this would prevent moving from resources to objects for

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Andrea Faulds
Hi, On 12 Feb 2015, at 07:05, Pavel Kouřil pajou...@gmail.com wrote: On Thu, Feb 12, 2015 at 1:13 AM, Andrea Faulds a...@ajf.me wrote: A number (or numeric, or num, or some other name) type hint is something I plan to propose in a future, follow-up RFC. wouldn't polymorphism (via

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Dennis Birkholz
Hello François, For a set of 'extended' types like 'number', and their matching rules against zvals, this may help : https://wiki.php.net/rfc/dbc#dbc_types_vs_zval_types I did not follow the DoC-discussion so far but from a quick glance at the list there are at least cases that need a

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Zeev Suraski
@Zeev: I don't like being used, singling out only my blog post because it proves your opinion, where clearly there were other posts in favour of strict mode typing, for exampl e ircmaxell his. Benjamin, As we discussed in personal exchanges, I really don't think I 'used' you and it certainly

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Andrea Faulds
Hi Pavel, On 12 Feb 2015, at 13:48, Pavel Kouřil pajou...@gmail.com wrote: C# does have dynamic typing. No it doesn’t, it’s a statically-typed language. I don’t understand why you say it has dynamic typing - there is some limited dynamism in parts, but I don’t think it affects what we’re

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread François Laupretre
Hi, 2- Lack of numeric scalar type There're others, but these ones are keys to make them fully usable. A number (or numeric, or num, or some other name) type hint is something I plan to propose in a future, follow-up RFC. For a set of 'extended' types like 'number', and their matching

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Pavel Kouřil
On Thu, Feb 12, 2015 at 1:45 PM, Andrea Faulds a...@ajf.me wrote: Hi Pavel, C# also doesn’t have dynamic typing. Plus, adding overloading to an existing language is more difficult. C# does have dynamic typing. Adding method overloading to an existing language may be more difficult than

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Andrea Faulds
Hi Pavel, On 12 Feb 2015, at 12:39, Pavel Kouřil pajou...@gmail.com wrote: I don't see any problem with combination of optional parameters with method overloading. C# has it and it is pretty useful and works there without any bigger issues. Sure, the dynamic typing may be a (small) issue,

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Pavel Kouřil
On Thu, Feb 12, 2015 at 12:44 PM, Andrea Faulds a...@ajf.me wrote: PHP already has polymorphism through its dynamic typing. I don’t see method overloading happening any time soon. We have optional parameters and dynamic typing, which all but eliminate the main needs for overloading. We’re a

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Nikita Nefedov
Hi, 2015-02-12 18:31 GMT+04:00 Andrea Faulds a...@ajf.me: Hi Pavel, On 12 Feb 2015, at 13:48, Pavel Kouřil pajou...@gmail.com wrote: C# does have dynamic typing. No it doesn’t, it’s a statically-typed language. I don’t understand why you say it has dynamic typing - there is some

AW: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Robert Stoll
Hi François, -Ursprüngliche Nachricht- Von: François Laupretre [mailto:franc...@tekwire.net] Gesendet: Donnerstag, 12. Februar 2015 18:01 An: 'Robert Stoll'; 'Nikita Nefedov'; 'Andrea Faulds' Cc: 'Pavel Kouřil'; 'PHP Internals' Betreff: RE: [PHP-DEV] [VOTE] Scalar Type Hints Hi

AW: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Robert Stoll
-Ursprüngliche Nachricht- Von: Nikita Nefedov [mailto:inefe...@gmail.com] Gesendet: Donnerstag, 12. Februar 2015 15:54 An: Andrea Faulds Cc: Pavel Kouřil; PHP Internals Betreff: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi, 2015-02-12 18:31 GMT+04:00 Andrea Faulds a...@ajf.me

AW: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Robert Stoll
-Ursprüngliche Nachricht- Von: Andrea Faulds [mailto:a...@ajf.me] Gesendet: Donnerstag, 12. Februar 2015 17:50 An: Robert Stoll Cc: Nikita Nefedov; Pavel Kouřil; PHP Internals Betreff: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hey Robert, On 12 Feb 2015, at 16:15, Robert Stoll p

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-12 Thread Andrea Faulds
Hey Robert, On 12 Feb 2015, at 16:15, Robert Stoll p...@tutteli.ch wrote: There are several programming languages which do support dynamic typing and method overloading somehow (Clojure, Erlang, Prolog, Cecil and certainly more). Most of them use a multi-method approach and I think if

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Andrea Faulds
Hi Pavel, On 11 Feb 2015, at 07:41, Pavel Kouřil pajou...@gmail.com wrote: Also, I realized one thing why I think the strict version is a bad idea for PHP (in the state PHP is now - in an ideal world I would love to have nothing but strongly typed PHP, but that's offtopic) - PHP has many

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Andrea Faulds
Hi Rasmus, On 11 Feb 2015, at 06:36, Rasmus Lerdorf ras...@lerdorf.com wrote: And in Drupal8 *without turning on strict*: use Drupal\Component\Utility\String; it dies with: Fatal error: string cannot be used as a class name in /var/www/drupal/core/includes/bootstrap.inc on line 11

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Zeev Suraski
-Original Message- From: Rasmus Lerdorf [mailto:ras...@lerdorf.com] Sent: Wednesday, February 11, 2015 8:37 AM To: Xinchen Hui; Andrea Faulds Cc: PHP Internals Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints On 02/10/2015 07:57 PM, Xinchen Hui wrote: am I wrong?! seems I am

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Rowan Collins
On 11 February 2015 06:36:52 GMT, Rasmus Lerdorf ras...@lerdorf.com wrote: And in Drupal8 *without turning on strict*: use Drupal\Component\Utility\String; it dies with: Fatal error: string cannot be used as a class name in /var/www/drupal/core/includes/bootstrap.inc on line 11 That

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Andrea Faulds
On 11 Feb 2015, at 21:30, Zeev Suraski z...@zend.com wrote: -Original Message- From: Rasmus Lerdorf [mailto:ras...@lerdorf.com] Sent: Wednesday, February 11, 2015 8:37 AM To: Xinchen Hui; Andrea Faulds Cc: PHP Internals Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints On 02/10

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Zeev Suraski
Faulds *Cc:* Zeev Suraski; Rasmus Lerdorf; PHP Internals *Subject:* Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi all, @Zeev and @Rasmus: Seriously, you both mentioned that consider the idea of scalar type hint, but I've never seen which idea would you consider. Andrea built a very flexible way

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Lester Caine
On 11/02/15 21:46, Andrea Faulds wrote: Anthony Ferrara also had his own analysis which showed some of the problems with weak type hinting, and where strict types can be beneficial: http://blog.ircmaxell.com/2015/02/scalar-types-and-php.html What is the point of using a 'Better static

Fwd: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Benjamin Eberlei
Forarding again, was rejected by the list because of spammy links :( -- Forwarded message -- From: Benjamin Eberlei kont...@beberlei.de Date: Thu, Feb 12, 2015 at 12:59 AM Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints To: Andrea Faulds a...@ajf.me Cc: Zeev Suraski z...@zend.com

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Rowan Collins
On 11 February 2015 22:41:21 GMT, Lester Caine les...@lsces.co.uk wrote: On 11/02/15 21:46, Andrea Faulds wrote: Anthony Ferrara also had his own analysis which showed some of the problems with weak type hinting, and where strict types can be beneficial:

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Andrea Faulds
Hey Guilherme, On 11 Feb 2015, at 22:46, guilhermebla...@gmail.com wrote: @Andrea: I spent around 2-3 hours speaking with Anthony and the other half talking to Jordi (Composer, Symfony). I still think a few things are required to be fully usable. 1- Exceptions RFC (outside of your scope,

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Sebastian B.-Hagensen
Hi, 2015-02-12 0:08 GMT+01:00 Zeev Suraski z...@zend.com: It gives the exact same value from an API author’s point of view. But not from an api-consumers point of view. Without either introducing a new set of casting/conversion rules or changing existing behavior (**exclusively**) 'weak'

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Pavel Kouřil
On Thu, Feb 12, 2015 at 1:13 AM, Andrea Faulds a...@ajf.me wrote: A number (or numeric, or num, or some other name) type hint is something I plan to propose in a future, follow-up RFC. Hello, wouldn't polymorphism (via method overloading) solve the use cases and be much more useful in the

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Nikita Nefedov
On 11 Feb 2015 09:38, Rasmus Lerdorf ras...@lerdorf.com wrote: On 02/10/2015 07:57 PM, Xinchen Hui wrote: am I wrong?! seems I am wrong with this, it's a false alarm... it can restore automatically. Yeah, declare() doesn't span files so that isn't a problem. My worry is still the lack

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-11 Thread Zeev Suraski
-Original Message- From: Sebastian B.-Hagensen [mailto:sbj.ml.r...@gmail.com] Sent: Thursday, February 12, 2015 2:11 AM To: Zeev Suraski Cc: guilhermebla...@gmail.com; Rasmus Lerdorf; PHP Internals Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi, 2015-02-12 0:08 GMT+01:00 Zeev

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Xinchen Hui
Hey: On Wed, Feb 11, 2015 at 11:36 AM, Xinchen Hui larue...@php.net wrote: Hey: On Fri, Feb 6, 2015 at 4:14 AM, Andrea Faulds a...@ajf.me wrote: Good evening, At long last, I’m going to put the RFC to a vote. It’s been long enough - I don’t think there needs to be, or will be, much

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Xinchen Hui
Hey: On Fri, Feb 6, 2015 at 4:14 AM, Andrea Faulds a...@ajf.me wrote: Good evening, At long last, I’m going to put the RFC to a vote. It’s been long enough - I don’t think there needs to be, or will be, much further discussion. I’d like to make sure that everyone voting understands the

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Xinchen Hui
Hey: On Wed, Feb 11, 2015 at 11:45 AM, Xinchen Hui larue...@php.net wrote: Hey: On Wed, Feb 11, 2015 at 11:36 AM, Xinchen Hui larue...@php.net wrote: Hey: On Fri, Feb 6, 2015 at 4:14 AM, Andrea Faulds a...@ajf.me wrote: Good evening, At long last, I’m going to put the RFC to a vote.

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Matt Ficken
FYI, the patch doesn't cause a performance regression. I built on and tested with IIS/Windows. Performance remains the same for Wordpress, Symfony and Joomla. Mediawiki actually increased slightly (5%), so performance is increase/decrease is not an issue here, the language and engine are. If

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Pierre Joye
On Tue, Feb 10, 2015 at 4:56 PM, Dmitry Stogov dmi...@zend.com wrote: If you measure performance impact using CPU performance counters (VTune, oprofile, perf) or even better CPU emulator (callgrind) you'll see slight degradation. It's also clear that it makes some degradation from code review.

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Dmitry Stogov
If you measure performance impact using CPU performance counters (VTune, oprofile, perf) or even better CPU emulator (callgrind) you'll see slight degradation. It's also clear that it makes some degradation from code review. 1% difference is invisible because measurement mistake is usually bigger

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Pavel Kouřil
On Wed, Feb 11, 2015 at 7:36 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 02/10/2015 07:57 PM, Xinchen Hui wrote: am I wrong?! seems I am wrong with this, it's a false alarm... it can restore automatically. Yeah, declare() doesn't span files so that isn't a problem. My worry is still

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Rasmus Lerdorf
On 02/10/2015 07:57 PM, Xinchen Hui wrote: am I wrong?! seems I am wrong with this, it's a false alarm... it can restore automatically. Yeah, declare() doesn't span files so that isn't a problem. My worry is still the lack of type coercion for internal calls. I tested it on some apps and it

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Dmitry Stogov
This is definitely not a blocker. Slight degradation is caused by additional checks on each function call. Anyway, it's an issue that would be geat to fix. Thanks. Dmitry. On Mon, Feb 9, 2015 at 11:17 AM, Pierre Joye pierre@gmail.com wrote: On Mon, Feb 9, 2015 at 3:04 PM, Dmitry Stogov

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Benjamin Coutu
: [PHP-DEV] [VOTE] Scalar Type Hints On Sun, Feb 8, 2015 at 3:22 PM, Zeev Suraski z...@zend.com wrote: I'm well aware of it as I wrote that policy. The goal of the policy was to prevent a situation where a temporary majority can introduce features into the language that would later

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Zeev Suraski
-Original Message- From: Andrea Faulds [mailto:a...@ajf.me] Sent: Monday, February 09, 2015 12:44 PM To: Zeev Suraski Cc: Jordi Boggiano; internals@lists.php.net Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi, On 9 Feb 2015, at 03:48, Zeev Suraski z...@zend.com wrote

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Matteo Beccati
On 09/02/2015 15:50, Pierre Joye wrote: On Feb 9, 2015 8:52 PM, Sebastian Bergmann sebast...@php.net wrote: then the corresponding check must be strict. But since that strictness does not align with the spirit of PHP I much rather have no support for scalars than one that is not strict.

RE: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Feb 10, 2015 12:03 AM, Zeev Suraski z...@zend.com wrote: -Original Message- From: Andrea Faulds [mailto:a...@ajf.me] Sent: Monday, February 09, 2015 12:44 PM To: Zeev Suraski Cc: Jordi Boggiano; internals@lists.php.net Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Lars Strojny
Hi Matteo, sorry for the late response. On 07 Feb 2015, at 12:46, Matteo Beccati p...@beccati.com wrote: Maybe it's just me, but I didn't quite understand the point you are making here. Are you saying that declares are more or less like ini settings? Yes, exactly that. The new

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread André Rømcke
On 09 Feb 2015, at 19:24 , guilhermebla...@gmail.com wrote: Hi Andrea, I totally see your viewpoint. That's why initially I voted YES, because your proposal somehow makes sense. My when I thought over and use a weak/strict boolean type conversion on my own brain, I came to the conclusion

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Arvids Godjuks
I actually have a question, that Ferenc touched on, but it never got any discussion. How, actually, the declare will work with concatenated PHP files? It's quite a common practice to put the files into packages, that require minimal amounts of includes for performance reasons. Declare is required

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Mon, Feb 9, 2015 at 3:02 PM, Arvids Godjuks arvids.godj...@gmail.com wrote: I actually have a question, that Ferenc touched on, but it never got any discussion. How, actually, the declare will work with concatenated PHP files? It's quite a common practice to put the files into packages,

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Dmitry Stogov
this is more or less true. :( The proposal is presented in an unfair way to include strict typing without the ability to vote for weak types only. Despite of semantic arguments, the implementation is a bit immature and introduces slowdown for any code without type hints. Thanks. Dmitry. On

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Mon, Feb 9, 2015 at 3:04 PM, Dmitry Stogov dmi...@zend.com wrote: this is more or less true. :( The proposal is presented in an unfair way to include strict typing without the ability to vote for weak types only. Despite of semantic arguments, the implementation is a bit immature and

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pavel Kouřil
On Mon, Feb 9, 2015 at 9:04 AM, Dmitry Stogov dmi...@zend.com wrote: this is more or less true. :( The proposal is presented in an unfair way to include strict typing without the ability to vote for weak types only. Despite of semantic arguments, the implementation is a bit immature and

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Mon, Feb 9, 2015 at 3:19 PM, Pavel Kouřil pajou...@gmail.com wrote: On Mon, Feb 9, 2015 at 9:04 AM, Dmitry Stogov dmi...@zend.com wrote: this is more or less true. :( The proposal is presented in an unfair way to include strict typing without the ability to vote for weak types only.

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pavel Kouřil
On Mon, Feb 9, 2015 at 9:22 AM, Pierre Joye pierre@gmail.com wrote: I am not saying I want one or the other (I have voted and now only focus on solving possible tech issues we may find) but trying to be fair with Andrea's RFC and amazing effort: What you ask is basically part of the RFC

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Mon, Feb 9, 2015 at 3:30 PM, Pavel Kouřil pajou...@gmail.com wrote: On Mon, Feb 9, 2015 at 9:22 AM, Pierre Joye pierre@gmail.com wrote: I am not saying I want one or the other (I have voted and now only focus on solving possible tech issues we may find) but trying to be fair with

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrey Andreev
Hi, On Mon, Feb 9, 2015 at 7:22 PM, Jordi Boggiano j.boggi...@seld.be wrote: And that is exactly why this RFC is great, since it lets the strict-proponents have their strict types in their files, but those preferring weak ones can remain in the default weak mode, never see an ugly declare(),

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread guilhermebla...@gmail.com
Hi, I read again and again the RFC and I just decided to switch my vote. Originally a YES voter, I'm now a NO voter. I still want strict types to exist in PHP, and not only at the end-user level, but also at the internals level (I can see so many optimizations around...). However, I think it's

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrea Faulds
Hi Zeev, On 9 Feb 2015, at 17:03, Zeev Suraski z...@zend.com wrote: I'll make an absolute last attempt to explain what I'm saying, after that we can agree to disagree. We probably interpret the same facts differently. Fact is, there were very few people who said that weak types are

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread guilhermebla...@gmail.com
Hi Andrea, I totally see your viewpoint. That's why initially I voted YES, because your proposal somehow makes sense. My when I thought over and use a weak/strict boolean type conversion on my own brain, I came to the conclusion my real wish does not get fully addressed with a YES, leading me to

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Philip Sturgeon
On Mon, Feb 9, 2015 at 1:22 PM, Lars Strojny l...@strojny.net wrote: Hi Matteo, sorry for the late response. On 07 Feb 2015, at 12:46, Matteo Beccati p...@beccati.com wrote: Maybe it's just me, but I didn't quite understand the point you are making here. Are you saying that declares are

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrea Faulds
Hi, On 9 Feb 2015, at 18:22, Lars Strojny l...@strojny.net wrote: On 07 Feb 2015, at 12:46, Matteo Beccati p...@beccati.com wrote: Maybe it's just me, but I didn't quite understand the point you are making here. Are you saying that declares are more or less like ini settings? Yes,

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Philip Sturgeon
On Mon, Feb 9, 2015 at 12:03 PM, Zeev Suraski z...@zend.com wrote: -Original Message- From: Andrea Faulds [mailto:a...@ajf.me] Sent: Monday, February 09, 2015 12:44 PM To: Zeev Suraski Cc: Jordi Boggiano; internals@lists.php.net Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints Hi

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrea Faulds
Hi Guilherme, On 9 Feb 2015, at 18:12, guilhermebla...@gmail.com wrote: I read again and again the RFC and I just decided to switch my vote. Originally a YES voter, I'm now a NO voter. I still want strict types to exist in PHP, and not only at the end-user level, but also at the internals

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Jordi Boggiano
On 09/02/2015 17:03, Zeev Suraski wrote: Fact is, there were very few people who said that weak types are *bad* (although Sebastian seems to fall in that category). The vast majority of feedback that 'opposed' weak typing, didn't really oppose weak typing at all. What it opposed was, rather,

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrea Faulds
Hi, On 9 Feb 2015, at 03:48, Zeev Suraski z...@zend.com wrote: A - has pretty much everybody agreeing with is a good idea. Nobody objects to it. It's under consensus. This isn't true. I've explained why it isn't true several times. Maybe you are suffering from confirmation bias or

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andrea Faulds
Hi, On 9 Feb 2015, at 08:04, Dmitry Stogov dmi...@zend.com wrote: this is more or less true. :( The proposal is presented in an unfair way to include strict typing without the ability to vote for weak types only. Oddly, nobody seems to complain that it's unfair if I side with the weak

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Lester Caine
On 09/02/15 10:44, Andrea Faulds wrote: There is no consensus whatsoever. To suggest there is would be to grossly exaggerate. I am just happy that to force change through a 2/3rds majority is required. If there was a consensus then the debate would not have been so extensive, but while the

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pascal MARTIN
Le 05/02/2015 21:14, Andrea Faulds a écrit : At long last, I’m going to put the RFC to a vote. It’s been long enough - I don’t think there needs to be, or will be, much further discussion. I’d like to make sure that everyone voting understands the RFC fully. Please read the RFC in full: the

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Andi Gutmans
On Feb 7, 2015, at 7:52 PM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 02/07/2015 09:51 PM, Andrea Faulds wrote: tan(1); echo strstr(test, est, 1); Banning int-float and float-int is both a pain point and sometimes a life-saver. It’s annoying that tan(1) doesn’t work. On the other

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Sebastian Bergmann
Am 07.02.2015 um 02:08 schrieb Sebastian Bergmann: After reading your email, Nikita, I deleted my vote (it was no before). I will review the RFC again, with your arguments (and others) in mind and maybe I'll come to a different conclusion. I have voted (no) again. I still think that if we

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Umberto Salsi
a...@ajf.me (Andrea Faulds) wrote: * Always allowing implicit conversions from int to float is sometimes going to cause data loss, so it may also be reasonable for PHP to prevent this specific case IMHO, automatic conversion int -- float is perfectly reasonable because: 1) int can always be

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Ivan Enderlin @ Hoa
Hello internal, Thank you Andrea for this RFC. I voted today. However, I would like to stress that my vote represents the opinion of Hoa's community [1] and fruux [2] (the company behind sabre/dav [3]). I talked to Pierre Joye today and I was mentioning this is something we do since few

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Feb 9, 2015 8:52 PM, Sebastian Bergmann sebast...@php.net wrote: Am 07.02.2015 um 02:08 schrieb Sebastian Bergmann: After reading your email, Nikita, I deleted my vote (it was no before). I will review the RFC again, with your arguments (and others) in mind and maybe I'll come to a

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Sebastian Bergmann
Am 09.02.2015 um 15:50 schrieb Pierre Joye: Not strict? You loose me here. I want support for scalar types in signatures. I want these type declarations to be strictly enforced. This is not wanted and not proposed by the RFC. Hence my vote. -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread Pierre Joye
On Feb 10, 2015 1:22 AM, Lars Strojny l...@strojny.net wrote: Hi Matteo, sorry for the late response. On 07 Feb 2015, at 12:46, Matteo Beccati p...@beccati.com wrote: Maybe it's just me, but I didn't quite understand the point you are making here. Are you saying that declares are more

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-09 Thread André Rømcke
On 09 Feb 2015, at 16:04 , Sebastian Bergmann sebast...@php.net wrote: Am 09.02.2015 um 15:50 schrieb Pierre Joye: Not strict? You loose me here. I want support for scalar types in signatures. I want these type declarations to be strictly enforced. This is not wanted and not proposed by

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-08 Thread Pavel Kouřil
On Sat, Feb 7, 2015 at 11:11 PM, Andrea Faulds a...@ajf.me wrote: Hi, On 7 Feb 2015, at 22:03, Pavel Kouřil pajou...@gmail.com wrote: Yeah, but you say in the RFC that With this approach, an argument is only accepted if its type is exactly the same as the parameter. when speaking about C#

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-08 Thread Nikita Popov
On Sun, Feb 8, 2015 at 3:38 AM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 02/07/2015 05:03 PM, Pavel Kouřil wrote: I'm wishing more and more that the RFC doesn't pass (even though I'd LOVE to have typehints in PHP as a userland developer) and someone else will make a better version of

AW: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-08 Thread Robert Stoll
-Ursprüngliche Nachricht- Von: Rasmus Lerdorf [mailto:ras...@lerdorf.com] Gesendet: Sonntag, 8. Februar 2015 04:53 An: Andrea Faulds Cc: Pavel Kouřil; PHP Internals Betreff: Re: [PHP-DEV] [VOTE] Scalar Type Hints On 02/07/2015 09:51 PM, Andrea Faulds wrote: tan(1); echo

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-08 Thread Jordi Boggiano
On 07/02/2015 01:08, Sebastian Bergmann wrote: On 02/06/2015 10:22 PM, Nikita Popov wrote: After much initial reluctance, I've voted in favor of this RFC. After reading your email, Nikita, I deleted my vote (it was no before). I will review the RFC again, with your arguments (and others)

  1   2   >