hmnc Posted July 8, 2005 Report Share Posted July 8, 2005 skriptā metas kļūda. 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 skripta paraudziņš (apgraizīts ļoti): viena no funkcijām klasē: function get_n ( $arr, $ret=null ) { $ret++; $this->get_n ( $arr, &$ret); return ($ret); } darba dators: WinXP, php 4.3.9 sterveris: OpenBSD, php 4.3.10 darba datorā nekas tāds neparādās. sterverī gan. pietam parādās errors pat nepalaižot pašu klasi. kā tikt vaļā? :) Link to comment Share on other sites More sharing options...
bubu Posted July 8, 2005 Report Share Posted July 8, 2005 Tā jau nav gļūda, bet gan warnings. Jaunākās php versijās padošana pēc adreses jādefinē tā, ka tā & zīme netiek rakstīta izsaucošajā kodā, bet gan pašā funkcijas definīcijā (kas arī teikts tai angliskajā tekstā!): function get_n ( $arr, &$ret=null ) { $ret++; $this->get_n ( $arr, $ret); return ($ret); } Link to comment Share on other sites More sharing options...
Delfins Posted July 8, 2005 Report Share Posted July 8, 2005 sterveris saki (2 reizes) ?! :) Link to comment Share on other sites More sharing options...
hmnc Posted July 8, 2005 Author Report Share Posted July 8, 2005 tencinu. &$ret=null līks. kkas nepatīk. &$ret iet griezdamies. sterveris kā sterveris ;) Link to comment Share on other sites More sharing options...
hmnc Posted July 8, 2005 Author Report Share Posted July 8, 2005 a vo ne sūda. pirmajā reizē kad tiek izsaukta tā funkcija, bļauj, ka missing argument (loģiski, ka, jo nav ko returnot), bet ja padodam tukšu argumentu ('') ta brēc, ka nevar padot argumentu by reference. Link to comment Share on other sites More sharing options...
bubu Posted July 8, 2005 Report Share Posted July 8, 2005 Tukšu argumentu var padot pēc references šādi: $this->get_n ($arr, $tmp=""); A tev tiešām vajadzīga tā reference? Nepietiek ar return array($bla1, $bla2); ? Link to comment Share on other sites More sharing options...
hmnc Posted July 8, 2005 Author Report Share Posted July 8, 2005 tencinu. aizgāja. reference iespējams, ka nav vajadzīga, bet tagad nav laika+slinkums tur gudrot kko jaunu :) Link to comment Share on other sites More sharing options...
Recommended Posts