On Sun, Mar 14, 2021 at 6:02 PM Gert de Pagter wrote:
> Hey Internals,
>
> Recently i've been working on an older code base, where we have a lot
> of classes with all
> static methods. We've been moving to injecting the classes, and
> calling the methods as if they
> were not static.
>
> I wanted
On Sat, Mar 13, 2021 at 1:54 PM tyson andre
wrote:
>
> I've created a new RFC https://wiki.php.net/rfc/println
> This proposes adding a global function to PHP to
> print a string followed by a unix newline (`\n`).
>
>
This isn't solving any problem that anyone is actually having.
Yes, that includ
Hi,
I have two questions regarding the RFC.
1. Why not provide an another optional attribute that allows to
specify the end of line eliminator?
2. Why don't you configure Unix end of line in INI file?
These additional steps will help users choose their favorite end of
line for their projects. The
On Sun, Mar 14, 2021 at 6:34 PM Peter Stalman wrote:
> Would it make sense to have both options?
>
6) Multiple decorators on the same function?
One problem with the wrapper pattern is that if you have multiple
decorators then wouldn't that end up calling the function multiple times?
Not so with
On Sun, Mar 14, 2021 at 5:34 AM David Gebler wrote:
> Before and after hooks are a similar but slightly different implementation,
> semantically, to what I was originally suggesting but may be the preferred
> option. I think to be useful, you probably still need some way to choose
> not to call t
The information you were given on StackOverflow is somewhat misleading,
since it is referring to the behaviour of PDO::quote(), not anything to do
with binding parameters. The referenced bug report is indeed not a bug.
Still, I don't really use Postgres but a quick smoke test indicates you're
not
Hi Marc
Thanks for testing the enum feature.
> Hi I'm trying out the new enumeration support for PHP 8.1 using
> https://github.com/php/php-src/pull/6489 thought to implement a polyfill
> based on class constants and reflection. Doing so I come across the
> newly defined interfaces:
> ``` interfa
On 14/03/2021 19:40, Matthew Brown wrote:
It's maybe possible in the special case of implementing interfaces, but
it's unsound for general inheritance:
someInt;
}
}
class B extends A {
public static function getSomeInt() : int {
return parent::getSomeInt();
}
}
Can yo
On 14.03.21 12:52, Benjamin Eberlei wrote:
On Sat, Mar 13, 2021 at 5:51 PM David Gebler wrote:
With the introduction of attributes in PHP 8, this new behaviour is still
quite sparsely documented. Some of the articles I've seen out there,
though, liken PHP's attributes to similar constructs i
Hi I'm trying out the new enumeration support for PHP 8.1 using
https://github.com/php/php-src/pull/6489 thought to implement a polyfill
based on class constants and reflection. Doing so I come across the
newly defined interfaces:
``` interface UnitEnum{
public string$name;
public static
Hi internals,
I just stumbled upon what I consider to be a bug with the PDO pgsql driver.
*TL;DR: the driver treats parameters bound with PARAM_INT the same as
PARAM_STR.*
Take the following example:
```
$pdo = new PDO('pgsql:host=localhost;port=5432', 'postgres', 'postgres');
$statement = $pdo
On Sun, 14 Mar 2021 at 12:02, Gert de Pagter wrote:
> Hey Internals,
>
> Recently i've been working on an older code base, where we have a lot
> of classes with all
> static methods. We've been moving to injecting the classes, and
> calling the methods as if they
> were not static.
>
> I wanted t
Python's implementation of decorators is great for these kinds of reasons.
You get direct access to the function being called, the arguments which
were passed to it and any return value after (and if) you execute it.
Python's magic here, of course, is that functions and class methods are
first clas
On Sun, Mar 14, 2021, at 7:33 AM, David Gebler wrote:
> Hi Ben,
> I have been looking at your #[Deprecated] PR to get an idea of where to
> start with implementing this, I think Peter's suggestion of how it might
> look syntactically is also interesting - it's exactly that sort of question
> of how
On 14/03/2021 15:52, tyson andre wrote:
There's also the alias fputs ofhttps://www.php.net/manual/en/function.fwrite.php
which also returns the byte count.
Notably, like printf(), that is borrowed directly from C, and probably
dates from a time when most PHP programmers were also C programme
Hey Internals,
Recently i've been working on an older code base, where we have a lot
of classes with all
static methods. We've been moving to injecting the classes, and
calling the methods as if they
were not static.
I wanted to add interfaces to these classes, with non static methods,
so we can
Hi Rowan,
> Hi Tyson,
>
> I'm on the fence on this one: I've certainly had occasions when it would
> be useful, but mostly in quick prototypes and demo code, and just as
> often in HTML context (where I'd want it to add '') as plain text
> context.
>
> I am not keen, however, on the proposed
On 13/03/2021 19:54, tyson andre wrote:
I've created a new RFC https://wiki.php.net/rfc/println
This proposes adding a global function to PHP to
print a string followed by a unix newline (`\n`).
Hi Tyson,
I'm on the fence on this one: I've certainly had occasions when it would
be useful, but
Hi Ben,
I have been looking at your #[Deprecated] PR to get an idea of where to
start with implementing this, I think Peter's suggestion of how it might
look syntactically is also interesting - it's exactly that sort of question
of how would you imagine devs implementing and using decorators in PHP
On Sat, Mar 13, 2021 at 5:51 PM David Gebler wrote:
> With the introduction of attributes in PHP 8, this new behaviour is still
> quite sparsely documented. Some of the articles I've seen out there,
> though, liken PHP's attributes to similar constructs in other languages
> including decorators i
Hi again David,
I've been thinking about this some more, it could be quite useful.
I'd like to propose a bit more of a Attributes-y syntax:
```
start = microtime(true);
// these could be made available
$foo = $this->getObject();
$args = $this->getArguments(); // [$a, $b]
21 matches
Mail list logo