diff options
| author | Felipe Pena <felipe@php.net> | 2011-11-06 13:25:45 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2011-11-06 13:25:45 +0000 |
| commit | eebaaf423f98fa0340038e4350a82b97d738a355 (patch) | |
| tree | 4898a1de1caf9f25a4abf0e666b142f14bb93002 /Zend/tests/indirect_property_access.phpt | |
| parent | d73b1a275d300ba8b30165dce16e273df57e3e08 (diff) | |
| download | php-git-eebaaf423f98fa0340038e4350a82b97d738a355.tar.gz | |
- Added class member access on instantiation (e.g. (new foo)->bar()) support
Diffstat (limited to 'Zend/tests/indirect_property_access.phpt')
| -rw-r--r-- | Zend/tests/indirect_property_access.phpt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Zend/tests/indirect_property_access.phpt b/Zend/tests/indirect_property_access.phpt new file mode 100644 index 0000000000..3645687f41 --- /dev/null +++ b/Zend/tests/indirect_property_access.phpt @@ -0,0 +1,26 @@ +--TEST-- +Testing indirect property access +--FILE-- +<?php + +class foo { + public $x = 1; +} + +class bar { + public $y = 'foo'; +} + +$x = 'bar'; + +$bar = new bar; + +var_dump((new bar)->y); // foo +var_dump((new $x)->y); // foo +var_dump((new $bar->y)->x); // 1 + +?> +--EXPECT-- +string(3) "foo" +string(3) "foo" +int(1) |
