3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*class A { static $a=7; var $b=9; }*/ class A{ static function __set_state($arr) { foreach($arr as $k=>$var) { $this->$k=$var; } } }; A::__set_state(array( 'b' => 9, )); function f($obj) { var_export($obj); echo $obj::$a; } $a; f(new A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maDe4
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'A', '__set_state'
   18     1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
   30     3        INIT_FCALL                                               'f'
          4        NEW                                              $2      'A'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $2
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/maDe4
function name:  f
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   24     1        INIT_FCALL                                               'var_export'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   25     4        FETCH_CLASS                                   0  $2      !0
          5        FETCH_STATIC_PROP_R          global lock         ~3      'a'
          6        ECHO                                                     ~3
   26     7      > RETURN                                                   null

End of function f

Class A:
Function __set_state:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/maDe4
function name:  __set_state
number of ops:  10
compiled vars:  !0 = $arr, !1 = $var, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1      > FE_RESET_R                                       $3      !0, ->8
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->8
          3    >   ASSIGN                                                   !2, ~4
   12     4        FETCH_THIS                                       $6      
          5        ASSIGN_OBJ                                               $6, !2
          6        OP_DATA                                                  !1
   11     7      > JMP                                                      ->2
          8    >   FE_FREE                                                  $3
   14     9      > RETURN                                                   null

End of function __set_state

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.55 ms | 1399 KiB | 16 Q