Annotation of embedaddon/php/Zend/tests/indirect_method_call_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Testing indirect method call
! 3: --FILE--
! 4: <?php
! 5:
! 6: class foo {
! 7: public $x = 1;
! 8:
! 9: public function getX() {
! 10: return $this->x;
! 11: }
! 12: public function setX($val) {
! 13: $this->x = $val;
! 14: return $this;
! 15: }
! 16: }
! 17:
! 18: $X = (new foo)->setX(10)->getX();
! 19: var_dump($X); // int(10)
! 20:
! 21: ?>
! 22: --EXPECT--
! 23: int(10)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>