3v4l.org

run code in 500+ PHP versions simultaneously
<?php function test() { $a = static function () use (&$a) { }; } for ($i = 1; $i <= 20001; $i++) { test(); if ($i == 10000 || $i == 20001) { printf("%d: %f %d\n", $i, memory_get_usage(true), gc_collect_cycles()); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 2
Branch analysis from position: 23
Branch analysis from position: 2
Branch analysis from position: 20
Branch analysis from position: 8
filename:       /in/r2F3l
function name:  (null)
number of ops:  24
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                       !0, 1
          1      > JMP                                                          ->21
    9     2    >   INIT_FCALL                                                   'test'
          3        DO_FCALL                                          0          
   10     4        IS_EQUAL                                             ~3      !0, 10000
          5      > JMPNZ_EX                                             ~3      ~3, ->8
          6    >   IS_EQUAL                                             ~4      !0, 20001
          7        BOOL                                                 ~3      ~4
          8    > > JMPZ                                                         ~3, ->20
   11     9    >   INIT_FCALL                                                   'printf'
         10        SEND_VAL                                                     '%25d%3A+%25f+%25d%0A'
         11        SEND_VAR                                                     !0
         12        INIT_FCALL                                                   'memory_get_usage'
         13        SEND_VAL                                                     <true>
         14        DO_ICALL                                             $5      
         15        SEND_VAR                                                     $5
         16        INIT_FCALL                                                   'gc_collect_cycles'
         17        DO_ICALL                                             $6      
         18        SEND_VAR                                                     $6
         19        DO_ICALL                                                     
    8    20    >   PRE_INC                                                      !0
         21    >   IS_SMALLER_OR_EQUAL                                          !0, 20001
         22      > JMPNZ                                                        ~9, ->2
   13    23    > > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2F3l
function name:  test
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        BIND_LEXICAL                                                 ~1, !0
          2        ASSIGN                                                       !0, ~1
    6     3      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2F3l
function name:  {closure:test():5}
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
          1      > RETURN                                                       null

End of Dynamic Function 0

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.18 ms | 487 KiB | 11 Q