Fully qualified class names not found by runkit_method_* functions #43

Closed
noseglid opened this Issue Nov 6, 2012 · 3 comments

Comments

Projects
None yet
2 participants

noseglid commented Nov 6, 2012

When using a fully qualified name (akin to `\Namespace\Class' - note backslash at start) runkit_method_* functions appears as if it does not find the class.

Consider following:

<?php

class A
{
  public static function fn()
  {
    printf("Hello, world!\n");
  }
}

\A::fn();
runkit_method_remove('\A', 'fn');

This gives the following output:

Hello, world!
PHP Warning:  runkit_method_remove(): class \a not found in /h/alexo/a.php on line 12
PHP Stack trace:
PHP   1. {main}() /h/alexo/a.php:0
PHP   2. runkit_method_remove() /h/alexo/a.php:12
PHP Warning:  runkit_method_remove(): Unknown method \a::fn() in /h/alexo/a.php on line 12
PHP Stack trace:
PHP   1. {main}() /h/alexo/a.php:0
PHP   2. runkit_method_remove() /h/alexo/a.php:12

So, \A does specify a class, but not recognized by runkit (Removing the leading \ gives expected result)

php -v gives:

PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug  6 2012 14:18:06) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
    with test_helpers v1.0.1-dev, Copyright (c) 2009-2010, by Johannes Schlueter, Scott MacVicar, Sebastian Bergmann

runkit version is 1.0.3.

Owner

zenovich commented Nov 6, 2012

Thanks for the report. How about the master branch?

noseglid commented Nov 6, 2012

Same result on d069e23

Owner

zenovich commented Aug 14, 2015

This works now.

zenovich closed this Aug 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment