Classes: Difference between revisions
Content deleted Content added
m Type System cathegory |
php |
||
Line 645:
=={{header|PHP}}==
<php>class MyClass {▼
public static $classVar;
public $instanceVar; // can also initialize it here
function __construct() {
$instanceVar = 0;
}
function someMethod() {
$instanceVar = 1;
$classVar = 3;
}
}
$myObj = new MyClass();</php>
<!-- TODO ;; 2008-01-24 07:35 fill this in when i get a few spare moments
/*
Line 799 ⟶ 812:
=={{header|Ruby}}==
<ruby>class MyClass
▲class MyClass
@@classVar
def initialize
Line 810 ⟶ 822:
end
end
myclass = MyClass.new</ruby>
=={{header|Smalltalk}}==
|