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/6OA3Q
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'makelouder'
          1        FETCH_CONSTANT                                   ~2      'abs'
          2        SEND_VAL                                                 ~2
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
    8     5        INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAL_EX                                              900
          7        DO_FCALL                                      0  $5      
          8        CONCAT                                           ~6      '%3Cp%3E', $5
          9        CONCAT                                           ~7      ~6, '%3Cbr%2F%3E'
         10        INIT_DYNAMIC_CALL                                        !0
         11        SEND_VAL_EX                                              -900
         12        DO_FCALL                                      0  $8      
         13        CONCAT                                           ~9      ~7, $8
         14        ECHO                                                     ~9
    9    15        INIT_FCALL                                               'makelouder'
         16        FETCH_CONSTANT                                   ~10     'strtoupper'
         17        SEND_VAL                                                 ~10
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !1, $11
   10    20        INIT_DYNAMIC_CALL                                        !1
         21        SEND_VAL_EX                                              'upper'
         22        DO_FCALL                                      0  $13     
         23        CONCAT                                           ~14     '%3Cp%3E', $13
         24        ECHO                                                     ~14
         25      > RETURN                                                   1

Function makelouder:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6OA3Q
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%2F6OA3Q%3A3%240'
          2        BIND_LEXICAL                                             ~1, !0
    5     3      > RETURN                                                   ~1
    6     4*     > RETURN                                                   null

End of function makelouder

Function %00%7Bclosure%7D%2Fin%2F6OA3Q%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6OA3Q
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%2F6OA3Q%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.2 ms | 1403 KiB | 15 Q