false p.has_manners? #=> false PHP <?php class Example { /** * Example instance member variable. * * Member variables may be public, protected or private. * * @var int */ public int $foo; /** * Example static member variable. * * @var bool */ protected static int $bar; /** * Example constructor method. * * @param int $foo */ public function __construct(int $foo) { // Sets foo. $this->foo = $foo; } } // Create a new Example object. // Set the "foo" member variable to 5. $example = new Example(5); // Overwrite the "foo" member variable to 10. $example->foo = 10; // Prints 10. echo $example->foo; Lua --region example --- @class example_c --- @field foo number Example "member variable". local example_c = {} local example_mt = {__index = example_c} --- Creates an object from example. --- @return example_c function example_c.new(foo) -- The first table argument is our object's member variables. -- In a Lua object is a metatable and its member variables are table key-value pairs. return setmetatable({ foo = foo }, example_mt) end --endregion -- Create an example object. -- Set the "foo" member variable to 5. local example = example_c.new(5) -- Overwrite the "foo" member variable to 10. example.foo = 10 -- Prints 10. print(example.foo) See also Global variable Local variable Property (programming) References Object-oriented programming Variable (computer science) Articles with example Python (programming language) code