Search
68 results · page 2 of 4
-
Marco Pivetta ·
On 24 February 2020 03:26:19 GMT+00:00, Marco Pivetta ocramius@gmail.com wrote: The solution is trivial: don't use cloning: final class Foo { public function withBar($bar):self { $instance = new self(); $instance->foo = $foo; // more …
-
Andrea Faulds ·
… cover a single feature. What I might do is write a separate patch and RFC to add a partial application function (and probably some other similarly useful things like composition or currying), then delay voting on this RFC until it …
-
Alexander Lisachenko ·
… related to the node. I also don't see why we need ParserEngine::parse() instead of just a (namespaced) parse() function. Not a fan of unnecessary wrapper classes. I think that PHP is ugly enough :) We should try to use …
-
Stefan Marr ·
… class composition into something which could be easily shared by both the reflection and the engine, and then re-doing it on demand in the reflection, or we extend zend_function by an origin pointer. Not sure what the better
-
Stefan Marr ·
… a = $value; } public function echoA() { echo $this->a; } } trait TraitUsingA { // var $a; <- intentionally left out because of another smart approach for using // really clever meta-programming, not shown here public function setTraitA($value) { $this->a = $value; } public function echoTraitA() { ech
-
Sam Barrow ·
… function parameters have this feature implemented today. It's like a half-done job. Many design patterns make use of composition (versus inheritance - thanks the GoF) and a composition would be more readable with such a feature. Model-driven, reverse …
-
Baptiste Autin ·
… function parameters have this feature implemented today. It's like a half-done job. Many design patterns make use of composition (versus inheritance - thanks the GoF) and a composition would be more readable with such a feature. Model-driven, reverse …
-
Marcus Boerger ·
… for MI up to the moment where Marcus Boerger came up with this: class Document implements Printable { delegate Printable $print; function __construct() { $this->print = new PrintHandler($this); } This combines the pros of MI with the advantages of "favour composition over …
-
Geoffrey Sneddon ·
… That explains why that comment makes so little sense :) What I was going to say is that how is something like: <?php trait foo { function output() { echo 'foo'; } } trait bar { function output() { echo 'bar'; } } class foobar { use foo; use bar; } ?&
-
sepehrphpr@gmail.com ·
… these clearer guidelines? Over recent major versions, modern PHP has embraced functional programming idioms with first-class callable syntax, arrow functions, and generic higher-order operations. While this compositional style significantly enhances code expressiveness and flexibility, it introduces notable architectural …
-
Paul M.Jones ·
Hi Jan, I like this proposal a lot, since it provides a clear, concise interface to these commonly uses, yet inconveniant to use, existing functions and variables without having to always use a full-featured userland library. Glad to hear …
-
Albert Casademont ·
This is very interesting, thanks! Would it make sense to also add an INI setting to disable superglobals and response functions? Zitat von Paul M. Jones pmjones@pmjones.io: Hi Internals, After a couple of years of incubation, I am …
-
krukowski.bartlomiej@gmail.com ·
so that I can use functional composition instead of operators (array_map('...', $values))). I think I do not understand. Still, the addition is very nice and complimentary with the existing splat/variadic argument stuff :D So can I create …
-
Yasuo Ohgaki ·
Hi Lester, That said, I generally think that built-in methods that accept Callables are a great way to go. It encourages reuse through modular composition - and could likely be a neater way around the throw exception/return error code …
-
Tjerk Anne Meesters ·
… forms return all input as strings, even if the input is actually meant to be numeric Many PHP database backend functions also return all result fields as strings regardless of the actual result type, e.g. mysql_fetch_(), mysqli_fetch …
-
Sara Golemon ·
… new features. What you seem to have described is improved lexical scoping. Rather than a shared "global" scope for classes, functions, constants, and variables, you'd like to allow files, or perhaps even statement lists (open brace to closed brace …
-
sepehrphpr@gmail.com ·
… function on a hypothetical future feature doesn't help users who need it now. The two proposals aren't in competition. One is a small, practical improvement that can land quickly. The other is a larger architectural change that needs …
-
RFC Data Classes
Niels Dossche ·
This isn't a race or competition, and I meant "competing with records" and not "competing with Ilija." Though, I see how it could be interpreted that way. Rob, You are making it a race. You did the same …
-
Sara Golemon ·
… finish myself. I'm just stuck at the basic zend class declaration functions. runkit could probably implement this using some composting rules... It doesn't have all the required pieces at the moment, but it's got most of 'em …
-
David Brown ·
| Hi: | <patch> Or, so as to not turn this into the Integer Overflow and Crappy C Competition (IOCCC <grin>), perhaps this instead: --- Zend/zend_builtin_functions.c~ 2003-05-20 11:33:36.000000000 -0400 +++ Zend/zend_builtin_functions …