Re: [PHP-DEV] Re: [RFC] Named parameters

2013-09-11 Thread Andrea Faulds
and $url pick up those named arguments. Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
and replies on it would also be sent to the mailing list in the appropriate format, so that people reading the mailing list could still see what was going on. Thoughts? -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
! So we should add that stuff to news.php.net, then? I suppose it would be nice to be able to reply directly from there, too, then. Sending an email or posting in a newsgroup can't be very hard from PHP, I'd imagine... -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
comments: now the most useful, and (hopefully) least absolutely terrible ideas security-wise are the top. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
moderation by the community. Nobody is muted or banned, but bad ideas or troll posts get downvoted to the bottom, whilst good ideas get upvoted to the top. Hacker News, in particular, has some very good discussions. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
with the downside of people downvoting different opinions, it would still be worth it, I think, because of how it could deal with trolls. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
to create a new community. Please read the backlog. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
assume PHP4? I'm editing it right now. Not sure why you can't find it, here: https://git.php.net/?p=web/news.git or https://github.com/php/web-news -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
can use the development server to debug it. Now that I've done that, I think I'll get started on making news.php.net build up a database of post relations so it can do a hierarchical view. Andrea Faulds is it ok to contact you off list for this on monday? Sure thing. -- Andrea Faulds http

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
On 11/09/2013 19:20, Rasmus Lerdorf wrote: On 09/11/2013 10:39 AM, Andrea Faulds wrote: You are free to set up a forum somewhere and discuss anything you want, but internals as a mailing list is not going anywhere, sorry. -Rasmus Perhaps you didn't read my replies, or I didn't make myself

Re: [PHP-DEV] Forum software

2013-09-11 Thread Andrea Faulds
the mailing list directly, but could also look at the web view with its hierarchical format and upvotes and downvotes. It also means people could use the web interface exclusively if they wished. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] partnership issue

2013-09-12 Thread Andrea Faulds
feel free? Hope for the fruitful cooperation, I don't. Best regards, Robert Froslev, http://www.webhosting-hotel.com/ Go away, Andrea Faulds, http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Withdrawn ircmaxell RFCs

2013-09-16 Thread Andrea Faulds
withdrawn them, would it be possible to pick up the RFC(s) where he left off? Would I have to ask his permission for that? Is there a process for this? Thanks in advance. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] Withdrawn ircmaxell RFCs

2013-09-17 Thread Andrea Faulds
On 17/09/2013 00:14, Pierre Joye wrote: Not really, and just take what you wish. I have a wiki account and I can edit RFCs. Could I edit, say, the Function Autoloading one to non-Withdrawn and add myself to the Authors, then announce it here? Thanks! -- Andrea Faulds http://ajf.me

Re: [PHP-DEV] Getting SG(request_info).post_data/raw_post_data on master branch?

2013-09-17 Thread Andrea Faulds
you're after? Hope this helped. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Getting SG(request_info).post_data/raw_post_data on master branch?

2013-09-17 Thread Andrea Faulds
On 17/09/2013 20:28, Yasuo Ohgaki wrote: I'm questioning about getting the data inside PHP with new code in master branch, not in user script. Oops, how silly of me. I must be tired if I thought that was PHP code. Apologies. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Fwd: ezmlm warning

2013-09-23 Thread Andrea Faulds
was scared that it was just me, I suppose I can be glad I'm not the only one. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Argument unpacking - Multiple unpacks and trailing arguments

2013-09-23 Thread Andrea Faulds
reasons behind it. So I think it would be best to allow neither of those, for the sake of consistency. (OT: I've also just discovered that Python supports a, b, *c = someseq for multiple assignment, perhaps we could see list($a, $b, ...$c) = $someseq support?) -- Andrea Faulds http://ajf.me

Re: [PHP-DEV] Argument unpacking - Multiple unpacks and trailing arguments

2013-09-23 Thread Andrea Faulds
be as easy since you'd have to chop up the ...$args in the definition, but all may be sacrificed in the name of backwards-compatibility. :P -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Parsing PUT data

2013-09-24 Thread Andrea Faulds
$_REQUEST but for the request body exclusively ($_BODY). We'd then have $_GET for query parameters and $_BODY for request body (POST, PUT, PATCH, etc.) parameters. While at it, why not add a better version of $_GET which doesn't replace certain characters with undescores? -- Andrea Faulds http

Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]

2013-09-26 Thread Andrea Faulds
becomes: ext/standard/php_array.h:119: #define ARRAY_FILTER_USE_KEY 1 #define ARRAY_FILTER_USE_VALUE 2 #define ARRAY_FILTER_USE_BOTH 3 Such that we have the best of both worlds, either `ARRAY_FILTER_USE_BOTH` or `ARRAY_FILTER_USE_KEY | ARRAY_FILTER_USE_VALUE` :D -- Andrea Faulds http

Re: [PHP-DEV] RFC: Automatic Property Initialization

2013-09-27 Thread Andrea Faulds
On 27/09/2013 08:17, Gordon Oheim wrote: I think this is a great proposal. Anything that reduces code verbosity, increases programmer productivity, improves readability and doesn't bloat PHP gets my support. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] HTTP supergloblas and request body/query (was: Parsing PUT data)

2013-10-02 Thread Andrea Faulds
handlers from extensions, ext/json may be an example, like it is hacked into pecl_http-v2. +1 Handling JSON would be pretty neat. Maybe we could even support it by default (after all, there is the json ext), so long as getting the unparsed request body isn't impeded by that. -- Andrea Faulds http

Re: [PHP-DEV] HTTP supergloblas and request body/query (was: Parsing PUT data)

2013-10-02 Thread Andrea Faulds
Le 2 octobre 2013 à 10:58, Michael Wallner m...@php.net a écrit : On 2 October 2013 11:56, Andrea Faulds a...@ajf.me wrote: Backwards compatibility matters, so we should keep $_GET and $_POST but add these as better aliases for them. That's why I said phase out... or is it a german

Re: [PHP-DEV] HTTP supergloblas and request body/query (was: Parsing PUT data)

2013-10-02 Thread Andrea Faulds
in PHP-5.0 and removed in PHP-5.4. Well, perhaps $_QUERY and $_FORM can be added in 5.6, deprecated in 6.0 and removed in 6.4, then? Who knows! -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Expectations

2013-10-22 Thread Andrea Faulds
), though ExpectationException might be confusing. I think we should name it AssertionException. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Expectations

2013-10-22 Thread Andrea Faulds
-1 to expect is a problem. expect is not a problem. Le 21 octobre 2013 à 10:42, Joe Watkins krak...@php.net a écrit : On 10/21/2013 09:57 AM, Tjerk Meesters wrote: On Mon, Oct 21, 2013 at 4:16 PM, Michael Wallner m...@php.net wrote: On 21 October 2013 10:13, Patrick Schaaf b...@bof.de

Re: [PHP-DEV] [VOTE] Change crypt() behavior w/o salt

2013-10-23 Thread Andrea Faulds
a strong hash with it (other factors are at play), but it does say that you can't without it. Perhaps secure might be better than strong. Just my 2 pence. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [RFC] list() Reference Assignment

2013-10-25 Thread Andrea Faulds
to fix it when I have more time. The patch is here: https://bugs.php.net/bug.php?id=6768 The RFC has been added to the list in Under Discussion. Any thoughts, suggestions, etc. appreciated. Regards, -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] [RFC] Exceptions in the engine

2013-10-25 Thread Andrea Faulds
could stop being fatal and start being exceptions, which is great news. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Adding new MIME types for the CLI web server

2013-11-01 Thread Andrea Faulds
/plain, .html as text/html, etc.), and guess the rest? Especially for ones which it would not correctly guess. Thanks. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] lxr.php.net's phpng seems out of date

2014-07-04 Thread Andrea Faulds
://github.com/php/php-src/commits/phpng/Zend/zend_types.h [12:04am]ajf: Aha [12:05am]ajf: Tyrael: and the most recent change, from laruence, is there:http://lxr.php.net/history/phpng/main/php_variables.c It would appear this issue has been resolved. -- Andrea Faulds http://ajf.me/ -- PHP

Re: [PHP-DEV] not_null function

2014-07-05 Thread Andrea Faulds
gone on for so long. PHP has idiosyncracies, but frankly, the is_null function is hardly the worst of them and I see nothing useful resulting from this discussion. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

[PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-05 Thread Andrea Faulds
it if everyone read the whole thing: https://wiki.php.net/rfc/php6 The plan for voting, if I think we should go ahead with it, is the same as a normal RFC: at least 2 weeks after proposed to internals, voting for at least 1 week. Thanks! -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-05 Thread Andrea Faulds
isn’t entirely ideal, but it’s not really important. I don’t think it’s possible to change it, and this is at least memorable. Really, RFC URLs are pretty meaningless. We’ve had URLs before with spelling errors in them. Thanks. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-05 Thread Andrea Faulds
. Also, I disagree that holding a vote to settle the name matter once and for all is a waste of energy. It should, hopefully, mean less energy wasted than otherwise in future. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-05 Thread Andrea Faulds
with that is that I feel such a narrow majority would be too contentious and not end the discussion for good. Sadly, it is not realistic to hold a vote on the majority with which to vote. ;) -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-05 Thread Andrea Faulds
On 6 Jul 2014, at 02:04, Christoph Becker cmbecke...@gmx.de wrote: Andrea Faulds wrote: I can see Zeev’s point that 7 is the main other option (though I also think 6.1, or codenames, are possible though unlikely other options). However, I don’t want to call a 50%+1 6/7 vote because it just

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
On 5 Jul 2014, at 22:23, Andrea Faulds a...@ajf.me wrote: This RFC attempts to settle the matter once and for all with a straight yes/no vote as to whether the name should be PHP 6. Should it pass, the matter is settled and we actually have a proper name for this fabled “PHP NEXT”. Should

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
was abandoned must be about a new PHP 6, and anything from before it must be about the old PHP 6. If this RFC were to pass with people voting for 6, then it would be pretty clear that anything coming after it was about the new PHP 6. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
and tested naming scheme, too. I think that’d be for the best. Side note: another thought comes to me now that just skipping 6 and going to 7 makes little sense in a way, as 7 isn’t the successor to 6, it is the second successor to 5, the first (the old PHP 6) having been abandoned. -- Andrea Faulds

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
On 6 Jul 2014, at 17:46, Lester Caine les...@lsces.co.uk wrote: On 06/07/14 16:08, Andrea Faulds wrote: I think it’s generally clear what’s for the new PHP 6 and what’s for the old; anything from after the old PHP 6 was abandoned must be about a new PHP 6, and anything from before it must

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
Rationale with me (I don’t want it to unintentionally be too 7-sided). If you can catch me on IRC, that would be optimal. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
that there are only two votes, and used the phrase “simple majority”. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-06 Thread Andrea Faulds
Zeev. Heck, it’s a wiki, anyone with karma could edit if they liked (but please ask first). All I’m waiting for is said contributions. :) -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [DRAFT][RFC] Big Integer Support

2014-07-06 Thread Andrea Faulds
On 3 Jul 2014, at 18:29, Andrea Faulds a...@ajf.me wrote: Either way, I think there should be some sort of warning (probably an E_NOTICE or E_WARNING?) when this cast happens implicitly and the number is truncated, such as in function calls. I’m tempted to remove this from Open Questions

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-07 Thread Andrea Faulds
year that PHP NEXT could happen, though 2016 is probably more realistic. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-07 Thread Andrea Faulds
feel they have to add it to phpng, because if phpng is to be PHP 6, then it would need to be based off that branch. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-07 Thread Andrea Faulds
to start an RFC-based discussion for moving phpng to master so that the uncertainties around it are removed. phpng has mostly been just performance so far, right? Could we use this opportunity, where it is not yet master, to make some deeper improvements? -- Andrea Faulds http://ajf.me/ -- PHP

Re: [PHP-DEV] [RFC] Name of Next Release of PHP

2014-07-07 Thread Andrea Faulds
On 7 Jul 2014, at 14:13, Zeev Suraski z...@zend.com wrote: On 7 ביול 2014, at 08:59, Andrea Faulds a...@ajf.me wrote: On 7 Jul 2014, at 13:57, Zeev Suraski z...@zend.com wrote: I don't think it's a problem, because I don't think we're two years away from releasing a phpng-based version

Re: [PHP-DEV] Concurrency support for run-tests

2014-07-07 Thread Andrea Faulds
it concurrently with another test with the same no-concurrent directive. So, if you had, say, a non-concurrent filesystem test, and another one, and some unrelated tests, you’d have to run those two FS tests sequentially, but you could still run unrelated tests at the same time. -- Andrea Faulds http

Re: [PHP-DEV] [VOTE] Uniform Variable Syntax

2014-07-07 Thread Andrea Faulds
unless we switch to using an AST-based parser someday. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Uniform Variable Syntax

2014-07-08 Thread Andrea Faulds
of Symfony and ZF is not representative. It is a tiny BC break and it’s for PHP NEXT (i.e 6 or 7), not 5.6. Why not? It’s a tiny change which will bother some people but make everyone else’s life easier. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] Uniform Variable Syntax

2014-07-08 Thread Andrea Faulds
6. Nikic’s PhpParser would be useful for this, and he’s already made a tool to help spot things this RFC would break. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Fast parameter parsing API: Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_builtin_functions.c Zend/zend_operators.c Zend/zend_operators.h ext/pcre/php_

2014-07-11 Thread Andrea Faulds
done and a vote will only be biased to begin with, based only on given performance results. It can't end well. Myself, I will be voting for phpng not for performance, but because I find the internal API to be saner. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Fast parameter parsing API: Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_builtin_functions.c Zend/zend_operators.c Zend/zend_operators.h ext/pcre/php_

2014-07-11 Thread Andrea Faulds
. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PHP-CVS] com php-src: Fast parameter parsing API: Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_builtin_functions.c Zend/zend_operators.c Zend/zend_operators.h ext/pcre/php_pcre

2014-07-11 Thread Andrea Faulds
of the votes on syntax have been held either. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-12 Thread Andrea Faulds
-src/pull/717 I’m hoping I can get this into PHP 5.7. I think scalar type hinting would be a valuable addition to PHP’s existing type hinting system. Thanks! -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
, and that there is a system of typing, but it doesn’t say anything about its strictness. Regardless, this RFC will stick with the current terminology, but changing the terminology would be quite simple, you could just update the manual and possibly change some of the internal names. -- Andrea Faulds http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
as internal_function($_GET[‘id’]). Also, it’s not really “what Andrea proposes”, it’s Anthony’s proposal, even if he is sadly absent from the list these days. I’m just trying to fix up the patch, iron out remaining wrinkles, and get this into PHP. -- Andrea Faulds http://ajf.me/ -- PHP

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
: function foo($bar) { if (!is_int($bar)) { throw new Exception('Invalid parameter type'); } } If you really want to continue doing that, nothing would stop you. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
type here. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
); // E_RECOVERABLE_ERROR Float hints: function foo(float $a) { var_dump($a); } foo(1); // float(1) foo(1); // float(1) foo(1.0); // float(1) foo(1a); // E_RECOVERABLE_ERROR foo(a); // E_RECOVERABLE_ERROR foo(1.5); // float(1.5) -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
their opinion in before changing it in each direction :) Zeev Yes, I might have acted a little too quickly. However, I’m not sure “12a” is such a common case. With the strict behaviour, foobar(“ 12”) and foobar(“12”) still work, however foobar(“12 “) unfortunately would not. -- Andrea Faulds http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
to the other type hints, which are strict, but is also further away from zpp. I’m a big conflicted. For now, I’ll leave it as E_RECOVERABLE_ERROR. While user input might be problematic, it can just be filtered. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
be really difficult for a developer to guess what will be the PHP behaviour with this new syntax. Well, they do. The results of implicit scalar type hint casts are, so far as I know, the same as explicit casts, but some cases lead to errors which don’t in an explicit casts. -- Andrea Faulds http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
to hint for them, then? -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
here in 2012: http://nikic.github.io/2012/03/06/Scalar-type-hinting-is-harder-than-you-think.html However, I don’t propose “strict weak” typing, I propose this RFC. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
On 13 Jul 2014, at 16:28, Rouven Weßling m...@rouvenwessling.de wrote: On 13 Jul 2014, at 17:05, Andrea Faulds a...@ajf.me wrote: On 13 Jul 2014, at 16:00, Rouven Weßling m...@rouvenwessling.de wrote: One thing however seems like a rather bad idea, and that is exposing the type

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
because we don’t need it; if Bar extends Foo and a function takes a Foo, it can also take a Bar. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
implementation. I’m thinking more about dealing with JSON and such which give you an object. Perhaps you might have a FooBar-fromObject() method that can be passed another FooBar to clone it, or an object decoded from JSON. Though in that particular case there’s no real need for a type hint. -- Andrea

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-13 Thread Andrea Faulds
. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
try to think about this, I usually end up going in circles. Anthony doesn’t seem to be decided either. Hence I’m putting this up for discussion. What are your thoughts? -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
On 14 Jul 2014, at 14:28, Andrea Faulds a...@ajf.me wrote: On 14 Jul 2014, at 14:12, Alexey Zakhlestin indey...@gmail.com wrote: I don’t think that scalar casts” should do any additional error-catching. they target a very different usecase. It shouldn’t guarantee correctness

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
supporting both syntaxes has also been proposed in the past. That isn’t this proposal and this proposal is not going to become that one. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
that validate for the int type hint could be accepted. Is that a good idea? Though it feels a bit loose, I think it covers all the important common use cases. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
the existing cast logic, as explicit casts *never fail*, so but existing casts work this way is not relevant. Right. I’d like the rules to be simple enough. I think the string, int and float ones make perfect sense and can be easily explained, it’s bool I’m uncertain about. -- Andrea Faulds

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
don’t like the idea of completely strict type hints here, but I also don’t think that completely loose type hints that cast and do zero validation are for the best either. This RFC tries to strike a compromise. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
-scalar type hints except more lenient as it allows equivalent values of other types. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
, if you run this: set_error_handler(function () { return true; }); function foo(int $a) { var_dump($a); } foo(“13abc”); You would get this: int(0) However, that could easily be fixed so the error case uses the normal casting behaviour. -- Andrea Faulds http://ajf.me/ -- PHP

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
On 14 Jul 2014, at 15:17, Andrea Faulds a...@ajf.me wrote: On 14 Jul 2014, at 15:03, Rowan Collins rowan.coll...@gmail.com wrote: Looking at the current table in the RFC, I'm not clear why NULL should pass as any value, but not array. Could it not behave the same as the existing type

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
) or (float) first is probably a good idea. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
)$a; } -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
that idea. If someone writes a function with type hints, people shouldn’t be able to make those type hints go away or become more or less strict. They should be consistent across environments and contexts. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
be in normal maths, i.e. the fractional value 0.666…. Actually, this makes a good case for return type hinting, as you could ensure you’d get an integer result here. (But that is another matter.) -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
= Not Invented Here We are using hack’s syntax (int, float, bool, string, no integer/double/boolean aliases). We are not using Hack’s semantics for reasons that have been discussed endlessly before in this thread and others, reasons which are not NIH. -- Andrea Faulds http://ajf.me/ -- PHP Internals

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
Python 3 does: if two integers cannot divide cleanly, then a float division is done instead. This may not be what C, C++, C#, Java, or some other strictly-typed languages do, but it is what PHP does, and has done for a long time. It’s also what makes the most sense, IMO. -- Andrea Faulds http

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
for anything -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
On 14 Jul 2014, at 18:38, Rowan Collins rowan.coll...@gmail.com wrote: Andrea Faulds wrote (on 14/07/2014): On 14 Jul 2014, at 18:24, Rowan Collins rowan.coll...@gmail.com wrote: If the current type hints were only for objects, I would be OK with that, but I really don't get why an array

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
” arrays and objects much, do we? You can cast to them, sure, because PHP as a rule allows you to cast anything to anything explicitly (bar resources), but I can’t, for example, do a loose comparison between an array and a string. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
On 14 Jul 2014, at 13:58, Andrea Faulds a...@ajf.me wrote: One of the issues with the RFC as it stands is how to handle bool casting. While int, float and string only allow lossless casting (with the exception of objects, but we can’t really do anything about that), bool’s behaviour

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-14 Thread Andrea Faulds
). -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [RFC] intdiv()

2014-07-14 Thread Andrea Faulds
addition. Thanks! -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] intdiv()

2014-07-14 Thread Andrea Faulds
up to 53 bits but not beyond? No idea. This RFC isn’t proposing that. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] intdiv()

2014-07-15 Thread Andrea Faulds
RFC can’t come soon enough given Y2K38). However, intdiv() is perhaps not the best way to implement it or the best syntax. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] intdiv()

2014-07-15 Thread Andrea Faulds
use \ for namespaces, and Python 3’s // obviously can’t be used, so I might suggest Pascal’s div operator: $minutes = ($s div 60) % 60; Failing that, div() as a built-in function much like pow() is: $minutes = div($s, 60) % 60; -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [RFC] intdiv()

2014-07-15 Thread Andrea Faulds
the range problem where a 64bit value may be required but the installation on4y supports 32bit integers. Currently the value simply works with the string version … Yeah, hence why I’m also proposing the bigint RFC, which intdiv() would work nicely with. -- Andrea Faulds http://ajf.me/ -- PHP

Re: [PHP-DEV] [RFC] intdiv()

2014-07-15 Thread Andrea Faulds
when a basic PHP installation is used. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)

2014-07-15 Thread Andrea Faulds
casts which have stricter rules than an explicit cast, and also somewhat stricter than zend_parse_parameters, meaning that people can safely do $_GET[‘thing’] and it’ll work, but if a nonsensical value is passed in, the program will error as it should. -- Andrea Faulds http://ajf.me/ -- PHP

  1   2   3   4   5   6   7   8   9   10   >