Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9f9c3a2870
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (52 sloc) 1.579 kb
--TEST--
runkit_import() Importing and overriding class properties with inheritance
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip";
if(array_shift(explode(".", PHP_VERSION)) < 5) print "skip";
?>
--FILE--
<?php
class Test {
public static $s = "s";
public $v = "v";
private $p = "p";
protected $o = "o";
public function getPrivate() {return $this->p;}
public function getProtected() {return $this->o;}
}
class SubClass extends Test {}
$o = new SubClass;
echo $o->v, "\n";
echo SubClass::$s, "\n";
echo $o->getPrivate(), "\n";
echo $o->getProtected(), "\n";
runkit_import(dirname(__FILE__) . '/runkit_import_class_property_and_inheritance.inc', RUNKIT_IMPORT_CLASS_PROPS);
$o = new SubClass;
echo $o->v, "\n";
echo SubClass::$s, "\n";
echo $o->getPrivate(), "\n";
echo $o->getProtected(), "\n";
runkit_import(dirname(__FILE__) . '/runkit_import_class_property_and_inheritance.inc', RUNKIT_IMPORT_CLASS_PROPS |
RUNKIT_IMPORT_CLASS_STATIC_PROPS | RUNKIT_IMPORT_OVERRIDE);
$o = new SubClass;
echo $o->v, "\n";
echo SubClass::$s, "\n";
echo $o->getPrivate(), "\n";
echo $o->getProtected(), "\n";
?>
--EXPECTF--
v
s
p
o
Notice: runkit_import(): Test->v already exists, not importing in %s on line %d
Notice: runkit_import(): Test->p already exists, not importing in %s on line %d
Notice: runkit_import(): Test->o already exists, not importing in %s on line %d
v
s
p
o
IMPORTED: v
IMPORTED: s
IMPORTED: p
IMPORTED: o
Jump to Line
Something went wrong with that request. Please try again.