3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gen = (function() { yield from [null, new class { function __destruct() { throw new Exception; } }]; })(); function foo($gen) { $gen->valid(); } foo($gen); function spray() {} spray(...range(1, 20)); $gen->throw(new Error);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeJLV
function name:  (null)
number of ops:  21
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    5     1        INIT_DYNAMIC_CALL                                        ~1
          2        DO_FCALL                                      0  $2      
    3     3        ASSIGN                                                   !0, $2
   10     4        INIT_FCALL                                               'foo'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   13     7        INIT_FCALL                                               'spray'
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 20
         11        DO_ICALL                                         $5      
         12        SEND_UNPACK                                              $5
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1          
   15    15        INIT_METHOD_CALL                                         !0, 'throw'
         16        NEW                                              $7      'Error'
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $7
         19        DO_FCALL                                      0          
         20      > 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/QeJLV
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        INIT_ARRAY                                       ~0      null
          2        DECLARE_ANON_CLASS                               <unknown> 
          3        NEW                                              $2      $1
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~0      $2
          6        YIELD_FROM                                       ~4      ~0
          7        FREE                                                     ~4
    5     8      > GENERATOR_RETURN                                         

End of Dynamic Function 0

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeJLV
function name:  foo
number of ops:  4
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_METHOD_CALL                                         !0, 'valid'
          2        DO_FCALL                                      0          
    9     3      > RETURN                                                   null

End of function foo

Function spray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeJLV
function name:  spray
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   null

End of function spray

Class class@anonymous:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/QeJLV
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $0      'Exception'
          1        DO_FCALL                                      0          
          2      > THROW                                         0          $0
          3*     > RETURN                                                   null

End of function __destruct

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.5 ms | 1005 KiB | 16 Q