|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-08-10 10:47 UTC] matteosistisette at gmail dot com
Description: ------------ Operator "->" (access of object properties and methods) is not listed either here: http://www.php.net/manual/en/language.operators.php nor here: http://www.php.net/manual/en/language.operators.precedence.php PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Or do you need an example? Here it is: <?php class Test { public $foo=1; public $bar=2; public $foobar="3"; } $p1="foo"; $p2="bar"; $test=new Test(); echo $test->$p1.$p2; How is one supposed to know (other than by trying) that the output will be "1bar" and not "3"? (not to mention that it will produce a parse error prior to 5.0)