>> > >function &testfunc()
>> > >{
>> > >$nullVar = NULL;
>> > >return $nullVar;
>> > >}
>> >
>> > That'd work, yep.
>>
>>Wrong ;-) It causes problems with reference counting - and will segfault
>>PHP after some time.
>
> Hmm, that in itself shouldn't cause any problems unless it's coupled with
>
>> >Is the correct approach to do something like:
>> >
>> >function &testfunc()
>> >{
>> >$nullVar = NULL;
>> >return $nullVar;
>> >}
>>
>> That'd work, yep.
>
> Wrong ;-) It causes problems with reference counting - and will segfault
> PHP after some time.
>
> Derick
Then what is the correct app
Just to followup on today's threads on both the strange PHP 4.3.10 apache
coredump/sitting and spinning in malloc() bug #31508 and the losing $this
variable bug 31525.
Both, it turns out, were caused because I was returning references inside
parenthetical expression on return(). i.e.
function &s
> Yermo,
>
> Essentially, what Andi was saying is that we need your help in order for
> us to help you. To put it more clearly - even if there is a bug in the
> language engine or some other component of PHP - it's impossible for us to
> figure out what it is, unless we're provided with a reprodu
What is the proper way to return a NULL condition from a method that
returns a reference?
function &testfunc()
{
return NULL;
}
generates:
"Strict Standards: Only variable references should be returned by
reference in ..."
Is the correct approach to do something like:
function &testfunc()
{
$
dy of my project.
Just alot of "var: Deprecated." and "Assigning the return value of new by
reference is deprecated" messages.
Just an FYI.
-- Yermo
>
> Thanks.
>
> At 09:35 PM 3/5/2005 -0500, Yermo Lamers wrote:
>>Andi,
>>
>> > Are you ge
RICT turned on it clearly generates the correct warning. That is
very helpful.
Thanks,
-- Yermo
>
> Thanks.
>
> At 09:35 PM 3/5/2005 -0500, Yermo Lamers wrote:
>>Andi,
>>
>> > Are you getting an error message if you set E_STRICT?
>>
>>I always run
#x27;t reproduce it in a few lines of code what should
I do then?
Keep quiet and/or go away?
Or do you believe the entire problem space will always reduce down to a
few lines of code?
I'm just looking for some direction; I'm sure there are alot of guys like
me out there that would
. (Of course PHP shouldn't trash it's symbol table, segfault, etc )
> Andi
>
>
> At 09:01 PM 3/5/2005 -0500, Yermo Lamers wrote:
>
>>Thanks to michaels (at) crye-leike.com for the followup. He produced a
>>much shorter version of the code that produces th
Thanks to michaels (at) crye-leike.com for the followup. He produced a
much shorter version of the code that produces the same result:
getThis();
}
}
$bar = new Foo();
$bar->destroyThis();
var_dump($bar);
?>
Interestingly if you change the return( $this ) in &getThis() to return
$this; the bug
> The problem you're having is not giving the right information. For
> instance, the buffer overrun errors would be an ideal thing to attach
> to your bug report.
The buffer overruns are the separate bug in PHP 4 as in
http://bugs.php.net/31508.
The PHP 5 is not encountering a buffer overrun; i
> Yermo Lamers wrote:
>> I've not had alot of luck with reporting bugs through the bug tracker;
>> For instance see
>>
>> http://bugs.php.net/31508
>>
>> where the guy claims PHP can't do recursion without crashing ... Ummm?
>
> To be fair,
PHP 5.0.3 is losing $this. PHP 4.3.10 and 5.0.0 seem to work fine.
The bug originally appeared in 5.0.2.
I have submitted a bug report at:
http://bugs.php.net/31525
I've not had alot of luck with reporting bugs through the bug tracker;
For instance see
http://bugs.php.net/31508
where the guy cl
13 matches
Mail list logo