Re: [PHP] Might just be a typo, but...
Here are your mistakes! This lines should be: $this-hinta = 0; $this-määrä = 0; $this-list = array(); // Initialised Thats because you haven't initiallized $this-list, but $list, that is internal to the Example function (in this case the constructor). Thats just it. I'm blind to these kinds of mistakes with PHP and other assorted languages. I'm a java guy, and the syntax in that language is just wonderful for dysleksic guys like me. Guess how many hours i've been looking for missing $:s. Soon I'll come up with a demanding question. - jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Might just be a typo, but...
On Sáb 01 Sep 2001 05:31, you wrote: Here are your mistakes! This lines should be: $this-hinta = 0; $this-määrä = 0; $this-list = array(); // Initialised Thats because you haven't initiallized $this-list, but $list, that is internal to the Example function (in this case the constructor). Thats just it. I'm blind to these kinds of mistakes with PHP and other assorted languages. I'm a java guy, and the syntax in that language is just wonderful for dysleksic guys like me. Guess how many hours i've been looking for missing $:s. Soon I'll come up with a demanding question. Oh, if you knew what I'm doing!!! Well, I'm just debugging quite an application (checking DB logs, apache logs, and a few emacs open on some scripts). :-) Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Might just be a typo, but...
On Sáb 01 Sep 2001 05:18, you wrote: Hey, you people are great. 5 reasonable answers to a 1 silly problem within the hour. I'll exploit your goodwill. Here's the next one, this is about objects (in finnish): class Example { var $list; // Here I set the problem var $hinta; var $määrä; function Example() { $hinta = 0; $määrä = 0; $list = array(); // Initialised Here are your mistakes! This lines should be: $this-hinta = 0; $this-määrä = 0; $this-list = array(); // Initialised } function addToExample($object) { array_push($this-list, $object); // I've been over it a hundred times, but... } } when I call the function instanceOfExample-addToExample($object) I get: Warning: First argument to array_push() needs to be an array in xxx on line xx Thats because you haven't initiallized $this-list, but $list, that is internal to the Example function (in this case the constructor). Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]