On Wed, Feb 01, 2017 at 07:45:50AM -0800, Rasmus Lerdorf wrote:
> The reason it is feasible to do this for single-expression closures in this
> short form syntax is that you don't typically need a local scope at all for
> these short closures and the syntax doesn't convey the idea that you would
>
> (Off-topic: there are some place where I can found the internals
talking about that?
> The externals.io not allows search.)
http://markmail.org/search/?q=https%3A%2F%2Fwiki.php.net%2Frfc%2Fenum+#query:https%3A%2F%2Fwiki.php.net%2Frfc%2Fenum%20list%3Anet.php.lists.internals+page:1+state:facets
On Wed, Jan 23, 2019 at 2:32 PM Andrey O Gromov wrote:
> Proposed syntax
> class A($prop) extends B("BlaBla", $prop) {
> }
Would this work with anonymous classes? If so, how would the syntax look like?
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
> array_map and array_filter combined
This example has array_map and array_filter in wrong order (duplicated once
or twice below as well).
The RFC proposes to allow multiple `for`s in comprehensions, and really
could benefit from an example of such usage.
After figuring out that opcache.jit_buffer_size is specified in bytes
(not in megabytes, as RFC states) I got ~5% speedup running
vimeo/psalm (static analyzer) on its own codebase with default
JIT flags and ~7.3% with minimal JIT (1201).
PHP+optimizer (-dopcache.jit_buffer_size=0): 32.29s
On Tue, Feb 5, 2019 at 8:38 AM Dmitry Stogov wrote:
> > PHP+optimizer (-dopcache.jit_buffer_size=0): 32.29s (100%)
> > PHP+optimizer+JIT (-dopcache.jit_buffer_size=5000): 30.72s (95.1%)
> > PHP+optimizer+minimalJIT (-dopcache.jit_buffer_size=5000
> > -dopcache.jit=1201): 29.95s (92.7%)
something),
so it implies you have a way to enter latin characters. Keyboard layout
switching is a problem solved decades ago.
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
ead of (LATIN SMALL LETTER C U+0063).
Incidentally these two chars also share the same physical button in
English/Russian keyboard layouts,
so it's a mistake easy to make and very hard to spot visually:
https://3v4l.org/rjjU9
--
Best regards,
Bruce Weirdan
is going
to yield false
negatives [1]
[1] https://3v4l.org/4HgUL
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
typehint=en=all
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
e']);
> $_SERVER['email'] !?? $user->setName($_SERVER['email']);
What you described is already achievable with short-circuit && :
isset($_SERVER['fname']) && $user->setName($_SERVER['fname']);
Besides, it's a widely used idiom known from shell sc
formed.
If `bind_param` is allowed to do incomplete bind (as in your example
where you supply 2 out of 3 required bound parameters) t
hen there's no need for additional method, as you could simply do:
if (isset($_GET['zip'])) $stmt->bind_param('s', $_GET['zip']);
--
Best regards,
B
On Fri, Oct 11, 2019 at 2:43 PM Andreas Hennings wrote:
> What other use cases exist for exit()?
Setting exit code for cli scripts.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
of php://input
What about $query and $body? That would be closer to the terminology
used in HTTP RFCs.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
There's also a fourth approach that does not involve any changes to
PHP: autoload + eval.
When PHP is looking for your class, in your autoload you load the
values from config, generate the class source and eval() it.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
RFC), which allows to write e.g. `xs -: sort -: reverse` instead
> > of `reverse (sort xs)` or `(reverse . sort) xs`.
>
> If I ever actually wrote Haskell, I'd find that extremely useful. :-)
>
> --Larry Garfield
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
ound:
$none = new stdClass;
$element = first($collection, fn($elt) => ...);
if ($element === $none) {
// nothing found
}
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
ct and check
> the identity of that to know if no matches have been found:
>
> $none = new stdClass;
> $element = first($collection, fn($elt) => ...);
> if ($element === $none) {
>// nothing found
> }
>
Of course it should have been `$element = first($collection, fn($elt)
=>..., $none);`
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
On Wed, Jul 22, 2020 at 4:21 PM Christian Schneider
wrote:
> but not to arithmetic *operators* like 42 + "" because that doesn't
> currently trigger E_WARNING AFAIK.
>
It does produce warning since PHP 7.1 : https://3v4l.org/4CV1E
--
Best regards,
if (is_array($array, $this->getFlags())) { ... }
}
```
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
once it
gets introduced and *if* it forbids usage on some elements it wouldn't be
possible to fix this from userspace.
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
y used a lot).
To clarify, do you imply that *all* integers are safe? Or would they
also be differentiated into literal and non-literal varieties?
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development
> - String + int concatenation isn't an injection risk.
I think this demonstrates it very well could be:
https://externals.io/message/114988#115038
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Developm
real quick and now
people can't even name the thing.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
iders the result of
literal-string + int concatenation a non-literal string:
https://psalm.dev/r/59ad602688
This may mean that Matthew's point has been misinterpreted.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Dev
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
want to make sure constructor is
*not* defined, e.g.
```
private final function __construct();
```
(often seen in singleton implementations).
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
On Sat, Jun 26, 2021 at 1:21 AM Craig Francis wrote:
> We're going back to the original is_literal() proposal.
>
> https://wiki.php.net/rfc/is_literal
Nice work! `chr()` returning literal strings is somewhat questionable,
but otherwise this is looking very good.
--
Best regards,
a problem. If the same code produces different results for
expression literalness depending on external factors like available
memory it may pass in the test environment, but fail in production.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
as a part of function signature like you can do with other types.
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
Interface::format()) would solve that.
--
Best regards,
Bruce Weirdan mailto:
weir...@gmail.com
the code
> decomposition taking into account ISP.
Prior art: @psalm-require-extends and @psalm-require-implements Psalm
annotations:
https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-require-extends
--
Best regards,
Bruce Weirdan
ld): list:(internals.lists.php.net)
Do this: Never send it to Spam
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
[1]
[1] https://3v4l.org/EfmJq
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
readonly it would probably be better
to declare that with a class modifier.
E.g.
```php
readonly class Entity {
public int $count;
public string $data;
}
```
Though `readonly` doesn't look like a perfect fit in that position to me.
--
Best regards,
Bruc
On Mon, Mar 28, 2022 at 7:56 PM Karoly Negyesi wrote:
> match ($object) {
> Someinterface => 'foo',
> AnotherInterface => 'bar',
> }
>
> this can not clash with any existing code as using identifiers like this
> are a syntax error currently.
That's valid code actually, see
On Tue, Jan 25, 2022 at 9:45 PM Chase Peeler wrote:
> it will make this much more difficult to read since the constants.php will
> have to be
> updated:
>
> if(!defined('dbserver')){
> define('dbserver','productiondb.example.com');
> }
> if(!defined('otherconstant')){
>
e($FileName); };
>
>
> title ?>
> bodyStream ?>
>
>
> Thank you for considering!
>
> Regards,
> Shailesh
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
--
Best regards,
On Fri, Nov 4, 2022 at 10:49 AM Marco Pivetta wrote:
> What's convenient about `Foo::{$bar}` vs `constant(Foo::class . '::' .
> $bar)`? I'm a bit confused by this :|
>From the static analysis POV `Foo::{$bar}` is way better, as we can immediately
see that the code is trying to access a constant
n just using
> new punctuation, if we wanted to encourage that analogy.
Would this be allowed in files included in the methods of the anonymous class?
`$this->` and `self::` is, and it's a pain point for static analyzers,
forcing us to invent
things like `@psalm-scope-this`
--
Best rega
On Tue, Feb 21, 2023 at 7:53 AM someniatko wrote:
> We want to write some tests for the Service class, but we don't want
> to use a real SomeDependency instance
> during tests. A common approach is to either extract an interface
> (JUST to make it testable), or to drop the
> `final` keyword and
On Thu, Mar 2, 2023 at 1:23 PM Jakub Zelenka wrote:
> The schema version should be specified by $schema keyword
Unfortunately, it's not what happens in the wild. Some schemas even
forbid `$schema` (e.g. Composer's one).
--
Best regards,
Bruce Weir
think* it would?
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
already know it will be deprecated and removed soon enough?
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
.postgresql.org/docs/current/two-phase.html), MySQL (
https://dev.mysql.com/doc/refman/8.0/en/xa.html) and Oracle (
https://docs.oracle.com/en/database/oracle/oracle-database/21/admin/distributed-transactions-concepts.html#GUID-8152084F-4760-4B89-A91C-9A84F81C23D1)
all support it.
--
Best regar
Hi Jim
On Sat, Mar 9, 2024, 20:46 Jim Winstead wrote:
> If the adherence to semantic versioning is meant to be strict,
PHP doesn't follow semver and never had.
ctStorage with an
incompatible `seek()` already implemented (e.g.
https://3v4l.org/uW9Yl), so it shouldn't happen in a patch release.
Not that I expect there to be many of those, but still.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
On Sun, Mar 10, 2024 at 2:38 AM Jim Winstead wrote:
>
> On Sat, Mar 9, 2024, at 1:04 PM, Bruce Weirdan wrote:
> > On Sat, Mar 9, 2024, 20:46 Jim Winstead wrote:
> >> If the adherence to semantic versioning is meant to be strict,
> >
> > PHP doesn't follow semve
On Tue, Feb 27, 2024 at 6:22 PM Bruce Weirdan wrote:
>
> Hi Larry and others
>
> On Fri, Feb 23, 2024 at 12:57 AM Larry Garfield
> wrote:
> >
> >
> > I've added an FAQ section explaining why the Python/JS approach wouldn't
> > really work. To be cl
php
function f(Universe $_u): void {}
$universe = new Universe(size:'big');
$shoe = new Shoe(size:'big);
if ($shoe === $universe) {
f($shoe); // shoe is *identical* to the universe, so it should be
accepted wherever the universe is
}
```
--
Best regards,
robably make sense to list them in the FAQ section.
[1]
https://wiki.php.net/rfc/property-hooks#why_not_pythonjavascript-style_accessor_methods
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
to also list `session.trans_sid_tags` and
`session.trans_sid_hosts` as
deprecated. And mentioning that `output_add_rewrite_var()` is
unaffected wouldn't harm either.
--
Best regards,
Bruce Weirdan mailto:weir...@gmail.com
53 matches
Mail list logo