3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function calc($a){ function some($b){ //echo $privateVar; return ($b * 3); } $privateVar = 100; $c = $this->some($a) * 2; echo $privateVar . "\n"; 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/cULUs
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test, !1 = $saveValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        INIT_METHOD_CALL                                         !0, 'calc'
          4        SEND_VAL_EX                                              10
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   18     7        ECHO                                                     !1
          8      > RETURN                                                   1

Function %00some%2Fin%2FcULUs%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cULUs
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 function %00some%2Fin%2FcULUs%3A4%240

Class MyClass:
Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cULUs
function name:  calc
number of ops:  12
compiled vars:  !0 = $a, !1 = $privateVar, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_FUNCTION                                         'some'
    8     2        ASSIGN                                                   !1, 100
   10     3        INIT_METHOD_CALL                                         'some'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $4      
          6        MUL                                              ~5      $4, 2
          7        ASSIGN                                                   !2, ~5
   11     8        CONCAT                                           ~7      !1, '%0A'
          9        ECHO                                                     ~7
   12    10      > RETURN                                                   !2
   13    11*     > RETURN                                                   null

End of function calc

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1395 KiB | 13 Q