Hi,
Can someone confirm this problem:
This works:
var $x = array(
"x" => "x".
"y",
"y" => "a".
"b"
);
}
var_dump($x);
But this doesn't work:
class g{
var $x = array(
"x" => "x".
"y",
"y" => "a".
"b"
);
}
$g = new g();
var_dump($g->x);
It throws
Parse error: parse error, expecting `')'' in x.php on line 5
I know I have an outdated version of PHP (4.3.2), but it is compiled
with a special MSSQl extension and I cannot seem to compile the patch
with 4.3.3 and 4.3.4. The patch reads the milliseconds for dates.
There's a workaround, but it would involve heaps of testing again.
Just wanted to see, if its worth going to a different version.
Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces. http://sourceforge.net/projects/phpdbedittk/ 5 2304
"Jochen Daum" <jo*********@cabletalk.co.nz> wrote in message
news:a2********************************@4ax.com... Hi,
Can someone confirm this problem:
<snip initialisation in declaration>
As a workaround, initialise it in the constructor.
class g{
var $x;
function g() {
$this->x = array(
"x" => "x".
"y",
"y" => "a".
"b"
);
}
}
Garp
Hi Garp,
On Tue, 20 Jul 2004 05:14:47 GMT, "Garp" <i_**@home.now> wrote: "Jochen Daum" <jo*********@cabletalk.co.nz> wrote in message news:a2********************************@4ax.com.. . Hi,
Can someone confirm this problem: <snip initialisation in declaration>
As a workaround, initialise it in the constructor.
Cheers, so you have the same problem on which PHP version?
Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces. http://sourceforge.net/projects/phpdbedittk/
Jochen Daum wrote: Cheers, so you have the same problem on which PHP version?
This is not really a "problem" with PHP4, but just how it was designed.
Please read: http://www.php.net/manual/en/language.oop.php
especially these examples:
<?php
class Cart {
/* None of these will work in PHP 4. */
var $todays_date = date("Y-m-d");
var $name = $firstname;
var $owner = 'Fred ' . 'Jones';
/* Arrays containing constant values will, though. */
var $items = array("VCR", "TV");
}
/* This is how it should be done. */
class Cart {
var $todays_date;
var $name;
var $owner;
var $items = array("VCR", "TV");
function Cart() {
$this->todays_date = date("Y-m-d");
$this->name = $GLOBALS['firstname'];
/* etc. . . */
}
}
?>
Just like Garp suggested.
Hi,
On Tue, 20 Jul 2004 05:24:50 GMT, Zurab Davitiani <ag*@mindless.com>
wrote: Jochen Daum wrote:
Cheers, so you have the same problem on which PHP version?
This is not really a "problem" with PHP4, but just how it was designed. Please read:
http://www.php.net/manual/en/language.oop.php
Right. Good Point.
Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces. http://sourceforge.net/projects/phpdbedittk/
"Jochen Daum" <jo*********@cabletalk.co.nz> wrote in message
news:m7********************************@4ax.com... Hi,
On Tue, 20 Jul 2004 05:24:50 GMT, Zurab Davitiani <ag*@mindless.com> wrote:
Jochen Daum wrote:
Cheers, so you have the same problem on which PHP version?
This is not really a "problem" with PHP4, but just how it was designed. Please read:
http://www.php.net/manual/en/language.oop.php Right. Good Point.
Yeah, what Zurab said. Hope you solved your problem anyway.
Garp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff Williams |
last post by:
This doesn't compile:
const char** ids =
{
"aaa",
"bbb",
"ccc"
};
I hope the above illustrates what I am trying to do, if it is possible, what
|
by: Eric A. Johnson |
last post by:
For the following code:
' return String representation of CTriangleShape
Public Overrides Function ToString() As String
' use MyBase reference to return CShape String
Return...
|
by: Michael |
last post by:
Hi,
I am trying to pass a function an array of strings, but I am having trouble
getting the indexing to index the strings rather than the individual
characters of one of the strings.
I have...
|
by: garyusenet |
last post by:
Hello everyone I hope you are having a good evening.
This evening I made a method that allows me to find the process id's of
running processes of a given 'friendly name' - using...
|
by: =?Utf-8?B?U2hhcm9u?= |
last post by:
Hi Gurus,
I need to transfer a jagged array of byte by reference to unmanaged
function, The unmanaged code should changed the values of the array, and when
the unmanaged function returns I need...
|
by: herobeat |
last post by:
Hi all,
I'm having a hell of a time with declaring a struct to hold some
binary data I'm trying to read from some files on disk. What I would
like to do is something like this:
public struct...
|
by: fauxanadu |
last post by:
Hello:
I've been working on an assignment and I have hit a stumbling block pertaining to an array of pointers.
If I am correct in my assumptions, the array
struct animal* zoo
should have...
|
by: kungfuelmosan |
last post by:
Hey guys, Im just getting into c++ at the moment so please bare with
me
Basically i need to declare a vector<stringstringArray(50)
inside a class, however by doing so i am getting the following...
|
by: lee.crabtree |
last post by:
In C#, an array marked 'readonly', as in:
public readonly bool array = new bool;
would allow individual members of the array to be modified while
protecting the array reference itself from...
|
by: mdh |
last post by:
May I ask.
If an array is defined , not as a static, but outside of a function,
is there any guarantee as to the contents of each element?
Thanks.
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |