What's the difference between this two types of methods of calling functions within classes:
Method One:
Myclass::returnValue('the value');
Method Two:
$returnthevalue = new MyClass();
$returnthevalue->returnValue('the value');
(Both of them print the same)
<?php
class MyClass
{
public function returnValue($string){
echo "<br><strong>";
echo 'This is the value: ' . $string;
echo "<br></strong>";
}
}
Myclass::returnValue('some');
$returnthevalue = new MyClass();
$returnthevalue->returnValue('the value');