3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $i = 0; public function method() { return $this->i++; } } $short = [0, 1, 2]; $long = [0, 1, 2]; $foo1 = new Foo(); $foo2 = new Foo(); $long[$foo1->method()] + $long[$foo1->method()] = 1; $short[$foo2->method()] += 1; var_dump($long, $short);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ccu71
function name:  (null)
number of ops:  26
compiled vars:  !0 = $short, !1 = $long, !2 = $foo1, !3 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   15     2        NEW                                              $6      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $6
   16     5        NEW                                              $9      'Foo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $9
   18     8        INIT_METHOD_CALL                                         !2, 'method'
          9        DO_FCALL                                      0  $12     
         10        FETCH_DIM_R                                      ~13     !1, $12
         11        INIT_METHOD_CALL                                         !2, 'method'
         12        DO_FCALL                                      0  $14     
         13        ASSIGN_DIM                                       ~15     !1, $14
         14        OP_DATA                                                  1
         15        ADD                                              ~16     ~13, ~15
         16        FREE                                                     ~16
   20    17        INIT_METHOD_CALL                                         !3, 'method'
         18        DO_FCALL                                      0  $17     
         19        ASSIGN_DIM_OP                +=               1          !0, $17
         20        OP_DATA                                                  1
   22    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class Foo:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ccu71
function name:  method
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   POST_INC_OBJ                                     ~0      'i'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function method

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.29 ms | 1396 KiB | 15 Q