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; } } $test = new Test; var_dump([ 'original' => $test->getA(), 'shuffled' => shuffle($test->getA()), 'result' => $test->getA(), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VVuPi
function name:  (null)
number of ops:  19
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'var_dump'
   14     4        INIT_METHOD_CALL                                         !0, 'getA'
          5        DO_FCALL                                      0  $4      
          6        INIT_ARRAY                                       ~5      $4, 'original'
   15     7        INIT_FCALL                                               'shuffle'
          8        INIT_METHOD_CALL                                         !0, 'getA'
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR_NO_REF                               0          $6
         11        DO_ICALL                                         $7      
         12        ADD_ARRAY_ELEMENT                                ~5      $7, 'shuffled'
   16    13        INIT_METHOD_CALL                                         !0, 'getA'
         14        DO_FCALL                                      0  $8      
         15        ADD_ARRAY_ELEMENT                                ~5      $8, 'result'
         16        SEND_VAL                                                 ~5
         17        DO_ICALL                                                 
   17    18      > RETURN                                                   1

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

End of function geta

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.28 ms | 1395 KiB | 17 Q