-1
I was studying what my book called "constant member functions" in C++. i.e., functions that cannot change any class attribute or call other methods that are not constant. So, I made this code in C++.
#include <iostream>
#include <string>
using namespace std;
class Foo
{
string outra_coisa;
public:
void printa_algo(string algo) const;
};
int main()
{
Foo tolo;
string alguma_coisa = "coisa_alguma";
tolo.printa_algo(alguma_coisa);
return 0;
}
void Foo::printa_algo(string algo) const
{
cout << algo;
}
It is possible to do the same in PHP?
What the title has to do with that code?
– Maniero
Bruno gives yes for sure, but, really the title does not match the question!
– novic
Vish is msm...pera ae.. Tidy.
– BrunoVdutra