-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.php
More file actions
34 lines (26 loc) · 729 Bytes
/
class.php
File metadata and controls
34 lines (26 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* Copyright (C) 2024-2026 Katarzyna Krasińska
* PHP.lab - https://github.com/katheroine/php.lab
* Licensed under GPL-3.0 - see LICENSE.md
*/
class SomeClass
{
public $someProperty = 64;
private $otherProperty = 'broccoli';
function someMethod()
{
return $this->otherProperty;
}
function otherMethod($someArgument)
{
$this->otherProperty = $someArgument;
}
}
$someObject = new SomeClass();
print($someObject->someProperty . PHP_EOL);
print($someObject->someMethod() . PHP_EOL . PHP_EOL);
$someObject->someProperty = 128;
$someObject->otherMethod('cauliflower');
print($someObject->someProperty . PHP_EOL);
print($someObject->someMethod() . PHP_EOL . PHP_EOL);