You are here: Re: Argument « PHP Programming Language « IT news, forums, messages
Re: Argument

Posted by Jamie on 11/19/74 11:46

In <1145523493.072571.318480@j33g2000cwa.googlegroups.com>,
"fletch" <richard.a.fletcher@googlemail.com> mentions:
>> What functions, if any, are causing $a and $b to BOTH be set
>> to "Dog" ???
>
>It's a mystery to be sure. I would say that the someMethod("Cat","Dog")
>is not called if you are not getting the output "[Cat, Dog]". Also I
>think that the script would produce infinate output since foot()
>includes a file that calls foot() and you get stuck in a loop.
>
>Is this the actual code you are using, or have you tried to make it
>simpler so that it's more easily understood?

I tried to simplify it. (I think I screwed up in the example, as it
was NOT caught in a loop, in a nutshell, I had:

class MyClass {
function display(){
include("some_file.php");
}
function foot(){
include('foot.php');
}
}

I tried to reproduce it using a few test files and wasn't able to.


where some_file.php accesses '$this->foot()' and foot() in turn
access some stuff using vsprintf() among other things.


I "fixed" the problem by removing some code in another area that
was using references.. (Oh how I miss perl's \$var syntax..)

I had: 'function &getParam($name);' that returned a reference
to an array element.

Anyhow, converting a method that was returning a reference to
a method that returns by-value (and just accessing the variables
directly when I want a reference) solved it. Albeit in a way
that I didn't want.

I now have "function getParam($name)" it works. Still, it bugs me
that I don't know why the call stack got messed up.


Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация