3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Form { protected $inputs = array(); public function makeInput($type, $name) { echo '<input type="'.$type.'" name="'.$name.'">'; } public function addInput($type, $name) { $this->inputs[] = array("type" => $type, "name" => $name); } public function run() { foreach($this->inputs as $array) { $this->makeInput($array['type'], $array['name']); } } } $form = new form(); $form->addInput("text", "username"); $form->addInput("text", "password"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MiW4P
function name:  (null)
number of ops:  12
compiled vars:  !0 = $form
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'form'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'addInput'
          4        SEND_VAL_EX                                              'text'
          5        SEND_VAL_EX                                              'username'
          6        DO_FCALL                                      0          
   27     7        INIT_METHOD_CALL                                         !0, 'addInput'
          8        SEND_VAL_EX                                              'text'
          9        SEND_VAL_EX                                              'password'
         10        DO_FCALL                                      0          
   28    11      > RETURN                                                   1

Class Form:
Function makeinput:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MiW4P
function name:  makeInput
number of ops:  8
compiled vars:  !0 = $type, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        CONCAT                                           ~2      '%3Cinput+type%3D%22', !0
          3        CONCAT                                           ~3      ~2, '%22+name%3D%22'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '%22%3E'
          6        ECHO                                                     ~5
    7     7      > RETURN                                                   null

End of function makeinput

Function addinput:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MiW4P
function name:  addInput
number of ops:  8
compiled vars:  !0 = $type, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_ARRAY                                       ~4      !0, 'type'
   12     3        ADD_ARRAY_ELEMENT                                ~4      !1, 'name'
   11     4        FETCH_OBJ_W                                      $2      'inputs'
          5        ASSIGN_DIM                                               $2
   12     6        OP_DATA                                                  ~4
   13     7      > RETURN                                                   null

End of function addinput

Function run:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/MiW4P
function name:  run
number of ops:  14
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~1      'inputs'
          1      > FE_RESET_R                                       $2      ~1, ->12
          2    > > FE_FETCH_R                                               $2, !0, ->12
   19     3    >   INIT_METHOD_CALL                                         'makeInput'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_DIM_FUNC_ARG                               $3      !0, 'type'
          6        SEND_FUNC_ARG                                            $3
          7        CHECK_FUNC_ARG                                           
          8        FETCH_DIM_FUNC_ARG                               $4      !0, 'name'
          9        SEND_FUNC_ARG                                            $4
         10        DO_FCALL                                      0          
   17    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $2
   21    13      > RETURN                                                   null

End of function run

End of class Form.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.19 ms | 1399 KiB | 13 Q