Is this old way to explain for PHP oop, if he use var thing?
for example,
<?php
class person {
var name;
}
?>
Is this old way to explain for PHP oop, if he use var thing?
for example,
<?php
class person {
var name;
}
?>
Yes. The var
keyword is PHP 4 syntax, deprecated in PHP 5 and no longer used.
If you run your script with E_STRICT
error reporting, it should notify you of this.
Use public
, private
, or protected
instead.
See http://www.php.net/manual/en/language.oop5.visibility.php for more information.