3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 'bar'; private $baz = 'value of baz'; function getBaz() { return $this->baz; } function setBaz($val) { $this->baz = $val; } function unBaz(){ unset($this->baz); echo 'Bye bye baz',"\n"; } } $foo = new Foo; echo $foo->getBaz(), "\n"; $foo->unBaz(); var_dump($foo); $foo->setBaz('baz again!'); echo $foo->baz, "\n"; //echo $foo->getBaz(), "\n"; var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETBTu
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'getBaz'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6        ECHO                                                     '%0A'
   21     7        INIT_METHOD_CALL                                         !0, 'unBaz'
          8        DO_FCALL                                      0          
   22     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   23    12        INIT_METHOD_CALL                                         !0, 'setBaz'
         13        SEND_VAL_EX                                              'baz+again%21'
         14        DO_FCALL                                      0          
   24    15        FETCH_OBJ_R                                      ~8      !0, 'baz'
         16        ECHO                                                     ~8
         17        ECHO                                                     '%0A'
   26    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Foo:
Function getbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETBTu
function name:  getBaz
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'baz'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getbaz

Function setbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETBTu
function name:  setBaz
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'baz'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function setbaz

Function unbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETBTu
function name:  unBaz
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   UNSET_OBJ                                                'baz'
   15     1        ECHO                                                     'Bye+bye+baz'
          2        ECHO                                                     '%0A'
   16     3      > RETURN                                                   null

End of function unbaz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.52 ms | 1400 KiB | 15 Q