3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $x; public function __construct($x) { $this->x = $x; } private function transform($y) { return $x + $y; } public function woo($a) { return array_map(array($this, 'transform'), $a); } } $foo = new Foo(10); var_dump($foo->woo(array(1,2,3,4)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZLKMm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              10
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   20     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'woo'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZLKMm
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'x'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

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

End of function transform

Function woo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZLKMm
function name:  woo
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'array_map'
          2        FETCH_THIS                                       ~1      
          3        INIT_ARRAY                                       ~2      ~1
          4        ADD_ARRAY_ELEMENT                                ~2      'transform'
          5        SEND_VAL                                                 ~2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   15     9*     > RETURN                                                   null

End of function woo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.9 ms | 1396 KiB | 17 Q