From: Stanislav Malyshev Date: Tue, 20 Apr 2010 19:46:30 +0000 (+0000) Subject: add test for self:: and static:: X-Git-Tag: php-5.4.0alpha1~191^2~1728 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10a9f48eeeb20fae3eef5d5b1b35d1bcf0bd1942;p=php add test for self:: and static:: --- diff --git a/Zend/tests/closure_037.phpt b/Zend/tests/closure_037.phpt new file mode 100755 index 0000000000..4b24c85d16 --- /dev/null +++ b/Zend/tests/closure_037.phpt @@ -0,0 +1,47 @@ +--TEST-- +Closure 037: self:: and static:: within closures +--FILE-- +x++; + self::printX(); + self::print42(); + static::print42(); + }; + } + + function printX () { + echo $this->x."\n"; + } + + function print42() { + echo "42\n"; + } +} + +class B extends A { + function print42() { + echo "forty two\n"; + } +} + +$a = new A; +$closure = $a->getClosure(); +$closure(); +$b = new B; +$closure = $b->getClosure(); +$closure(); +?> +Done. +--EXPECTF-- +1 +42 +42 +1 +42 +forty two +Done. \ No newline at end of file