3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $foo; public function setFoo($value) { $this->foo = $value; } public function unsetFoo() { unset($this->foo); } public function dump() { var_dump($this); try { var_dump($this->foo); } catch ( Error $err ) { echo 'ERROR: ', $err->getMessage(), "\n"; } } } $a = new A; echo "Initial:\n"; $a->dump(); echo "\nAssign null:\n"; $a->setFoo(null); $a->dump(); echo "\nUnset:\n"; $a->unsetFoo(); $a->dump(); echo "\nAssign value:\n"; $a->setFoo(42); $a->dump();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U2DFZ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        ECHO                                                     'Initial%3A%0A'
   26     4        INIT_METHOD_CALL                                         !0, 'dump'
          5        DO_FCALL                                      0          
   28     6        ECHO                                                     '%0AAssign+null%3A%0A'
   29     7        INIT_METHOD_CALL                                         !0, 'setFoo'
          8        SEND_VAL_EX                                              null
          9        DO_FCALL                                      0          
   30    10        INIT_METHOD_CALL                                         !0, 'dump'
         11        DO_FCALL                                      0          
   32    12        ECHO                                                     '%0AUnset%3A%0A'
   33    13        INIT_METHOD_CALL                                         !0, 'unsetFoo'
         14        DO_FCALL                                      0          
   34    15        INIT_METHOD_CALL                                         !0, 'dump'
         16        DO_FCALL                                      0          
   36    17        ECHO                                                     '%0AAssign+value%3A%0A'
   37    18        INIT_METHOD_CALL                                         !0, 'setFoo'
         19        SEND_VAL_EX                                              42
         20        DO_FCALL                                      0          
   38    21        INIT_METHOD_CALL                                         !0, 'dump'
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

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

End of function setfoo

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

End of function unsetfoo

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U2DFZ
function name:  dump
number of ops:  16
compiled vars:  !0 = $err
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   15     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~3      'foo'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
          8      > JMP                                                      ->15
   17     9  E > > CATCH                                       last         'Error'
   18    10    >   ECHO                                                     'ERROR%3A+'
         11        INIT_METHOD_CALL                                         !0, 'getMessage'
         12        DO_FCALL                                      0  $5      
         13        ECHO                                                     $5
         14        ECHO                                                     '%0A'
   20    15    > > RETURN                                                   null

End of function dump

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.67 ms | 1405 KiB | 15 Q