3v4l.org

run code in 300+ PHP versions simultaneously
<?php class hoge{ public static function fivehoge($array){ return array_splice($array,0,3); } } //実際は別クラスから配列を作成しています。 $source = array(1,2,3,4,5); //このコードを書くと$sourceから3つ要素は取り出せますが、$userで取得した配列の中の要素を削除できません。 $user = hoge::fivehoge($source); var_dump($user); var_dump($source); $user = array_splice($source,0,3); var_dump($source);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e9C3f
function name:  (null)
number of ops:  21
compiled vars:  !0 = $source, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_STATIC_METHOD_CALL                                  'hoge', 'fivehoge'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   13     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   14     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   16    11        INIT_FCALL                                               'array_splice'
         12        SEND_REF                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 3
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !1, $7
   17    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class hoge:
Function fivehoge:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e9C3f
function name:  fivehoge
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'array_splice'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    6     7*     > RETURN                                                   null

End of function fivehoge

End of class hoge.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.89 ms | 1396 KiB | 17 Q