Edit report at http://bugs.php.net/bug.php?id=37675&edit=1

 ID:               37675
 Comment by:       
 Reported by:      thomas at ecommerce dot com
 Summary:          OOP -> Maximum function nesting error
 Status:           Bogus
 Type:             Bug
 Package:          Unknown/Other Function
 Operating System: SuSE Linux 10,0
 PHP Version:      5.1.4

 New Comment:

This arbitrary limit is set by xDebug. If you disable it you will find
out that PHP aborts when the stack is exhausted ("Segmentation fault"),
rather than after 100 function calls.



I reply to this old thread because I couldn't find this simple sollution
anywhere on the internets. Hopefully it helps someone.


Previous Comments:
------------------------------------------------------------------------
[2006-06-02 11:00:48] der...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

$this doesn\'t move to the static scope after calling it...

------------------------------------------------------------------------
[2006-06-02 11:00:10] thomas at ecommerce dot com

You didn't test it at all. I have xDebug installed, yea, but also
without acitvated any special modul/extension i get:



 php test.php



Fatal error: Allowed memory size of 62914560 bytes exhausted (tried to
allocate 12 bytes) in /home/Thomas/test.php on line 10



because of endless loop

------------------------------------------------------------------------
[2006-06-02 10:55:30] tony2...@php.net

Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

There is no such error message in PHP itself.

------------------------------------------------------------------------
[2006-06-02 10:46:40] thomas at ecommerce dot com

Description:
------------
PHP 5.1.4 seams like running an endless loop here with this code. When
running the bottom code, i get following error message:



Fatal error: Maximum function nesting level of '100' reached, aborting!
in /home/Thomas/test.php on line 11



Its not possibe, that this cause an endless loop. $this is setted, when
created with 'new', so checkthis() should only be called 2 times.

Reproduce code:
---------------
<?php



class Test1

{

    public $anyVar = "Setted";



    public static function checkThis($var = null)

    {

       if (!isset($this) || !isset($this->anyVar)) {

            $obj = new Test1();

            return $obj->checkThis($var);

        }



        echo "$var\n";

    }

}



$return = Test1::checkThis("Works!");



var_dump($return);

Expected result:
----------------
Output of script should be:



Works!

NULL

Actual result:
--------------
Fatal error: Maximum function nesting level of '100' reached, aborting!
in /home/Thomas/test.php on line 11


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=37675&edit=1

Reply via email to