Call-time pass-by-reference has been deprecated;
Call-time pass-by-reference has been deprecated;
am 16.01.2008 16:51:11 von sisqorap
Hi all,
I have this kind of warning and would like to have it solved:
Warning: Call-time pass-by-reference has been deprecated; If you would
like to pass it by reference, modify the declaration of
xml_parse_into_struct(). 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. in /bla.php on line 94
The code which is behind is like this:
/* read the DSN from the file */
if( !($parser = xml_parser_create( ) )){
echo "Could not create parser
";
exit;
}
/* read the xml file */
$data = implode( file( $_SESSION[ 'CONF_file' ] ), "" );
/* parse into array */
xml_parse_into_struct( $parser, $data, &$structure, &$index );
xml_parser_free( $parser );
Somebody who can help me? And turning off/on
allow_call_time_pass_reference is not an option.
Greetz
Re: Call-time pass-by-reference has been deprecated;
am 16.01.2008 17:58:42 von zeldorblat
On Jan 16, 10:51 am, "sisqo...@gmail.com" wrote:
> Hi all,
>
> I have this kind of warning and would like to have it solved:
> Warning: Call-time pass-by-reference has been deprecated; If you would
> like to pass it by reference, modify the declaration of
> xml_parse_into_struct(). 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. in /bla.php on line 94
>
> The code which is behind is like this:
> /* read the DSN from the file */
> if( !($parser = xml_parser_create( ) )){
> echo "Could not create parser
";
> exit;
> }
>
> /* read the xml file */
> $data = implode( file( $_SESSION[ 'CONF_file' ] ), "" );
>
> /* parse into array */
> xml_parse_into_struct( $parser, $data, &$structure, &$index );
> xml_parser_free( $parser );
>
> Somebody who can help me? And turning off/on
> allow_call_time_pass_reference is not an option.
>
> Greetz
Remove the & in front of $structure when you call
xml_parse_into_struct().
That function (according to the documentation, anyway) takes that
argument by reference -- so there's no need to specify the & when you
call the function.
Re: Call-time pass-by-reference has been deprecated;
am 16.01.2008 18:24:43 von Toby A Inkster
sisqorap@gmail.com wrote:
> Warning: Call-time pass-by-reference has been deprecated; If you would
> like to pass it by reference, modify the declaration of
> xml_parse_into_struct().
In other words, instead of this:
xml_parse_into_struct( $parser, $data, &$structure, &$index );
Use this:
xml_parse_into_struct( $parser, $data, $structure, $index );
And modify the function definition of xml_parse_into_struct to include the
ampersand symbols there instead.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 4:36.]
Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
Re: Call-time pass-by-reference has been deprecated;
am 17.01.2008 09:25:31 von sisqorap
On 16 jan, 18:24, Toby A Inkster
wrote:
> sisqo...@gmail.com wrote:
> > Warning: Call-time pass-by-reference has been deprecated; If you would
> > like to pass it by reference, modify the declaration of
> > xml_parse_into_struct().
>
> In other words, instead of this:
>
> xml_parse_into_struct( $parser, $data, &$structure, &$index );
>
> Use this:
>
> xml_parse_into_struct( $parser, $data, $structure, $index );
>
> And modify the function definition of xml_parse_into_struct to include the
> ampersand symbols there instead.
>
> --
> Toby A Inkster BSc (Hons) ARCS
> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 4:36.]
>
> Gnocchi all'Amatriciana al Forno
> http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
Tried this and warnings are gone but now I get this Notice:
Notice: Only variable references should be returned by reference in
blaja.php on line 165
The last line of the code is line 165
if ($uID == 0) {
$uID = $this->f_getUserID();
}
if ($uID <= 0) { return 0; }
Maybe someone can get me out of this?
Re: Call-time pass-by-reference has been deprecated;
am 17.01.2008 14:42:49 von Jerry Stuckle
sisqorap@gmail.com wrote:
> On 16 jan, 18:24, Toby A Inkster
> wrote:
>> sisqo...@gmail.com wrote:
>>> Warning: Call-time pass-by-reference has been deprecated; If you would
>>> like to pass it by reference, modify the declaration of
>>> xml_parse_into_struct().
>> In other words, instead of this:
>>
>> xml_parse_into_struct( $parser, $data, &$structure, &$index );
>>
>> Use this:
>>
>> xml_parse_into_struct( $parser, $data, $structure, $index );
>>
>> And modify the function definition of xml_parse_into_struct to include the
>> ampersand symbols there instead.
>>
>> --
>> Toby A Inkster BSc (Hons) ARCS
>> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
>> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 4:36.]
>>
>> Gnocchi all'Amatriciana al Forno
>> http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
>
> Tried this and warnings are gone but now I get this Notice:
> Notice: Only variable references should be returned by reference in
> blaja.php on line 165
>
> The last line of the code is line 165
> if ($uID == 0) {
> $uID = $this->f_getUserID();
> }
>
> if ($uID <= 0) { return 0; }
>
> Maybe someone can get me out of this?
>
Exactly what it says. You indicated your function returns a reference.
This implies a variable to refer to. 0 is not a variable.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================