t;function", and getting back to the main topic, would
it be possible to do the same with compact()?
fn() => compact('dummy')
turns into:
fn() => [ 'dummy' => $dummy ]
which turns into:
function() use($dummy) { return [ 'dummy' => $dummy ]; }
Atenciosamente,
David Rodrigues
ectly over the resulting array, rather than the compact itself.
Atenciosamente,
David Rodrigues
Em qua., 19 de out. de 2022 às 14:09, Marco Pivetta
escreveu:
> On Wed, 19 Oct 2022, 19:04 David Rodrigues,
> wrote:
>
>> Hello!
>>
>> I'm converting my code to u
ssibility of this being fixed? I would love to help, but I
don't have much C programming skills, unfortunately.
Atenciosamente,
David Rodrigues
#x27;123'
[ $a ?: '123' ] = [ 456 ]; so $a = 456
Atenciosamente,
David Rodrigues
>From what I understand, your concern is "what if we need to change the
direction of something already decided"? For example, initially it was
decided and very well accepted private(set), but after a while the idea was
revised and it was decided that private:set would be better instead.
In this ca
taxes to co-exist in this feature is
acceptable (which I personally think is a bad idea).
Atenciosamente,
David Rodrigues
Em ter., 11 de out. de 2022 às 22:23, Larry Garfield
escreveu:
> On Tue, Oct 11, 2022, at 3:25 PM, David Rodrigues wrote:
> > In order to try to organize a litt
eatures should generally be released in patch versions (eg.
PHP 8.1.12 to preview a PHP 8.2 feature).
Atenciosamente,
David Rodrigues
use experimental_json_validate(), else use previous PHP compatible
code.
Atenciosamente,
David Rodrigues
Em seg., 10 de out. de 2022 às 19:20, David Gebler
escreveu:
> My two cents...
>
> Why can't "common users" install a PECL extension? It's not a difficult,
&
earlier feedback from users
willing to test it.
Atenciosamente,
David Rodrigues
Em qui., 6 de out. de 2022 às 17:12, Rowan Tommins
escreveu:
> On 06/10/2022 17:41, Alex Wells wrote:
> > For example, Kotlin has recently introduced a new feature - unsigned
> integer types.
>
>
&g
atures and shouldn't be used in production (unless you're willing to take
risks). The difference between using the in-development version of PHP 8.2
is that many servers only make this version officially available after a
few months, while smaller versions of PHP usually become available w
amente,
David Rodrigues
Em ter., 4 de out. de 2022 às 19:37, Flávio Heleno
escreveu:
> On Tue, Oct 4, 2022, 17:43 David Rodrigues wrote:
>
>> I wanted to suggest the possibility of introducing experimental features
>> to
>> PHP.
>>
>> This is an old thread
before the next version is released, allowing users to try
them out more easily.
Atenciosamente,
David Rodrigues
han array unpacking.
Atenciosamente,
David Rodrigues
Em seg., 1 de ago. de 2022 às 14:45, Kamil Tekiela
escreveu:
> Hi David,
>
> It would be useful if you could provide your measurements and the way you
> arrived at such results. A quick test doesn't seem to support your
> fin
Hello!
PHP 8.1 supports array unpacking with keys. I guess that is very similar to
array_merge(), but for some reason array_merge() is 50% slower than
unpacking.
So my question is: is there some way to optimize the engine so
array_merge() can work like unpacking?
Thanks!
ntion. The
performance would also be absurdly better.
What worries me above is the misuse of the function, like checking if
is_json() === true and using json_decode() right after. However, I believe
this can be easily optimized by the engine itself.
My vote is YES.
Atenciosamente,
David Rodrigues
> $foo[?'maynotexist'] // returns null and emits no warning
In JS we have some like:
foo['maynotexist']
foo?.['maynotexist']
In PHP could be:
$foo['maynotexist']
$foo?->['maynotexist']
Atenciosamente,
David Rodrigues
Em sex., 15 de ab
Maybe I'm a little late to this discussion, but is there any reason why
*false|null* is allowed but *true|null* is not?
I can think of few cases where *true|null* could be interesting, but I've
been through situations like this.
Atenciosamente,
David Rodrigues
Em sáb., 12 de mar.
weeks
using date() -- I had to search. But I think creating new "root functions"
would be too much. Perhaps a package like Carbon could be very useful. Or
even the DateTime itself.
Atenciosamente,
David Rodrigues
Em sáb., 25 de set. de 2021 às 16:48, Daniele B via internals <
intern
Hello!
I would like to suggest a feature I saw being implemented in the V8 9.4
engine called "*class static initialization block*".
https://v8.dev/blog/v8-release-94
In short, it is a method that is executed once when a class is imported and
loaded, allowing for some more advanced initialization
erate another one.
Anyway, I don't know if this is actually possible, or if the cost-benefit
would be better than what there is today. But I believe it is a path to be
thought of.
Atenciosamente,
David Rodrigues
but the idea didn't
go forward (even though there were no alternatives). :(
Atenciosamente,
David Rodrigues
Em sáb., 10 de jul. de 2021 às 06:10, Max Semenik
escreveu:
> I've been thinking about extending PHP's cast syntax to user-defined types,
> e.g. not only (int)$f
I really prefer the Sara suggestion, instead of creating a new function
to do the same thing. parse_str($str): array.
Atenciosamente,
David Rodrigues
Em qua., 23 de jun. de 2021 às 20:20, Sara Golemon
escreveu:
> On Wed, Jun 23, 2021 at 5:02 PM Kamil Tekiela
> wrote:
>
> >
be used for $userInstance, retest all options
(except #2).
}
3. Poorly typed functions or methods cannot be overloaded.
function printId(User $user) { ... }
function printId($user) { ... } // Fatal error
Atenciosamente,
David Rodrigues
turn": "return
the exit").
Is there any chance of discussing terms, even if the "never" indication is
winning at the moment? Or did I miss this discussion?
Thanks!
Atenciosamente,
David Rodrigues
Em sáb., 3 de abr. de 2021 às 23:07, Matthew Brown
escreveu:
>
Em qua., 24 de fev. de 2021 às 12:29, Michael Morris
escreveu:
> Javascript has this now though support isn't widespread.
>
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
>
> The most similar way to do it in PHP would be ?->
>
Optional chaining
Thanks!
There is a reason why it is not supported anymore?
There is a difference in output or performance, maybe?
Atenciosamente,
David Rodrigues
Em qua., 17 de fev. de 2021 às 17:37, Nikita Popov
escreveu:
> On Wed, Feb 17, 2021 at 9:28 PM David Rodrigues
> wrote:
>
>> He
!
Atenciosamente,
David Rodrigues
ed to include a class in an HTML
element conditionally. There are probably better ways, but this is a quick
one for simple situations:
... vs.
...
It is much easier to read, and I believe that the cost for language would
be minimal, and perhaps even more optimized than the use of ?:.
Atenciosamente,
my suggestion we have:
return $languageFirst instanceof LanguageExperience =>
$languageFirst->title;
The => is just a suggestion, other options using existing keywords is:
return expr() then output();
return expr(): output();
I do not know if other languages support something like that.
Thanks!
Atenciosamente,
David Rodrigues
Hello!
I cannot access php.net anymore. error 500.
Atenciosamente,
David Rodrigues
red!
}
Atenciosamente,
David Rodrigues
itch(8.0) { case strict 8.0: ... } // yes
Or allowing operators (this would be the most flexible way, as it would
allow for a number of other features):
(6) switch(8.0) { case === 8.0: ... } // yes
Atenciosamente,
David Rodrigues
red.
public function setAge(private int $age) {}
Just to think about whether it is possible to think of something along
these lines, but I'm still not sure if it's a good option.
Atenciosamente,
David Rodrigues
the stables, so it's too late to enforce the right (to me) ordering.
Yeah, but is there any way to go back now? :/
Atenciosamente,
David Rodrigues
Em sex., 20 de nov. de 2020 às 16:08, Sara Golemon
escreveu:
> On Fri, Nov 20, 2020 at 12:58 PM Guilliam Xavier <
> guilliam.xav...@gm
exposes fb()
to global scope and could causes errors:
function test() {
function fb($n): int
{
if ($n === 0) return 0;
if ($n === 1) return 1;
return fb($n - 1) + fb($n - 2);
}
var_dump(fb(10));
}
test();
test(); // Fatal error: Cannot redeclare fb()
Atenciosamente,
David R
, the unique behavior).
Atenciosamente,
David Rodrigues
too.
function fn1() as $lambda1 {
return function() as $lambda2 use ($lambda1) {
return [ gettype($lambda1), gettype($lambda2) ];
};
}
Atenciosamente,
David Rodrigues
Em qua., 11 de nov. de 2020 às 14:59, Christoph M. Becker
escreveu:
> On 11.11.2020 at 18:39, Dan Ackr
!
Atenciosamente,
David Rodrigues
x(): void => y(); // equivalents to function x(): void { y(); }
Atenciosamente,
David Rodrigues
Em seg., 26 de out. de 2020 às 11:23, Michał Marcin Brzuchalski <
michal.brzuchal...@gmail.com> escreveu:
> Hi Larry,
>
> I'm wondering why we hadn't thought yet about r
lass Test {
public function test(): void {
static $x = 0;
$x++;
var_dump($x);
}
}
(new Test)->test(); // 1
(new Test)->test(); // 2
Note that $x will share the context like a static property, even if it been
called from a non-static context.
Atenciosamente,
David Rodrigues
be done.
So opcode could be generated based on encrypted phar to give more speed.
Atenciosamente,
David Rodrigues
Em sex., 2 de out. de 2020 às 13:52, Rowan Tommins
escreveu:
> On Thu, 1 Oct 2020 at 16:13, Dik Takken wrote:
>
> > The only use case I see is to package commercial c
Maybe you just can implements your own method to check? Like your exists()
example.
Em sex, 4 de set de 2020 15:08, Michael Voříšek - ČVUT FEL <
voris...@fel.cvut.cz> escreveu:
> Your examples provide code for checking the existance of real
> properties. But how to check existance of a magic one?
s created using reflection without
> constructor.
>
> With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,
>
> Michael Voříšek
>
> On 3 Sep 2020 18:00, Sara Golemon wrote:
>
> > On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues
> > wrote:
>
It was just an example to avoid modify how clone works, using existing
features. :)
Em qui, 3 de set de 2020 13:00, Sara Golemon escreveu:
> On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues
> wrote:
>
>> Now I rethinked about what I said. Really, maybe clone is not the best
>
$this->copies[] = $userCopy;
return $userCopy;
}
Considering it, we have access to both now, with "write to source" support
with no additional feature need.
Em qui, 3 de set de 2020 11:21, Sara Golemon escreveu:
> On Wed, Sep 2, 2020 at 2:11 PM David Rodrigues
> wrote:
&g
Do you think that it could be proxied? I mean, optimize foreach
(array_keys()...) syntax to not call array_keys() in fact, but a optimized
version of foreach to handle key only. I don't know it opcache could do
that, and if it already does.
Em qui, 3 de set de 2020 12:12, Levi Morrison via interna
Do you think that it could be proxied too? I mean, optimize foreach
(array_keys()...) syntax to not call array_keys() in fact, but a optimized
version of foreach to handle key only.
Em qui, 3 de set de 2020 11:36, Sara Golemon escreveu:
> On Mon, Aug 31, 2020 at 6:56 PM tyson andre
> wrote:
>
>
I don't see problem to allow modify the original object, once that you are
doing it by using a new argument, and not the $this itself.
Em qui, 3 de set de 2020 08:49, Pedro Magalhães escreveu:
> On Wed, Sep 2, 2020 at 7:41 PM Michael Voříšek - ČVUT FEL <
> voris...@fel.cvut.cz> wrote:
>
> > do y
I understand... seems that `$this` is very confusing inside `__clone()`:
when writing, it writes to the clone, when reading it reads from original.
Seems valid a new optional parameter definition with the original source.
Atenciosamente,
David Rodrigues
Em qua., 2 de set. de 2020 às 15:41
I think "void" is a good solution and is very clear, compared to "_".
[void, void, $username] = getUserData();
Atenciosamente,
David Rodrigues
Em qua., 2 de set. de 2020 às 10:57, Dik Takken
escreveu:
> On 02-09-2020 15:35, Chase Peeler wrote:
> > Isn't t
tenciosamente,
David Rodrigues
Em seg., 31 de ago. de 2020 às 13:00, Sara Golemon
escreveu:
> On Mon, Aug 31, 2020 at 10:35 AM David Rodrigues
> wrote:
> >> It should be possible for the engine (at some layer) to look at that
> closure
> >> and see that it's just ne
be a good solution, but how hard should it
be to create a proxy like that?
Atenciosamente,
David Rodrigues
Em seg., 31 de ago. de 2020 às 11:55, Sara Golemon
escreveu:
> On Mon, Aug 31, 2020 at 9:41 AM David Rodrigues
> wrote:
>
>> > I agree with Larry that userland implementat
will be very simple and will
not need to create a new function to userland.
PS.: the array_reject() name suggestion is based on the lodash version (
https://lodash.com/docs/4.17.15#reject).
Atenciosamente,
David Rodrigues
Em seg., 31 de ago. de 2020 às 11:08, Chase Peeler
Currently we have array_filter(), but sometimes we need an inverse function
like array_reject().
array_reject('is_null', [ 1, 2, null, 3 ]); // [ 1, 2, 3 ]
It could be easily implemented with:
function array_reverse($fn, $arr) { return array_filter(fn($item) =>
!$fn($item), $arr); }
Anyway, I t
I have suggested on past a declare() to help in cases like that:
declare(php_version = "8.0");
It could be declared to new PHP files, so old files could supports # as
comments and new files will not.
Other option is supports
escreveu:
> Hi internals,
>
> If it turns out that the impact on lega
I really found your idea better than all. Keywork is already reserved, make
sense on this context.
Em ter, 18 de ago de 2020 03:49, Aleksander Machniak
escreveu:
> On 18.08.2020 00:35, Mike Schinkel wrote:
> > 1. Postpone inclusion of attributes until PHP 8.1
>
> +1
>
> I wonder why my suggestio
I suggests to make something like Node does: import "file.php" ($a, $b) so
$a and $b must be extracted from file.php context. All other variables
should be ignored.
Or, to avoid create more complexity and possible new keywords to import
syntax, maybe create a new function:
importx(string $file, ?
A new suggestion: @attr(...). It could be used on future for other syntaxes
and should be supersedes the error supression. So will be a BC exclusively
for @attr() error supression for attr() function. But it is few verbose and
easy to understand. With error supression remotion (9.0?) it could be us
equired characters: (16+1)
- Has end delimiter: yes
- Allow grouping: yes
- Forward compatibility in PHP 7: yes
- Breaks BC of valid PHP 7 codes: no
- Used by other languages: no?
- Familiar with Docblock Usage: I don't know
- Difficulties with Userland Parsers: I don't know
Atenciosament
gement, and on future we could have the "verbose syntax" ("using
attribute()") and shortened syntax (to be decided, but like "#[...]").
Atenciosamente,
David Rodrigues
Em qui., 30 de jul. de 2020 às 11:09, tyson andre
escreveu:
> Hi David,
>
> > I
I would like to suggests the syntax "using attribute(Attribute, ...)". It
is more clear and should not create BC.
Em qui, 30 de jul de 2020 10:28, Joe Ferguson escreveu:
> On Thu, Jul 30, 2020 at 7:50 AM Benjamin Eberlei
> wrote:
>
> > I think it has become clear that we need to revisit this sy
Oh, you are right! "yield from" is not common for me currently, so I really
skipped it.
In this case, is there some problem to apply it to Attribute case? "using
attribute(Attribute())" or something like that?
Atenciosamente,
David Rodrigues
Em qua., 29 de jul. de 2020 às
le is very hard to Google
symbols (so search will be "what mean double at in PHP" or "what mean
hashtag brackets").
Atenciosamente,
David Rodrigues
eed a new keyword, so we can apply it "as a function":
attr(Attribute(), Attribute()) function () {...} or attribute().
Or even more complex syntaxes, like: [: Attribute :].
Atenciosamente,
David Rodrigues
Em qui., 23 de jul. de 2020 às 12:32, Benas IML
escreveu:
> Just to chime i
ribute(...), ...
Or even create a new keyword like:
with Attribute(...), ...
function withAttribute() { ... }
And in last case, just use nothing but the attribute itself as a prefix:
Attribute(...) function withAttribute() {...}
Atenciosamente,
David Rodrigues
Em qua., 22 de jul. de 2020 às
cast working together with
__toBool() is a good one, but I think that it is being discussed in another
topic.
Atenciosamente,
David Rodrigues
Em ter., 14 de jul. de 2020 às 20:59, Josh Bruce
escreveu:
> Implement an interface and magic method to allow objects to represent
> false (or empty) w
There are some problem by using double back slash for PHP namespace?
Eg. Instead of \PHP\String be just \\String.
Em ter, 7 de jul de 2020 19:04, Larry Garfield
escreveu:
> On Tue, Jul 7, 2020, at 4:22 PM, Miguel Rosales wrote:
> > Larry Garfield wrote on 07/07/2020 16:46:
> > > This has reache
Seems great, but maybe include more information should be better:
Warning: Attempt to read property 'property' on bool <> in
/in/IGUcS on line 5
Atenciosamente,
David Rodrigues
Em qui., 2 de jul. de 2020 às 12:27, Máté Kocsis
escreveu:
> Hi David,
>
> Please have a
;property
-> trying to get property 'id' of non-object (array) retrieved from return
of getObject()
Atenciosamente,
David Rodrigues
, because if
we have get:public, and $x is accessible, so it is isset by nature.
Atenciosamente,
David Rodrigues
Em seg., 29 de jun. de 2020 às 12:03, Deleu escreveu:
> As a user, I would prefer the original proposed syntax `public:private` or
> the Swift syntax `public private(set)` t
I like to suggest that, by default, attributes could be repeatable, so we
can disable this instead (eg. "@@ Attribute(self::IS_UNIQUE)").
Atenciosamente,
David Rodrigues
Em seg., 22 de jun. de 2020 às 13:38, Benjamin Eberlei
escreveu:
> Hello,
>
> The voting period is over
life
(of course, considering that there are really exceptions).
Anyway, I believe that we must keep the current terminology as long as it
has specific meaning for us and, if it is to change, to change little by
little, and not in a radical or forced way.
Atenciosamente,
David Rodrigues
Em seg.,
t;
I believe that the second solution is the simplest to be implemented and
already solves the problem enough.
Atenciosamente,
David Rodrigues
need works with external resources, like
RESTful, where timeout can occur and we need a better way to work with
that. Or when we have few seconds to run a process.
What do you think?
Atenciosamente,
David Rodrigues
I just think that this way is more compatible witth the reading. "Return X
if Y" seems better than "return (if) X: (then) Y". Too the ":" could
conflicts with return type.
Em dom, 10 de mai de 2020 16:59, Ralph Schindler
escreveu:
>
>
> On 5/10/20 1:56 PM
Suggestion:
return if $x > 1; (to return "void")
return $y if ($x > 1 && $x < 5);
break if $x > 1;
break 2 if $x > 1;
throw new Exception if $x > 1;
Em dom, 10 de mai de 2020 15:48, Nikita Popov
escreveu:
> On Sun, May 10, 2020 at 5:49 PM Ralph Schindler
> wrote:
>
> > Hi!
> >
> >
> > # Intr
Maybe throw an exception by default when it happen. Considering
max_input_vars+1, when hit, throw.
Em dom, 10 de mai de 2020 09:34, Craig Duncan escreveu:
> >
> > Although not particularly elegant, and it does require you to reject
> requests that hit but don't exceed the limit, I've used this a
tenciosamente,
David Rodrigues
Em seg., 13 de abr. de 2020 às 12:32, Reindl Harald
escreveu:
>
>
> Am 13.04.20 um 17:08 schrieb David Rodrigues:
> > With all the humility of the world and without wanting to be exhaustive
> > about this, my only question is why can't we keep
ch are basically the same thing,
however, in different scopes. Likewise, "break 2" would be impossible in
this case, so just issue an error saying "break n is not supported in this
situation".
Atenciosamente,
David Rodrigues
Em seg., 13 de abr. de 2020 às 11:49, Rowan Tommins
e
another format to switch.
And maybe you should just use "return" here to specify the return value.
$x = switch ($y) {
case 1: return $y + 1;
case 2: return $y - 1;
// default: return null;
};
Atenciosamente,
David Rodrigues
Em ter., 31 de mar. de 2020 às 15:51, Ilija Tovilo
I think it useful, despite that it could be done by using array_push() as
Woortmann said. Anyway, I think valid a new proposal for thinks like that.
But I will suggests this:
$arr[] = ... $items;
Atenciosamente,
David Rodrigues
Em sáb., 28 de mar. de 2020 às 20:07, Michael Voříšek - ČVUT FEL
I agree with Tovilo. It is weird and confusing. Actually I never know that
it was possible. And the ";" sounds like "it ends here", while ":" counds
like "it does it ->". For me, "case 1;" will sounds like "skip case 1".
Atencio
ction __construct(public int $x) { ... }
}
class B extends A {
public function __construct(public int $y) { ...;
parent::__construct($y); }
}
Atenciosamente,
David Rodrigues
Em qui., 26 de mar. de 2020 às 12:45, Sebastian Bergmann
escreveu:
> Am 26.03.2020 um 14:30 schrieb Nikita Popo
);
But you have only A $a.
You can create:
function __cast($value) {
if ($value instanceof A) return B($value, 123, M_PI);
}
Then use:
requiresB((B) $a);
Atenciosamente,
David Rodrigues
Em qua., 25 de mar. de 2020 às 20:06, Stanislav Malyshev <
smalys...@gmail.com> escreveu:
>
and properties.
---
To make possible custom some kind of castings, I suggests a new magic
method __cast($value).
class Number {
...
function __cast($value) {
if (is_int($value) || is_float($value)) return new static($value);
throw new TypeError();
}
}
Just to talk.
Atenci
int $b = 0)
My suggestion would be to use the keyword "default" in the context of the
argument. To avoid confusion, another keyword could be created, but I don't
see why they confuse "default" as an argument and "default" for switch.
test(default, 2) === test(M_PI, 2, 0)
Atenciosamente,
David Rodrigues
ther languages.
And too, could annotators have some additional features like Typescript
decorators?
Atenciosamente,
David Rodrigues
Em seg., 9 de mar. de 2020 às 16:35, Aleksander Machniak
escreveu:
> On 09.03.2020 15:42, Benjamin Eberlei wrote:
> > The RFC is at https://wiki.php.net/r
ntil the PSR
staff decides how best to write.
Atenciosamente,
David Rodrigues
Em seg., 9 de mar. de 2020 às 16:19, Andrea Faulds escreveu:
> Benjamin Eberlei wrote:
> > I want to resurrect Dmitrys Attributes RFC that was rejected for 7.1 in
> > 2016 with a few changes, incorporating feed
Maybe you can set all this messages as lowercase? That way we can use it
more easily. If we need the first letter in capital letters we can use
`ucfirst()`, because the opposite is more complicated (a `strtolower()`
would "break" the "JIT" message, for example).
Atenciosame
have an error. Call order should be respected
now once that will be impossible you have $objectA * $objectB without
defines a priority (the main handler).
--
Atenciosamente,
David Rodrigues
Em ter., 28 de jan. de 2020 às 20:14, escreveu:
> Hello everybody,
>
>
>
> the last days I
Em qui., 28 de nov. de 2019 às 14:13, Dan Ackroyd
escreveu:
> On Wed, 27 Nov 2019 at 23:33, David Rodrigues
> wrote:
> >
> > Hi internals,
> >
> > I am using the register_shutdown_function() inside a class, and then I
> have
> > created a private meth
t a public scope. As workaround I am
keeping it as public.
So, there are some reason to it do not works like spl does?
--
David Rodrigues
: ( $expr == B1 ? B2 : C );
Just a discussion to check what do you think.
--
David Rodrigues
9AGId2Gp0YgGOaNTu+BZmeB6Q+pnjWNO5fJVRry68=
> =ueur
> -END PGP SIGNATURE-
>
>
> --
> PHP 7.4 Release Manager
> Host of PHP Internals News: https://phpinternals.news
> Like Xdebug? Become my Patron: https://www.patreon.com/derickr
> https://derickrethans.nl | https://xdebug.org | https://dram.io
> twitter: @derickr and @xdebug
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
David Rodrigues
ES6 supports the Symbol type that is a replacement to hard-coded
identifiers where it are not really need.
I like to suggests a similar feature to PHP.
#0: it should be a partial class that could not be instantiated (new symbol
should be invalid, like an abstract class).
In this point I should s
Not long ago I heard about the Tail Call Optimization from ES6. It seemed
obscure to me at first, but once I understood the benefit of having it, it
seemed like a good idea of optimization for PHP to avoid recursion problems.
Is there any plan to make it possible in the engine?
--
David
]
> >
> > Thank you,
>
> Hello again internals,
>
> Thanks everyone for your valuable feedback. I have updated the RFC
> with a new Discussion section to [try to] summarize the various
> arguments raised in this thread.
>
> --
> Guilliam Xavier
>
--
David Rodrigues
f you pretends to keep the comma as fourth arg once that
normally you will use or "." or "," as decimal separator.
* If you pretends to use dot + comma, just use two args;
* If you pretends to use comma + dot, just use four args;
* If you pretends to use dot + nothing, use three args;
* If you pretends to use comma + nothing, use three args;
--
David Rodrigues
ull;
> }
>
> return (int)$int;
> }
>
> register_cast_function('?int', 'castToIntOrNull');
>
> $x = (?int)getIntOrNull();
>
>
> > Additionally, it was requested on the mailing list to consider adding
> > support of nullable types to the settype() function,
> > e.g. settype($variable, "?int")
>
> Someone probably needs to make an argument for it to be in core,
> rather than just saying that it's something that could be done.
>
> cheers
> Dan
> Ack
>
--
David Rodrigues
Just to know, can we have a random_seed() for random_int()/random_bytes()
like we have mt_srand() to mt_rand()?
I don't know if random_int() is more "random" than mt_rand(), but if it is,
so maybe is valid a random_seed() function.
--
David Rodrigues
1 - 100 of 176 matches
Mail list logo