Re: Final variables

From: Date: Thu, 29 Jun 2017 09:33:36 +0000
Subject: Re: Final variables
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-99676@lists.php.net to get a copy of this message
Am 29.06.2017 um 11:25 schrieb Marco Pivetta:
On Thu, Jun 29, 2017 at 11:19 AM, lists@rhsoft.net <mailto:lists@rhsoft.net> <lists@rhsoft.net <mailto:lists@rhsoft.net>> wrote:
    in other languages like Visual Basic constants are fast, in PHP they
    are slow, both in define and access
Two things here: 1. don't ever consider visual basic for any comparison of any sort: it's basically (ha!) the worst example of a programming language that I can think of before malborge
stop it - many people say the same about PHP
2. speed is not relevant in this scope: program correctness is. Final properties would allow switching value object representations from accessor (getter) based logic (extremely slow) to public property based (less overhead, also in writing)
in which scope is speed not relevant? depends on your application, in my scopes i try to avoid expensive opcodes and useless function calls, program correctness is a completly different thing and it's not one or the other but both

« previous php.internals (#99676) next »