re is type checking
$circle is Circle{radius: "10"};
```
~
4 of the 8 points I discussed above are related to range pattern and
regex pattern. Both are used daily. From my point of view, literal
pattern is no more special than range pattern and regex pattern. IMO,
both should be placed in Core patterns section, not in Possible
patterns section.
Regards, Hendra Gunawan.
above are related to range pattern and
regex pattern. Both are used daily. From my point of view, literal
pattern is no more special than range pattern and regex pattern. IMO,
both should be placed in Core patterns section, not in Possible
patterns section.
Regards, Hendra Gunawan.
> 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 inconsist
> (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 tha
> 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
> ```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) {}
ile still providing a lot 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->fi
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
> w
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
> w
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
> w
>
> 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(
do grouping, 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
>
> 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
3" => 123,
"ward4" => 234,
],
...
];
$wQ1 = [
"district1" => [
"ward1" => 123,
"ward2" => 234,
],
"district2" => [
"ward3" =&
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
rray,
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 eve
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
wrong, scalar object 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 yo
or solution 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
same as traits), but only the
function body and the visibility is overridden based on accessors
definition.
Regards,
Hendra Gunawan.
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 funct
22 matches
Mail list logo