3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $a = [1, 2, 3, 4, 5]; public function getA() { return $this->a; } } $a = [1, 2, 3, 4, 5]; $test = new Test; $_a = $test->getA(); shuffle($a); shuffle($_a); var_dump([ 'original' => $test->getA(), 'result _a' => $_a, 'result a' => $a, ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dlc5M
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $test, !2 = $_a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        NEW                                              $4      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   15     4        INIT_METHOD_CALL                                         !1, 'getA'
          5        DO_FCALL                                      0  $7      
          6        ASSIGN                                                   !2, $7
   17     7        INIT_FCALL                                               'shuffle'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'shuffle'
         11        SEND_REF                                                 !2
         12        DO_ICALL                                                 
   20    13        INIT_FCALL                                               'var_dump'
   21    14        INIT_METHOD_CALL                                         !1, 'getA'
         15        DO_FCALL                                      0  $11     
         16        INIT_ARRAY                                       ~12     $11, 'original'
   22    17        ADD_ARRAY_ELEMENT                                ~12     !2, 'result+_a'
   23    18        ADD_ARRAY_ELEMENT                                ~12     !0, 'result+a'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
   24    21      > RETURN                                                   1

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

End of function geta

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.02 ms | 1395 KiB | 17 Q