3v4l.org

run code in 300+ PHP versions simultaneously
<?php //imp of _invoke magic method class Value { protected $value; public function __construct($value) { $this->value = $value; } public function getValue() { return $this->value; } } $three = new Value(3); $four = new Value(4); $closure = function ($delta) { var_dump($this->getValue() + $delta); }; //$a = new closure(); $closure(4); $closure->call($three, 4); $closure->call($four, 4); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UcHVb
function name:  (null)
number of ops:  22
compiled vars:  !0 = $three, !1 = $four, !2 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'Value'
          1        SEND_VAL_EX                                              3
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   17     4        NEW                                              $6      'Value'
          5        SEND_VAL_EX                                              4
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   19     8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUcHVb%3A19%240'
          9        ASSIGN                                                   !2, ~9
   21    10        INIT_DYNAMIC_CALL                                        !2
         11        SEND_VAL_EX                                              4
         12        DO_FCALL                                      0          
   23    13        INIT_METHOD_CALL                                         !2, 'call'
         14        SEND_VAR_EX                                              !0
         15        SEND_VAL_EX                                              4
         16        DO_FCALL                                      0          
   24    17        INIT_METHOD_CALL                                         !2, 'call'
         18        SEND_VAR_EX                                              !1
         19        SEND_VAL_EX                                              4
         20        DO_FCALL                                      0          
   25    21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUcHVb%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UcHVb
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $delta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       $1      
          3        INIT_METHOD_CALL                                         $1, 'getValue'
          4        DO_FCALL                                      0  $2      
          5        ADD                                              ~3      $2, !0
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
          8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUcHVb%3A19%240

Class Value:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UcHVb
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      
    8     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UcHVb
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function getvalue

End of class Value.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1400 KiB | 15 Q