|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-07-10 09:07 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 19:00:01 2025 UTC |
defining a function with reference variables like this: function funcname(&$parm) { ; } doesnt work inside classes. The following script documents this (sorry i could not get it shorter) <?php class a { function one(&$s) { # see -------^ $s="bar"; } function two() { $s="foo"; $this->one($s); # see -----^ print $s."\n"; $s="foo"; $this->one(&$s); # see -----^ print $s."\n"; } } $o = new a; $o->two(); ?> It should produce: bar bar But it produces foo bar I suspect this behaviour to cause a core dump under certain circumstances. I assume this is a bug?