3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Priv { private function privateMethod() { return true; } } function myCLosure() { return $this->privateMethod(); } $myClosure = (new myClosure)->bind(new Priv); echo $myClosure;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b7NBT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $myClosure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'myClosure'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'bind'
          3        NEW                                              $3      'Priv'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   18     8        ECHO                                                     !0
          9      > RETURN                                                   1

Function myclosure:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b7NBT
function name:  myCLosure
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'privateMethod'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   14     4*     > RETURN                                                   null

End of function myclosure

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

End of function privatemethod

End of class Priv.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1398 KiB | 13 Q