3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FgICGl%3A20%240

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

End of function %00%7Bclosure%7D%2Fin%2FgICGl%3A22%241

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gICGl
function name:  __construct
number of ops:  4
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'c'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gICGl
function name:  __destruct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'B'
   14     1        INIT_FCALL                                               'error_log'
          2        FETCH_OBJ_R                                      ~0      'c'
          3        CONCAT                                           ~1      'D', ~0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   15     6      > RETURN                                                   null

End of function __destruct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.42 ms | 1404 KiB | 19 Q