3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'token.php'; require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); $DB = $Manager->GetDB(); if(!$Manager->Valid()) { header("X-API-Status: 40002 Invalid Manager"); die(); } if(preg_match("/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/", $_POST["mail"]) != 1) { header("X-API-Status: 44003 Mail invalid"); die(); } if($Manager->GetUsers("WHERE `".$DB["Tables"]["Users"]["Mail"]."` LIKE '".$Manager->EscapeString($_POST["mail"])."'") !== FALSE) { header("X-API-Status: 44004 Mail exists"); die(); } $Entry = new \teachme\CUser(); $Entry->SetName($_POST["name"]); $Entry->SetMail($_POST["mail"]); if(isset($_POST["password"]) && strlen($_POST["password"]) > 0) { $Entry->SetPassword($_POST["password"]); } if(strpos($Client["OS"], "iOS") !== FALSE) { $_POST["offers"] = explode($iOSDelimiter, $_POST["offers"]); $_POST["requests"] = explode($iOSDelimiter, $_POST["requests"]); } $Entry->SetPhone($_POST["phone"]); $Entry->SetUniversity($_POST["university"]); $Entry->SetOffers("µ".implode("µµ", $_POST["offers"])."µ"); $Entry->SetRequests("µ".implode("µµ", $_POST["requests"])."µ"); $Entry->SetPriceOffer($_POST["priceoffer"]); $Entry->SetPriceRequest($_POST["pricerequest"]); $Entry->SetBirthday($_POST["birthday"]); $Entry->SetGender($_POST["gender"]); $Entry->SetSemester($_POST["semester"]); $Entry->SetAbout($_POST["about"]); $Entry->SetTimes($_POST["times"]); $Entry->SetLastActivity(now()); $Entry->SetRegistration(now()); $Entry->SetActive(1); if(!$Manager->Save($Entry)) { header("X-API-Status: 44002 Saving Failed"); die(); } if(($User = $Manager->GetUsers("WHERE `".$DB["Tables"]["Users"]["Mail"]."` LIKE '".$Manager->EscapeString($_POST["mail"])."'")) !== false) { $Entry = $User[0]; } $_SESSION["TeachMe-Server"]["loggedin"] = true; $_SESSION["TeachMe-Server"]["User"] = $Entry->ToArray(); PrintResult($Entry->ToArray()); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 50
Branch analysis from position: 46
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 46) Position 1 = 68, Position 2 = 73
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 80
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 105
Branch analysis from position: 87
2 jumps found. (Code = 43) Position 1 = 199, Position 2 = 203
Branch analysis from position: 199
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 203
2 jumps found. (Code = 43) Position 1 = 222, Position 2 = 224
Branch analysis from position: 222
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 224
Branch analysis from position: 105
Branch analysis from position: 80
Branch analysis from position: 73
filename:       /in/YbWUO
function name:  (null)
number of ops:  240
compiled vars:  !0 = $Manager, !1 = $DB, !2 = $Entry, !3 = $Client, !4 = $iOSDelimiter, !5 = $User
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'token.php', INCLUDE
    3     1        INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
    5     2        NEW                                              $8      'teachme%5CCManager'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $8
    6     5        INIT_METHOD_CALL                                         !0, 'GetDB'
          6        DO_FCALL                                      0  $11     
          7        ASSIGN                                                   !1, $11
    8     8        INIT_METHOD_CALL                                         !0, 'Valid'
          9        DO_FCALL                                      0  $13     
         10        BOOL_NOT                                         ~14     $13
         11      > JMPZ                                                     ~14, ->16
   10    12    >   INIT_FCALL                                               'header'
         13        SEND_VAL                                                 'X-API-Status%3A+40002+Invalid+Manager'
         14        DO_ICALL                                                 
         15      > EXIT                                                     
   13    16    >   INIT_FCALL                                               'preg_match'
         17        SEND_VAL                                                 '%2F%5E%28%3F%3A%5B%5Cw%5C%21%5C%23%24%5C%25%5C%26%5C%27%5C%2A%5C%2B%5C-%5C%2F%5C%3D%5C%3F%5C%5E%5C%60%5C%7B%5C%7C%5C%7D%5C%7E%5D%2B%5C.%29%2A%5B%5Cw%5C%21%5C%23%24%5C%25%5C%26%5C%27%5C%2A%5C%2B%5C-%5C%2F%5C%3D%5C%3F%5C%5E%5C%60%5C%7B%5C%7C%5C%7D%5C%7E%5D%2B%40%28%3F%3A%28%3F%3A%28%3F%3A%5Ba-zA-Z0-9%5D%28%3F%3A%5Ba-zA-Z0-9%5C-%5D%28%3F%21%5C.%29%29%7B0%2C61%7D%5Ba-zA-Z0-9%5D%3F%5C.%29%2B%5Ba-zA-Z0-9%5D%28%3F%3A%5Ba-zA-Z0-9%5C-%5D%28%3F%21%24%29%29%7B0%2C61%7D%5Ba-zA-Z0-9%5D%3F%29%7C%28%3F%3A%5C%5B%28%3F%3A%28%3F%3A%5B01%5D%3F%5Cd%7B1%2C2%7D%7C2%5B0-4%5D%5Cd%7C25%5B0-5%5D%29%5C.%29%7B3%7D%28%3F%3A%5B01%5D%3F%5Cd%7B1%2C2%7D%7C2%5B0-4%5D%5Cd%7C25%5B0-5%5D%29%5C%5D%29%29%24%2F'
         18        FETCH_R                      global              ~16     '_POST'
         19        FETCH_DIM_R                                      ~17     ~16, 'mail'
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                         $18     
         22        IS_NOT_EQUAL                                             $18, 1
         23      > JMPZ                                                     ~19, ->28
   15    24    >   INIT_FCALL                                               'header'
         25        SEND_VAL                                                 'X-API-Status%3A+44003+Mail+invalid'
         26        DO_ICALL                                                 
         27      > EXIT                                                     
   18    28    >   INIT_METHOD_CALL                                         !0, 'GetUsers'
         29        FETCH_DIM_R                                      ~21     !1, 'Tables'
         30        FETCH_DIM_R                                      ~22     ~21, 'Users'
         31        FETCH_DIM_R                                      ~23     ~22, 'Mail'
         32        CONCAT                                           ~24     'WHERE+%60', ~23
         33        CONCAT                                           ~25     ~24, '%60+LIKE+%27'
         34        INIT_METHOD_CALL                                         !0, 'EscapeString'
         35        CHECK_FUNC_ARG                                           
         36        FETCH_FUNC_ARG               global              $26     '_POST'
         37        FETCH_DIM_FUNC_ARG                               $27     $26, 'mail'
         38        SEND_FUNC_ARG                                            $27
         39        DO_FCALL                                      0  $28     
         40        CONCAT                                           ~29     ~25, $28
         41        CONCAT                                           ~30     ~29, '%27'
         42        SEND_VAL_EX                                              ~30
         43        DO_FCALL                                      0  $31     
         44        TYPE_CHECK                                  1018          $31
         45      > JMPZ                                                     ~32, ->50
   20    46    >   INIT_FCALL                                               'header'
         47        SEND_VAL                                                 'X-API-Status%3A+44004+Mail+exists'
         48        DO_ICALL                                                 
         49      > EXIT                                                     
   23    50    >   NEW                                              $34     'teachme%5CCUser'
         51        DO_FCALL                                      0          
         52        ASSIGN                                                   !2, $34
   25    53        INIT_METHOD_CALL                                         !2, 'SetName'
         54        CHECK_FUNC_ARG                                           
         55        FETCH_FUNC_ARG               global              $37     '_POST'
         56        FETCH_DIM_FUNC_ARG                               $38     $37, 'name'
         57        SEND_FUNC_ARG                                            $38
         58        DO_FCALL                                      0          
   26    59        INIT_METHOD_CALL                                         !2, 'SetMail'
         60        CHECK_FUNC_ARG                                           
         61        FETCH_FUNC_ARG               global              $40     '_POST'
         62        FETCH_DIM_FUNC_ARG                               $41     $40, 'mail'
         63        SEND_FUNC_ARG                                            $41
         64        DO_FCALL                                      0          
   28    65        FETCH_IS                                         ~43     '_POST'
         66        ISSET_ISEMPTY_DIM_OBJ                         0  ~44     ~43, 'password'
         67      > JMPZ_EX                                          ~44     ~44, ->73
         68    >   FETCH_R                      global              ~45     '_POST'
         69        FETCH_DIM_R                                      ~46     ~45, 'password'
         70        STRLEN                                           ~47     ~46
         71        IS_SMALLER                                       ~48     0, ~47
         72        BOOL                                             ~44     ~48
         73    > > JMPZ                                                     ~44, ->80
   30    74    >   INIT_METHOD_CALL                                         !2, 'SetPassword'
         75        CHECK_FUNC_ARG                                           
         76        FETCH_FUNC_ARG               global              $49     '_POST'
         77        FETCH_DIM_FUNC_ARG                               $50     $49, 'password'
         78        SEND_FUNC_ARG                                            $50
         79        DO_FCALL                                      0          
   34    80    >   INIT_FCALL                                               'strpos'
         81        FETCH_DIM_R                                      ~52     !3, 'OS'
         82        SEND_VAL                                                 ~52
         83        SEND_VAL                                                 'iOS'
         84        DO_ICALL                                         $53     
         85        TYPE_CHECK                                  1018          $53
         86      > JMPZ                                                     ~54, ->105
   36    87    >   INIT_FCALL                                               'explode'
         88        SEND_VAR                                                 !4
         89        FETCH_R                      global              ~57     '_POST'
         90        FETCH_DIM_R                                      ~58     ~57, 'offers'
         91        SEND_VAL                                                 ~58
         92        DO_ICALL                                         $59     
         93        FETCH_W                      global              $55     '_POST'
         94        ASSIGN_DIM                                               $55, 'offers'
         95        OP_DATA                                                  $59
   37    96        INIT_FCALL                                               'explode'
         97        SEND_VAR                                                 !4
         98        FETCH_R                      global              ~62     '_POST'
         99        FETCH_DIM_R                                      ~63     ~62, 'requests'
        100        SEND_VAL                                                 ~63
        101        DO_ICALL                                         $64     
        102        FETCH_W                      global              $60     '_POST'
        103        ASSIGN_DIM                                               $60, 'requests'
        104        OP_DATA                                                  $64
   40   105    >   INIT_METHOD_CALL                                         !2, 'SetPhone'
        106        CHECK_FUNC_ARG                                           
        107        FETCH_FUNC_ARG               global              $65     '_POST'
        108        FETCH_DIM_FUNC_ARG                               $66     $65, 'phone'
        109        SEND_FUNC_ARG                                            $66
        110        DO_FCALL                                      0          
   41   111        INIT_METHOD_CALL                                         !2, 'SetUniversity'
        112        CHECK_FUNC_ARG                                           
        113        FETCH_FUNC_ARG               global              $68     '_POST'
        114        FETCH_DIM_FUNC_ARG                               $69     $68, 'university'
        115        SEND_FUNC_ARG                                            $69
        116        DO_FCALL                                      0          
   42   117        INIT_METHOD_CALL                                         !2, 'SetOffers'
        118        INIT_FCALL                                               'implode'
        119        SEND_VAL                                                 '%C2%B5%C2%B5'
        120        FETCH_R                      global              ~71     '_POST'
        121        FETCH_DIM_R                                      ~72     ~71, 'offers'
        122        SEND_VAL                                                 ~72
        123        DO_ICALL                                         $73     
        124        CONCAT                                           ~74     '%C2%B5', $73
        125        CONCAT                                           ~75     ~74, '%C2%B5'
        126        SEND_VAL_EX                                              ~75
        127        DO_FCALL                                      0          
   43   128        INIT_METHOD_CALL                                         !2, 'SetRequests'
        129        INIT_FCALL                                               'implode'
        130        SEND_VAL                                                 '%C2%B5%C2%B5'
        131        FETCH_R                      global              ~77     '_POST'
        132        FETCH_DIM_R                                      ~78     ~77, 'requests'
        133        SEND_VAL                                                 ~78
        134        DO_ICALL                                         $79     
        135        CONCAT                                           ~80     '%C2%B5', $79
        136        CONCAT                                           ~81     ~80, '%C2%B5'
        137        SEND_VAL_EX                                              ~81
        138        DO_FCALL                                      0          
   44   139        INIT_METHOD_CALL                                         !2, 'SetPriceOffer'
        140        CHECK_FUNC_ARG                                           
        141        FETCH_FUNC_ARG               global              $83     '_POST'
        142        FETCH_DIM_FUNC_ARG                               $84     $83, 'priceoffer'
        143        SEND_FUNC_ARG                                            $84
        144        DO_FCALL                                      0          
   45   145        INIT_METHOD_CALL                                         !2, 'SetPriceRequest'
        146        CHECK_FUNC_ARG                                           
        147        FETCH_FUNC_ARG               global              $86     '_POST'
        148        FETCH_DIM_FUNC_ARG                               $87     $86, 'pricerequest'
        149        SEND_FUNC_ARG                                            $87
        150        DO_FCALL                                      0          
   46   151        INIT_METHOD_CALL                                         !2, 'SetBirthday'
        152        CHECK_FUNC_ARG                                           
        153        FETCH_FUNC_ARG               global              $89     '_POST'
        154        FETCH_DIM_FUNC_ARG                               $90     $89, 'birthday'
        155        SEND_FUNC_ARG                                            $90
        156        DO_FCALL                                      0          
   47   157        INIT_METHOD_CALL                                         !2, 'SetGender'
        158        CHECK_FUNC_ARG                                           
        159        FETCH_FUNC_ARG               global              $92     '_POST'
        160        FETCH_DIM_FUNC_ARG                               $93     $92, 'gender'
        161        SEND_FUNC_ARG                                            $93
        162        DO_FCALL                                      0          
   48   163        INIT_METHOD_CALL                                         !2, 'SetSemester'
        164        CHECK_FUNC_ARG                                           
        165        FETCH_FUNC_ARG               global              $95     '_POST'
        166        FETCH_DIM_FUNC_ARG                               $96     $95, 'semester'
        167        SEND_FUNC_ARG                                            $96
        168        DO_FCALL                                      0          
   49   169        INIT_METHOD_CALL                                         !2, 'SetAbout'
        170        CHECK_FUNC_ARG                                           
        171        FETCH_FUNC_ARG               global              $98     '_POST'
        172        FETCH_DIM_FUNC_ARG                               $99     $98, 'about'
        173        SEND_FUNC_ARG                                            $99
        174        DO_FCALL                                      0          
   50   175        INIT_METHOD_CALL                                         !2, 'SetTimes'
        176        CHECK_FUNC_ARG                                           
        177        FETCH_FUNC_ARG               global              $101    '_POST'
        178        FETCH_DIM_FUNC_ARG                               $102    $101, 'times'
        179        SEND_FUNC_ARG                                            $102
        180        DO_FCALL                                      0          
   51   181        INIT_METHOD_CALL                                         !2, 'SetLastActivity'
        182        INIT_FCALL_BY_NAME                                       'now'
        183        DO_FCALL                                      0  $104    
        184        SEND_VAR_NO_REF_EX                                       $104
        185        DO_FCALL                                      0          
   52   186        INIT_METHOD_CALL                                         !2, 'SetRegistration'
        187        INIT_FCALL_BY_NAME                                       'now'
        188        DO_FCALL                                      0  $106    
        189        SEND_VAR_NO_REF_EX                                       $106
        190        DO_FCALL                                      0          
   53   191        INIT_METHOD_CALL                                         !2, 'SetActive'
        192        SEND_VAL_EX                                              1
        193        DO_FCALL                                      0          
   55   194        INIT_METHOD_CALL                                         !0, 'Save'
        195        SEND_VAR_EX                                              !2
        196        DO_FCALL                                      0  $109    
        197        BOOL_NOT                                         ~110    $109
        198      > JMPZ                                                     ~110, ->203
   57   199    >   INIT_FCALL                                               'header'
        200        SEND_VAL                                                 'X-API-Status%3A+44002+Saving+Failed'
        201        DO_ICALL                                                 
        202      > EXIT                                                     
   61   203    >   INIT_METHOD_CALL                                         !0, 'GetUsers'
        204        FETCH_DIM_R                                      ~112    !1, 'Tables'
        205        FETCH_DIM_R                                      ~113    ~112, 'Users'
        206        FETCH_DIM_R                                      ~114    ~113, 'Mail'
        207        CONCAT                                           ~115    'WHERE+%60', ~114
        208        CONCAT                                           ~116    ~115, '%60+LIKE+%27'
        209        INIT_METHOD_CALL                                         !0, 'EscapeString'
        210        CHECK_FUNC_ARG                                           
        211        FETCH_FUNC_ARG               global              $117    '_POST'
        212        FETCH_DIM_FUNC_ARG                               $118    $117, 'mail'
        213        SEND_FUNC_ARG                                            $118
        214        DO_FCALL                                      0  $119    
        215        CONCAT                                           ~120    ~116, $119
        216        CONCAT                                           ~121    ~120, '%27'
        217        SEND_VAL_EX                                              ~121
        218        DO_FCALL                                      0  $122    
        219        ASSIGN                                           ~123    !5, $122
        220        TYPE_CHECK                                  1018          ~123
        221      > JMPZ                                                     ~124, ->224
   63   222    >   FETCH_DIM_R                                      ~125    !5, 0
        223        ASSIGN                                                   !2, ~125
   66   224    >   FETCH_W                      global              $127    '_SESSION'
        225        FETCH_DIM_W                                      $128    $127, 'TeachMe-Server'
        226        ASSIGN_DIM                                               $128, 'loggedin'
        227        OP_DATA                                                  <true>
   67   228        INIT_METHOD_CALL                                         !2, 'ToArray'
        229        DO_FCALL                                      0  $133    
        230        FETCH_W                      global              $130    '_SESSION'
        231        FETCH_DIM_W                                      $131    $130, 'TeachMe-Server'
        232        ASSIGN_DIM                                               $131, 'User'
        233        OP_DATA                                                  $133
   68   234        INIT_FCALL_BY_NAME                                       'PrintResult'
        235        INIT_METHOD_CALL                                         !2, 'ToArray'
        236        DO_FCALL                                      0  $134    
        237        SEND_VAR_NO_REF_EX                                       $134
        238        DO_FCALL                                      0          
   70   239      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1416 KiB | 23 Q