Object Oriented PHP
<?php
class Box {
var $contents;
function Box($contents) {
$this->contents = $contents;
}
function get_whats_inside() {
return $this->contents;
}
}
?>
I am reading an OO tutorial. I'm familiar with PHP and the OO concept, but it's still a tough fight most of the time! However, the above code returns the error "Unexpectedly also on line 7". I can't find anyone else having problems with the tutorial. I am running MAMP with php version 5.2.5. Does anyone have any idea?
-1
source to share