3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { private $testvar='virgin'; public function setTestVar($val) { $this->testvar=$val; } public function echoVar() { echo $this->testvar; } } $a=new TestClass(); $b=new TestClass(); $c=new TestClass(); $arr=array($a, $b, $c); foreach ($arr as $e) $e->setTestVar(rand(1,10)); print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/96js6
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $arr, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $5      'TestClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
   13     3        NEW                                              $8      'TestClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $8
   14     6        NEW                                              $11     'TestClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $11
   16     9        INIT_ARRAY                                       ~14     !0
         10        ADD_ARRAY_ELEMENT                                ~14     !1
         11        ADD_ARRAY_ELEMENT                                ~14     !2
         12        ASSIGN                                                   !3, ~14
   17    13      > FE_RESET_R                                       $16     !3, ->23
         14    > > FE_FETCH_R                                               $16, !4, ->23
         15    >   INIT_METHOD_CALL                                         !4, 'setTestVar'
         16        INIT_FCALL                                               'rand'
         17        SEND_VAL                                                 1
         18        SEND_VAL                                                 10
         19        DO_ICALL                                         $17     
         20        SEND_VAR_NO_REF_EX                                       $17
         21        DO_FCALL                                      0          
         22      > JMP                                                      ->14
         23    >   FE_FREE                                                  $16
   18    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class TestClass:
Function settestvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96js6
function name:  setTestVar
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'testvar'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function settestvar

Function echovar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96js6
function name:  echoVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'testvar'
          1        ECHO                                                     ~0
    9     2      > RETURN                                                   null

End of function echovar

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.43 ms | 1400 KiB | 17 Q