3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [123]; unset($array[0]); function changeScope($array){ if($array === []){ // then $array[] = "x"; // will result in assert([0 => "x"] === $array); } } changeScope($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nJgR8
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, 0
   13     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
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/nJgR8
function name:  changeScope
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        IS_IDENTICAL                                             !0, <array>
          2      > JMPZ                                                     ~1, ->11
    8     3    >   ASSIGN_DIM                                               !0
          4        OP_DATA                                                  'x'
    9     5        ASSERT_CHECK                                             
          6        INIT_FCALL                                               'assert'
          7        IS_IDENTICAL                                     ~3      !0, <array>
          8        SEND_VAL                                                 ~3
          9        SEND_VAL                                                 'assert%28%5B0+%3D%3E+%27x%27%5D+%3D%3D%3D+%24array%29'
         10        DO_ICALL                                                 
   11    11    > > RETURN                                                   null

End of function changescope

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.11 ms | 1001 KiB | 15 Q