3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 2, 3]; unset($array[3]); function changeScope($array){ assert($array === array_values($array)); $array[] = "x"; assert([0, 1, 2, "x"] === $array, print_r($array, TRUE)); } changeScope($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UbjbE
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        UNSET_DIM                                                !0, 3
   12     2        INIT_FCALL                                               'changescope'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function changescope:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UbjbE
function name:  changeScope
number of ops:  23
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSERT_CHECK                                             
          2        INIT_FCALL                                               'assert'
          3        INIT_FCALL                                               'array_values'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        IS_IDENTICAL                                     ~2      !0, $1
          7        SEND_VAL                                                 ~2
          8        SEND_VAL                                                 'assert%28%24array+%3D%3D%3D+array_values%28%24array%29%29'
          9        DO_ICALL                                                 
    8    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  'x'
    9    12        ASSERT_CHECK                                             
         13        INIT_FCALL                                               'assert'
         14        IS_IDENTICAL                                     ~5      !0, <array>
         15        SEND_VAL                                                 ~5
         16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $6      
         20        SEND_VAR                                                 $6
         21        DO_ICALL                                                 
   10    22      > RETURN                                                   null

End of function changescope

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.16 ms | 1005 KiB | 17 Q