3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 'bar'; private $baz = 'baz'; function getBaz() { return $this->baz; } function setBaz($val) { $this->baz = $val; } } $foo = new Foo; echo $foo->getBaz(), "\n"; unset($foo->baz); var_dump($foo); $foo->setBaz('all set'); 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/XvJhJ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'getBaz'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6        ECHO                                                     '%0A'
   17     7        UNSET_OBJ                                                !0, 'baz'
   18     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   19    11        INIT_METHOD_CALL                                         !0, 'setBaz'
         12        SEND_VAL_EX                                              'all+set'
         13        DO_FCALL                                      0          
   20    14        INIT_METHOD_CALL                                         !0, 'getBaz'
         15        DO_FCALL                                      0  $7      
         16        ECHO                                                     $7
         17        ECHO                                                     '%0A'
   21    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/XvJhJ
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/XvJhJ
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

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.47 ms | 1396 KiB | 15 Q