3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { function __destruct() { echo __METHOD__, "\n"; } } class D { function __destruct() { echo __METHOD__, "\n"; } } $gen = function ($c) use (&$gen) { new D($gen, yield); }; $gen = $gen(new C()); foreach ($gen as $value) { break; } $gen = null; gc_collect_cycles(); echo "DONE\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 13
filename:       /in/32Ku7
function name:  (null)
number of ops:  19
compiled vars:  !0 = $gen, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        BIND_LEXICAL                                             ~2, !0
          2        ASSIGN                                                   !0, ~2
   19     3        INIT_DYNAMIC_CALL                                        !0
          4        NEW                                              $4      'C'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !0, $6
   21     9      > FE_RESET_R                                       $8      !0, ->13
         10    > > FE_FETCH_R                                               $8, !1, ->13
   22    11    > > JMP                                                      ->13
   21    12*       JMP                                                      ->10
         13    >   FE_FREE                                                  $8
   25    14        ASSIGN                                                   !0, null
   27    15        INIT_FCALL                                               'gc_collect_cycles'
         16        DO_ICALL                                                 
   32    17        ECHO                                                     'DONE%0A'
         18      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/32Ku7
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $c, !1 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
          2        BIND_STATIC                                              !1
   16     3        NEW                                              $2      'D'
          4        SEND_VAR_EX                                              !1
          5        YIELD                                            $3      
          6        SEND_VAR_NO_REF_EX                                       $3
          7        DO_FCALL                                      0          
          8        FREE                                                     $2
   17     9      > GENERATOR_RETURN                                         

End of Dynamic Function 0

Class C:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/32Ku7
function name:  __destruct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'C%3A%3A__destruct'
          1        ECHO                                                     '%0A'
    6     2      > RETURN                                                   null

End of function __destruct

End of class C.

Class D:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/32Ku7
function name:  __destruct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'D%3A%3A__destruct'
          1        ECHO                                                     '%0A'
   12     2      > RETURN                                                   null

End of function __destruct

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.56 ms | 1015 KiB | 14 Q