3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** @param callable(int): int $closure */ function takesClosure($closure): int { return $closure(123); } function takesIntByRef(int &$i): int { return $i**2; } takesClosure("takesIntByRef");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T3J6J
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'takesclosure'
          1        SEND_VAL                                                 'takesIntByRef'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function takesclosure:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T3J6J
function name:  takesClosure
number of ops:  8
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_DYNAMIC_CALL                                        !0
          2        SEND_VAL_EX                                              123
          3        DO_FCALL                                      0  $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
    7     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function takesclosure

Function takesintbyref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T3J6J
function name:  takesIntByRef
number of ops:  6
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        POW                                              ~1      !0, 2
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   12     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function takesintbyref

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
261.49 ms | 1014 KiB | 14 Q