Re: Re: important bug, please read
| From: | André Langhorst | Date: | Mon, 30 Oct 2000 17:04:55 +0000 |
| Subject: | Re: Re: important bug, please read | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-36458@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
AL>> don´t do that!!! that´s what we (including you) are fighting against,
AL>> "reference to..." is evil :)
AL>> why not simlply
AL>> AL>> array(3) {
AL>> [0]=> int{&1}(1)
AL>> [1]=> int(2)
AL>> [3]=> int{&1} }
AL>> AL>> only variables with ref_count>1 will be attached on {} index thing and
No good. Refcount for variable can have arbitrary values in given
point. Think copy-on-write. Lots of it.
umh, sure - I actually haven´t seen the patch, but you should be able to buffer your output like this: (replace [~]n(i) with an unique string for every zval ((I assumed you do not use XML internally :) )))
array(3) {
[0]=> int{[~]1}(1)
[1]=> int{[~]2}(2)
[3]=> int{[~]1} }
then count these [~]n artefects to calculate your own "ref_count", if there´s only a single artefect [~]n(i) delete the whole brackets {[~]n(i)} if there are more replace [~]n(i) with an incremented number
and your output as follows:
array(3) {
[0]=> int{&1}(1)
[1]=> int(2)
[3]=> int{&1} }
well, I think there are many better ways to realize, just a thought
regards