3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { private $name; private $age; public function setName($name) { $this->name = $name; return $this; } public function setAge($age) { $this->age = $age; return $this; } } $thing = new Thing(); $thing->setName('Matt'); $thing->setAge(23); $thing = (array)$thing; $thing = (object)$thing; echo $thing->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hYcG1
function name:  (null)
number of ops:  16
compiled vars:  !0 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Thing'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'setName'
          4        SEND_VAL_EX                                              'Matt'
          5        DO_FCALL                                      0          
   24     6        INIT_METHOD_CALL                                         !0, 'setAge'
          7        SEND_VAL_EX                                              23
          8        DO_FCALL                                      0          
   26     9        CAST                                          7  ~6      !0
         10        ASSIGN                                                   !0, ~6
   27    11        CAST                                          8  ~8      !0
         12        ASSIGN                                                   !0, ~8
   29    13        FETCH_OBJ_R                                      ~10     !0, 'name'
         14        ECHO                                                     ~10
         15      > RETURN                                                   1

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

End of function setname

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

End of function setage

End of class Thing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.98 ms | 1395 KiB | 13 Q