Обсуждение: plphp: PHP Warning: Call-time pass-by-reference has been deprecated
I'm getting this warning in pgsql's log: LOG: plphp: PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in plphp trigger call on line 1 Is there anything I can do about it? I'd email plphp's list, but their mailing list links are 404. Thanks, CSN __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
# cool_screen_name90001@yahoo.com / 2005-08-11 13:23:52 -0700: > I'm getting this warning in pgsql's log: > > LOG: plphp: PHP Warning: Call-time pass-by-reference > has been deprecated - argument passed by value; If > you would like to pass it by reference, modify the > declaration of [runtime function name](). If you > would like to enable call-time pass-by-reference, you > can set allow_call_time_pass_reference to true in your > INI file. However, future versions may not support > this any longer. in plphp trigger call on line 1 > > Is there anything I can do about it? Yes. It's completely off topic here, however. You'll find more help in the PHP manual and/or php-general@lists.php.net (you can subscribe from http://www.php.net/). -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991
Roman Neuhauser wrote: > # cool_screen_name90001@yahoo.com / 2005-08-11 13:23:52 -0700: > >>I'm getting this warning in pgsql's log: >> >>LOG: plphp: PHP Warning: Call-time pass-by-reference >>has been deprecated - argument passed by value; If >>you would like to pass it by reference, modify the >>declaration of [runtime function name](). If you >>would like to enable call-time pass-by-reference, you >>can set allow_call_time_pass_reference to true in your >>INI file. However, future versions may not support >>this any longer. in plphp trigger call on line 1 >> >>Is there anything I can do about it? > > > Yes. > Actually the below is incorrect. He should be visiting plphp.commandprompt.com and signing up for the list there. > It's completely off topic here, however. You'll find more help in > the PHP manual and/or php-general@lists.php.net (you can subscribe > from http://www.php.net/). > -- Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240 PostgreSQL Replication, Consulting, Custom Programming, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/
# jd@commandprompt.com / 2005-08-11 15:45:18 -0700: > Roman Neuhauser wrote: > ># cool_screen_name90001@yahoo.com / 2005-08-11 13:23:52 -0700: > > > >>I'm getting this warning in pgsql's log: > >> > >>LOG: plphp: PHP Warning: Call-time pass-by-reference > >>has been deprecated - argument passed by value; If > >>you would like to pass it by reference, modify the > >>declaration of [runtime function name](). If you > >>would like to enable call-time pass-by-reference, you > >>can set allow_call_time_pass_reference to true in your > >>INI file. However, future versions may not support > >>this any longer. in plphp trigger call on line 1 > >> > >>Is there anything I can do about it? > > > > > > Yes. > > > > Actually the below is incorrect. He should be visiting > plphp.commandprompt.com and signing up for the list there. Why? What does the generic warning emitted by PHP 4 (no need to get PostgreSQL into the mix) since forever on code like this: function foo($arg) {} /* foo is declared to take $arg by value */ foo(&$var); /* $var is passed by reference */ have to do with PL/PHP? > > It's completely off topic here, however. You'll find more help in > > the PHP manual and/or php-general@lists.php.net (you can subscribe > > from http://www.php.net/). -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991
I'm using PHP5, and I'm not passing by reference. My first stop WAS plphp.commandprompt.com, but none of their mailing list links for plphp work. CSN > # jd ( at ) commandprompt ( dot ) com / 2005-08-11 15:45:18 -0700: > > Roman Neuhauser wrote: > > ># cool_screen_name90001 ( at ) yahoo ( dot ) com / 2005-08-11 13:23:52 -0700: > > > > > >>I'm getting this warning in pgsql's log: > > >> > > >>LOG: plphp: PHP Warning: Call-time pass-by-reference > > >>has been deprecated - argument passed by value; If > > >>you would like to pass it by reference, modify the > > >>declaration of [runtime function name](). If you > > >>would like to enable call-time pass-by-reference, you > > >>can set allow_call_time_pass_reference to true in your > > >>INI file. However, future versions may not support > > >>this any longer. in plphp trigger call on line 1 > > >> > > >>Is there anything I can do about it? > > > > > > > > > Yes. > > > > > > > Actually the below is incorrect. He should be visiting > > plphp.commandprompt.com and signing up for the list there. > > Why? What does the generic warning emitted by PHP 4 (no need to get > PostgreSQL into the mix) since forever on code like this: > > function foo($arg) {} /* foo is declared to take $arg by value */ > foo(&$var); /* $var is passed by reference */ > > have to do with PL/PHP? > > > > It's completely off topic here, however. You'll find more help in > > > the PHP manual and/or php-general ( at ) lists ( dot ) php ( dot ) net (you can subscribe > > > from http://www.php.net/). ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
# cool_screen_name90001@yahoo.com / 2005-08-11 16:49:25 -0700: > I'm using PHP5, and I'm not passing by reference. My > first stop WAS plphp.commandprompt.com, but none of > their mailing list links for plphp work. Can you post the code that triggers the warning? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991
Sure- CREATE or REPLACE FUNCTION email_activated_member () RETURNS trigger AS $$ $new=$_TD['new']; $old=$_TD['old']; if(($_TD['event']=='INSERT' and $new['active']='t') or ($_TD['event']=='UPDATE' and $new['active']=='t' and $old['active']=='f')) { $link=$_TD['new']; $sql="select * from groups where id=$link[group_id]"; $result=spi_exec_query($sql); if($result) { $group=spi_fetch_row($result); } if($group) { $message=<<<EOT Greetings... Here are your link details: Name: $link[name] URL: $link[url] Email: $link[email] Contact Name: $link[contact_name] Description: $link[description] Thanks, $group[name] $group[url] EOT; if(!empty($link['email'])) { $to=empty($link['contact_name']) ? $link['email'] : "$link[contact_name] <$link[email]>"; mail($to, "Link Activated - $group[name]!", $message, "From: {$group[name]} <$group[email]>\r\n"); } } } $$ LANGUAGE 'plphpu'; -- CREATE TRIGGER email_activated_member AFTER INSERT or UPDATE ON links FOR EACH ROW EXECUTE PROCEDURE email_activated_member(); It justs lets people know when their link has been activated. CSN --- Roman Neuhauser <neuhauser@sigpipe.cz> wrote: > # cool_screen_name90001@yahoo.com / 2005-08-11 > 16:49:25 -0700: > > I'm using PHP5, and I'm not passing by reference. > My > > first stop WAS plphp.commandprompt.com, but none > of > > their mailing list links for plphp work. > > Can you post the code that triggers the warning? > > -- > How many Vietnam vets does it take to screw in a > light bulb? > You don't know, man. You don't KNOW. > Cause you weren't THERE. > http://bash.org/?255991 > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
CSN wrote: >I'm using PHP5, and I'm not passing by reference. My >first stop WAS plphp.commandprompt.com, but none of >their mailing list links for plphp work. > > You are correct. This is a mistake on our part. Perhaps next time a little note to support or info@ saying, "Hey what is up with this link?" would be helpful. The link to the mailing list will be fixed in the next hour. Sincerely, Joshua D. Drake >CSN > > > > >># jd ( at ) commandprompt ( dot ) com / 2005-08-11 >> >> >15:45:18 -0700: > > >>>Roman Neuhauser wrote: >>> >>> >>>># cool_screen_name90001 ( at ) yahoo ( dot ) com >>>> >>>> >/ 2005-08-11 13:23:52 -0700: > > >>>>>I'm getting this warning in pgsql's log: >>>>> >>>>>LOG: plphp: PHP Warning: Call-time >>>>> >>>>> >pass-by-reference > > >>>>>has been deprecated - argument passed by value; >>>>> >>>>> >If > > >>>>>you would like to pass it by reference, modify >>>>> >>>>> >the > > >>>>>declaration of [runtime function name](). If >>>>> >>>>> >you > > >>>>>would like to enable call-time >>>>> >>>>> >pass-by-reference, you > > >>>>>can set allow_call_time_pass_reference to true >>>>> >>>>> >in your > > >>>>>INI file. However, future versions may not >>>>> >>>>> >support > > >>>>>this any longer. in plphp trigger call on line >>>>> >>>>> >1 > > >>>>>Is there anything I can do about it? >>>>> >>>>> >>>> Yes. >>>> >>>> >>>> >>>Actually the below is incorrect. He should be >>> >>> >visiting > > >>>plphp.commandprompt.com and signing up for the >>> >>> >list there. > > >> >> Why? What does the generic warning emitted by >> >> >PHP 4 (no need to get > > >> PostgreSQL into the mix) since forever on code >> >> >like this: > > >> function foo($arg) {} /* foo is declared to take >> >> >$arg by value */ > > >> foo(&$var); /* $var is passed by reference */ >> >> have to do with PL/PHP? >> >> >> >>>> It's completely off topic here, however. >>>> >>>> >You'll find more help in > > >>>> the PHP manual and/or php-general ( at ) >>>> >>>> >lists ( dot ) php ( dot ) net (you can subscribe > > >>>> from http://www.php.net/). >>>> >>>> > > > >____________________________________________________ >Start your day with Yahoo! - make it your home page >http://www.yahoo.com/r/hs > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > >
# cool_screen_name90001@yahoo.com / 2005-08-11 17:36:49 -0700: > --- Roman Neuhauser <neuhauser@sigpipe.cz> wrote: > > Can you post the code that triggers the warning? > > Sure- > > > CREATE or REPLACE FUNCTION email_activated_member () > RETURNS trigger AS $$ > > $new=$_TD['new']; > $old=$_TD['old']; > > if(($_TD['event']=='INSERT' and $new['active']='t') or You are assigning to $new['active'] instead of the probably wanted comparison. I don't see any byref arguments, and don't know how to help further. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991
--- Roman Neuhauser <neuhauser@sigpipe.cz> wrote: > # cool_screen_name90001@yahoo.com / 2005-08-11 > 17:36:49 -0700: > > --- Roman Neuhauser <neuhauser@sigpipe.cz> wrote: > > > Can you post the code that triggers the > warning? > > > > Sure- > > > > > > CREATE or REPLACE FUNCTION email_activated_member > () > > RETURNS trigger AS $$ > > > > $new=$_TD['new']; > > $old=$_TD['old']; > > > > if(($_TD['event']=='INSERT' and > $new['active']='t') or > > You are assigning to $new['active'] instead of > the > probably wanted comparison. > > I don't see any byref arguments, and don't know > how to help further. Doh! I fixed it but I'm still getting the same warnings in the log. I'd guess maybe it's something plphp is doing on its own with references, but I should probably play around with some more plphp functions and see if they generate the same warnings. Anyhow, thanks for the help. CSN __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com