3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { public function getValues($tool, $built, $par) { // lets mock some data $mocks = array( array(0, 1, 2, 17), array(1, 2, 42, 96), array(4, 5, 6, 7), array(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 = array('php', 'ver 5.6', 3, 2); $instance = new SomeClass; $val = $instance->getValues($a[0], $a[1], array($a[2], $a[3])); $val[2][3]; echo $val;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNr40
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $instance, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, <array>
   21     1        NEW                                              $4      'SomeClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   23     4        INIT_METHOD_CALL                                         !1, 'getValues'
          5        CHECK_FUNC_ARG                                           
          6        FETCH_DIM_FUNC_ARG                               $7      !0, 0
          7        SEND_FUNC_ARG                                            $7
          8        CHECK_FUNC_ARG                                           
          9        FETCH_DIM_FUNC_ARG                               $8      !0, 1
         10        SEND_FUNC_ARG                                            $8
         11        FETCH_DIM_R                                      ~9      !0, 2
         12        INIT_ARRAY                                       ~10     ~9
         13        FETCH_DIM_R                                      ~11     !0, 3
         14        ADD_ARRAY_ELEMENT                                ~10     ~11
         15        SEND_VAL_EX                                              ~10
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                                   !2, $12
   24    18        FETCH_DIM_R                                      ~14     !2, 2
         19        FETCH_DIM_R                                      ~15     ~14, 3
         20        FREE                                                     ~15
   26    21        ECHO                                                     !2
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBNr40%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNr40
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $m, !1 = $par
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     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%2FBNr40%3A12%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/BNr40
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                                             !2      
    8     3        ASSIGN                                                   !3, <array>
    9     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                                 
   11     7      > FE_RESET_RW                                      $7      !3, ->17
          8    > > FE_FETCH_RW                                              $7, !4, ->17
   12     9    >   INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBNr40%3A12%240'
         11        BIND_LEXICAL                                             ~8, !2
         12        SEND_VAL                                                 ~8
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !4, $9
   11    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $7
   15    18      > RETURN                                                   !3
   16    19*     > RETURN                                                   null

End of function getvalues

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.36 ms | 1400 KiB | 17 Q