xref: /PHP-5.4/Zend/tests/lsb_003.phpt (revision 166266df)
1--TEST--
2ZE2 Late Static Binding creating a new class with 'static'
3--FILE--
4<?php
5
6class TestClass {
7	public static function createInstance() {
8		return new static();
9	}
10}
11
12class ChildClass extends TestClass {}
13
14$testClass = TestClass::createInstance();
15$childClass = ChildClass::createInstance();
16
17echo get_class($testClass) . "\n";
18echo get_class($childClass) . "\n";
19?>
20==DONE==
21--EXPECTF--
22TestClass
23ChildClass
24==DONE==
25