3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [false, false, false]; $key = 0; // $array[$key++] ||= true; $array[$key] = $array[$key] || true; ++$key; // $array[++$key] ||= true; ++$key; $array[$key] = $array[$key] || true; assert($array === [true, false, true]); var_dump($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 5
filename:       /in/FGBjj
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 0
    7     2        FETCH_DIM_R                                          ~5      !0, !1
          3      > JMPNZ_EX                                             ~5      ~5, ->5
          4    >   BOOL                                                 ~5      <true>
          5    >   ASSIGN_DIM                                                   !0, !1
          6        OP_DATA                                                      ~5
          7        PRE_INC                                                      !1
   10     8        PRE_INC                                                      !1
          9        FETCH_DIM_R                                          ~9      !0, !1
         10      > JMPNZ_EX                                             ~9      ~9, ->12
         11    >   BOOL                                                 ~9      <true>
         12    >   ASSIGN_DIM                                                   !0, !1
         13        OP_DATA                                                      ~9
   12    14        ASSERT_CHECK                                                 
         15        INIT_FCALL                                                   'assert'
         16        IS_IDENTICAL                                         ~10     !0, <array>
         17        SEND_VAL                                                     ~10
         18        SEND_VAL                                                     'assert%28%24array+%3D%3D%3D+%5Btrue%2C+false%2C+true%5D%29'
         19        DO_ICALL                                                     
   13    20        INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !0
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.03 ms | 479 KiB | 9 Q