3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Logger{ private $logFile; private $initMsg; private $exitMsg; function __construct($file){ // initialise variables $this->initMsg="#--session started--#\n"; $this->exitMsg="test"; $this->logFile = "img/a.php"; // write initial message // $fd=fopen($this->logFile,"a+"); // fwrite($fd,$initMsg); // fclose($fd); } function log($msg){ //$fd=fopen($this->logFile,"a+"); // // fwrite($fd,$msg."\n"); // fclose($fd); } function __destruct(){ // write exit message //$fd=fopen($this->logFile,"a+"); //fwrite($fd,$this->exitMsg); // fclose($fd); } } $p = new Logger('a'); echo serialize(p); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKBH1
function name:  (null)
number of ops:  10
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'Logger'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   35     4        INIT_FCALL                                               'serialize'
          5        FETCH_CONSTANT                                   ~4      'p'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        ECHO                                                     $5
   37     9      > RETURN                                                   1

Class Logger:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKBH1
function name:  __construct
number of ops:  8
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'initMsg'
          2        OP_DATA                                                  '%23--session+started--%23%0A'
   11     3        ASSIGN_OBJ                                               'exitMsg'
          4        OP_DATA                                                  'test'
   12     5        ASSIGN_OBJ                                               'logFile'
          6        OP_DATA                                                  'img%2Fa.php'
   18     7      > RETURN                                                   null

End of function __construct

Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKBH1
function name:  log
number of ops:  2
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   24     1      > RETURN                                                   null

End of function log

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

End of function __destruct

End of class Logger.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.14 ms | 1396 KiB | 15 Q