3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public $b; function set($array){ foreach ($array as $key => $value){ $this->{$key} = $value; } } } $a = new A(); $val = Array( "a" => "this should be set to property", "b" => "and this also"); $a->set($val); var_export($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MG7e1
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        ASSIGN                                                   !1, <array>
   16     4        INIT_METHOD_CALL                                         !0, 'set'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
   17     7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function set

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.44 ms | 1010 KiB | 14 Q