3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a {} function foo() {} foreach (["substr", "foo"] as $fn) { $x = (new ReflectionFunction($fn))->getClosure(); $x->call(new a); Closure::bind($x, new a, "a"); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 21
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/oHW7B
function name:  (null)
number of ops:  23
compiled vars:  !0 = $fn, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > FE_RESET_R                                       $2      <array>, ->21
          1    > > FE_FETCH_R                                               $2, !0, ->21
    7     2    >   NEW                                              $3      'ReflectionFunction'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $3, 'getClosure'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
    8     8        INIT_METHOD_CALL                                         !1, 'call'
          9        NEW                                              $7      'a'
         10        DO_FCALL                                      0          
         11        SEND_VAR_NO_REF_EX                                       $7
         12        DO_FCALL                                      0          
    9    13        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
         14        SEND_VAR                                                 !1
         15        NEW                                              $10     'a'
         16        DO_FCALL                                      0          
         17        SEND_VAR                                                 $10
         18        SEND_VAL                                                 'a'
         19        DO_FCALL                                      0          
    6    20      > JMP                                                      ->1
         21    >   FE_FREE                                                  $2
   11    22      > RETURN                                                   1

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

End of function foo

Class a: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.36 ms | 1395 KiB | 13 Q