4da410ab58
Closures and generators are really hard to reason about in backtraces. For generators, I took the exact name of the method and put ##$continuation##. I put it at the end so it reads exactly like a method name since in WWW we use them almost the same as the method itself. For closures, I named the class ##Closue$Class::method#num## where num is an optional autoincrementing number. I decided to stop prefixing the methods with ##0## which is breaking the reflection tests. This basically redoes D782498 and D750608 but it works in repo mode.
19 linhas
317 B
PHP
19 linhas
317 B
PHP
<?php
|
|
|
|
class A {
|
|
public function Gen() {
|
|
var_dump($this);
|
|
yield 1; yield 2; yield 3;
|
|
}
|
|
|
|
public static function SGen() {
|
|
var_dump(get_called_class());
|
|
yield 4; yield 5; yield 6;
|
|
}
|
|
}
|
|
|
|
|
|
$a = new A();
|
|
foreach ($a->Gen() as $num) { var_dump($num); }
|
|
foreach (A::SGen() as $num) { var_dump($num); }
|