Combination with static in OOP in PHP
A class can contain both static properties and methods, and regular ones.
Let's look at an example. Suppose we
have a class Test with both
a static property and a regular one:
<?php
class Test
{
public static $staticProperty = 'static';
public $usualProperty = 'usual';
}
?>
Let's work with the regular property of the class:
<?php
$test = new Test;
echo $test->usualProperty;
?>
And now let's use the static property:
<?php
echo Test::$staticProperty;
?>
Create a class that will have both a regular method and a static one.