3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ public function pub() { $cool = $this->priv(); return [$cool + 5, 'someti', 'das', 'ok']; } private function priv() { $arr = array(1, '100', 1000); return $arr[2]; } } $newb = new test; var_dump($newb->pub()[2]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRQnY
function name:  (null)
number of ops:  10
compiled vars:  !0 = $newb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'pub'
          5        DO_FCALL                                      0  $4      
          6        FETCH_DIM_R                                      ~5      $4, 2
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class test:
Function pub:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRQnY
function name:  pub
number of ops:  10
compiled vars:  !0 = $cool
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'priv'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    8     3        ADD                                              ~3      !0, 5
          4        INIT_ARRAY                                       ~4      ~3
          5        ADD_ARRAY_ELEMENT                                ~4      'someti'
          6        ADD_ARRAY_ELEMENT                                ~4      'das'
          7        ADD_ARRAY_ELEMENT                                ~4      'ok'
          8      > RETURN                                                   ~4
    9     9*     > RETURN                                                   null

End of function pub

Function priv:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KRQnY
function name:  priv
number of ops:  4
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        FETCH_DIM_R                                      ~2      !0, 2
          2      > RETURN                                                   ~2
   15     3*     > RETURN                                                   null

End of function priv

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.89 ms | 1388 KiB | 15 Q