Re: [PHP-DEV] Proposal: AS assertions

2024-03-22 Thread Jordi Boggiano
On 2024-03-22 10:46, Rowan Tommins [IMSoP] wrote: On Fri, 22 Mar 2024, at 08:17, Jordi Boggiano wrote: We perhaps could make sure that as does not throw if used with `??`, or that `??` catches the type error and returns the right-hand expression instead: So to do a nullable typecast you

Re: [PHP-DEV] Proposal: AS assertions

2024-03-22 Thread Jordi Boggiano
in an also very concise way. The only catch I see is that it would also swallow errors about $a not being defined at all. Best, Jordi -- Jordi Boggiano @seldaek -https://seld.be

Re: [PHP-DEV] [RFC] New core autoloading mechanism with support for function autoloading

2023-04-13 Thread Jordi Boggiano
til it is defined, and once it is defined the cache should be busted. https://3v4l.org/VLW5O looks like correct behavior to me correctly. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.

Re: [PHP-DEV] BC breaking changes in PHP 8.1

2021-09-26 Thread Jordi Boggiano
have prevented all resource-related errors I ran into with php8.0 migration I believe. That'd be a welcome improvement/fix for 8.1. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net

Re: [PHP-DEV] [RFC] Partial Function Application, take 2

2021-06-10 Thread Jordi Boggiano
ds good to me to make sure the debate is closed once and for all. Ignoring it now to get another RFC trying to change the syntax in two months isn't helpful :) Aside from that, also +1 on "good work everyone involved", this looks pretty solid now and I'm looking forward to the addition! Bes

Re: [PHP-DEV] json_encode indent parameter

2021-06-04 Thread Jordi Boggiano
sed. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Regarding array_shift()/array_unshift()

2021-06-03 Thread Jordi Boggiano
and SPL with better docs/naming/usability would absolutely be great to have from my userland perspective. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] json_encode indent parameter

2021-06-03 Thread Jordi Boggiano
, or "" if that's how you want your JSON indented.. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Under Discussion: Add Random class and RandomNumberGenerator interface

2021-06-02 Thread Jordi Boggiano
new Random($obj)`, probably it should throw an InvalidArgumentException if a seed is also passed in, as I assume in that case it would be otherwise be ignored. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, vi

Re: [PHP-DEV] Regarding array_shift()/array_unshift()

2021-06-02 Thread Jordi Boggiano
I find this isn't great ergonomics compared to the existing. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC] Autoloader Classmap

2021-04-07 Thread Jordi Boggiano
Hi Mark, On 06/04/2021 00:05, Mark Randall wrote: * I expect 99.% of users will never know it exists, and it will instead just be an option for tools like composer that will provide a small transparent boost. I wrote this as feedback in your early round (I don't think you answered),

Re: [PHP-DEV] [RFC] Autoloader Classmap

2021-03-16 Thread Jordi Boggiano
On 16/03/2021 15:02, Stephen Reay wrote: On 16 Mar 2021, at 20:07, Jordi Boggiano wrote: P.S: While I am here looking at spl_* docs, it seems to me like spl_autoload_call should be deprecated in favor of class_exists, and spl_autoload_extensions + spl_autoload also probably should

Re: [PHP-DEV] [RFC] Autoloader Classmap

2021-03-16 Thread Jordi Boggiano
poser/blob/b6826f352390b4c952be8fd75d60cfd4f6f39f11/src/Composer/Autoload/ClassLoader.php#L478-L481 -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-19 Thread Jordi Boggiano
would prevent us from adding some features later based on a lack of end delimiter, as it was the only objective technical argument in favor of #[]/@[]. Now it's IMO all about what syntax people prefer visually.. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Interna

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-18 Thread Jordi Boggiano
ussing, it'll be up to everyone's preference. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Shorter Attribute Syntax Change

2020-08-10 Thread Jordi Boggiano
On 10/08/2020 10:41, Derick Rethans wrote: I've just opened the vote to make sure we don't make a terrible mistake with using the @@ syntax for attributes: https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting Here is a more detailed comparison of how this would look like in real

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-09 Thread Jordi Boggiano
this to work because why not? I think if it can be reasonably fixed it probably would make sense for consistency and WTF-avoidance if anything. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-04 Thread Jordi Boggiano
every single thread about attributes contains an email like the above, no matter what we end up with I will be glad if it's not <>. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Shorter attribute syntax

2020-06-04 Thread Jordi Boggiano
ecked, while << does occur both as the << operator and heredocs/nowdocs. My fellow grumpy-old-non-IDE-users might find this a valid argument too :) Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, v

Re: [PHP-DEV] [RFC] Nullsafe operator

2020-06-03 Thread Jordi Boggiano
ead to much uglier and repetitive code like:     if ($foo && $foo->getBar() && $foo->getBar()->getBaz()) { ... } So yeah, +1 Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Union types | true pseudo-type

2020-01-20 Thread Jordi Boggiano
d of a shame if we can foresee it and prevent it from happening. TL;DR: true Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Changing fundamental language behaviors

2019-09-12 Thread Jordi Boggiano
in exactly? Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Preloading

2018-10-19 Thread Jordi Boggiano
On Fri, 19 Oct 2018 at 10:18, Dmitry Stogov wrote: > I would like to start discussion on a Preloadng RFC > https://wiki.php.net/rfc/preload This sounds great! If I understand correctly, this could also be included in Composer as a new autoload type "preload" (which would be an array of files

Re: [PHP-DEV] Re: [RFC][Vote] iterable_to_array() and iterable_count()

2018-07-05 Thread Jordi Boggiano
-17 12:00 UTC *couldn't* work – it's just I'd rather have some buffer time (I presume there will be more RFCs whose voting ends close to feature freeze). Alright, updated! RFC voting now closes on 2018-07-16 23:00 UTC. M. -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP

Re: [PHP-DEV] Strict switch statements

2018-06-15 Thread Jordi Boggiano
switch ($a) { case FOO: case BAR: // both are strict === } Might I suggest a new strictwich ($a) { ... } keyword? It's much more appetizing. Apologies, Jordi -- Jordi Boggiano @seldaek - https://seld.be -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] [RFC] Reproducible Builds Support

2017-12-15 Thread Jordi Boggiano
to actually fix the Phar extension so addFromString has a filemtime parameter you can pass the desired mtime to. I have not checked whether addFile suffers from the same issue or not, but possibly it needs to be fixed to read the mtime from the file you add. Best, Jordi -- Jordi Boggiano

Re: [PHP-DEV] PHP 7.1.0 GA

2016-11-23 Thread Jordi Boggiano
date, but that's ok we'll run RC6 in prod for a bit longer ;) Thanks to everyone involved! Great progress [1] [1] https://raw.githubusercontent.com/php/php-src/php-7.1.0RC6/UPGRADING Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] Countable Type Hint

2016-11-17 Thread Jordi Boggiano
and array_* functions should probably be fixed to work with arraylike objects too, then it'd bring actual value. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] RNG fixes

2016-06-21 Thread Jordi Boggiano
years, but they are finally gone. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP allocating too much memory

2016-06-15 Thread Jordi Boggiano
/bug.php?id=70795 Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] RNG fixes

2016-06-15 Thread Jordi Boggiano
if you add a library that relies on mt_rand you can suddenly break your ability to get consistent numbers. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Is the "No BC Breaks in Minor Releases" policy enforceable?

2016-06-15 Thread Jordi Boggiano
ot; intact instead of going back to cowboy php days. We are finally seeing more rapid PHP version adoption and I think it would be a shame to break the trust PHP gained in the last few years of stable and predictable releases. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Inter

Re: [PHP-DEV] can't reflection on DateTime properties?

2016-06-04 Thread Jordi Boggiano
_dump($reflection->getProperties()); outputs: array(0) { } The object clearly has properties corresponding to it's internal state, but reflection doesn't seem to report them? I can't tell you why it acts like this, but in case you are looking for a workaround: https://3v4l.org/V5cfl

Re: [PHP-DEV] [RFC] [PRE-VOTE] Union types

2016-06-03 Thread Jordi Boggiano
ave. I don't think for function arguments it's massively useful and I doubt it'll get put everywhere, but it's nice to be able to express this when you have to. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit

Re: [PHP-DEV][RFC] Callable Types

2016-04-22 Thread Jordi Boggiano
ne with the function signature but at the same time I can't imagine how else it would work that would be any better. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] PHP Attributes

2016-04-22 Thread Jordi Boggiano
, but I see a few benefits of having real AST vs a string.. You get syntax highlighting in editors, and most importantly compile time syntax errors if you messed up. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2016-04-14 Thread Jordi Boggiano
e-hint appropriately. And it would save us one line of phpdoc as well because IDEs could infer the information from the code. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP 7.1 - should we add a random_str() function?

2015-10-01 Thread Jordi Boggiano
://stackoverflow.com/a/32870871/2224584 Sounds great, and the amount of different answers on this stack overflow question highlights the problem very well IMO. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] Re: [RFC] [VOTE] Short Closures

2015-09-24 Thread Jordi Boggiano
a bit. Cheers -- Jordi Boggiano @seldaek - http://seld.be -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP 7.0.0alpha1 Released for Testing!

2015-06-12 Thread Jordi Boggiano
On 12/06/2015 01:53, a...@php.net wrote: The first alpha for 7.0.0 was just released and can be downloaded from: https://downloads.php.net/~ab/ The Windows binaries are available at http://windows.php.net/qa/ Yay! Thanks to everyone involved. Composer test suite passing and in -50%

Re: [PHP-DEV] About declare(strict_types = 1)

2015-03-16 Thread Jordi Boggiano
On 16/03/2015 11:49, Pavel Kouřil wrote: it's similiar to the safe_mode though. Sure, it's not as bad as INI setting, but the intent is the same - a switch changing how code behaves. ini_set('memory_limit', 10); also changes how your code behave, but it's global so that can be problematic.

Re: [PHP-DEV] RE: STH and the 3 RFCs

2015-03-16 Thread Jordi Boggiano
On 16/03/2015 14:45, Theodore Brown wrote: On Monday March 16 at 9:33 am Thomas Punt wrote: Strictly speaking (pun intended), this is not true. A library can easily expose a facade that enforces a user of that library (who is in weak mode) to have to write in strict mode [1]. Once more, this

Re: [PHP-DEV] Voting irregularities

2015-03-15 Thread Jordi Boggiano
On 15/03/2015 22:27, Derick Rethans wrote: On Sun, 15 Mar 2015, Zeev Suraski wrote: I don't think it's going to far, if you have people with no clue writing this: https://plus.google.com/+KristianK%C3%B6hntopp/posts/ijoDNH2M8mB Do you know who Kristian is and how instrumental he was in the

Re: [PHP-DEV] Re: [RFC] [DISCUSSION] Consistent Function Names

2015-03-05 Thread Jordi Boggiano
On 05/03/2015 08:07, Yasuo Ohgaki wrote: So array functions are subject to be changed. bool in_array ( mixed $needle , array $haystack [, bool $strict ] ) Renamed to array_in() and fix order. mixed array_search ( mixed $needle , array $haystack [, bool $strict ] ) Renamed to

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

2015-02-27 Thread Jordi Boggiano
On 27/02/2015 14:31, Sebastian Bergmann wrote: Am 23.02.2015 um 19:15 schrieb Nikita Popov: Voting on the engine exceptions RFC, which proposes to convert existing fatal and recoverable fatal errors into exceptions, has opened: https://wiki.php.net/rfc/engine_exceptions_for_php7#vote The

Re: [PHP-DEV] Follow-up to STH user experience, this time with actual testing

2015-02-27 Thread Jordi Boggiano
Matthew, Thanks a bunch for going through this and writing such a detailed report. On 27/02/2015 00:29, Matthew Weier O'Phinney wrote: ### STHv5 [snip] Analysis I did not expect the float value to be coerced, particularly as it had a fractional part. Yes, I understand that this is how

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Jordi Boggiano
On 27/02/2015 15:19, Andi Gutmans wrote: On Feb 27, 2015, at 7:12 AM, Anthony Ferrara ircmax...@gmail.com wrote: Dmitry and Zend, Thank you for sharing your code. I look forward to playing with it. Perhaps after 7 stabilizes (and ships) you could write up your thoughts around it? Why

Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5

2015-02-25 Thread Jordi Boggiano
why most people know to stay away from refs in PHP. PHP5 would behave the same if you did an explicit $a = (int) $a; in bar() for example, and the same WTF happens with the other RFC, so I am not really sure what you are trying to point out here. Cheers -- Jordi Boggiano @seldaek - http

Re: [PHP-DEV] Re: [RFC][VOTE] Introduce script only include/require

2015-02-25 Thread Jordi Boggiano
and offer no good reason to be allowed in user uploads, I guess it's safe. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Reviving scalar type hints

2015-02-17 Thread Jordi Boggiano
. As for the straw poll, I also think declare() is the clearest syntax, especially if it's enforced to appear at most once and on top of the file to remove any potential misuses. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe

Re: [PHP-DEV] [RFC][VOTE][RESULT] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-11 Thread Jordi Boggiano
the upgrade path harsher, but it's also not great to let they linger on forever with no notice to users that they are doing something wrong. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

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

2015-02-09 Thread Jordi Boggiano
solution is quite good as well. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2015-02-08 Thread Jordi Boggiano
) in mind and maybe I'll come to a different conclusion. Thank you for that, Sebastian. It is not a simple RFC and votes should be thought through as it is such an old and important topic to many people. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime

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

2015-02-08 Thread Jordi Boggiano
of it. By this logic, the current proposal also does not take anything away from weak-typing proponents (which I guess I am a part of FWIW). It lets everyone be happy in their corner. I don't see how this is worse than one side winning by ignoring the other. Cheers -- Jordi Boggiano @seldaek - http

Re: [PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Jordi Boggiano
invalid params, but that is what they want since they asked to be strict, so they get full on error reporting/static analysis of their code, but do not push it on the whole ecosystem. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [RFC] Combined Comparison (Spaceship) Operator

2015-01-19 Thread Jordi Boggiano
On 19/01/2015 10:40, Andrea Faulds wrote: Hi Jordi, On 19 Jan 2015, at 10:37, Jordi Boggiano j.boggi...@seld.be wrote: On 19/01/2015 08:28, Andrea Faulds wrote: Good morning, This is a reboot of Davey Shafik’s RFC (with permission). After recent discussions about sort functions, I

Re: [PHP-DEV] Re: Top 10 Pecl extensions PHP7 compatibility

2015-01-16 Thread Jordi Boggiano
that pecl is its own ecosystem and I come in out of nowhere and ask you to change, but I really believe it's for the best in the longer term. [1] in the sense that a branch produces releases since tags are made out of a given branch usually. -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
rules to improve the behavior of the weak types, having scalars in return hints (since return hints seem likely to pass), etc. If *b* passes as well great we have a complete picture and every team can have declare() Y/N in their own coding guidelines based on preference. Cheers -- Jordi

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
move code into places you own, I'd assume you know it if you are using strict typing. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
On 15/01/2015 16:01, Pavel Kouřil wrote: On Thu, Jan 15, 2015 at 4:35 PM, Jordi Boggiano j.boggi...@seld.be wrote: I mean that if someone wants strict typing they won't want to use weak hints because that would coerce the data before they can verify it and ensure their code is strictly typed

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
On 15/01/2015 15:31, Pavel Kouřil wrote: On Thu, Jan 15, 2015 at 4:19 PM, Jordi Boggiano j.boggi...@seld.be wrote: Right now, or with only weak hints, if a library decides to implement strict typing, they'll skip the scalar hints and check types with something like the assert lib [1]. A user

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
yourself where you see fit. If you had strict typing only or weak only you anyway could not choose which library should be strict, each library would decide for you. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-01-15 Thread Jordi Boggiano
whether it's declare() or some other way to enable this per file I don't really care. [1] https://github.com/beberlei/assert -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] rand(), mt_rand() and limits

2015-01-11 Thread Jordi Boggiano
change it would be even better. Bottom line is I think it's important to have the ability to set the seed yourself. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

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

2015-01-02 Thread Jordi Boggiano
($number); expectString($string); } That'd be a simple lib to write, it barely adds more code to your functions, and you get strict typing. But I hardly see anyone do this, and I would argue it's because it sounds appealing in theory but it's not worth it in practice. Cheers -- Jordi Boggiano

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

2015-01-02 Thread Jordi Boggiano
because it's not your job to validate user input. You need an int ask for an int and get an int. If users like convenience they can skip validation, if they like strictness they can do their own layer of Assertion::foo calls in their controllers. Cheers -- Jordi Boggiano @seldaek - http://nelm.io

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Jordi Boggiano
properties without custom getter. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-28 Thread Jordi Boggiano
a setter (even a default empty one) if none is needed? P.S: Don't want to open pandora's box, but we could also have writeonly for completeness perhaps. I don't really see the use case at all though (immutability sure, mutant bottomless pit objects not so much:). Cheers -- Jordi Boggiano

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-26 Thread Jordi Boggiano
On 24/10/2014 12:54, Andrea Faulds wrote: On 24 Oct 2014, at 10:29, Jordi Boggiano j.boggi...@seld.be wrote: Thanks for the work (again). It's an interesting small idea but I'd much prefer revisiting the original getter/setter RFC [1] which had a majority but just fell short of the 66% mark

Re: [PHP-DEV] [RFC] Readonly Properties

2014-10-24 Thread Jordi Boggiano
properties and setFoo. [1] https://wiki.php.net/rfc/propertygetsetsyntax-v1.2 Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE][RFC] Name of Next Release of PHP (again)

2014-07-23 Thread Jordi Boggiano
Somewhat unrelated to this vote in particular, but someone mentioned on IRC that it would be cool to see votes chronologically so I wrote a short JS snippet that does just that. In case anyone is interested for archeological purposes: https://gist.github.com/Seldaek/bc0ae0e2bf1617d71ed7 --

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

2013-10-26 Thread Jordi Boggiano
handlers and related show a nice error page to users when all hell breaks loose tricks. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Wake up

2013-09-11 Thread Jordi Boggiano
As I answered on Anthony's post, there is not much need for waking up, or moving the talks to a forum, or discussing the problem to death here. The problem is clear, and everyone involved on this mailing list is aware of it to some degree. The only way this can be solved is if the offenders

Re: [PHP-DEV] [RFC] Switch from json extension to jsonc [Discussion]

2013-08-30 Thread Jordi Boggiano
having a switch in php like --enable-evil-json sounds better than the current state. If we do have an equivalent implementation though we might as well throw away the existing one instead of keeping two IMO, but that's a detail. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP

Re: [PHP-DEV] git branches 5.3/ 5.4 / 5.5

2013-08-15 Thread Jordi Boggiano
). And to ensure you never push garbage by accident, run this to tell git to always only push the branch you're on when you run `git push`: git config --global push.default current Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] RFC: constructor argument promotion

2013-08-08 Thread Jordi Boggiano
someone forgot. I am very supportive the idea, although I see that it could be confusing to some. Maybe the syntax needs to change, but the overall change is much welcome. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] Add a constant to reflect --with-curlwrappers

2013-04-01 Thread Jordi Boggiano
removing it. In my experience most/all people using it just do so by accident, because they copy pasted a configure line that had it enabled from somewhere 5 years ago and never looked back. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] DateTimeImmutable

2013-03-27 Thread Jordi Boggiano
in a sane way though :/ Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Integrating Zend Optimizer+ into the PHP distribution

2013-02-28 Thread Jordi Boggiano
out of the ordinary. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Travis-CI supports 5.5

2013-01-29 Thread Jordi Boggiano
under some conditions when using composer which makes a lot of builds fails for nothing. While I wish they'd update their VMs more regularly, it's definitely still a good idea to enable those bleeding-edge builds. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP

Re: [PHP-DEV] File-Paths exceeding MAX_PATH on Windows

2013-01-07 Thread Jordi Boggiano
with namespace-itis + PSR-0 have led to some really long paths) I can only encourage you to continue the research, and I sure hope you get somewhere. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] [PHP-RFC] Property Accessors 1.2 for Final Review before Vote

2013-01-05 Thread Jordi Boggiano
? public $hexFoo = 10 { get { return dechex($this-foo); } set { $this-hexFoo = hexdec($value); } } Or is it this? public $hexFoo { get { return dechex($this-foo); } set { $this-hexFoo = hexdec($value); } } = 10; Is it possible at all? Cheers -- Jordi

Re: [PHP-DEV] Decorators Revisited

2012-08-13 Thread Jordi Boggiano
like that it opens up some sort of duck-typing by allowing decorators to be drop-in replacements even if there is no interface to implement. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] List comprehensions and generator expressions for PHP

2012-06-28 Thread Jordi Boggiano
Heya, So, what do you think? Do we want something like this in PHP? I think it looks great, especially the generator functions would be useful to avoid having to create a full blown iterator for simple stuff. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP

Re: [PHP-DEV] Extension versions

2012-04-26 Thread Jordi Boggiano
On 23.04.2012 18:06, Johannes Schlüter wrote: On Mon, 2012-04-23 at 16:47 +0200, Jordi Boggiano wrote: As you see it goes from no version at all to proper versions, passing by svn revisions, dates, or a mix of all. In Composer [1] we try to parse all that using ReflectionExtension, to allow

Re: [PHP-DEV] Extension versions

2012-04-26 Thread Jordi Boggiano
help you here. But that's not something we have to take care of IMHO, one can get that information with LIBXML_VERSION or LIBXML_DOTTED_VERSION True, and maybe we should actually expose libxml and other bundled libs as packages too via Composer. Could be handy. Cheers -- Jordi Boggiano

[PHP-DEV] Extension versions

2012-04-23 Thread Jordi Boggiano
? [1] http://getcomposer.org/ Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] skipping optional parameters

2012-04-17 Thread Jordi Boggiano
in combination to this? i.e. foo(arg,) would just call foo with arg and then the default value for the second arg if there is one, or just nothing. That would make multi-line function calls a bit cleaner, and more similar to arrays. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP

Re: [PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-10-30 Thread Jordi Boggiano
'Array'; I don't think I have ever encountered a case where you actually want to convert an array to a string and use the result in a useful way. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http

Re: [PHP-DEV] [RFC] Choosing a distributed version control system for PHP (or not). Call for Participation.

2011-08-09 Thread Jordi Boggiano
one, because you can do the same in svn using 'foo -r1000 svn://somerepo' and have it fixed to one revision, just like git does. It's a much saner approach anyway to avoid people having out-of-sync versions of the externals. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP

Re: [PHP-DEV] bugs.php.net status and plan(s)

2011-06-30 Thread Jordi Boggiano
-Control header has the public directive in it. The bug report form and anything else that transmits a password or similar could of course still be done via https://. What about session cookies? Full-https is the only safe thing really. Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi

Re: [PHP-DEV] Re: [RFC] Improved parser error message

2011-06-23 Thread Jordi Boggiano
string in the unexpected part. This might be useful for finding really which makes the parser error. (It was a bit tricky though :D) Good stuff, maybe unexpected string 'foo' (T_STRING) or unexpected string (T_STRING) 'foo' would be more clear, but no big deal really. Cheers -- Jordi Boggiano

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-22 Thread Jordi Boggiano
be broken, while in other instances BC is broken in bigger ways, sometimes by accident, and sometimes in minor versions too. Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Jordi Boggiano
I'm not gonna fight one way or the other, it's a detail, but I don't think the BC concern is as big as it's presented. Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Jordi Boggiano
it's not just a matter of taste, but the null case imo really is not likely to happen by accident, and there is no valid use case. Anyways.. Case closed I suppose. Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Jordi Boggiano
equally on strings and arrays, but changing {} to make it behave more like substr/array_slice might be a viable BC break (for the negative numbers that might exist in arrays that is). Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordi -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] Re: $arr = array('Hello', 'world'); $arr();

2011-06-08 Thread Jordi Boggiano
pretty awesome to me. Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Callable typehint

2011-06-07 Thread Jordi Boggiano
be anywhere, anytime, readable or not, it depends on the environment the code runs on, and not on the code itself, so it's not deterministic and you should therefore be able to easily handle this gracefully. Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Object and Array Literals

2011-06-05 Thread Jordi Boggiano
, that'd really suck :/ Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] annotations again

2011-05-11 Thread Jordi Boggiano
should be handled without quotes if we want to support current docblocks, like @author Guilherme Blanco should be enough. Cheers [1] And in this case single quotes are even invalid in json and I'm not gonna complain ;) -- Jordi Boggiano @seldaek :: http://seld.be/ -- PHP Internals - PHP

  1   2   >