3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X extends ArrayObject { public function get($index) { return $this[$index]; } public function first() { return $this[0]; } public function last() { return $this[($this->count() - 1)]; } } $array = new X(); $array[] = 'ciao!!!!!!!'; $array[] = 'hello'; $array[] = 'sono'; $array[] = 'ultimo'; echo $array->get(1); echo "\n"; echo $array->last();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AZULP
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  'ciao%21%21%21%21%21%21%21'
   23     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  'hello'
   24     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  'sono'
   25     9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  'ultimo'
   28    11        INIT_METHOD_CALL                                         !0, 'get'
         12        SEND_VAL_EX                                              1
         13        DO_FCALL                                      0  $8      
         14        ECHO                                                     $8
   29    15        ECHO                                                     '%0A'
   30    16        INIT_METHOD_CALL                                         !0, 'last'
         17        DO_FCALL                                      0  $9      
         18        ECHO                                                     $9
         19      > RETURN                                                   1

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

End of function get

Function first:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AZULP
function name:  first
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_DIM_R                                      ~1      ~0, 0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function first

Function last:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AZULP
function name:  last
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_THIS                                       ~0      
          1        INIT_METHOD_CALL                                         'count'
          2        DO_FCALL                                      0  $1      
          3        SUB                                              ~2      $1, 1
          4        FETCH_DIM_R                                      ~3      ~0, ~2
          5      > RETURN                                                   ~3
   17     6*     > RETURN                                                   null

End of function last

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.87 ms | 1399 KiB | 13 Q