File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / lsb_003.phpt
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (12 years, 4 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

--TEST--
ZE2 Late Static Binding creating a new class with 'static'
--FILE--
<?php

class TestClass {
	public static function createInstance() {
		return new static();
	}
}

class ChildClass extends TestClass {}

$testClass = TestClass::createInstance();
$childClass = ChildClass::createInstance();

echo get_class($testClass) . "\n";
echo get_class($childClass) . "\n";
?>
==DONE==
--EXPECTF--
TestClass
ChildClass
==DONE==

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>