3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FU6bmk%3A16%240

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U6bmk
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/U6bmk
function name:  Weeee
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~1      'value'
          1        ASSIGN                                                   !0, ~1
   16     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FU6bmk%3A16%240'
   18     3      > RETURN                                                   ~3
   19     4*     > RETURN                                                   null

End of function weeee

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.72 ms | 1396 KiB | 15 Q