note 73186 rejected from function.runkit-import by tularis
| From: | tularis@php.net | Date: | Tue, 13 Feb 2007 00:16:49 +0000 |
| Subject: | note 73186 rejected from function.runkit-import by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123297@lists.php.net to get a copy of this message | ||
Note Submitter: haas at xmission dot com
----
Running PHP 5.1.6 on Fedora Core 6 with runkit compiled from source. The following has me confused:
File testrunkit.php:
<?php
class Foo
{
function Foo() { echo "using the original Foo\n"; }
}
runkit_import('mockfoo.php', RUNKIT_IMPORT_CLASSES);
new Foo();
?>
File mockfoo.php:
<?php
class Foo
{
function Foo() { echo "using the mock Foo\n"; }
}
?>
Then "php testrunkit.php" outputs "using the mock Foo". But, with the addition
of a property to the original class:
File testrunkit.php:
<?php
class Foo
{
public $i;
function Foo() { echo "using the original Foo\n"; }
}
runkit_import('mockfoo.php', RUNKIT_IMPORT_CLASSES);
new Foo();
?>
"php testrunkit.php" outputs "using the original Foo". ORing in the flag
RUNKIT_IMPORT_OVERRIDE in the runkit_import() call makes no difference.
-- Walt