Thread: class errors
View Single Post
Old Oct 24th, 2006, 4:58 PM   #2
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
<?php
  class foo
  {
    $something = 1;
    function __construct()
    {}
  }
  $f = new foo();
?>
yielded the same as yours, but this worked:
<?php
  class foo
  {
    public $something = 1;
    function __construct()
    {

    }
  }
  $f = new foo();
?>
Maybe PHP now requires access modifiers for variables?
[edit:] confirmed:
Quote:
Originally Posted by http://us3.php.net/manual/en/language.oop5.visibility.php
Class members must be defined with public, private, or protected.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote