3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Kitchen { private $yummy = 'cakesss'; } $sweetsThief = function (Kitchen $kitchen) { return $kitchen->yummy; }; $kitchen = new Kitchen(); $sweetsThief = Closure::bind($sweetsThief, null, $kitchen); var_dump($sweetsThief($kitchen));
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/uZZ5N
function name:  (null)
number of ops:  19
compiled vars:  !0 = $sweetsThief, !1 = $kitchen
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   8     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuZZ5N0x7f7f55faa083'
  10     2        ASSIGN                                                   !0, ~3
  12     3        NEW                                              $5      :-5
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !1, $5
  14     6        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
         7        SEND_VAR_EX                                              !0
         8        SEND_VAL_EX                                              null
         9        SEND_VAR_EX                                              !1
        10        DO_FCALL                                      0  $8      
        11        ASSIGN                                                   !0, $8
  16    12        INIT_FCALL                                               'var_dump'
        13        INIT_DYNAMIC_CALL                                        !0
        14        SEND_VAR_EX                                              !1
        15        DO_FCALL                                      0  $10     
        16        SEND_VAR                                                 $10
        17        DO_ICALL                                                 
        18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuZZ5N0x7f7f55faa083:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/uZZ5N
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $kitchen
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   RECV                                             !0      
   9     1        FETCH_OBJ_R                                      $1      !0, 'yummy'
         2      > RETURN                                                   $1
  10     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuZZ5N0x7f7f55faa083

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.2.0