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 $this; foreach($arr as $k=>$var) { echo $k; $obj->$k=$var; } } }; A::__set_state(array( 'b' => 9, )); var_dump(new A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pimX7
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'A', '__set_state'
   20     1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
   24     3        INIT_FCALL                                               'var_dump'
          4        NEW                                              $1      'A'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class A:
Function __set_state:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/pimX7
function name:  __set_state
number of ops:  15
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        FETCH_THIS                                       ~4      
          2        FETCH_CLASS                                   0  $5      ~4
          3        NEW                                              $6      $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   12     6      > FE_RESET_R                                       $9      !0, ->13
          7    > > FE_FETCH_R                                       ~10     $9, !2, ->13
          8    >   ASSIGN                                                   !3, ~10
   13     9        ECHO                                                     !3
   14    10        ASSIGN_OBJ                                               !1, !3
         11        OP_DATA                                                  !2
   12    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $9
   16    14      > RETURN                                                   null

End of function __set_state

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.07 ms | 1396 KiB | 15 Q