3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected static $val = 1; public static function setVal($value) { self::$val = $value; } public function val() { return self::$val; } } $t1 = new Test; $t2 = new Test; $t1::setVal(2); echo $t2->val();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4DqlF
function name:  (null)
number of ops:  14
compiled vars:  !0 = $t1, !1 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        NEW                                              $5      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   19     6        FETCH_CLASS                                   0  $8      !0
          7        INIT_STATIC_METHOD_CALL                                  $8, 'setVal'
          8        SEND_VAL_EX                                              2
          9        DO_FCALL                                      0          
   20    10        INIT_METHOD_CALL                                         !1, 'val'
         11        DO_FCALL                                      0  $10     
         12        ECHO                                                     $10
         13      > RETURN                                                   1

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

End of function setval

Function val:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4DqlF
function name:  val
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'val'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function val

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.95 ms | 1012 KiB | 13 Q