3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myInstance = new MyClass('ciao'); $res = $myInstance->doSomething($myInstance->getName()); print($res . ' ' . $myInstance->getName()); class MyClass { private $_name; public function setName($name) { $this->_name = $name; } public function getName() { return $this->_name; } public function __construct($name) { $this->_name = $name; } public function doSomething(&$value) { $value = $value . '_MODIFIED'; return $value; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBE9s
function name:  (null)
number of ops:  16
compiled vars:  !0 = $myInstance, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'MyClass'
          1        SEND_VAL_EX                                              'ciao'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        INIT_METHOD_CALL                                         !0, 'doSomething'
          5        INIT_METHOD_CALL                                         !0, 'getName'
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !1, $6
    7    10        CONCAT                                           ~8      !1, '+'
         11        INIT_METHOD_CALL                                         !0, 'getName'
         12        DO_FCALL                                      0  $9      
         13        CONCAT                                           ~10     ~8, $9
         14        ECHO                                                     ~10
   28    15      > RETURN                                                   1

Class MyClass:
Function setname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBE9s
function name:  setName
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               '_name'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function setname

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBE9s
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      '_name'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getname

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBE9s
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               '_name'
          2        OP_DATA                                                  !0
   22     3      > RETURN                                                   null

End of function __construct

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JBE9s
function name:  doSomething
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        CONCAT                                           ~1      !0, '_MODIFIED'
          2        ASSIGN                                                   !0, ~1
   26     3      > RETURN                                                   !0
   27     4*     > RETURN                                                   null

End of function dosomething

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.67 ms | 1399 KiB | 13 Q