3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyCollection extends ArrayObject { public function updateIndexes() { $this->exchangeArray(array_values($this->getArrayCopy())); } } $collection = new MyCollection([ 'first', 'second', 'third', ]); var_dump($collection); $collection->offsetUnset(1); var_dump($collection); $collection->updateIndexes(); var_dump($collection);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S8I7Z
function name:  (null)
number of ops:  19
compiled vars:  !0 = $collection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'MyCollection'
   10     1        SEND_VAL_EX                                              <array>
    9     2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   15     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   17     7        INIT_METHOD_CALL                                         !0, 'offsetUnset'
          8        SEND_VAL_EX                                              1
          9        DO_FCALL                                      0          
   19    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   21    13        INIT_METHOD_CALL                                         !0, 'updateIndexes'
         14        DO_FCALL                                      0          
   23    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class MyCollection:
Function updateindexes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S8I7Z
function name:  updateIndexes
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'exchangeArray'
          1        INIT_FCALL                                               'array_values'
          2        INIT_METHOD_CALL                                         'getArrayCopy'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $1      
          6        SEND_VAR_NO_REF_EX                                       $1
          7        DO_FCALL                                      0          
    6     8      > RETURN                                                   null

End of function updateindexes

End of class MyCollection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.56 ms | 1004 KiB | 15 Q