Jump to content

[SOLVED] PHP Class Problem


jjacquay712

Recommended Posts

I am learning php oop and am trying this code:

 

<?php
class person {
function lol() {
	echo 'hey';
}
public $name;
public $height;
public $weight;
public $hair;
}
$object = new person;
$object->name = "John";
$object->height = "'6\"0";
$object->weight = 190;
$object->hair = "Brown";

echo "The new persons is: " . $object->name . " " . $object->height . " " . $object->weight . " " . $object->hair;
?>

 

but it gives me this error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in *** on line 14

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/144064-solved-php-class-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.