3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $string = ''; private $appendString = false; public function __construct($appendString = false) { $this->appendString = $appendString; $this->string .= 'Costruito'; } public function __destruct() { echo 'ciao'; if ($this->appendString) { $this->string .= ' Distrutto'; } } public function get() { return $this->string; } } $x = new A(false); $y = new A(true); echo $x->get(); echo "\n"; echo $y->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0RHP
function name:  (null)
number of ops:  16
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'A'
          1        SEND_VAL_EX                                              <false>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   30     4        NEW                                              $5      'A'
          5        SEND_VAL_EX                                              <true>
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   32     8        INIT_METHOD_CALL                                         !0, 'get'
          9        DO_FCALL                                      0  $8      
         10        ECHO                                                     $8
   33    11        ECHO                                                     '%0A'
   34    12        INIT_METHOD_CALL                                         !1, 'get'
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0RHP
function name:  __construct
number of ops:  6
compiled vars:  !0 = $appendString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      <false>
    9     1        ASSIGN_OBJ                                               'appendString'
          2        OP_DATA                                                  !0
   11     3        ASSIGN_OBJ_OP                                 8          'string'
          4        OP_DATA                                                  'Costruito'
   12     5      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/F0RHP
function name:  __destruct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'ciao'
   18     1        FETCH_OBJ_R                                      ~0      'appendString'
          2      > JMPZ                                                     ~0, ->5
   19     3    >   ASSIGN_OBJ_OP                                 8          'string'
          4        OP_DATA                                                  '+Distrutto'
   21     5    > > RETURN                                                   null

End of function __destruct

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0RHP
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'string'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.73 ms | 1399 KiB | 13 Q