3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = get_object_vars(json_decode('{"2":1}')); $y = (object)$x; $exprs = ['isset($x[2])', 'isset($x["2"])', 'isset($y->{2})', 'isset($y->{"2"})', '$x', '$y']; var_dump(array_map(function ($expr) use ($x, $y) { return eval("return $expr;"); }, array_combine($exprs, $exprs)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HcLSg
function name:  (null)
number of ops:  25
compiled vars:  !0 = $x, !1 = $y, !2 = $exprs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'get_object_vars'
          1        INIT_FCALL                                               'json_decode'
          2        SEND_VAL                                                 '%7B%222%22%3A1%7D'
          3        DO_ICALL                                         $3      
          4        SEND_VAR                                                 $3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
    4     7        CAST                                          8  ~6      !0
          8        ASSIGN                                                   !1, ~6
    6     9        ASSIGN                                                   !2, <array>
    8    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'array_map'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FHcLSg%3A8%240'
         13        BIND_LEXICAL                                             ~9, !0
         14        BIND_LEXICAL                                             ~9, !1
   10    15        SEND_VAL                                                 ~9
         16        INIT_FCALL                                               'array_combine'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                         $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FHcLSg%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HcLSg
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $expr, !1 = $x, !2 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    9     3        ROPE_INIT                                     3  ~4      'return+'
          4        ROPE_ADD                                      1  ~4      ~4, !0
          5        ROPE_END                                      2  ~3      ~4, '%3B'
          6        INCLUDE_OR_EVAL                                  $6      ~3, EVAL
          7      > RETURN                                                   $6
   10     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FHcLSg%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.06 ms | 1401 KiB | 23 Q