3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { public function getValues($tool, $built, ...$par) { // lets mock some data $mocks = [[0, 1, 2, 17], [1, 2, 42, 96], [4, 5, 6, 7], [10, 13, 8, 15]]; var_dump($par); foreach ($mocks as &$mock) { $mock = array_map(function ($m) use ($par) {return $m * $par[1];}, $mock); } return $mocks; } } $a = ['php', 'ver 5.6', 3, 2]; $val = (new SomeClass)->getValues(...$a)[2][3]; echo $val;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n0rfE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   19     1        NEW                                              $3      'SomeClass'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $3, 'getValues'
          4        SEND_UNPACK                                              !0
          5        CHECK_UNDEF_ARGS                                         
          6        DO_FCALL                                      1  $5      
          7        FETCH_DIM_R                                      ~6      $5, 2
          8        FETCH_DIM_R                                      ~7      ~6, 3
          9        ASSIGN                                                   !1, ~7
   21    10        ECHO                                                     !1
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fn0rfE%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n0rfE
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $m, !1 = $par
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !1, 1
          3        MUL                                              ~3      !0, ~2
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fn0rfE%3A11%240

Class SomeClass:
Function getvalues:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/n0rfE
function name:  getValues
number of ops:  20
compiled vars:  !0 = $tool, !1 = $built, !2 = $par, !3 = $mocks, !4 = $mock
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_VARIADIC                                    !2      
    8     3        ASSIGN                                                   !3, <array>
    9     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                                 
   10     7      > FE_RESET_RW                                      $7      !3, ->17
          8    > > FE_FETCH_RW                                              $7, !4, ->17
   11     9    >   INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fn0rfE%3A11%240'
         11        BIND_LEXICAL                                             ~8, !2
         12        SEND_VAL                                                 ~8
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !4, $9
   10    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $7
   14    18      > RETURN                                                   !3
   15    19*     > RETURN                                                   null

End of function getvalues

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.08 ms | 1400 KiB | 17 Q