3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 1. check if referer is Unity else echo error class Result implements \JsonSerializable { private $error; private $accessToken; public function __construct($anErrorName, $anAccessToken) { $this->error = $anErrorName; $this->accessToken = $anAccessToken; } public function jsonSerialize() { return get_object_vars($this); } } $result = new Result("true", 0); echo json_encode($result); $referrer = (string)$_SERVER['HTTP_USER_AGENT']; foreach( $_POST as $key=>$value) { if( is_array( $value ) ) { foreach( $value as $thing ) { echo $thing . "\xA"; } } else { echo "$key=$value" . "\xA"; } } echo'test' . "\xA";; if (strpos($referrer, 'Unity') !== false) { echo 'true'; } else echo 'false'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 33
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/eAjbR
function name:  (null)
number of ops:  45
compiled vars:  !0 = $result, !1 = $referrer, !2 = $value, !3 = $key, !4 = $thing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'result'
   21     1        NEW                                              $5      'Result'
          2        SEND_VAL_EX                                              'true'
          3        SEND_VAL_EX                                              0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $5
   22     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        ECHO                                                     $8
   26    10        FETCH_R                      global              ~9      '_SERVER'
         11        FETCH_DIM_R                                      ~10     ~9, 'HTTP_USER_AGENT'
         12        CAST                                          6  ~11     ~10
         13        ASSIGN                                                   !1, ~11
   28    14        FETCH_R                      global              ~13     '_POST'
         15      > FE_RESET_R                                       $14     ~13, ->33
         16    > > FE_FETCH_R                                       ~15     $14, !2, ->33
         17    >   ASSIGN                                                   !3, ~15
   29    18        TYPE_CHECK                                  128          !2
         19      > JMPZ                                                     ~17, ->27
   30    20    > > FE_RESET_R                                       $18     !2, ->25
         21    > > FE_FETCH_R                                               $18, !4, ->25
   31    22    >   CONCAT                                           ~19     !4, '%0A'
         23        ECHO                                                     ~19
   30    24      > JMP                                                      ->21
         25    >   FE_FREE                                                  $18
         26      > JMP                                                      ->32
   34    27    >   ROPE_INIT                                     3  ~21     !3
         28        ROPE_ADD                                      1  ~21     ~21, '%3D'
         29        ROPE_END                                      2  ~20     ~21, !2
         30        CONCAT                                           ~23     ~20, '%0A'
         31        ECHO                                                     ~23
   28    32    > > JMP                                                      ->16
         33    >   FE_FREE                                                  $14
   38    34        ECHO                                                     'test%0A'
   42    35        INIT_FCALL                                               'strpos'
         36        SEND_VAR                                                 !1
         37        SEND_VAL                                                 'Unity'
         38        DO_ICALL                                         $24     
         39        TYPE_CHECK                                  1018          $24
         40      > JMPZ                                                     ~25, ->43
   43    41    >   ECHO                                                     'true'
         42      > JMP                                                      ->44
   44    43    >   ECHO                                                     'false'
   47    44    > > RETURN                                                   1

Class Result:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eAjbR
function name:  __construct
number of ops:  7
compiled vars:  !0 = $anErrorName, !1 = $anAccessToken
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ASSIGN_OBJ                                               'error'
          3        OP_DATA                                                  !0
   13     4        ASSIGN_OBJ                                               'accessToken'
          5        OP_DATA                                                  !1
   14     6      > RETURN                                                   null

End of function __construct

Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eAjbR
function name:  jsonSerialize
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'get_object_vars'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   18     5*     > RETURN                                                   null

End of function jsonserialize

End of class Result.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.9 ms | 1405 KiB | 19 Q