3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function ($instance) { return $instance->x; }; class FooBar { public $x = 3; } $foobar = new FooBar; for ($i = 0; $i < 100000; $i++) { $x = function () use ($foobar, $a) { return $a($foobar); }; $x(); }
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 = 7
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
Branch analysis from position: 7
filename:       /in/H3eeC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $foobar, !2 = $i, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FH3eeC%3A4%240'
          1        ASSIGN                                                   !0, ~4
    9     2        NEW                                              $6      'FooBar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
   11     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->14
   12     7    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FH3eeC%3A12%241'
          8        BIND_LEXICAL                                             ~10, !1
          9        BIND_LEXICAL                                             ~10, !0
         10        ASSIGN                                                   !3, ~10
   16    11        INIT_DYNAMIC_CALL                                        !3
         12        DO_FCALL                                      0          
   11    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 100000
         15      > JMPNZ                                                    ~14, ->7
   17    16    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FH3eeC%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H3eeC
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FETCH_OBJ_R                                      ~1      !0, 'x'
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FH3eeC%3A4%240

Function %00%7Bclosure%7D%2Fin%2FH3eeC%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H3eeC
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $foobar, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
   13     2        INIT_DYNAMIC_CALL                                        !1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   14     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FH3eeC%3A12%241

Class FooBar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.97 ms | 1395 KiB | 13 Q