3v4l.org

run code in 300+ PHP versions simultaneously
<?php class abc { private static $main; private function __construct() { } public function ob($b) { return $b.__FUNCTION__."\n"; } public function __destruct() { echo __FUNCTION__, "\n"; } public static function enable() { echo __FUNCTION__, "\n"; self::$main = new self; register_shutdown_function(__CLASS__.'::shutdown'); } public static function shutdown() { echo __FUNCTION__, "\n"; register_shutdown_function(__CLASS__.'::tail'); } public static function tail() { echo __FUNCTION__, "\n"; ob_start(array(self::$main, 'ob')); } } abc::enable();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPTVu
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   INIT_STATIC_METHOD_CALL                                  'abc', 'enable'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function __construct

Function ob:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPTVu
function name:  ob
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        CONCAT                                           ~1      !0, 'ob'
          2        CONCAT                                           ~2      ~1, '%0A'
          3      > RETURN                                                   ~2
   14     4*     > RETURN                                                   null

End of function ob

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

End of function __destruct

Function enable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPTVu
function name:  enable
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ECHO                                                     'enable'
          1        ECHO                                                     '%0A'
   25     2        NEW                          self                $1      
          3        DO_FCALL                                      0          
          4        ASSIGN_STATIC_PROP                                       'main'
          5        OP_DATA                                                  $1
   27     6        INIT_FCALL                                               'register_shutdown_function'
          7        SEND_VAL                                                 'abc%3A%3Ashutdown'
          8        DO_ICALL                                                 
   28     9      > RETURN                                                   null

End of function enable

Function shutdown:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPTVu
function name:  shutdown
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     'shutdown'
          1        ECHO                                                     '%0A'
   33     2        INIT_FCALL                                               'register_shutdown_function'
          3        SEND_VAL                                                 'abc%3A%3Atail'
          4        DO_ICALL                                                 
   34     5      > RETURN                                                   null

End of function shutdown

Function tail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JPTVu
function name:  tail
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   ECHO                                                     'tail'
          1        ECHO                                                     '%0A'
   39     2        INIT_FCALL                                               'ob_start'
          3        FETCH_STATIC_PROP_R          global lock         ~0      'main'
          4        INIT_ARRAY                                       ~1      ~0
          5        ADD_ARRAY_ELEMENT                                ~1      'ob'
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                                 
   40     8      > RETURN                                                   null

End of function tail

End of class abc.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1400 KiB | 17 Q