3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function calc($a){ function some($b){ //echo $privateVar; return ($b * 3); } $c = some($a) * 2; return $c; } } $test = new MyClass(); $saveValue = $test->calc(10); echo $saveValue;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cT4v8
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test, !1 = $saveValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'calc'
          4        SEND_VAL_EX                                              10
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   15     7        ECHO                                                     !1
          8      > RETURN                                                   1

Class MyClass:
Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cT4v8
function name:  calc
number of ops:  9
compiled vars:  !0 = $a, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_FUNCTION                                         'some'
    8     2        INIT_FCALL_BY_NAME                                       'some'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        MUL                                              ~3      $2, 2
          6        ASSIGN                                                   !1, ~3
    9     7      > RETURN                                                   !1
   10     8*     > 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/cT4v8
function name:  some
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        MUL                                              ~1      !0, 3
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of Dynamic Function 0

End of function calc

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.01 ms | 995 KiB | 13 Q