Skip to content

Instantly share code, notes, and snippets.

@brandonkelly
Created February 20, 2009 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonkelly/67616 to your computer and use it in GitHub Desktop.
Save brandonkelly/67616 to your computer and use it in GitHub Desktop.
<?php
// __call() test
// ===========================================================================
class MyBaseClass {
function _call($method, $args)
{
echo($args[0]);
return TRUE;
}
}
if (phpversion() >= '5')
{
eval('
class MyClass extends MyBaseClass {
function __call($method, $args)
{
return $this->_call($method, $args);
}
}
');
}
else
{
eval('
class MyClass extends MyBaseClass {
function __call($method, $args, &$return_value)
{
$return_value = $this->_call($method, $args);
}
}
');
}
$obj = new MyClass();
$obj->test('Success!');
@anoxic
Copy link

anoxic commented Jul 22, 2013

What's going on here? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment