Description:
------------
I know that get_defined_vars() is not returning $this but for every developer it feels like a variable that is currently defined inside an object context.
As you can never overwrite $this - even outside an object context it would make sense that the extract function always work as $this is defined and use the appropriate method (skip/prefix).
Test script:
---------------
<?php
$arr = ['this' => 'hello world'];
extract($arr, EXTR_SKIP);
extract($arr, EXTR_PREFIX_INVALID, 'v_');
var_dump($v_hello === $arr['this']);
Expected result:
----------------
bool(true)
Actual result:
--------------
PHP Fatal error: Uncaught Error: Cannot re-assign $this in /tmp/test.php:4
Stack trace:
#0 /tmp/test.php(4): extract(Array, 1)
#1 {main}
thrown in /tmp/test.php on line 4