Thread Rating:
  • 44 Vote(s) - 3.36 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Plugin Changes coming in 1.6.5
#9
Not Solved
(2011-10-28, 03:09 AM)Rukbat Wrote:
(2011-10-28, 02:28 AM)Dylan M. Wrote: It shouldn't. If a value is passed by ref, and you return it at the end of a function it works... and if you both pass and receive by ref it silently ignores one since its already "by ref". Or at least thats how I understand it.
I haven't read the changes yet (I'll head over there now), but I just wanted to say that if you pass by ref (whether the notation is on the caller's end or the function's end) you don't have to return the variable you passed. Passing by reference means that if the function changes the value of that variable, it's not changing a value (that's the only difference between passing by value and passing by reference), it's changing the actual valid-outside-the-function variable. So if the function changes the passed variable's value, the caller will see the new value if it looks at the variable.

When you pass by value, you have to send back the changed value, because the original variable remains unchanged if "it's" changed in the function. (It's not, only a local copy of its value is.) Passing by value is "here's what $variable is equal to now". Passing by reference is "here's the address of $variable".

Yes, thats what my initial post says. I've also highlighted part of your post in bold. That isn't passing by ref, its receiving by ref. Which is now the standard in PHP as of 5.3.x (I don't exactly know which 5.3 version) and is what we're moving to with MyBB.

As for my comment about returning it, read what was asked and I quoted Wink Right now MyBB is passing these things by ref, but in 1.6.5 many will be passed by value and so need to be returned. If you update your plugins now to return the value, it wont affect them at all. They will continue to work as they should.


Messages In This Thread
Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-27, 06:36 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-27, 08:21 PM
RE: Plugin Changes coming in 1.6.5 - by labrocca - 2011-10-27, 08:25 PM
RE: Plugin Changes coming in 1.6.5 - by Jaketfg - 2011-10-27, 11:51 PM
RE: Plugin Changes coming in 1.6.5 - by enhu - 2011-10-28, 03:47 AM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 02:28 AM
RE: Plugin Changes coming in 1.6.5 - by Rukbat - 2011-10-28, 03:09 AM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 03:33 AM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 04:08 AM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-28, 06:40 AM
RE: Plugin Changes coming in 1.6.5 - by Euan T - 2011-10-28, 09:12 AM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-28, 04:11 PM
RE: Plugin Changes coming in 1.6.5 - by Tomm M - 2011-10-28, 07:45 AM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-28, 02:23 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 03:28 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 03:29 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-28, 04:23 PM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-28, 04:29 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 06:03 PM
RE: Plugin Changes coming in 1.6.5 - by sunjava1 - 2011-10-28, 06:44 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 06:46 PM
RE: Plugin Changes coming in 1.6.5 - by sunjava1 - 2011-10-28, 06:58 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-28, 07:13 PM
RE: Plugin Changes coming in 1.6.5 - by adbrad - 2011-10-28, 07:37 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-28, 07:38 PM
RE: Plugin Changes coming in 1.6.5 - by Solidus - 2011-10-28, 10:56 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-28, 11:14 PM
RE: Plugin Changes coming in 1.6.5 - by Maj - 2011-10-29, 12:00 AM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-29, 12:30 AM
RE: Plugin Changes coming in 1.6.5 - by Maj - 2011-10-29, 05:15 AM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-29, 06:00 AM
RE: Plugin Changes coming in 1.6.5 - by crazy4cs - 2011-10-29, 10:54 AM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-29, 02:42 PM
RE: Plugin Changes coming in 1.6.5 - by Solidus - 2011-10-29, 05:04 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-29, 10:41 PM
RE: Plugin Changes coming in 1.6.5 - by Alan S. - 2011-10-30, 06:18 PM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-29, 04:56 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-30, 04:05 AM
RE: Plugin Changes coming in 1.6.5 - by Solidus - 2011-10-30, 02:13 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-30, 02:37 PM
RE: Plugin Changes coming in 1.6.5 - by pdtrx - 2011-10-30, 02:22 PM
RE: Plugin Changes coming in 1.6.5 - by FBI - 2011-10-30, 02:51 PM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-30, 03:11 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-30, 03:23 PM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-30, 03:28 PM
RE: Plugin Changes coming in 1.6.5 - by pavemen - 2011-10-30, 04:57 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-10-30, 06:46 PM
RE: Plugin Changes coming in 1.6.5 - by Hay_Den - 2011-10-31, 01:40 AM
RE: Plugin Changes coming in 1.6.5 - by qwertyx - 2011-11-01, 07:43 PM
RE: Plugin Changes coming in 1.6.5 - by qwertyx - 2011-11-01, 08:00 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-11-01, 07:56 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-11-01, 08:01 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-11-01, 08:03 PM
RE: Plugin Changes coming in 1.6.5 - by Dylan M. - 2011-11-02, 04:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)