lamad Posted January 30, 2007 Share Posted January 30, 2007 Calling object methods inside complex (curly) syntax fails for some php versions. Strangely the [url=http://php.net/string]PHP docs on this[/url] do not mention anything. here is some simple code to illustrate the problem:[code]class foobar{ function bar(){ echo 'blah'; }}$foo = new foobar();echo <<<EOD <br /> this does not work on with some versions: {$foo->bar()}EOD;[/code]What I would like to know is: in which version of PHP did calling object methods begin to work? If anyone can point me to authoritative information on this or test the code and report which versions do or do not work I would appreciate it!So far I have it working on: PHP 5.1.6Not working on: PHP 4.4.0 Quote Link to comment Share on other sites More sharing options...
lamad Posted January 30, 2007 Author Share Posted January 30, 2007 Odd, I can't edit my own posts?Also tested on PHP 4.4.4, doesn't work. I would almost suspect this to be a PHP5 feature except that there is zero version information on the docs. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted January 30, 2007 Share Posted January 30, 2007 [quote]Odd, I can't edit my own posts?[/quote]15 minute limit on editing time for this form, 2 minutes for others (or it was last time I checked)About your other problem, maybe there is just a different in the way normal variables, and OOP references are used during extrapolation.I ran some searches on google, and didn't see anything about it.In this specific situation, you are calling a function.I don't know if you can directly just call a function in the middle of it like that. Quote Link to comment Share on other sites More sharing options...
lamad Posted January 30, 2007 Author Share Posted January 30, 2007 ok, thanks.Well, I'm going to try posting on the actual doc page then and see what happens. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.