3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'abc'; echo $str[TRUE]; // Notice: String offset cast occurred echo $str[NULL]; // Notice: String offset cast occurred echo $str[[]]; // Warning: Illegal offset type $int = 123; echo $int[1]; // no error echo $int[TRUE]; // no error echo $int[[]]; // no error $bool = TRUE; echo $bool[1]; // no error echo $bool[TRUE]; // no error echo $bool[[]]; // no error $null = NULL; echo $null[1]; // no error echo $null[TRUE]; // no error echo $null[[]]; // no error
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vMvD2
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $int, !2 = $bool, !3 = $null
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'abc'
    5     1        FETCH_DIM_R                                      ~5      !0, <true>
          2        ECHO                                                     ~5
    6     3        FETCH_DIM_R                                      ~6      !0, null
          4        ECHO                                                     ~6
    7     5        FETCH_DIM_R                                      ~7      !0, <array>
          6        ECHO                                                     ~7
    9     7        ASSIGN                                                   !1, 123
   11     8        FETCH_DIM_R                                      ~9      !1, 1
          9        ECHO                                                     ~9
   12    10        FETCH_DIM_R                                      ~10     !1, <true>
         11        ECHO                                                     ~10
   13    12        FETCH_DIM_R                                      ~11     !1, <array>
         13        ECHO                                                     ~11
   15    14        ASSIGN                                                   !2, <true>
   17    15        FETCH_DIM_R                                      ~13     !2, 1
         16        ECHO                                                     ~13
   18    17        FETCH_DIM_R                                      ~14     !2, <true>
         18        ECHO                                                     ~14
   19    19        FETCH_DIM_R                                      ~15     !2, <array>
         20        ECHO                                                     ~15
   21    21        ASSIGN                                                   !3, null
   23    22        FETCH_DIM_R                                      ~17     !3, 1
         23        ECHO                                                     ~17
   24    24        FETCH_DIM_R                                      ~18     !3, <true>
         25        ECHO                                                     ~18
   25    26        FETCH_DIM_R                                      ~19     !3, <array>
         27        ECHO                                                     ~19
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.56 ms | 1394 KiB | 13 Q