3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $value; public function __construct($value) { $this->value = $value; } public function Weeee() { $that = &$this; return function() use ($that) { return str_repeat($that->value, 1000); }; } } $foo = new Foo('stuff'); echo $foo->Weeee()();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjEWc
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              'stuff'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'Weeee'
          5        DO_FCALL                                      0  $4      
          6        INIT_DYNAMIC_CALL                                        $4
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQjEWc%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjEWc
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_STATIC                                              !0
   16     1        INIT_FCALL                                               'str_repeat'
          2        FETCH_OBJ_R                                      ~1      !0, 'value'
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 1000
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   17     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQjEWc%3A15%240

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjEWc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function weeee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QjEWc
function name:  Weeee
number of ops:  6
compiled vars:  !0 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                       $1      
          1        ASSIGN_REF                                               !0, $1
   15     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQjEWc%3A15%240'
          3        BIND_LEXICAL                                             ~3, !0
   17     4      > RETURN                                                   ~3
   18     5*     > RETURN                                                   null

End of function weeee

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.13 ms | 1396 KiB | 15 Q