This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Objects in PHP Forum

View Course » View Exercise

455 points
5f91c877156a10b96f15c639992ff5c1?s=140&d=retro
Submitted by
Catherine
over 2 years ago

passed but "Parse error: syntax error, unexpected T_CLASS on line 11" on the screen

<?php>

class Person{
public $isAlive = true;
public $firstname;
public $lastname;
public $age;
}

$teacher = new Person();
$student = new Person();

echo $teacher->isAlive;
<?>


2 votes

permalink

problem solved
<?php

class Person{
public $isAlive = true;
public $firstname;
public $lastname;
public $age;
}

$teacher = new Person();
$student = new Person();

echo $teacher->isAlive;
?>

455 points
5f91c877156a10b96f15c639992ff5c1?s=140&d=retro
Submitted by
Catherine
over 2 years ago