rgb192
asked on
Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\wamp\www\oop-beg\ch4-7.php on line 38
<?php
class Person{}
class Vegetable{}
interface ISweat{
function MakeYouSweat();
}
class AttractiveStranger extends Person implements ISweat{
public function LookAtYou(){}
public function SmileAtYou(){}
public function TalkToYou(){}
public function MakeYouSweat(){
$this->LookAtYou();
$this->SmileAtYou();
$this->TalkToYou();
}
}
class Pepper extends Vegetable{
public function BurnYourTongue(){}
public function CauseBathroomEmergency(){}
public function MakeYouSweat(){
$this->BurnYourTongue();
$this->CauseBathroomEmergency();
}
}
class CollegeBar implements ISweat{
public function __construct(){
$attractivestranger=new AttractiveStranger();
$hotpepper=new Pepper();
$thing1=$attractivestranger->MakeYouSweat();
$thing2=$hotpepper->MakeYouSweat();
$thingsThatMakeYouSweat=array($thing1,$thing2);
SitAtBar($thingsThatMakeYouSweat);
}
void SitAtBar(){
//when you are sitting at the Bar
foreach($thingsThatMakeYouSweat as $value){
}
}
}
from an object oriented php tutorial
Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\wamp\www\oop-beg\ch4-7.
and how could an object be created and an object instance called
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah, this kind of error is probably because you are using a very old version of PHP (i guess it from the path, that contains WAMPP, instead of XAMPP. That name has been switched a lot of time ago).
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Uh, wow.
Sorry: i was sure xampp was the evolution of wampp...
:-(
then @rgb192 : can you post a phpinfo(), please?
Sorry: i was sure xampp was the evolution of wampp...
:-(
then @rgb192 : can you post a phpinfo(), please?
ASKER
line 38:
public function SitAtBar(){
can 'void' be used because tutorial was an example of 'void'
public function SitAtBar(){
can 'void' be used because tutorial was an example of 'void'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the echo information which I will have a new question on how to output by calling the object
$obj = new CollegeBar();
to call the object method SitAtBar:
$obj->SitAtBar();
Hope this helps