3v4l.org

run code in 500+ PHP versions simultaneously
<?php class O { function __destruct() { echo "D\n"; } } $o = new O(); $fx = fn() => ($o = 5) && $o; unset($o); var_dump($fx()); $o = new O(); $fx = fn($o) => $o; unset($o); var_dump($fx(5));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/It1HL
function name:  (null)
number of ops:  25
compiled vars:  !0 = $o, !1 = $fx
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $2      'O'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   11     3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        BIND_LEXICAL                                                 ~5, !0
          5        ASSIGN                                                       !1, ~5
   12     6        UNSET_CV                                                     !0
   13     7        INIT_FCALL                                                   'var_dump'
          8        INIT_DYNAMIC_CALL                                            !1
          9        DO_FCALL                                          0  $7      
         10        SEND_VAR                                                     $7
         11        DO_ICALL                                                     
   15    12        NEW                                                  $9      'O'
         13        DO_FCALL                                          0          
         14        ASSIGN                                                       !0, $9
   16    15        DECLARE_LAMBDA_FUNCTION                              ~12     [1]
         16        ASSIGN                                                       !1, ~12
   17    17        UNSET_CV                                                     !0
   18    18        INIT_FCALL                                                   'var_dump'
         19        INIT_DYNAMIC_CALL                                            !1
         20        SEND_VAL_EX                                                  5
         21        DO_FCALL                                          0  $14     
         22        SEND_VAR                                                     $14
         23        DO_ICALL                                                     
         24      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/It1HL
function name:  {closure:/in/It1HL:11}
number of ops:  6
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                                  !0
          1        ASSIGN                                               ~1      !0, 5
          2      > JMPZ_EX                                              ~1      ~1, ->4
          3    >   BOOL                                                 ~1      !0
          4    > > RETURN                                                       ~1
          5*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/It1HL
function name:  {closure:/in/It1HL:16}
number of ops:  3
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1      > RETURN                                                       !0
          2*     > RETURN                                                       null

End of Dynamic Function 1

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

End of function __destruct

End of class O.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.38 ms | 482 KiB | 8 Q