# final is b0rk b0rk b0rk

- Thread: https://externals.io/message/960
- Original archive: https://news-web.php.net/php.internals/960
- Started by Sterling Hughes on 2003-04-18T17:12:04+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #960 — Sterling Hughes — 2003-04-18T17:12:04+00:00

URL: https://externals.io/message/960#960

<?php
class foo {
    final public $bar = 10;
}

$f = new foo;
$a = 'bar';
$f->$a = 20;
echo $f->bar;
?>

outputs :

20

Final needs to be runtime.

-Sterling

PS: Insert mention of how this feature doesn't belong in a language like
php here.  Also mention that interfaces/abstract suffer from the same
problem, and should be removed for the same reason.

-- 
"People can have the Model T in any colour -- so long as it's black." 
    - Henry Ford

---

## #961 — Mike Robinson — 2003-04-18T18:51:03+00:00

URL: https://externals.io/message/960#961 · In reply to: #960

Sterling Hughes wrote:
> <?php
> class foo {
>     final public $bar = 10;
> }
> 
> $f = new foo;
> $a = 'bar';
> $f->$a = 20;
> echo $f->bar;
> ?>
[b0rk3d output snipped]
> 
> PS: Insert mention of how this feature doesn't belong in a language like
> php here.  Also mention that interfaces/abstract suffer from the same
> problem, and should be removed for the same reason.

+1 for removing _all_ that stuff.  :P

Best Regards
Mike Robinson

---

## #963 — marcus.boerger@t-online.de — 2003-04-18T19:23:23+00:00

URL: https://externals.io/message/960#963 · In reply to: #960

At 20:51 18.04.2003, Mike Robinson wrote:
>Sterling Hughes wrote:
> > […]
>[b0rk3d output snipped]


I don't see a reason or sense in "final" for properties. IMO it is only in 
there by
mistake.


> > […]
>
>+1 for removing _all_ that stuff.  :P

Final and interfaces are ways to express aspects of an oo model.
When working in big projects you'll get used to such. If not feel free
to ignore the feature just like any other feature you dislike in php, too.

regards
marcus
