3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private function some($b){ //echo $privateVar; return ($b * 3); } public function calc($a){ $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/TrdZG
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

Class MyClass:
Function some:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TrdZG
function name:  some
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        MUL                                              ~1      !0, 3
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function some

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

End of function calc

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.29 ms | 1395 KiB | 13 Q