3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ private $options = array(1,3,4); public function __construct(){ return array($this->optionParts(0), $this->optionParts(2)); } private function optionParts($num){ echo $this->options[$num]; } } $t = new test(); print_r($t); //$t->optionParts(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6PHPj
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'print_r'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   14     6      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6PHPj
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'optionParts'
          1        SEND_VAL_EX                                              0
          2        DO_FCALL                                      0  $0      
          3        INIT_ARRAY                                       ~1      $0
          4        INIT_METHOD_CALL                                         'optionParts'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0  $2      
          7        ADD_ARRAY_ELEMENT                                ~1      $2
          8      > RETURN                                                   ~1
    6     9*     > RETURN                                                   null

End of function __construct

Function optionparts:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6PHPj
function name:  optionParts
number of ops:  5
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        FETCH_OBJ_R                                      ~1      'options'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function optionparts

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.23 ms | 1395 KiB | 15 Q