3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { public function __destruct() { echo 'B'; error_log('D'); } } $b = new B; register_shutdown_function(function(){ $b = new B; echo 'A';}); ob_start(function($buffer){ $b = new B; $buffer .= 'C'; return $buffer;});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obe77
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'register_shutdown_function'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fobe77%3A15%240'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   17     7        INIT_FCALL                                               'ob_start'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fobe77%3A17%241'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fobe77%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obe77
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3        ECHO                                                     'A'
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fobe77%3A15%240

Function %00%7Bclosure%7D%2Fin%2Fobe77%3A17%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obe77
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $buffer, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        NEW                                              $2      'B'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
          4        ASSIGN_OP                                     8          !0, 'C'
          5      > RETURN                                                   !0
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fobe77%3A17%241

Class B:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/obe77
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'B'
    9     1        INIT_FCALL                                               'error_log'
          2        SEND_VAL                                                 'D'
          3        DO_ICALL                                                 
   10     4      > RETURN                                                   null

End of function __destruct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.93 ms | 1400 KiB | 19 Q