3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return 1; } private static function baz() { return 2; } } function mapIt( callable $mapper ) { $a = array( 1, 2, 3 ); return array_map( $mapper, $a ); } $f = new Foo(); var_dump( mapIt( array( $f, 'bar' ) ) ); var_dump( mapIt( array( $f, 'baz' ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egqd4
function name:  (null)
number of ops:  20
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'mapit'
          5        INIT_ARRAY                                       ~4      !0
          6        ADD_ARRAY_ELEMENT                                ~4      'bar'
          7        SEND_VAL                                                 ~4
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
   19    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'mapit'
         13        INIT_ARRAY                                       ~7      !0
         14        ADD_ARRAY_ELEMENT                                ~7      'baz'
         15        SEND_VAL                                                 ~7
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function mapit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egqd4
function name:  mapIt
number of ops:  8
compiled vars:  !0 = $mapper, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, <array>
   14     2        INIT_FCALL                                               'array_map'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
   15     7*     > RETURN                                                   null

End of function mapit

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egqd4
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   1
    5     1*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egqd4
function name:  baz
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   2
    9     1*     > RETURN                                                   null

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1394 KiB | 19 Q