3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo(array $input) { array_walk($input, array(__CLASS__, 'bar')); return $input; } protected static function bar(&$value) { ++$value; } } $a = range(10, 100, 10); $b = $a; echo join(', ', $a), "\n"; echo join(', ', A::foo($a)), "\n"; var_dump($b === $a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qoO29
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 10
          2        SEND_VAL                                                 100
          3        SEND_VAL                                                 10
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   14     6        ASSIGN                                                   !1, !0
   15     7        INIT_FCALL                                               'join'
          8        SEND_VAL                                                 '%2C+'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ECHO                                                     $5
         12        ECHO                                                     '%0A'
   16    13        INIT_FCALL                                               'join'
         14        SEND_VAL                                                 '%2C+'
         15        INIT_STATIC_METHOD_CALL                                  'A', 'foo'
         16        SEND_VAR                                                 !0
         17        DO_FCALL                                      0  $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                         $7      
         20        ECHO                                                     $7
         21        ECHO                                                     '%0A'
   17    22        INIT_FCALL                                               'var_dump'
         23        IS_IDENTICAL                                     ~8      !1, !0
         24        SEND_VAL                                                 ~8
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qoO29
function name:  foo
number of ops:  7
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                                 
    5     5      > RETURN                                                   !0
    6     6*     > RETURN                                                   null

End of function foo

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

End of function bar

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.34 ms | 1400 KiB | 21 Q