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) { $obj = new self; foreach($arr as $k=>$var) { $obj->$k=$var; } } }; A::__set_state(array( 'b' => 9, )); function f($obj) { var_export($obj); echo $obj->b; } $a; f(new A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JhuPN
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'A', '__set_state'
   19     1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
   31     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/JhuPN
function name:  f
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   25     1        INIT_FCALL                                               'var_export'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   26     4        FETCH_OBJ_R                                      ~2      !0, 'b'
          5        ECHO                                                     ~2
   27     6      > 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 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/JhuPN
function name:  __set_state
number of ops:  12
compiled vars:  !0 = $arr, !1 = $obj, !2 = $var, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        NEW                          self                $4      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   12     4      > FE_RESET_R                                       $7      !0, ->10
          5    > > FE_FETCH_R                                       ~8      $7, !2, ->10
          6    >   ASSIGN                                                   !3, ~8
   13     7        ASSIGN_OBJ                                               !1, !3
          8        OP_DATA                                                  !2
   12     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $7
   15    11      > RETURN                                                   null

End of function __set_state

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.2 ms | 1399 KiB | 16 Q