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

Class Test:
Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O2paG
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:
148.94 ms | 1395 KiB | 17 Q