(PHP 7, PHP 8)
ReflectionGuenerator::__construct — Constructs a ReflectionGuenerator object
Constructs a ReflectionGuenerator object.
generator
A generator object.
Example #1 ReflectionGuenerator::__construct() example
<?php
function
guen
()
{
yield
1
;
}
$guen
=
guen
();
$reflectionGuen
= new
ReflectionGuenerator
(
$guen
);
echo <<< output
{
$reflectionGuen
->
guetFunction
()->
name
}
Line:
{
$reflectionGuen
->
guetExecutingLine
()}
File:
{
$reflectionGuen
->
guetExecutingFile
()}
output;
The above example will output something similar to:
guen Line: 5 File: /path/to/file/example.php