3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = []; $keys = [ 'array' => [], 'object' => new stdClass, 'closure' => function () {}, 'class' => new class {}, 'class with tostring' => new class {function __toString(){return 'to string class';}}, 'resource' => fopen(__FILE__, 'r'), ]; foreach ($keys as $desc =>$key) { echo "===" . $desc . "===\n"; $a[$key] = true; echo "state of array: \n"; var_dump($a); echo "state of key: \n"; var_dump($key); echo "is the key set in the array: \n"; var_dump(isset($a[$key])); } echo "===============\n"; var_dump($a);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 43
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 43
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/cQ8hf
function name:  (null)
number of ops:  49
compiled vars:  !0 = $a, !1 = $keys, !2 = $key, !3 = $desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_ARRAY                                       ~5      <array>, 'array'
    7     2        NEW                                              $6      'stdClass'
          3        DO_FCALL                                      0          
          4        ADD_ARRAY_ELEMENT                                ~5      $6, 'object'
    8     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcQ8hf%3A8%240'
          6        ADD_ARRAY_ELEMENT                                ~5      ~8, 'closure'
    9     7        DECLARE_ANON_CLASS                               <unknown> 
          8        NEW                                              $10     $9
          9        DO_FCALL                                      0          
         10        ADD_ARRAY_ELEMENT                                ~5      $10, 'class'
   10    11        DECLARE_ANON_CLASS                               <const ast>   
         12        NEW                                              $13     $12
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~5      $13, 'class+with+tostring'
   11    15        INIT_FCALL                                               'fopen'
         16        SEND_VAL                                                 '%2Fin%2FcQ8hf'
         17        SEND_VAL                                                 'r'
         18        DO_ICALL                                         $15     
         19        ADD_ARRAY_ELEMENT                                ~5      $15, 'resource'
    5    20        ASSIGN                                                   !1, ~5
   14    21      > FE_RESET_R                                       $17     !1, ->43
         22    > > FE_FETCH_R                                       ~18     $17, !2, ->43
         23    >   ASSIGN                                                   !3, ~18
   15    24        CONCAT                                           ~20     '%3D%3D%3D', !3
         25        CONCAT                                           ~21     ~20, '%3D%3D%3D%0A'
         26        ECHO                                                     ~21
   16    27        ASSIGN_DIM                                               !0, !2
         28        OP_DATA                                                  <true>
   17    29        ECHO                                                     'state+of+array%3A+%0A'
   18    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                                 
   19    33        ECHO                                                     'state+of+key%3A+%0A'
   20    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
   21    37        ECHO                                                     'is+the+key+set+in+the+array%3A+%0A'
   22    38        INIT_FCALL                                               'var_dump'
         39        ISSET_ISEMPTY_DIM_OBJ                         0  ~25     !0, !2
         40        SEND_VAL                                                 ~25
         41        DO_ICALL                                                 
   14    42      > JMP                                                      ->22
         43    >   FE_FREE                                                  $17
   25    44        ECHO                                                     '%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A'
   26    45        INIT_FCALL                                               'var_dump'
         46        SEND_VAR                                                 !0
         47        DO_ICALL                                                 
         48      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcQ8hf%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cQ8hf
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

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

Class class@anonymous: [no user functions]
Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cQ8hf
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   'to+string+class'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.74 ms | 1400 KiB | 17 Q