3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CarlClass { private $bits = 'Manly Bloke bits'; } $carl = new CarlClass(); $rape = Closure::bind(function & (CarlClass $carl) { return $carl->bits; }, null, $carl); $hisbits = & $rape($carl); $hisbits = 'Lady parts'; echo 'Carl\'s bits are ' . $rape($carl);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9AYJq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $carl, !1 = $rape, !2 = $hisbits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $3      'CarlClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   12     3        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9AYJq%3A12%240'
   14     5        SEND_VAL                                                 ~6
          6        SEND_VAL                                                 null
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $7      
   12     9        ASSIGN                                                   !1, $7
   17    10        INIT_DYNAMIC_CALL                                        !1
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $9      
         13        ASSIGN_REF                                               !2, $9
   18    14        ASSIGN                                                   !2, 'Lady+parts'
   20    15        INIT_DYNAMIC_CALL                                        !1
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0  $12     
         18        CONCAT                                           ~13     'Carl%27s+bits+are+', $12
         19        ECHO                                                     ~13
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9AYJq%3A12%240:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/9AYJq
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $carl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_W                                      $1      !0, 'bits'
          2      > RETURN_BY_REF                                            $1
   14     3*     > RETURN_BY_REF                                            null

End of function %00%7Bclosure%7D%2Fin%2F9AYJq%3A12%240

Class CarlClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1398 KiB | 13 Q