3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Doubler { public function __invoke($item) { return $item * 2; } } $array = [1, 2, 3]; $operation = new Doubler(); var_dump(array_map($operation, $array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cqhho
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $operation
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   11     1        NEW                                              $3      'Doubler'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   12     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'array_map'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class Doubler:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cqhho
function name:  __invoke
number of ops:  4
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        MUL                                              ~1      !0, 2
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of function __invoke

End of class Doubler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.99 ms | 1395 KiB | 17 Q