3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Logger { public function __construct() { register_shutdown_function(function () { // make regular flush before other shutdown functions, which allows session data collection and so on $this->flush(); // make sure log entries written by shutdown functions are also flushed // ensure "flush()" is called last when there are multiple shutdown functions register_shutdown_function([$this, 'flush'], true); }); } public function flush($final = false) { return 1; } } for ($i = 0; $i < 200; $i++) { $a = new Logger(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
Branch analysis from position: 2
filename:       /in/KC8d3
function name:  (null)
number of ops:  9
compiled vars:  !0 = $i, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                       !0, 0
          1      > JMP                                                          ->6
   20     2    >   NEW                                                  $3      'Logger'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $3
   19     5        PRE_INC                                                      !0
          6    >   IS_SMALLER                                                   !0, 200
          7      > JMPNZ                                                        ~7, ->2
   21     8    > > RETURN                                                       1

Class Logger:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KC8d3
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                                   'register_shutdown_function'
          1        DECLARE_LAMBDA_FUNCTION                              ~0      [0]
   11     2        SEND_VAL                                                     ~0
    5     3        DO_ICALL                                                     
   12     4      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KC8d3
function name:  {closure:Logger::__construct():5}
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                             'flush'
          1        DO_FCALL                                          0          
   10     2        INIT_FCALL                                                   'register_shutdown_function'
          3        FETCH_THIS                                           ~1      
          4        INIT_ARRAY                                           ~2      ~1
          5        ADD_ARRAY_ELEMENT                                    ~2      'flush'
          6        SEND_VAL                                                     ~2
          7        SEND_VAL                                                     <true>
          8        DO_ICALL                                                     
   11     9      > RETURN                                                       null

End of Dynamic Function 0

End of function __construct

Function flush:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KC8d3
function name:  flush
number of ops:  3
compiled vars:  !0 = $final
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV_INIT                                            !0      <false>
   15     1      > RETURN                                                       1
   16     2*     > RETURN                                                       null

End of function flush

End of class Logger.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.85 ms | 3268 KiB | 14 Q