3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $Something; public $SomethingElse; function setSomething($value) { $this->Something = $value; } function setSomethingElse($value) { $this->SomethingElse = $value; } } $property = "Something"; $t = new test; $setter = "set$property"; $t->$setter(4); echo $t->Something; $property = "SomethingElse"; $t->{"set$property"}(8); echo $t->SomethingElse;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aO5Vl
function name:  (null)
number of ops:  21
compiled vars:  !0 = $property, !1 = $t, !2 = $setter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'Something'
   19     1        NEW                                              $4      'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   20     4        NOP                                                      
          5        FAST_CONCAT                                      ~7      'set', !0
          6        ASSIGN                                                   !2, ~7
   21     7        INIT_METHOD_CALL                                         !1, !2
          8        SEND_VAL_EX                                              4
          9        DO_FCALL                                      0          
   22    10        FETCH_OBJ_R                                      ~10     !1, 'Something'
         11        ECHO                                                     ~10
   24    12        ASSIGN                                                   !0, 'SomethingElse'
   25    13        NOP                                                      
         14        FAST_CONCAT                                      ~12     'set', !0
         15        INIT_METHOD_CALL                                         !1, ~12
         16        SEND_VAL_EX                                              8
         17        DO_FCALL                                      0          
   26    18        FETCH_OBJ_R                                      ~14     !1, 'SomethingElse'
         19        ECHO                                                     ~14
   27    20      > RETURN                                                   1

Class test:
Function setsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aO5Vl
function name:  setSomething
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'Something'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function setsomething

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

End of function setsomethingelse

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
123.7 ms | 1399 KiB | 13 Q