3v4l.org

run code in 500+ PHP versions simultaneously
<?php class SomeTheoreticalYieldExample { public $value; public function __construct() { $this->value = 'Some value'; yield 1; } } $it = new SomeTheoreticalYieldExample(); var_dump($it->value); // PHP 8.5 surprise, it is NULL ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z4dMTF
function name:  (null)
number of ops:  8
compiled vars:  !0 = $it
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $1      'SomeTheoreticalYieldExample'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   15     3        INIT_FCALL                                                   'var_dump'
          4        FETCH_OBJ_R                                          ~4      !0, 'value'
          5        SEND_VAL                                                     ~4
          6        DO_ICALL                                                     
   17     7      > RETURN                                                       1

Class SomeTheoreticalYieldExample:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/Z4dMTF
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   GENERATOR_CREATE                                             
    9     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      'Some+value'
   10     3        YIELD                                                        1
   11     4      > GENERATOR_RETURN                                             

End of function __construct

End of class SomeTheoreticalYieldExample.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.45 ms | 3304 KiB | 14 Q