note 73186 added to function.runkit-import
| From: | haas at xmission dot com | Date: | Mon, 12 Feb 2007 18:26:03 +0000 |
| Subject: | note 73186 added to function.runkit-import | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123287@lists.php.net to get a copy of this message | ||
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
----
Server IP: 64.71.164.2
Probable Submitter: 166.70.14.86
----
Manual Page -- http://www.php.net/manual/en/function.runkit-import.php
Edit -- https://master.php.net/note/edit/73186
Del: integrated -- https://master.php.net/note/delete/73186/integrated
Del: useless -- https://master.php.net/note/delete/73186/useless
Del: bad code -- https://master.php.net/note/delete/73186/bad+code
Del: spam -- https://master.php.net/note/delete/73186/spam
Del: non-english -- https://master.php.net/note/delete/73186/non-english
Del: in docs -- https://master.php.net/note/delete/73186/in+docs
Del: other reasons-- https://master.php.net/note/delete/73186
Reject -- https://master.php.net/note/reject/73186
Search -- https://master.php.net/manage/user-notes.php