3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create_function2($args, $content) { static $counter = 0; $funcname = '_lambda_' . (++$counter); eval("function {$funcname} ({$args}) { {$content}; }"); } $f = create_function('$a,$b', 'return $a+$b;'); $f(1,2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbRZj
function name:  (null)
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL_BY_NAME                                       'create_function'
          1        SEND_VAL_EX                                              '%24a%2C%24b'
          2        SEND_VAL_EX                                              'return+%24a%2B%24b%3B'
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   10     5        INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAL_EX                                              1
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function create_function2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbRZj
function name:  create_function2
number of ops:  15
compiled vars:  !0 = $args, !1 = $content, !2 = $counter, !3 = $funcname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        BIND_STATIC                                              !2
    5     3        PRE_INC                                          ~4      !2
          4        CONCAT                                           ~5      '_lambda_', ~4
          5        ASSIGN                                                   !3, ~5
    6     6        ROPE_INIT                                     7  ~8      'function+'
          7        ROPE_ADD                                      1  ~8      ~8, !3
          8        ROPE_ADD                                      2  ~8      ~8, '+%28'
          9        ROPE_ADD                                      3  ~8      ~8, !0
         10        ROPE_ADD                                      4  ~8      ~8, '%29+%7B+'
         11        ROPE_ADD                                      5  ~8      ~8, !1
         12        ROPE_END                                      6  ~7      ~8, '%3B+%7D'
         13        INCLUDE_OR_EVAL                                          ~7, EVAL
    7    14      > RETURN                                                   null

End of function create_function2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.52 ms | 1394 KiB | 16 Q