472,976 Members | 1,236 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

T_OBJECT_OPERATOR error

<?
class foo {

var $value;
var $child = array();

function setChild($ch) {
array_push($this->child,$ch);
}

function getChild($i) {
return $this->child[$i];
}

function getValue() {
return $this->value;
}

}

$tp = new foo();
$row = new foo();

$row->setChild($tp);

$row->getChild(0)->getValue();

?>

When I run this script i get the error

Parse error: parse error, unexpected T_OBJECT_OPERATOR in \\path\to\file on line 26

on line "$row->getChild(0)->getValue();"

can someone help me out here..??

Thanx

Salil

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Salil Das | It's ok to kiss a fool,
bugs@cc | It's ok to let a fool kiss you,
| but never ever let a kiss fool you.
Jul 17 '05 #1
4 11102
On Sat, 17 Apr 2004 22:05:55 +0000, bugs wrote:
<?
class foo {

var $value;
var $child = array();

function setChild($ch) {
array_push($this->child,$ch);
}

function getChild($i) {
return $this->child[$i];
}

function getValue() {
return $this->value;
}

}

$tp = new foo();
$row = new foo();

$row->setChild($tp);

$row->getChild(0)->getValue();

?>

When I run this script i get the error

Parse error: parse error, unexpected T_OBJECT_OPERATOR in \\path\to\file on line 26

on line "$row->getChild(0)->getValue();"

$a = $row->getChild(0);
$b = $a->getValue();

Regards,
Henk Burgstra
Jul 17 '05 #2
"bugs" <bu**@cc.gatech.edu> wrote in message
news:c5**********@solaria.cc.gatech.edu...
<?
class foo {

var $value;
var $child = array();

function setChild($ch) {
array_push($this->child,$ch);
}

function getChild($i) {
return $this->child[$i];
}

function getValue() {
return $this->value;
}

}

$tp = new foo();
$row = new foo();

$row->setChild($tp);

$row->getChild(0)->getValue();

?>


If you plan to program in this way, you're in for a world of hurt. Your
program probably won't behave the way you think it would, because all your
assignments are by copy and you're always returning copies of the child
objects.
Jul 17 '05 #3
Henk Burgstra <eg****@xs4all.nl> wrote:
On Sat, 17 Apr 2004 22:05:55 +0000, bugs wrote:

<?
class foo {

$a = $row->getChild(0);
$b = $a->getValue();

Ya, I came up with that, but, isnt there a way to do this like C style..
would be helpful rather than creating a new variable everytime..

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Salil Das | It's ok to kiss a fool,
bugs@cc | It's ok to let a fool kiss you,
| but never ever let a kiss fool you.
Jul 17 '05 #4
Salil Das schrieb:
Henk Burgstra <eg****@xs4all.nl> wrote:
On Sat, 17 Apr 2004 22:05:55 +0000, bugs wrote:

<?
class foo {

$a = $row->getChild(0);
$b = $a->getValue();

Ya, I came up with that, but, isnt there a way to do this like C style..


Use PHP 5.

Regards,
Matthias
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sky2070 | last post by:
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in c:\inetpub\wwwroot\session.php on line 19 can anyone tell me what is wrong with this code??? <? // Define the Session...
2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
5
by: devereaux | last post by:
I'm trying to run a script and it's throwing the following error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in openfile.php on line 41 Here is the openfile.php file and I have...
1
by: mohsin shekh | last post by:
Hello dear members, I am displaying the online news through rss feed in my portal, it is working good enough on localhost WAMP but when i upload the script on our USA...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.