3v4l.org

run code in 500+ PHP versions simultaneously
<?php function f(callable $f = null) {return !$f ? 'null' : call_user_func($f);} echo f() . "\n"; echo f(function() {return 'test';});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QTd4
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A'
          3        ECHO                                                     ~1
    4     4        INIT_FCALL                                               'f'
          5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QTd4
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E > > RETURN                                                   'test'
          1*     > RETURN                                                   null

End of Dynamic Function 0

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QTd4
function name:  f
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      null
          1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      'null'
          4      > JMP                                                      ->8
          5    >   INIT_USER_CALL                                0          'call_user_func', !0
          6        DO_FCALL                                      0  $3      
          7        QM_ASSIGN                                        ~2      $3
          8    > > RETURN                                                   ~2
          9*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.87 ms | 3319 KiB | 15 Q