3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function mapIt($x) { return $x + 1; } public function doStuff() { $xs = array_map(array($this, 'mapIt'), array(1, 2, 3)); var_dump($xs); } } $x = new Foo(); $x->doStuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E0o3T
function name:  (null)
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'doStuff'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function mapit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E0o3T
function name:  mapIt
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        ADD                                              ~1      !0, 1
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function mapit

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E0o3T
function name:  doStuff
number of ops:  12
compiled vars:  !0 = $xs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'array_map'
          1        FETCH_THIS                                       ~1      
          2        INIT_ARRAY                                       ~2      ~1
          3        ADD_ARRAY_ELEMENT                                ~2      'mapIt'
          4        SEND_VAL                                                 ~2
          5        SEND_VAL                                                 <array>
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
    8     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    9    11      > RETURN                                                   null

End of function dostuff

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.64 ms | 1395 KiB | 17 Q