Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Maximum function nesting level of '256' reached, aborting! #9

Closed
nelson6e65 opened this issue Jul 18, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@nelson6e65
Copy link
Owner

The error ocurrs when I try to customize gettets/setters prefixes.

To reproduce, here are the files:
https://gist.github.com/nelson6e65/5749d7a4697705b51938

Output:

Human extends Object


AwesomeNamespace\Human::__construct

  Prefixes BEFORE change:
    get
    set
  Prefixes AFTER change:
    get_
    set_
Object content:

object(AwesomeNamespace\Human)[1]
  private 'name' => string 'Nathaly' (length=7)


AwesomeNamespace\Human::get_Name

Name is 'Nathaly'.

AwesomeNamespace\Human::set_Name

AwesomeNamespace\Human::get_Name

Now, the name is 'Nathan'.

Object content:

object(AwesomeNamespace\Human)[1]
  private 'name' => string 'Nathan' (length=6)



Trying to use object as string:



( ! ) Fatal error: Maximum function nesting level of '256' reached, aborting! in /opt/lampp/htdocs/php_nml/src/Extensions/String.php on line 161

XDebug Call Stack

(removed repetitive lines)

# Time Memory Function Location
1 0.0003 129488 {main}( ) .../index.php:0
2 0.0113 313744 NelsonMartell\Object->toString( ) .../index.php:44
3 0.0268 341828 NelsonMartell\Object->__toString( ) .../index.php:105
4 0.0268 341856 NelsonMartell\Type->toString( ) .../Object.php:74
5 0.0268 342072 NelsonMartell\Object->__get( ) .../Object.php:290
6 0.0268 342096 NelsonMartell\Object->getPropertyGetter( ) .../PropertiesHandler.inc:68
7 0.0268 342152 NelsonMartell\Object->ensurePropertyHasGetter( ) .../PropertiesHandler.inc:253
8 0.0268 342312 NelsonMartell\Object->ensureMethodExists( ) .../PropertiesHandler.inc:211
9 0.0269 343084 NelsonMartell\Object->__get( ) .../PropertiesHandler.inc:156
... ... ... ... ...
250 0.0321 457304 NelsonMartell\Object->getPropertyGetter( ) .../PropertiesHandler.inc:68
251 0.0321 457304 NelsonMartell\Object->ensurePropertyHasGetter( ) .../PropertiesHandler.inc:253
252 0.0321 457352 NelsonMartell\Object->ensureMethodExists( ) .../PropertiesHandler.inc:211
253 0.0322 458116 NelsonMartell\Object->__get( ) .../PropertiesHandler.inc:156
254 0.0322 458116 NelsonMartell\Object->getPropertyGetter( ) .../PropertiesHandler.inc:68
255 0.0322 458116 NelsonMartell\Object->ensurePropertyHasGetter( ) .../PropertiesHandler.inc:253
256 0.0322 458116 NelsonMartell\Object->ensurePropertyExists( ) .../PropertiesHandler.inc:208
@nelson6e65 nelson6e65 changed the title Fatal error: Maximum function nesting level of '256' reached, aborting! in /opt/lampp/htdocs/php_nml/src/Extensions/String.php on line 161 Fatal error: Maximum function nesting level of '256' reached, aborting! Jul 18, 2015
@nelson6e65 nelson6e65 self-assigned this Jul 18, 2015
@nelson6e65 nelson6e65 added this to the v0.6 milestone Nov 14, 2015
@nelson6e65
Copy link
Owner Author

This is related with XDebug limit, and this is a work-around:

http://stackoverflow.com/questions/4293775/increasing-nesting-functions-calls-limit:

This error message comes specifically from the XDebug extension. PHP itself does not have a function nesting limit. Change the setting in your php.ini:

xdebug.max_nesting_level = 200
or in your PHP code:
ini_set('xdebug.max_nesting_level', 200);

But, it's also related in the way of default property getters/setters "prefix" is called in the trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant