Re: [PHP-DEV] [VOTE] PHP 8.3 Release Managers

2023-04-17 Thread Calvin Buckley
On Apr 17, 2023, at 6:01 PM, Sergey Panteleev  wrote:
> 
> Hi all,
> 
> The polls have closed, and Derick’s scripts have tallied the votes [1],
> 
> Our “rookie" PHP 8.3 release managers are:
> - Jakub Zelenka
> - Eric Mann
> 
> Our "veteran” is the PHP 8.2 release manager Pierrick Charron.
> Jakub and Eric you are in a good hands!
> 
> Further steps are described in the New release manager checklist [2],
> I believe you can discuss it with Pierrick.
> 
> Calvin, I hope you’ll consider putting in your name for future release 
> manager elections.
> 
> Thank you to all!
> 
> [1] https://gist.github.com/derickr/9dca6c23663eb44b58d380ae8b914e5a
> [2] 
> https://github.com/php/php-src/blob/b340e10d6e32df0ca586e06d0c9406402b47205f/docs/release-process.md#new-release-manager-checklist
> 
> Cheers,
> Sergey


Of course :)

Best of luck to everyone with PHP 8.3!
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] Re: [VOTE] PHP 8.3 Release Managers

2023-04-17 Thread Ben Ramsey

On 4/17/23 16:01, Sergey Panteleev wrote:

Hi all,

The polls have closed, and Derick’s scripts have tallied the votes [1],

Our “rookie" PHP 8.3 release managers are:
- Jakub Zelenka
- Eric Mann

Our "veteran” is the PHP 8.2 release manager Pierrick Charron.
Jakub and Eric you are in a good hands!

Further steps are described in the New release manager checklist [2],
I believe you can discuss it with Pierrick.

Calvin, I hope you’ll consider putting in your name for future release manager 
elections.

Thank you to all!



Congratulations, everyone!

If you ever need anything, don't hesitate to reach out.

Cheers,
Ben



OpenPGP_signature
Description: OpenPGP digital signature


[PHP-DEV] Re: [VOTE] PHP 8.3 Release Managers

2023-04-17 Thread Sergey Panteleev
Hi all,

The polls have closed, and Derick’s scripts have tallied the votes [1],

Our “rookie" PHP 8.3 release managers are:
- Jakub Zelenka
- Eric Mann

Our "veteran” is the PHP 8.2 release manager Pierrick Charron.
Jakub and Eric you are in a good hands!

Further steps are described in the New release manager checklist [2],
I believe you can discuss it with Pierrick.

Calvin, I hope you’ll consider putting in your name for future release manager 
elections.

Thank you to all!

[1] https://gist.github.com/derickr/9dca6c23663eb44b58d380ae8b914e5a
[2] 
https://github.com/php/php-src/blob/b340e10d6e32df0ca586e06d0c9406402b47205f/docs/release-process.md#new-release-manager-checklist

Cheers,
Sergey


signature.asc
Description: Message signed with OpenPGP


Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Alexandru Pătrănescu
Hi Zoltán,
On Mon, Apr 17, 2023 at 11:13 PM Zoltán Fekete 
wrote:

> Hey,


> > public function withStatus($code, $reasonPhrase = ''): Response
> > {
> > return clone $this {
> > $this->statusCode = $code;
> > $this->reasonPhrase = $reasonPhrase;
> > };
> > }
>
> How to refer to any of the properties of the current instance? Let's say
> this:
>
> ```
> class Foo {
> protected int $code;
> protected string $message;
> public function withStatus($code, $message): Foo {
> return clone $this {
> $this->code = $code; // so far so good
> // Which $this->message is what?
> $this->message = "cloned: (" . $this->message . ")" . $message;
> }
> }
> }
> ```


Yes, it's true that it looks weird that $this is present in two places with
two different meanings, but that's just because we are cloning $this. If we
were cloning $object, it would be clearer.
$this inside the braces is referring to the new object after it was cloned,
after __clone() was executed, if defined.
The old instance data is already copied over, no real need to reference
that.

Maybe we can think about it a bit more and improve the idea. I'm
thinking we can have a closure/callable or an instance method reference
instead of a block of code.
Also, that might be preferable, as there is a natural way to either use
closure with "use" or pass parameters.
I don't like too much how $code and $message are referenced inside the
block of code... maybe it's not an issue.
Also, I'm not really sure how easy it would be to model this behavior, to
have a block of code where $this would reference something else than
outside of it.

Regards,
Alex


Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Zoltán Fekete
Hey,

> public function withStatus($code, $reasonPhrase = ''): Response
> {
> return clone $this {
> $this->statusCode = $code;
>
> $this->reasonPhrase = $reasonPhrase;
> }
> };

How to refer to any of the properties of the current instance? Let's say
this:

```
class Foo {
protected int $code;
protected string $message;
public function withStatus($code, $message): Foo {
return clone $this {
$this->code = $code; // so far so good
// Which $this->message is what?
$this->message = "cloned: (" . $this->message . ")" . $message;
}
}
}
```

> Thanks for your efforts and for bringing that up.
> I am curious if possible to implement the feature without using `with`
> keyword
> it visually could look pretty close to something like an object
initializer
> in the future:
>
> return clone $this {c: 1};
> return new Bar {c: 1};

Similarity is not necessarily always good.

Regards,
Zoltán Fekete


Re: [PHP-DEV] First class callable syntax for instance methods

2023-04-17 Thread Zoltán Fekete
> I can get assistance on a better implementation than my paltry skills were 
> able to manage before.  (And if we can collectively make a stronger argument 
> for it.)

Well sadly that definitely cannot be me. As I just started to get on
board with internal development. But I am more than excited and ready
to help wherever I can.

> $a = $obj->getConfig()
>  |> array_map($$->getId(), $$)
> That is, using $$ to refer to "the value passed from the previous pipe" and 
> "make a closure whose argument is an object that we can then operate on".  
> Both of those are "obvious" users of $$, but when combined... it's confusing 
> to me which $$ is which, at least.

Yes, I mixed up stuff.

> That's one of the reasons I preferred partial function applications to have 
> their own separate syntax and RFC, and have pipes work on just 
> closures/callables directly.  It neatly sidesteps this issue, and leaves $$ 
> free for the "closure that takes an object" syntax.
> So the above would become something like:
> $a = $obj->getConfig()
>  |> array_map($$->getId(), ?)
>
> Which is less ambiguous.

What if it's not an object? Let's say an array of arrays? Or an array
of value objects with public properties, and I don't want to call
->getId(), instead just ->id?

```
$a = $obj->getConfig()
|> array_map($$["id"], ?)
```

Personally I would keep the $$ for the pipe. Why:
1. Hacklang has it that way.
2. I think a lot of people already associate it with this purpose.
3. I feel that $$ more has “something previously” or “something same”.
As it would be passed through the pipe I feel it fits more.
4. Maybe the following example is silly but

```
$foo = “stuff”;
$baz = “foo”;

$items = getConfig()
|> array_map($$[$$baz], ?) // what is $$baz in this case?

var_dump($items); // what would this be?
```

Sure this could be done if the T_BLING is restricted for the pipe
operator. But I feel, having it restricted there leaves less
opportunity for sloppy code.

Anyways, as you just wrote, these are all individual, separate
language features, but still have to be designed together. So to
sum-up, I would keep the T_BLING for the pipe operator. And how do you
feel about any of the following?

```
$items = array_map(array $value => $value->getId(), $items); // A
shorter anonymous function shorthand

// As a variable all would lead to syntax error, but here as -
whatever we name it - it would work
// Just $
$items = array_map(User $->getId(), $items);
$items = array_map(array $["id"], $items);
// Or $@ / $:
$items = array_map(User $@->getId(), $item);
```

These could work well with pipe operators.



> in my mind, these are all separate language features (PFA, pipes, and lenses) 
> that have their own distinct uses, but they need to be designed in tandem so 
> that they mix well together.  Sadly, PHP doesn't do well with that kind of 
> mini-roadmap. :-(

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] self-hosting (compiling context) PHP

2023-04-17 Thread Thomas Krüger
I guess Robert's idea is more like the "pypy" project for Python, which 
is a fast Python interpreter written in Python.


So, there are examples of PHP interpreter/VMs written in PHP:
https://github.com/ircmaxell/PHPPHP

Best regards,
Thomas

Am 17.04.2023 20:21 schrieb Thomas Hruska:

On 4/17/2023 9:29 AM, Robert Landers wrote:

Hello Internals,

I saw someone mention writing PHP (the engine) in PHP and it got me
thinking, is there anything preventing PHP from being a self-hosted
language? I assume this has been discussed before, but I couldn't find
anything via Google or Externals.

Robert Landers
Software Engineer
Utrecht NL


Do you mean something like:

https://github.com/cubiclesoft/php-app-server


Or something more like Java which is written in Java?  In that case, 
maybe:


https://github.com/Corveda/PHPSandbox

--
Thomas Hruska
CubicleSoft President

CubicleSoft has over 80 original open source projects and counting.
Plus a couple of commercial/retail products.

What software are you looking to build?


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] self-hosting (compiling context) PHP

2023-04-17 Thread Thomas Hruska

On 4/17/2023 9:29 AM, Robert Landers wrote:

Hello Internals,

I saw someone mention writing PHP (the engine) in PHP and it got me
thinking, is there anything preventing PHP from being a self-hosted
language? I assume this has been discussed before, but I couldn't find
anything via Google or Externals.

Robert Landers
Software Engineer
Utrecht NL


Do you mean something like:

https://github.com/cubiclesoft/php-app-server


Or something more like Java which is written in Java?  In that case, maybe:

https://github.com/Corveda/PHPSandbox

--
Thomas Hruska
CubicleSoft President

CubicleSoft has over 80 original open source projects and counting.
Plus a couple of commercial/retail products.

What software are you looking to build?

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] self-hosting (compiling context) PHP

2023-04-17 Thread Robert Landers
Hello Internals,

I saw someone mention writing PHP (the engine) in PHP and it got me
thinking, is there anything preventing PHP from being a self-hosted
language? I assume this has been discussed before, but I couldn't find
anything via Google or Externals.

Robert Landers
Software Engineer
Utrecht NL

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] Protected visibility in interface

2023-04-17 Thread Vorisek, Michael
Hello everyone,

I would like to finish https://github.com/php/php-src/pull/5708 and the next 
step is RFC.

Protected visibility in an interface should be supported to support non-public 
interfaces to be used together with instanceof operator in traits - example: 
https://github.com/php/php-src/pull/5708#issuecomment-644616936

I would like to hear your feedback if this feature is wanted and if there are 
any questions I should clarify.

Michael


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

2023-04-17 Thread Robert Landers
Hello,

This looks really interesting but it might be a good idea to add a
section for the definition of "pinning" and the scope of the pin. For
example, what is the output of this code, executed in this order (with
this new autoloading configured):

// Test.php

namespace Test {
  function password_verify(string $password, string $hash): bool {
return true; }
}

// another file

echo Test\password_verify('password', 'hash');
echo password_verify('password', 'hash');

// yet another file

echo password_verify('password', 'hash');

Does this get pinned in the global namespace and does this pin extend
to other files? If so, this could lead to very hard-to-reason-about
code.

Cheers,

Rob Landers
Utrecht, Netherlands

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Michał Marcin Brzuchalski
Hi Máté,

pon., 17 kwi 2023 o 08:32 Máté Kocsis  napisał(a):

> Hi Everyone,
>
> Quite some time after mentioning the "clone with" construct the first time
> (at the end of the
> https://wiki.php.net/rfc/write_once_properties#run-time_behaviour
> section),
> finally I managed to create a working implementation for this feature which
> would make it possible to properly modify readonly properties
> while simplifying how we write "wither" methods:
> https://wiki.php.net/rfc/clone_with


Thanks for your efforts and for bringing that up.
I am curious if possible to implement the feature without using `with`
keyword
it visually could look pretty close to something like an object initializer
in the future:

return clone $this {c: 1};
return new Bar {c: 1};

Cheers,
Michał Marcin Brzuchalski


Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Alexandru Pătrănescu
On Mon, Apr 17, 2023, 07:32 Máté Kocsis  wrote:

> finally I managed to create a working implementation for this feature which
> would make it possible to properly modify readonly properties
> while simplifying how we write "wither" methods:
> https://wiki.php.net/rfc/clone_with


Hey Máté,

How about just allowing a block of code after the clone statement that
would execute it in the same context as the clone context, allowing to
modify once readonly variables.
Allows better flexibility compared with clone with syntax or clone metho:

public function withStatus($code, $reasonPhrase = ''): Response
{
return clone $this {
$this->statusCode = $code;

   $this->reasonPhrase = $reasonPhrase;

};

Regards,
Alex


>


[PHP-DEV] [RFC] [Discussion] Clone with

2023-04-17 Thread Máté Kocsis
Hi Everyone,

Quite some time after mentioning the "clone with" construct the first time
(at the end of the
https://wiki.php.net/rfc/write_once_properties#run-time_behaviour section),
finally I managed to create a working implementation for this feature which
would make it possible to properly modify readonly properties
while simplifying how we write "wither" methods:
https://wiki.php.net/rfc/clone_with

Regards,
Máté Kocsis