Search
13 results
-
Caleb White ·
… from the example. Looking at the RFC examples again, I was reminded of this RFC: https://wiki.php.net/rfc/implicit_move_optimisation, which concerns itself with optimizing the $foo = func($foo); case. Perhaps it makes sense to list this …
-
Claude Pache ·
… wilfully breaks BC for the sake of cleanup and optimisation, you should seriously consider Hack. Although I don’t know whether they’ve already removed support of the appalling implicit initialisation of variables to null, or of the dreadful back
-
Andrea Faulds ·
Actually displaying a warning in E_STRICT but still doing the implicit cast would not change the function signature. Sure. What I meant was more that we’re changing expectations based on php.ini/variable/etc., and I’d …
-
Stefan Marr ·
I think they are pulled out of thin air. More specifically, I think there are optimizations heaped upon optimizations heaped upon an initial implementation. It seems that each new release of PHP has a small speed improvement based on …
-
Larry Garfield ·
… PER from FIG that has one.). So for this to make sense in the language itself, it needs to offer more benefit than just "the same thing but in the language." The OP mentioned possible optimizations or inlining or things …
-
Mike Schinkel ·
+1. It's 100% opt-in. People can keep using implicit fall-through, their own /* fallthrough / comments, or the new token. There's virtually no overhead in the compile phase and it doesn't mess with the jump table optimizations …
-
Joe Watkins ·
The perf numbers are for current implementation. Predictability seems more important than simplicity, considering what the feature is for. The only way to make the simpler implementation predictable in the same kind of way was found to be unacceptable during …
-
Morgan ·
… fn($u) => $u['role']==$r), $roles)); though there are more efficient (and readable) ways of doing that. -- Optimising the implementation would be more difficult if the language were allowed to be sloppier. Conversely, tightening up the language allows improved optimisation.
-
Dmitry Stogov ·
… closure [..] Safest not to take shortcuts. You get yourself into trouble with things which will stop working. -1 on this optimization. I believe that always implicitly referencing $this is a mistake. Not only does it turn every lambda that is …
-
Nikita Popov ·
… judged), so they are effectively assertions implemented using E_ERROR rather than assert(). The ZEND_IMPOSSIBLE macro is a more explicit way of saying assert(0). PHP removes assertions in non-debug builds (optimization), so this follows suit. I did …
-
Ilija Tovilo ·
… it also doesn't prevent accidentally using $this in a closure that was supposed to be static. The RFC is explicit about static not being redundant. While explicit marking remains preferable, this optimization aims to benefit codebases that prefer not …
-
Stanislav Malyshev ·
… we decided to drop, at this point it's virtually the same) - yet more mandate its usage over the whole PHP codebase! - is the right way to solve an optimization problem in optimizer code. Optimization is nice, but it s
-
Rowan Tommins ·
… value that is "like null, but even more so". The combination of union types and enums actually gives a much more expressive way of representing "valid value or explicit null or special default". To use the ORM lazy-loading example …