3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hoge { private $hoge = null; private $fuga = null; public function __construct($hoge = []) { $this->set($hoge); } private function set($hoge = []) { foreach ($this as $key => $value) { $this->$key = (true === isset($hoge[$key])) ? $hoge[$key] : $value; var_dump($key, $value, $hoge[$key]); } } } $hoge = new Hoge(['hoge' => 1111, 'fuga' => 2222]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ybqeo
function name:  (null)
number of ops:  5
compiled vars:  !0 = $hoge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Hoge'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Class Hoge:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ybqeo
function name:  __construct
number of ops:  5
compiled vars:  !0 = $hoge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      <array>
   10     1        INIT_METHOD_CALL                                         'set'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   11     4      > RETURN                                                   null

End of function __construct

Function set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Ybqeo
function name:  set
number of ops:  23
compiled vars:  !0 = $hoge, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV_INIT                                        !0      <array>
   16     1        FETCH_THIS                                       ~3      
          2      > FE_RESET_R                                       $4      ~3, ->21
          3    > > FE_FETCH_R                                       ~5      $4, !1, ->21
          4    >   ASSIGN                                                   !2, ~5
   17     5        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      !0, !2
          6        TYPE_CHECK                                    8          ~8
          7      > JMPZ                                                     ~9, ->11
          8    >   FETCH_DIM_R                                      ~10     !0, !2
          9        QM_ASSIGN                                        ~11     ~10
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~11     !1
         12    >   ASSIGN_OBJ                                               !2
         13        OP_DATA                                                  ~11
   18    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !1
         17        FETCH_DIM_R                                      ~12     !0, !2
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                                 
   16    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $4
   20    22      > RETURN                                                   null

End of function set

End of class Hoge.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.55 ms | 1400 KiB | 15 Q