e function guard2(): void {/* ... */}
private function commonGuard(): void {/* ... */}
}
I hope that "guard" can be included again.
I don't understand the internals of PHP VM. I think the mechanism of this
is compiler assisted copy-paste (same as traits), but only the function
b
aits), but only the
function body and the visibility is overridden based on accessors
definition.
Regards,
Hendra Gunawan.
bject date back to before PHP 7.0. Is there
any consideration why scalar object was not escalated to the next
phase, say to RFC?
Regards
Hendra Gunawan.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
Hello.
>
> Yes, but Nikita wrote this note about technical limitations at the bottom of
> the repo README:
>
> Due to technical limitations, it is not possible to create mutable APIs for
> primitive types. Modifying $self within the methods is not possible (or
> rather, will have no effect, as
lution while "->" would do
> exactly what people want.
Not so poor if we
* use "~>" as pipe operator rather than "|>"
* redesign the api under their proper namespace and strictly place
the "haystack" as the first function argument.
Regards,
Hendra Gunawan.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
function __get($name) {
// Will get called on first access, but once initialized.
$this->groups = ...;
}
}
Regards,
Hendra Gunawan.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
t($sexGroup["male"]);
}
}
Not a perfect solution, but at least your code is reduced.
Best Regards
Hendra Gunawan.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
int|string|array $index_key,
callable $reducer = null
)
// callable signature
fn (array|object $item, int|string $index, mixed $cummulative): mixed
note:
- $index_key can be in the form `["education", ...]` or `"education"`.
- or even `[0
23,
"ward4" => 234,
],
...
];
$wQ1 = [
"district1" => [
"ward1" => 123,
"ward2" => 234,
],
"district2" => [
"ward3" => 123,
>
> Better map/filter/reduce primitives in PHP would be dandy, but they have
> nothing to do with array grouping. They're a separate operation that should
> be composed with grouping. Packing them all into a single function sounds
> like a terrible idea.
>
> If we wanted that... that's called list
g, and the last do reducing. (less common to me)
OR:
do sorting, then do filtering, then do grouping, and the last do reducing.
Best Regards
Hendra Gunawan.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
>
> And if you want to map, reduce, or filter without grouping? Then you can't
> really use this function. And as noted, the order in which you apply those
> operations may matter, and no order is necessarily more obvious or beneficial
You can modify it slightly if you eager to:
array_group(
On Tue, May 9, 2023 at 4:38 AM Larry Garfield wrote:
>
> Ilija Tovilo and I would like to offer another RFC for your consideration.
> It's been a while in coming, and we've evolved the design quite a bit just in
> the last week so if you saw an earlier draft of it in the past few months, I
>
On Tue, May 9, 2023 at 4:38 AM Larry Garfield wrote:
>
> Ilija Tovilo and I would like to offer another RFC for your consideration.
> It's been a while in coming, and we've evolved the design quite a bit just in
> the last week so if you saw an earlier draft of it in the past few months, I
>
On Tue, May 9, 2023 at 4:38 AM Larry Garfield wrote:
>
> Ilija Tovilo and I would like to offer another RFC for your consideration.
> It's been a while in coming, and we've evolved the design quite a bit just in
> the last week so if you saw an earlier draft of it in the past few months, I
>
of functionality in one package.
>
> https://wiki.php.net/rfc/property-hooks
>
> --
> Larry Garfield
> la...@garfieldtech.com
Hi Larry
Can the engine detect these logical errors?
```
public string $fullName = "hendra gunawan" => $this->first . " " . $th
> ```php
> class User {
> private string $first;
> private string $last;
> public string $fullName {
> get => $this->first . ' ' . $this->last;
> set => [$this->first, $this->last] = explode(' ', $value, 2);
> }
>
> public function __construct($this->fullName)
> If there is no forward compatibility consideration, can we simplify
> interface definition to this one?
> ```
> interface IFace
> {
> public string $readable;
> public string $writeable;
> public string $both;
> }
> ```
After carefully reading the proposal again, I think I know the answer
> (Also, when replying, please please remove duplicate names from the to/cc
> line. I just got double copies of everything in this thread this morning.
> I'm on the list, I don't need to be CCed.)
Sorry about that. Not my habit before.
> For the second, the problem with omitting the {} is
> Secondary votes are generally discouraged. I can see the argument for
> wanting a short-short version of set, given how common the validation use
> case is, but => is almost universally the "evaluates to" symbol, so using
> that for a set operation rather than get just feels weirdly
20 matches
Mail list logo