1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
psalm/tests/fixtures/DestructiveAutoloader/autoloader.php

22 lines
524 B
PHP
Raw Normal View History

<?php
// attempt to destroy some variables Psalm entrypoint may be using
// this will run when autoloader is being registered
foreach ($GLOBALS as $key => $_) {
if ($key === 'GLOBALS') {
continue;
}
$GLOBALS[$key] = new Exception;
}
2023-10-21 20:45:09 +02:00
spl_autoload_register(static function () {
// and destroy vars again
// this will run during scanning (?)
foreach ($GLOBALS as $key => $_) {
if ($key === 'GLOBALS') {
continue;
}
$GLOBALS[$key] = new Exception;
}
});