3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); for ($i = 0; $i < 1000; $i++) { $fn = @create_function('$a,$b', 'return log($a * $b);'); } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i < 1000; $i++) { $fn = function ($a, $b) {return log($a * $b);}; } var_dump(microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
Branch analysis from position: 29
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/13afF
function name:  (null)
number of ops:  42
compiled vars:  !0 = $start, !1 = $i, !2 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->14
    6     6    >   BEGIN_SILENCE                                    ~6      
          7        INIT_FCALL_BY_NAME                                       'create_function'
          8        SEND_VAL_EX                                              '%24a%2C%24b'
          9        SEND_VAL_EX                                              'return+log%28%24a+%2A+%24b%29%3B'
         10        DO_FCALL                                      0  $7      
         11        END_SILENCE                                              ~6
         12        ASSIGN                                                   !2, $7
    5    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 1000
         15      > JMPNZ                                                    ~10, ->6
    9    16    >   INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $11     
         20        SUB                                              ~12     $11, !0
         21        SEND_VAL                                                 ~12
         22        DO_ICALL                                                 
   12    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !0, $14
   14    27        ASSIGN                                                   !1, 0
         28      > JMP                                                      ->32
   15    29    >   DECLARE_LAMBDA_FUNCTION                          ~17     [0]
         30        ASSIGN                                                   !2, ~17
   14    31        PRE_INC                                                  !1
         32    >   IS_SMALLER                                               !1, 1000
         33      > JMPNZ                                                    ~20, ->29
   19    34    >   INIT_FCALL                                               'var_dump'
         35        INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $21     
         38        SUB                                              ~22     $21, !0
         39        SEND_VAL                                                 ~22
         40        DO_ICALL                                                 
         41      > 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/13afF
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'log'
          3        MUL                                              ~2      !0, !1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.28 ms | 1433 KiB | 16 Q