3v4l.org

run code in 500+ PHP versions simultaneously
<?php #[AllowDynamicProperties] class A { 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/ln7Or
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $1      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   24     3        ECHO                                                         'Initial%3A%0A'
   25     4        INIT_METHOD_CALL                                             !0, 'dump'
          5        DO_FCALL                                          0          
   27     6        ECHO                                                         '%0AAssign+null%3A%0A'
   28     7        INIT_METHOD_CALL                                             !0, 'setFoo'
          8        SEND_VAL_EX                                                  null
          9        DO_FCALL                                          0          
   29    10        INIT_METHOD_CALL                                             !0, 'dump'
         11        DO_FCALL                                          0          
   31    12        ECHO                                                         '%0AUnset%3A%0A'
   32    13        INIT_METHOD_CALL                                             !0, 'unsetFoo'
         14        DO_FCALL                                          0          
   33    15        INIT_METHOD_CALL                                             !0, 'dump'
         16        DO_FCALL                                          0          
   35    17        ECHO                                                         '%0AAssign+value%3A%0A'
   36    18        INIT_METHOD_CALL                                             !0, 'setFoo'
         19        SEND_VAL_EX                                                  42
         20        DO_FCALL                                          0          
   37    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/ln7Or
function name:  setFoo
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        ASSIGN_OBJ                                                   'foo'
          2        OP_DATA                                                      !0
    7     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/ln7Or
function name:  unsetFoo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   UNSET_OBJ                                                    'foo'
   10     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/ln7Or
function name:  dump
number of ops:  16
compiled vars:  !0 = $err
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_THIS                                           ~1      
          2        SEND_VAL                                                     ~1
          3        DO_ICALL                                                     
   14     4        INIT_FCALL                                                   'var_dump'
          5        FETCH_OBJ_R                                          ~3      'foo'
          6        SEND_VAL                                                     ~3
          7        DO_ICALL                                                     
          8      > JMP                                                          ->15
   16     9  E > > CATCH                                           last         'Error'
   17    10    >   ECHO                                                         'ERROR%3A+'
         11        INIT_METHOD_CALL                                             !0, 'getMessage'
         12        DO_FCALL                                          0  $5      
         13        ECHO                                                         $5
         14        ECHO                                                         '%0A'
   19    15    > > RETURN                                                       null

End of function dump

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.53 ms | 1479 KiB | 14 Q