3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class HelloWorld { /** @var array<string, string> */ private $items; public function doFoo(string $input) { $this->items[$input] = $input; foreach ($this->items as $key => $value) { $this->requireString($key); } } public function requireString(string $s) { } } $h = new HelloWorld(); $h->doFoo('1'); // bang
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OfRBH
function name:  (null)
number of ops:  7
compiled vars:  !0 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'HelloWorld'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'doFoo'
          4        SEND_VAL_EX                                              '1'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class HelloWorld:
Function dofoo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/OfRBH
function name:  doFoo
number of ops:  14
compiled vars:  !0 = $input, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        FETCH_OBJ_W                                      $3      'items'
          2        ASSIGN_DIM                                               $3, !0
          3        OP_DATA                                                  !0
   12     4        FETCH_OBJ_R                                      ~5      'items'
          5      > FE_RESET_R                                       $6      ~5, ->12
          6    > > FE_FETCH_R                                       ~7      $6, !1, ->12
          7    >   ASSIGN                                                   !2, ~7
   13     8        INIT_METHOD_CALL                                         'requireString'
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
   12    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $6
   15    13      > RETURN                                                   null

End of function dofoo

Function requirestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OfRBH
function name:  requireString
number of ops:  2
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1      > RETURN                                                   null

End of function requirestring

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.01 ms | 1395 KiB | 13 Q