#x27;80');
> var_dump($sock);
>
> $socks = array($sock);
> var_dump(stream_select($socks, $socks, $socks, 1));
>
> //var_dump(stream_select(array($sock), array($sock), array($sock), 1));
> //Fatal error: Only variables can be passed by reference in
> /home/yohgaki/tmp/t
may also need to
check if those numeric keys are a sequence starting from 0.
At least, that was my case when I was implementing MessagePack protocol.
And I ended up just doing this trivial check: array_values($array) ===
$array.
--
Thank you and best regards,
Eugene Leonovich
On Sat, Jun 4, 2016 at 9:42 PM, Jordi Boggiano wrote:
> On 04/06/2016 20:36, Rasmus Schultz wrote:
>
>> I wrote a library that can serialize/unserialize PHP object graphs to JSON
>> data.
>>
>> Somebody reported it doesn't work on the DateTime class.
>>
>> Does this deliberately not work?
>>
>>
>
> Didja really?
>
> https://wiki.php.net/rfc/auto-implement_stringable_for_string_backed_enums
Why has it been withdrawn?
> Hello internals!
>
> I was wondering, has there been any discussion about supporting local
> constants (variables that cannot be reassigned, perhaps even function
> parameters)?
>
As for me, I would've hoped that there were local constants in PHP and I'd
want to provide some thoughts on this reg
Name::__CLASS__?
Eugene
"Ralph Schindler" wrote in message
news:4f89d4f1.8070...@ralphschindler.com...
> Hi all,
>
> There are many different use cases were in code we expect classes names as
> arguments to functions as fully qualified names. We do this in ZF a lot
> wit
solutions for that?
Please, any kind of information will helpful here.
Thanks ahead.
Eugene San
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Antony Dovgal wrote:
On 26.02.2008 23:48, Eugene San wrote:
1) Is there any reason to link all PHP SAPI modules statically with all
PHP objects?
In most cases you need only one SAPI, so there is no reason to share something.
2) Is it possible to extract all shared functionality
Antony Dovgal wrote:
On 27.02.2008 21:04, Eugene San wrote:
3) Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?
What costs 2.5MB?
Dynamic linking against libxml2.so?
Linking against
Andi Gutmans wrote:
Hi Eugene,
Do you want to have an option to exclude libxml2 and its related functionality
from the build? If so, have you done the analysis of what pieces of PHP create
this dependency?
Currently I've replaced libxml2 with libexpat + DOM in php, that solution
Hello, internals! I just want to share some thoughts with you regarding
what could be improved in the first class callable syntax.
It is already possible to create Callable from a static method:
```
class Foo {
public static function staticmethod() {}
}
$c = Foo::staticmethod(...);
```
It would
Hi there,
This functionality is common for data intensive applications that leverage
distributed systems for coping with load.
In other words, having it at core level is desirable for enterprise-level
systems.
Ordinary web-sites are unlikely to use this feature.
Though, I'd highly appreciate it
One thing I'd like to point out is regarding second phase (commit phase)
It's important to understand that once this phase has started, there's no
way back. After code execution is behind commit point, the transactions
MUST commit no matter what. Data must be committed regardless of network
issues
You won't believe it, but just right now I've been thinking about that it
would be a wonderful feature for PHP to have some kind of type-tests (like
`$a is Foo&Bar` or `$b is Foo|Baz|null`), and here you write out this email.
I didn't read the whole RFC, but I'd like to say that having at least
af
On Tue, May 7, 2019 at 5:14 PM Mark Randall wrote:
> On 07/05/2019 15:22, Gert wrote:
> > My idea, extremely summarized, would be to take the functions that
> > return false/null when they 'error', and instead make them actually
> > throw an error.
>
> It comes up on various discussion forums eve
Hello, internals!
I am wondering why don't we use ordinary `->` operator with safe null
handling? Programmers will be more prone to return null values. And thus,
in most of cases `?->` will replace `->`.
Why do we need another operator, if we can implement null safe in current
operator without BC b
-- Forwarded message -
From: Eugene Sidelnyk
Date: Tue, Nov 3, 2020 at 7:08 PM
Subject: Re: [PHP-DEV] Nullsafe
To: Benjamin Morel
But currently working code doesn't fail with NullPointerException?
Otherwise it would not be a working code.
Early fail will be when we try r
h no warning:
> https://3v4l.org/Wmun4
>
> Benjamin
>
> On Tue, 3 Nov 2020 at 18:09, Eugene Sidelnyk wrote:
>
>> But currently working code doesn't fail with NullPointerException?
>> Otherwise it would not be a working code.
>> Early fail will be when we try return
-- Forwarded message -
From: Eugene Sidelnyk
Date: Tue, Nov 3, 2020 at 8:11 PM
Subject: Re: [PHP-DEV] Nullsafe
To: Benjamin Morel
When trying call a method, php falls with fatal error:
https://3v4l.org/jk5Fp
With nullsafe it silently returns null:
https://3v4l.org/MhXtM
Are
-- Forwarded message -
From: Eugene Sidelnyk
Date: Tue, Nov 3, 2020 at 9:05 PM
Subject: Re: [PHP-DEV] Nullsafe
To: G. P. B.
Null value by itself was invented to indicate lack of data.
But we can't just use it instead of objects, because of how it works.
We need to cre
-- Forwarded message -
From: G. P. B.
Date: Tue, Nov 3, 2020 at 9:08 PM
Subject: Re: [PHP-DEV] Nullsafe
To: Eugene Sidelnyk
On Tue, 3 Nov 2020 at 19:05, Eugene Sidelnyk wrote:
> Null value by itself was invented to indicate lack of data.
> But we can't just use it
"have bad
preconceptions" and would like to find more things they like about the
feature.
On Tue, Nov 3, 2020 at 8:33 PM G. P. B. wrote:
> On Tue, 3 Nov 2020 at 16:48, Benjamin Morel
> wrote:
>
>> On Tue, 3 Nov 2020 at 17:38, Eugene Sidelnyk wrote:
>>
>
11 PM Marco Pivetta wrote:
> Heya,
>
> On Tue, Nov 3, 2020, 17:38 Eugene Sidelnyk wrote:
>
>> Hello, internals!
>> I am wondering why don't we use ordinary `->` operator with safe null
>> handling? Programmers will be more prone to return null values. And t
""` or `0` or `0.0`
or `false` or `[]` - generally speaking `null`.
On Tue, Nov 3, 2020 at 9:56 PM Claude Pache wrote:
>
>
> > Le 3 nov. 2020 à 17:38, Eugene Sidelnyk a écrit :
> >
> > Hello, internals!
> > I am wondering why don't we use ordinary `->` op
NCTION__);
}
$foo = null;
$foo?->baz(expensive_function());
```
On Tue, Nov 3, 2020 at 10:11 PM Marco Pivetta wrote:
> Heya,
>
> On Tue, Nov 3, 2020, 17:38 Eugene Sidelnyk wrote:
>
>> Hello, internals!
>> I am wondering why don't we use ordinary `->` operator w
Thus, can you provide any other dangerous example?
On Wed, Nov 4, 2020, 6:59 AM Eugene Sidelnyk wrote:
> But wait!
>
> In your example, funds won't get detracted. If `$accounts->get($receiver)`
> will return `null`, then everything inside `addFunds(...)` will not be
> e
Yeah... Creating null was a huge mistake.
Now it is probably too late to fix that (maybe some new language can
introduce that).
But what do you think about introducing special class `NullObject`?
On Wed, Nov 4, 2020, 9:32 PM Christian Schneider
wrote:
> Am 04.11.2020 um 19:39 schrieb Eug
When you follow ISP, you probably would have a lot of interfaces.
Thus, client code may require an object to implement a bunch of interfaces
depending on functionality needed.
Consider class `Bar`:
```php
interface A {}
interface B {}
interface C {}
interface D {}
interface E {}
class Bar i
Yes.
And I think it will be good if enforced by language.
On Sat, Nov 7, 2020, 5:33 PM Olle Härstedt wrote:
> 2020-11-07 15:12 GMT, Eugene Sidelnyk :
> > When you follow ISP, you probably would have a lot of interfaces.
> > Thus, client code may require an object to imple
ould be some case where such features are actually
needed.
Regards, Eugene
On Sat, Nov 7, 2020 at 10:47 PM Sara Golemon wrote:
> On Sat, Nov 7, 2020 at 9:33 AM Olle Härstedt
> wrote:
>
>> 2020-11-07 15:12 GMT, Eugene Sidelnyk :
>> > function foo(A & B & E $object)
, Nov 8, 2020 at 4:53 PM Marco Pivetta wrote:
> Hey Eugene,
>
> On Sat, Nov 7, 2020 at 4:13 PM Eugene Sidelnyk
> wrote:
>
>> ```php
>> function foo(A & B & E $object) {
>> // some work
>>
>> var_dump($object);
>> }
>> ```
>
Hello, internals!
What do you think about creating shorthand `number` for `int|float`?
Think the way it is implemented in JS is better than `$lambda` variable. At
least it doesn't have BC breaks (does it?)
On Tue, Nov 10, 2020, 7:38 PM Hans Henrik Bergan
wrote:
> something i'm missing from Javascript is the ability to give names to
> closures,
> this both gives closures the abilit
Levi will not have time for this. Who else do you suggest?
On Sun, Nov 8, 2020, 6:47 PM Eugene Sidelnyk wrote:
> > As for when to allow them: as others have suggested in this thread, keep
> it simple for now, and only allow intersection of class/interface
> references.
>
>
or don't.
BTW, this way people won't be able to cheat inasmuch vote is an monetary
unit
On Sat, Nov 14, 2020, 2:56 PM G. P. B. wrote:
> On Sat, 14 Nov 2020 at 11:17, Eugene Sidelnyk wrote:
>
>> Levi will not have time for this. Who else do you suggest?
>>
>
> Pl
Fully agree with Marco
On Tue, Dec 22, 2020, 1:00 PM Marco Pivetta wrote:
> Hey Tyson,
>
> I know I'm being stubborn, but we have namespaces, but also an "old guard"
> that doesn't understand its own programming language 🤷♀️
>
> On Sat, Dec 19, 2020, 21:24 tyson andre wrote:
>
> > Hi internals
Hi there!
I faced a lack of methods overloading in PHP once again and would like to
ask will it be implemented at some point?
As well, I want you to show some pros and cons which you see in this
feature.
Here're some thoughts about this by Yegor Bugayenko:
> On 28/02/2021 12:49, Eugene Sidelnyk wrote:
> > Hi there!
> > I faced a lack of methods overloading in PHP once again and would like to
> > ask will it be implemented at some point?
> > As well, I want you to show some pros and cons which you see in this
> > featu
When use str_replace with arrays there's strange behavior
https://3v4l.org/maNqa
```php
var_dump(str_replace(
[
',',
'.',
],[
'.',
',',
],
'1.2,3'
));
```
This code is expecte
will fail if you pass only one:
https://3v4l.org/tLO0s. I wonder what the correct version of the pipe
example (the one that uses strings as callbacks) would look like, given
that you have to pass two arguments for explode()?
--
Thank you and best regards,
Eugene Leonovich
On Fri, Jul 1, 2016 at 10:51 AM, Михаил Востриков <
michael.vostri...@gmail.com> wrote:
> > I can easier add a new template to e.g. a Laravel
> > project (own parser, own extension, living next to existing blade
> templates)
>
> Your project already has a template engine, and framework has common
Hello, everybody!
After using nullsafe operator for a while, I have some further thoughts.
In most cases when we make type nullable, we would use nullsafe operator if
we don't know how to deal with it. This causes clogging main code with this
? signs. Possible solution is to make nullsafe type in
I would really like to hear your thoughts on this.
On Thu, Jun 24, 2021, 10:14 PM Eugene Sidelnyk wrote:
> Hello, everybody!
>
> After using nullsafe operator for a while, I have some further thoughts.
> In most cases when we make type nullable, we would use nullsafe operator
> i
IMHO, This is suger which leads to diabetes. It adds pure implicitness
without any payback. To convert object into something else add appropriate
method.
On Sat, Jul 10, 2021, 3:07 PM Marco Pivetta wrote:
> Hey Max,
>
> On Sat, 10 Jul 2021, 11:09 Max Semenik, wrote:
>
> > I've been thinking abo
This is replica of github PR comments:
Hi there!
Isn't it better to simplify this a bit? I mean `readonly` keyword is really
long to type every time we need such property. Earlier (in php7.3)
properties were defined only with visibility modifier. Now it is going to
become *t verbose*.
```php
ill use it because it is too complicated (really,
instead of simply declaring an argument, a programmer has to write a bunch
of other stuff in front of it for every single method and function).
On Fri, Jul 16, 2021 at 10:06 AM Nikita Popov wrote:
> On Fri, Jul 16, 2021 at 8:45 AM Eugene Side
`php
mutable public string $bar;
```
Hence I mean: currently we have one default option (mutable properties)
from 2 options. Why do we need to create such a long keyword just to use
readonly properties (if immutability is better than mutability)?
Regards, Eugene
On Fri, Jul 16, 2021 at 1:13 PM Bruce
AM, Bruce Weirdan wrote:
> >
> > On Fri, Jul 16, 2021 at 9:45 AM Eugene Sidelnyk
> wrote:
> >
> >> Readonly properties are really useful for DDD, where everything is
> going to
> >> be immutable. It promotes best practices. However for people to use it,
>
he will
know what he did wrong right in a few seconds. After blowing up (if this
will ever happen), programmer will write the code with understanding how
and why it works this way.
On Fri, Jul 16, 2021 at 7:14 PM Larry Garfield
wrote:
> On Fri, Jul 16, 2021, at 6:48 AM, Eugene Sidelnyk wrot
I don't think the way it is going to be realeased is elegant solution
On Sat, Jul 17, 2021, 2:47 PM Andreas Leathley wrote:
> On 16.07.21 09:06, Nikita Popov wrote:
> > We cannot make properties readonly by default, because that would be a
> > major backwards compatibility break.
> >
> > If you'
Hi, I myself faced such bugs because filter function preserves keys. From
my experience it is not that easy to locate bug like this. In my case I
rewrote solution in other way than it was originally written. Only later I
realized that root cause was array_filter
On Sun, Sep 19, 2021, 4:11 PM tyson
All the world currently talks about the situation in Ukraine. Everyone who
knows the truth are trying to help stop invasion. The main problem here is
that most of Russian people believe in Putin's political position. Moreover
they will have Instagram and Twitter blocked soon in Russia so that they
r 3, 2022, 7:59 PM Chase Peeler wrote:
>
>
> On Thu, Mar 3, 2022 at 12:56 PM Eugene Sidelnyk
> wrote:
>
>> All the world currently talks about the situation in Ukraine. Everyone who
>> knows the truth are trying to help stop invasion. The main problem here is
>>
Maybe we'd create an RFC, create an poll and decide this way?
On Thu, Mar 3, 2022, 8:10 PM Alain D D Williams wrote:
> On Thu, Mar 03, 2022 at 07:56:39PM +0200, Eugene Sidelnyk wrote:
>
> > If you, as PHP community, do not do anything about it, it would mean that
> &g
BTW, regarding symfony and banner, it doesn't seem to have many (if any)
issues in github flooded. So what's the problem?
On Thu, Mar 3, 2022, 8:27 PM Max Semenik wrote:
> Each of these options would take some time, and time is what
>
> On Thu, Mar 3, 2022 at 9:14 PM Eugen
ow you
are trying to help whatever you think you can help.
By "you" I mean PHP community.
On Thu, Mar 3, 2022, 11:46 PM Kalle Sommer Nielsen wrote:
> Den tor. 3. mar. 2022 kl. 20.29 skrev Eugene Sidelnyk >:
> >
> > BTW, regarding symfony and banner, it doesn'
Looks very interesting, and most importantly, useful.
On Sat, Mar 19, 2022 at 6:38 PM G. P. B. wrote:
> Hello internals,
>
> I would like to open the discussion on the Disjunctive Normal Form (DNF)
> types RFC:
> https://wiki.php.net/rfc/dnf_types
>
> The implementation for it is available on my
I completely agree with Marco. We should not mix up nullsafe operator with
array access. As for me, aforementioned code works as expected.
As an improvement, we can think of access-safe operator (like `$arr[?0]`),
however I'm not sure if introduction of such will make sense.
Regards
Yevhen
On We
Hello internals!
I have noted some strange points about `str_repeat` performance. It looks
like the lesser `$times` argument is, the bigger is execution time (only if
we consider big numbers).
For example, `str_repeat('%d ', 12500);` is a lot slower than
`str_repeat('%d ', 125)`.
First case
Oh, yes. Sorry for that.
Thanks for pointing out.
On Sat, Sep 10, 2022 at 3:23 PM Christoph M. Becker
wrote:
> On 10.09.2022 at 14:19, Eugene Sidelnyk wrote:
>
> > I have noted some strange points about `str_repeat` performance. It looks
> > like the lesser `$times` argument
Hello internals!
I'm wondering if there are any plans for union type casts support.
That's basically what I mean:
```php
function checkItOut(int|float|string $bar)
{
$foo = (int|float)$bar;
var_dump($foo);
}
```
I assume the behavior should be the same as if we called the function
havin
t 4, 2022, at 21:46, Eugene Sidelnyk wrote:
> >$foo = (int|float)$bar;
>
> As written, I wouldn't know what to expect this to do with a string value
> -- would it cast it to int or float?
>
> Based on the behavior of your second example, the answer appears to be
> &qu
I used to have an awkward feeling when it was necessary to convert the
nullable integer into a nullable string. It would be kind of ternary
operator anyway. Either `$b = (null !== $a) ? (string)$a : null;` or `$b =
(string)$a ?: null;`.
A lot easier to read would it be if written this way: `$b = (
Hello internals!
I'm just wondering why First class callable syntax doesn't allow partial
application?
Recently I stumbled across following scenario where it could be really
useful:
```
public function __invoke(SendOtpCommand $command)
{
$this->cache->get($command->getPhone(), $thi
Seems Uncle Bob with his boy scout rule left the room...
On Fri, Mar 10, 2023, 2:19 PM Max Kellermann wrote:
> On 2023/03/01 13:15, Max Kellermann wrote:
> > IMO this is a bug in the process, and I'm trying to fix it. It should
> > be allowed to merge small incremental improvements without a d
n Fri, Mar 10, 2023, 9:53 PM Larry Garfield wrote:
> On Fri, Mar 10, 2023, at 1:04 PM, Eugene Sidelnyk wrote:
> > Hello internals!
> > I'm just wondering why First class callable syntax doesn't allow partial
> > application?
> > Recently I stumbled across f
On Tue, Mar 14, 2023 at 12:39 PM Bob Weinand wrote:
>
> > Am 14.03.2023 um 10:16 schrieb Rowan Tommins :
> >
> > On 13/03/2023 20:44, Larry Garfield wrote:
> >> As has been discussed numerous times, all of the most used array
> functions need to be redesigned to work with iterables, and in many
s/maps:
https://github.com/rybakit/msgpack.php/blob/master/src/Packer.php#L112-L114
--
Thank you and best regards,
Eugene Leonovich
On Mon, Feb 4, 2019 at 3:45 PM Zeev Suraski wrote:
> One our hopes in opening this up for comments, is that people would
> actually try the code themselves and experiment with it - well beyond what
> we can do ourselves.
>
Is there a docker image with JIT support that people can try?
: https://gist.github.com/rybakit/bb551f962b706a9e08c995cf5ed9762f
--
Thank you and best regards,
Eugene Leonovich
Hello internals!
Currently, iterator_count has the following signature:
iterator_count(Traversable|array $iterator): int
If we try to use iterable type and pass it to iterator_count function, we'd
get following static analysis error:
Argument 1 of iterator_count expects Traversable|array,
but
Hi, Larry, That's super! I hope it will pass!
Oladoyinbo, IMO the way it is described right now (e.g. explicit closures)
is much more elegant than a new way of doing things that's not so obvious
and will be necessary to keep in mind and support anyway.
If it'd be necessary to simplify the stuff,
Hello
If I remember correctly, the whole concept of "value" is fully described in
DDD book by Eric Evans. If that's the point of the RFC, I wonder of there's
any point in not making such classes immutable by default, and to keep only
one instance of value object unique per given set of properties
Hello, everyone
I'm just wondering how the new attribute that defines behavior (not just
additional metadata) will fit into the rest of the system.
Right now, return type hints are not implemented just as an attribute, but
as "native" type declaration.
I mean, what we have right now:
function f
Hi Sam, Tim, Rob
Maybe there could be another good feature to start with - the function to
format bytes into a human-readable format (for debug purpuses) to have
pretty view of the size (like 1.5GB, or 20MB)
Right now every time I need this, I find myself copying the function from
stack overflow,
>
> The wording “spicy”, “heretical”, “literally unusable”, “vibe”, the use
> of ChatGPT, and the current calendar date requires me to ask:
>
Actually, if we put aside all of this, and think about it more seriously,
personally I myself find it somewhat tedious to have every class have
interface fo
>
> Yes, that is much much nicer! It feel familiar to go:
>
> go file_get_contents($file[$i])
>
> And yes, I realize that would be a fun error in go, but you get the gist.
>
> — Rob
>
Yes, that's the point that we don't bother client code with any of the
async stuff 🙂
If we want to create "async
>
>
>
The uncoloring of functions in PHP is probably one of the most annoying
> aspects of fibers, IMHO. It's hard to explain unless you've been using them
> awhile. But, with colored functions, the caller has control over when the
> result is waiting on -- it could be now, it could be in a totally
>
> wrap it in a specific form (async\run or async\async, in this RFC), which
> ironically colors the function.
>
It doesn't color the function.
The function is unchanged.
Any existing function in userland do not have to be changed in any way.
It's calls do not have to be rewritten into await, an
Hi there,
I would also like to highlight some interesting ideas that I find being
useful to consider.
Recently Bend programming language has been released, and it incorporates a
completely different view on the conception of "code", in the definition of
"what it is" and "how it should be interpre
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
At first signature seemed somewhat confusing to me, but now it makes
perfect sense.
Type-wise, about LSP, I find it logical that more concrete implementations
cou
On Sat, Jun 28, 2025, 8:07 AM Larry Garfield wrote:
> Hi folks. Arnaud and I would like to present take-2 at Partial Function
> Application.
>
> https://wiki.php.net/rfc/partial_function_application_v2
>
> It is largely similar to the previous PFA proposal from 2021, though there
> are a number
Hello, Khalil
Could you explain the pros of your proposal in comparison with the next one:
From my point of view, the modifier for this kind of things is the
restriction for developers, who want to inform user about details like
"why we are going to remove this functionality".
On 12/26/20
normal E_DEPRECATED error thrown automatically when a
function is given the ZEND_ACC_DEPRECATED flag.
Yussuf Khalil
On Wed, Dec 26, 2012 at 10:04 PM, Eugene L Kovalenja
wrote:
Hello, Khalil
Could you explain the pros of your proposal in comparison with the next
one:
restriction for devel
84 matches
Mail list logo