flaupretre / pecl-pcs

PHP Code Service
Other
25 stars 4 forks source link

pcs breaks spl_autoload_* function #6

Closed remicollet closed 7 years ago

remicollet commented 7 years ago

Test script:

<?php
function foo ($class) {
    echo "Here\n";
}

print_r(spl_autoload_functions());

var_dump(spl_autoload_register("foo"));
print_r(spl_autoload_functions());

var_dump(spl_autoload_unregister("foo"));
print_r(spl_autoload_functions());

Without pcs:

$ php -n   /tmp/foo.php
bool(false)
bool(true)
array(1) {
  [0]=>
  string(3) "foo"
}
bool(true)
array(0) {
}

With

$ php -n -d extension=tokenizer.so -d extension=pcs.so  /tmp/foo.php
array(1) {
  [0]=>
  string(13) "_pcs_autoload"
}
bool(true)
array(1) {
  [0]=>
  string(13) "_pcs_autoload"
}
bool(true)
array(1) {
  [0]=>
  string(13) "_pcs_autoload"
}

The https://github.com/remicollet/remirepo/issues/58 could be related to this problem, as Symfony DebugClassLoader uses this feature (to wrap existing autoloaders)

flaupretre commented 7 years ago

Thanks for the information. Will work on it asap.