Skip to content

Instantly share code, notes, and snippets.

@Burakhan
Created May 2, 2013 23:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Burakhan/5506306 to your computer and use it in GitHub Desktop.
__toString && __call
<?php
class example {
const val = "print value";
public function __toString(){
return self::val;
}
public function __call($name,$arr){
echo "There is no method called {$name}";
}
}
$exam = new example();
echo $exam; // "print value"
$exam->s(); //"There is no method called {$name}";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment