3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json_string = <<<EOT {"name":"KillerBot 6000","desc":"A room with very harsh moderation. Proceed with caution!","max":600,"color":"#e0e0e0","whispersenabled":true,"forbiddenCommands":["/milk", "/bal"],"msg":[{"cont":"hey, hxor?","time":1,"color":"black","type":"message","visibility":"HxOr1337","from":"UnknownUser1"},{"cont":"Welcome to the chat!","time":0,"type":"message","color":"black","visibility":"HxOr1337","from":"Test"}]} EOT; $_SESSION["ts_user"] = 'HxOr1337'; //if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){ // $jsonF = file_get_contents("data/".$_GET["room"].".json"); $jsonD = json_decode($json_string, true); var_dump($jsonD); //echo count($jsonD["msg"]); // echo $jsonD["msg"][1]["type"]; foreach($jsonD["msg"] as $key => $message){ if($jsonD["msg"][$key]["visibility"] !== "all"){ if(isset($_SESSION["ts_user"]) && $_SESSION["ts_user"] == $jsonD["msg"][$key]["visibility"] && $jsonD["msg"][$key]["type"] != "rawbr"){ echo $jsonD["msg"][$key]["from"].": ".htmlspecialchars($jsonD["msg"][$key]["cont"])." [To you]", PHP_EOL; } else if($jsonD["msg"][$key]["type"] === "message"){ echo $jsonD["msg"][$key]["from"].": ".htmlspecialchars($jsonD["msg"][$key]["cont"])." [normal message]", PHP_EOL; } else if($jsonD["msg"][$key]["type"] === "rawbr"){ echo $jsonD["msg"][$key]["cont"]."<br />"; } } } //}
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 84
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 84
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 83
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 53
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 73
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 83
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 83
Branch analysis from position: 37
Branch analysis from position: 31
Branch analysis from position: 83
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 84
filename:       /in/ThmDV
function name:  (null)
number of ops:  86
compiled vars:  !0 = $json_string, !1 = $jsonD, !2 = $message, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%7B%22name%22%3A%22KillerBot+6000%22%2C%22desc%22%3A%22A+room+with+very+harsh+moderation.+Proceed+with+caution%21%22%2C%22max%22%3A600%2C%22color%22%3A%22%23e0e0e0%22%2C%22whispersenabled%22%3Atrue%2C%22forbiddenCommands%22%3A%5B%22%2Fmilk%22%2C+%22%2Fbal%22%5D%2C%22msg%22%3A%5B%7B%22cont%22%3A%22hey%2C+hxor%3F%22%2C%22time%22%3A1%2C%22color%22%3A%22black%22%2C%22type%22%3A%22message%22%2C%22visibility%22%3A%22HxOr1337%22%2C%22from%22%3A%22UnknownUser1%22%7D%2C%7B%22cont%22%3A%22Welcome+to+the+chat%21%22%2C%22time%22%3A0%2C%22type%22%3A%22message%22%2C%22color%22%3A%22black%22%2C%22visibility%22%3A%22HxOr1337%22%2C%22from%22%3A%22Test%22%7D%5D%7D'
    7     1        FETCH_W                          global              $5      '_SESSION'
          2        ASSIGN_DIM                                                   $5, 'ts_user'
          3        OP_DATA                                                      'HxOr1337'
   11     4        INIT_FCALL                                                   'json_decode'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !1, $7
   12     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                                     
   15    12        FETCH_DIM_R                                          ~10     !1, 'msg'
         13      > FE_RESET_R                                           $11     ~10, ->84
         14    > > FE_FETCH_R                                           ~12     $11, !2, ->84
         15    >   ASSIGN                                                       !3, ~12
   16    16        FETCH_DIM_R                                          ~14     !1, 'msg'
         17        FETCH_DIM_R                                          ~15     ~14, !3
         18        FETCH_DIM_R                                          ~16     ~15, 'visibility'
         19        IS_NOT_IDENTICAL                                             ~16, 'all'
         20      > JMPZ                                                         ~17, ->83
   17    21    >   FETCH_IS                                             ~18     '_SESSION'
         22        ISSET_ISEMPTY_DIM_OBJ                             0  ~19     ~18, 'ts_user'
         23      > JMPZ_EX                                              ~19     ~19, ->31
         24    >   FETCH_R                          global              ~20     '_SESSION'
         25        FETCH_DIM_R                                          ~21     ~20, 'ts_user'
         26        FETCH_DIM_R                                          ~22     !1, 'msg'
         27        FETCH_DIM_R                                          ~23     ~22, !3
         28        FETCH_DIM_R                                          ~24     ~23, 'visibility'
         29        IS_EQUAL                                             ~25     ~21, ~24
         30        BOOL                                                 ~19     ~25
         31    > > JMPZ_EX                                              ~19     ~19, ->37
         32    >   FETCH_DIM_R                                          ~26     !1, 'msg'
         33        FETCH_DIM_R                                          ~27     ~26, !3
         34        FETCH_DIM_R                                          ~28     ~27, 'type'
         35        IS_NOT_EQUAL                                         ~29     ~28, 'rawbr'
         36        BOOL                                                 ~19     ~29
         37    > > JMPZ                                                         ~19, ->53
   18    38    >   FETCH_DIM_R                                          ~30     !1, 'msg'
         39        FETCH_DIM_R                                          ~31     ~30, !3
         40        FETCH_DIM_R                                          ~32     ~31, 'from'
         41        CONCAT                                               ~33     ~32, '%3A+'
         42        INIT_FCALL                                                   'htmlspecialchars'
         43        FETCH_DIM_R                                          ~34     !1, 'msg'
         44        FETCH_DIM_R                                          ~35     ~34, !3
         45        FETCH_DIM_R                                          ~36     ~35, 'cont'
         46        SEND_VAL                                                     ~36
         47        DO_ICALL                                             $37     
         48        CONCAT                                               ~38     ~33, $37
         49        CONCAT                                               ~39     ~38, '+%5BTo+you%5D'
         50        ECHO                                                         ~39
         51        ECHO                                                         '%0A'
   17    52      > JMP                                                          ->83
   19    53    >   FETCH_DIM_R                                          ~40     !1, 'msg'
         54        FETCH_DIM_R                                          ~41     ~40, !3
         55        FETCH_DIM_R                                          ~42     ~41, 'type'
         56        IS_IDENTICAL                                                 ~42, 'message'
         57      > JMPZ                                                         ~43, ->73
   20    58    >   FETCH_DIM_R                                          ~44     !1, 'msg'
         59        FETCH_DIM_R                                          ~45     ~44, !3
         60        FETCH_DIM_R                                          ~46     ~45, 'from'
         61        CONCAT                                               ~47     ~46, '%3A+'
         62        INIT_FCALL                                                   'htmlspecialchars'
         63        FETCH_DIM_R                                          ~48     !1, 'msg'
         64        FETCH_DIM_R                                          ~49     ~48, !3
         65        FETCH_DIM_R                                          ~50     ~49, 'cont'
         66        SEND_VAL                                                     ~50
         67        DO_ICALL                                             $51     
         68        CONCAT                                               ~52     ~47, $51
         69        CONCAT                                               ~53     ~52, '+%5Bnormal+message%5D'
         70        ECHO                                                         ~53
         71        ECHO                                                         '%0A'
   19    72      > JMP                                                          ->83
   21    73    >   FETCH_DIM_R                                          ~54     !1, 'msg'
         74        FETCH_DIM_R                                          ~55     ~54, !3
         75        FETCH_DIM_R                                          ~56     ~55, 'type'
         76        IS_IDENTICAL                                                 ~56, 'rawbr'
         77      > JMPZ                                                         ~57, ->83
   22    78    >   FETCH_DIM_R                                          ~58     !1, 'msg'
         79        FETCH_DIM_R                                          ~59     ~58, !3
         80        FETCH_DIM_R                                          ~60     ~59, 'cont'
         81        CONCAT                                               ~61     ~60, '%3Cbr+%2F%3E'
         82        ECHO                                                         ~61
   15    83    > > JMP                                                          ->14
         84    >   FE_FREE                                                      $11
   27    85      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
220.05 ms | 2085 KiB | 16 Q