3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace blah; function test($callback){ var_dump($callback); if($callback instanceof \Closure){ echo "yeah, it's a closure\n"; } } namespace blah2; \blah\test(function ($param){ echo $param; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtpB2
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'blah%5Ctest'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00blah2%5C%7Bclosure%7D%2Fin%2FUtpB2%3A13%240'
   15     2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function blah%5Ctest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/UtpB2
function name:  blah\test
number of ops:  8
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_NS_FCALL_BY_NAME                                    'blah%5Cvar_dump'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    7     4        INSTANCEOF                                               !0, 'Closure'
          5      > JMPZ                                                     ~2, ->7
    8     6    >   ECHO                                                     'yeah%2C+it%27s+a+closure%0A'
   10     7    > > RETURN                                                   null

End of function blah%5Ctest

Function %00blah2%5C%7Bclosure%7D%2Fin%2FUtpB2%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UtpB2
function name:  blah2\{closure}
number of ops:  3
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ECHO                                                     !0
   15     2      > RETURN                                                   null

End of function %00blah2%5C%7Bclosure%7D%2Fin%2FUtpB2%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.11 ms | 1398 KiB | 16 Q