3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function secret() { echo "Can't touch this!"; } public function checkCallable(callable $f): callable { return $f; } } $foo = new Foo; $f = $foo->checkCallable([$foo, 'secret']); $f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7df2
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'checkCallable'
          4        INIT_ARRAY                                       ~5      !0
          5        ADD_ARRAY_ELEMENT                                ~5      'secret'
          6        SEND_VAL_EX                                              ~5
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   15     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Foo:
Function secret:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7df2
function name:  secret
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'Can%27t+touch+this%21'
    6     1      > RETURN                                                   null

End of function secret

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

End of function checkcallable

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
458.4 ms | 1069 KiB | 13 Q