3v4l.org

run code in 300+ PHP versions simultaneously
<?php function makeLouder($fn) { return function($a) use($fn) { return $fn($a)."!!!"; }; } $foo = makeLouder(abs()); echo "<p>".$foo(900)."<br/>".$foo(-900); $bar = makeLouder(strtoupper()); echo "<p>".$bar("upper");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2EkTX
function name:  (null)
number of ops:  28
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'makelouder'
          1        INIT_FCALL                                               'abs'
          2        DO_ICALL                                         $2      
          3        SEND_VAR                                                 $2
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !0, $3
    8     6        INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAL_EX                                              900
          8        DO_FCALL                                      0  $5      
          9        CONCAT                                           ~6      '%3Cp%3E', $5
         10        CONCAT                                           ~7      ~6, '%3Cbr%2F%3E'
         11        INIT_DYNAMIC_CALL                                        !0
         12        SEND_VAL_EX                                              -900
         13        DO_FCALL                                      0  $8      
         14        CONCAT                                           ~9      ~7, $8
         15        ECHO                                                     ~9
    9    16        INIT_FCALL                                               'makelouder'
         17        INIT_FCALL                                               'strtoupper'
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_FCALL                                      0  $11     
         21        ASSIGN                                                   !1, $11
   10    22        INIT_DYNAMIC_CALL                                        !1
         23        SEND_VAL_EX                                              'upper'
         24        DO_FCALL                                      0  $13     
         25        CONCAT                                           ~14     '%3Cp%3E', $13
         26        ECHO                                                     ~14
         27      > RETURN                                                   1

Function makelouder:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2EkTX
function name:  makeLouder
number of ops:  5
compiled vars:  !0 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2EkTX%3A3%240'
          2        BIND_LEXICAL                                             ~1, !0
    5     3      > RETURN                                                   ~1
    6     4*     > RETURN                                                   null

End of function makelouder

Function %00%7Bclosure%7D%2Fin%2F2EkTX%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2EkTX
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    4     2        INIT_DYNAMIC_CALL                                        !1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      $2, '%21%21%21'
          6      > RETURN                                                   ~3
    5     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2EkTX%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.38 ms | 1403 KiB | 19 Q