Hello, I tried to register in RFC Wiki but I get the error "That wasn't the
answer we were expecting", but in all cases, I'm David Rodrigues, and I
like to suggest a method to initialize objects by using an object
initializar. Currently it is supported on C#
mple is roughly equivalent
> to:
>
> function($x) use($multiplier) { return $x * $multiplier; }
>
> The RFC contains a detailed discussion of syntax choices and binding modes.
>
> Regards,
> Nikita
>
--
David Rodrigues
> So the following, while redundant, is currently valid:
>
> $foo = [ ($bar) => $baz ];
>
Yeah, I don't think in that case. And maybe using [] instead of ()? For
instance: "[$x] => $x + 1". PHP don't supports and array as key, so maybe
it will not causes any conflict.
--
David Rodrigues
is promoting programmers to make mistakes. Albeit typically
> easy to catch ones, it is a quality of life change at least.
>
> Hence I'm proposing a RFC changing the precedences:
> https://wiki.php.net/rfc/concatenation_precedence
>
> Bob
>
--
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
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
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
]
> >
> > 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
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
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
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
: ( $expr == B1 ? B2 : C );
Just a discussion to check what do you think.
--
David Rodrigues
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
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
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
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
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
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
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
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
);
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:
>
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
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
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
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
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
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
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
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
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
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
t;
I believe that the second solution is the simplest to be implemented and
already solves the problem enough.
Atenciosamente,
David Rodrigues
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.,
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
, 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
;property
-> trying to get property 'id' of non-object (array) retrieved from return
of getObject()
Atenciosamente,
David Rodrigues
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
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
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
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
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
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
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
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
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
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
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
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, ?
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 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
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
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
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
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
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
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 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
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:
>
>
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
$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
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
>
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:
>
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?
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
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
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
!
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
, the unique behavior).
Atenciosamente,
David Rodrigues
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 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
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
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!
}
Atenciosamente,
David Rodrigues
Hello!
I cannot access php.net anymore. error 500.
Atenciosamente,
David Rodrigues
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
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,
!
Atenciosamente,
David Rodrigues
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
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
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:
>
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
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:
>
> >
This is a great idea in general, but I think that this kind of
operator is not the ideal (expect for $$ that seems very good).
Some possibilities to think about:
|> (as suggested) seems strange and not very clear, mainly in linear calls
--> can be too long, but can make more sense or continuing,
implementation of this
feature.
All this ways have a lot of limitations.
A hackish example that shows how it should works on current PHP
version: http://pastebin.com/cz93wL7n
---
I tell more about that here: https://bugs.php.net/bug.php?id=72637
--
David Rodrigues
--
PHP Internals - PHP
e end however, is something I'd rather handle
> with the following:
>
> foo() |> bar($$) |> $baz = qux($$);
>
> Which is both legal with the syntax as-is, and entirely readable
> without adding an extra operator.
>
> -Sara
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
The idea is good, but I think that is not pratical in general.
---
First point: we should define each new identifier that could be used.
It not make clear what this identifier does or even how it should
works when a package redefines what it does.
For instance:
// file1.php
set_escape_handler('
> However, that also means there's an enormous potential for race
> conditions. Technically no more than closures now, but the use cases
> seem like they'd make it more prevalent. If you "use" by reference, or
> use a mutable object, or a service that depends on IO, etc. then the
> resulting valu
Dan Ackroyd wrote:
> This looks to solve a problem very similar to the one solved by the
> 'Memoize' annotation in HHVM -
> https://docs.hhvm.com/hack/attributes/special#__memoize
> However the memoize functionality seems a lot clearer to me, as it's
> less 'magic'; it doesn't make accessing a var
Dan Ackroyd wrote:
> Yes, but the difference is in the surprise factor.
>
> Two functions having a circular dependency ==> not too astonishing,
> and easy to think about.
>
> Reading the value of a variable having a circular dependency ==> give
> up programming to become a farmer.
Okay, so we can
p.net/bug.php?id=50434. I've added those functions on my
> local PHP copy. I would like to make an RFC and a PR for adding it to the
> core PHP copy.
>
> Thanks,
>
> Will
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: htt
'm not sure on the boolean through, I think a new function might be better.
>
> It's something that can be implemented in userland, but it's also something
> that's really often needed.
>
> Regards, Niklas
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
arate functions rather than as a parameter. e.g.
>> str_begins(), str_ibegins(), str_ends(), end_iends()
>
> +1 for having functions for case insensitivity.
> I'm not sure if we should have "s". i.e. str_begin"s".
>
> Regards,
>
> --
> Yasuo Oh
>>> along with Composer auto-loading features will favor a best practice of
>>> shipping packages with namespaced functions only, so the performance
>>> implications of checking twice would be negligible in practice.
>>>
>>> Being basically unable to shi
> Looking for some feedback/opinions on whether anyone else thinks this
> should be fixed differently (or not at all).
>
> N.B. this also changes the behaviour of mt_rand to now accept min > max
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ormance? It should be great. In all case, depending
of response here, I could try do something, but I don't promises.
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
27;, 5) => compare($id, 5, '>')
I guess that it could supports all PHP operators: ==, ===, !=, <>,
!==, <, >, <= and >=.
The spaceship operator does the works too for integers, but not should
works if you expects than $a === $b, or when you expects than $a >=
$b.
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
ndition is client-defined, not
developer-defined. For instance:
lower, greater, lower-equal, greater-equal,
equal
In this case, I should implements a switch, where a compare() should works fine.
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
float, $bits), for instance). But it can be part of another
discussion.
--
David Rodrigues
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
1 - 100 of 176 matches
Mail list logo