Closed splitbrain closed 3 years ago
Yes, that's because Derick removed xdebug_disable
in 3.x and phpDox doesn't know about that yet.
While with Xdebug 3.x the performance penalty even when not actively using it is almost gone, it's always a good idea to not have extensions loaded you don't need. As a temporary workaround, just remove xdebug from your cli environment as it will slow down execution in worstcase or be uselessly loaded at best.
I will try to make a new release sometime soon but phpDox sadly suffers under neglect and I don't have much time these days to work on it.
Yes, that's because Derick removed xdebug_disable in 3.x and phpDox doesn't know about that yet.
The check itself is not the problem here.
The issue is that if the function exists in the global namespace it is not executed as xdebug_disable()
but as TheSeer\phpDox\xdebug_disable()
instead.
I suppose a simple backslash could help here \xdebug_disable()
but I currently can't test it.
Yes, that's because Derick removed xdebug_disable in 3.x and phpDox doesn't know about that yet.
The check itself is not the problem here.
The issue is that if the function exists in the global namespace it is not executed as
xdebug_disable()
but asTheSeer\phpDox\xdebug_disable()
instead.I suppose a simple backslash could help here
\xdebug_disable()
but I currently can't test it.
Actually, yes and no: In xdebug 3.x, there simply is no xdebug_disable()
function. That's why PHP is trying to use a "local" variant. But prepending a \
won't change the fact the function doesn't exist - it would merely fail with complaining \xdebug_disable not defined
, rather than TheSeer\phpDox\xdebug_disable not defined
.
The check is simply wrong. It needs to check if xdebug is enabled and the function exists. I just don't have time for phpDox these days. Sorry for the delay...
Thank you for the clarification and sorry for the misunderstanding! Now I understand where I have been wrong! 🤦♀️
I thought we were actually talking about this but that is already the fixed variant (which only is in the master by now and just not yet in a current release):
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
Have a nice weekend!
The underlying issue is fixed. I'll to make a reason soon.
When I try to run the latest phar, the tool crashes with the following output. Seems like it tries to execute
xdebug_disable
within the phpDox namespace!?I'm running xdebug 3.0.2 BTW.