3v4l.org

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

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

End of function last

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1395 KiB | 13 Q