3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $foo; private $bar; public function __set($name, $value) { $this->$name = $value; return $this; } public function setBar($value) { $this->bar = $value; return $this; } public function sendVar($name) { echo $this->$name; return $this; } } $thing = new Test(); $thing->__set('foo', 'Test1')->setBar('Test2')->sendVar('foo')->sendVar('bar');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGlHs
function name:  (null)
number of ops:  17
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, '__set'
          4        SEND_VAL_EX                                              'foo'
          5        SEND_VAL_EX                                              'Test1'
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'setBar'
          8        SEND_VAL_EX                                              'Test2'
          9        DO_FCALL                                      0  $5      
         10        INIT_METHOD_CALL                                         $5, 'sendVar'
         11        SEND_VAL_EX                                              'foo'
         12        DO_FCALL                                      0  $6      
         13        INIT_METHOD_CALL                                         $6, 'sendVar'
         14        SEND_VAL_EX                                              'bar'
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Class Test:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGlHs
function name:  __set
number of ops:  7
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   11     4        FETCH_THIS                                       ~3      
          5      > RETURN                                                   ~3
   12     6*     > RETURN                                                   null

End of function __set

Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGlHs
function name:  setBar
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
   16     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   17     5*     > RETURN                                                   null

End of function setbar

Function sendvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cGlHs
function name:  sendVar
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_R                                      ~1      !0
          2        ECHO                                                     ~1
   21     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   22     5*     > RETURN                                                   null

End of function sendvar

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.5 ms | 1000 KiB | 13 Q