3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('API_URL', "https://urldefense.proofpoint.com/v2/url?u=http-3A__54.164.157.10_api_&d=AwIGAg&c=k9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4&r=QaP7FSdIyAhgenUfxnQ6QXqomsBIfkFdHDW_3mTFA28&m=IAXcb4-Y8VZw6uKKE3YfTH2eo2WZrEPrRAnaYAJ92bE&s=IS86EN4YZD14QW2nO2gQxL6lpGXDUaPYqEpCgqvikIQ&e= "); define('API_TOKEN', "8e9ead149afaf8896c2fa57f239c65b6d4eae34be898ae52bc6ab1b52c499672"); define('API_REQUEST_IMPORT', "import"); class clsPhysician { public $id = 0; public $version = 1; public $first_name = ""; public $last_name = ""; public $npi = ""; public function __construct($id, $fn, $ln, $npi) { $this->id = $id; $this->first_name = $fn; $this->last_name = $ln; $this->npi = $npi; } } class clsMedication { public $id = 0; public $version = 1; public $med_name = ""; public $med_trade_name = ""; public $med_type = ""; public $med_taking = 0; // patient is taking this med public $med_recommended = 0; // this med is recommended public function __construct($id, $med_name, $med_trade_name, $med_type, $med_taking, $med_recommended) { $this->id = $id; $this->med_name = $med_name; $this->med_trade_name = $med_trade_name; $this->med_type = $med_type; $this->med_taking = $med_taking; $this->med_recommended = $med_recommended; } } class clsPatient { public $id = 0; public $version = 1; public $collision_resolver_token = ""; public $patient_id = ""; public $record_token = ""; public $physicians = []; // array of physicians public $meds = []; // array of med objects public function __construct($id, $crt, $pid, $tkn) { $this->id = $id; $this->collision_resolver_token = $crt; $this->patient_id = $pid; $this->record_token = $tkn; } public function addPhysician($id, $fn, $ln, $npi) { $this->physicians[] = new clsPhysician($id, $fn, $ln, $npi); } public function addMedication($id, $med_name, $med_trade_name, $med_type, $med_taking, $med_recommended) { $this->meds[] = new clsMedication($id, $med_name, $med_trade_name, $med_type, $med_taking, $med_recommended); } } /* TEST PATIENT Ruth M. Montgomery 6/13/1947 47 Mayberry Lane F Liana Fraenkel, 1679556815 */ $patient_id = hash('sha256', "rumo06/13/1947fm"); // the name-dob-gender hash $record_token = "{c176f54a-fd76-4a08-8ecc-29cdd2f3316a}"; // just a v4 GUID I pulled off the interwebs $crt = hash('sha256', "47"); // collision resolver token /*--- INSTANTIATE RECORD ---*/ $objPatient = new clsPatient(0, $crt, $patient_id, $record_token); /*--- ADD PHYSICIAN(s) ---*/ $objPatient->addPhysician(0, "Liana", "Fraenkel", "1679556815"); /*--- ADD MED(s) ---*/ $objPatient->addMedication(0, "Methotrexate", "Methotrexate", "methotrexate", 1, 1); // taking methotrexate $objPatient->addMedication(1, "etanercept", "Enbrel", "anti-tnfs", 1, 1); // taking enbrel $objPatient->addMedication(2, "abatacept", "Orencia", "abatacept", 0, 1); // abatacept is RECOMMENDED /*--- REQUEST IMPORT TO RAGUIDE ---*/ $jsondata = json_encode($objPatient); $req = http_build_query(array('token' => API_TOKEN, 'data' => $jsondata, 'request' => API_REQUEST_IMPORT)); print_r($req);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  (null)
number of ops:  77
compiled vars:  !0 = $patient_id, !1 = $record_token, !2 = $crt, !3 = $objPatient, !4 = $jsondata, !5 = $req
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'API_URL'
          2        SEND_VAL                                                 'https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__54.164.157.10_api_%26d%3DAwIGAg%26c%3Dk9MF1d71ITtkuJx-PdWme51dKbmfPEvxwt8SFEkBfs4%26r%3DQaP7FSdIyAhgenUfxnQ6QXqomsBIfkFdHDW_3mTFA28%26m%3DIAXcb4-Y8VZw6uKKE3YfTH2eo2WZrEPrRAnaYAJ92bE%26s%3DIS86EN4YZD14QW2nO2gQxL6lpGXDUaPYqEpCgqvikIQ%26e%3D+'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'API_TOKEN'
          6        SEND_VAL                                                 '8e9ead149afaf8896c2fa57f239c65b6d4eae34be898ae52bc6ab1b52c499672'
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'API_REQUEST_IMPORT'
         10        SEND_VAL                                                 'import'
         11        DO_ICALL                                                 
  158    12        INIT_FCALL                                               'hash'
         13        SEND_VAL                                                 'sha256'
         14        SEND_VAL                                                 'rumo06%2F13%2F1947fm'
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !0, $9
  161    17        ASSIGN                                                   !1, '%7Bc176f54a-fd76-4a08-8ecc-29cdd2f3316a%7D'
  164    18        INIT_FCALL                                               'hash'
         19        SEND_VAL                                                 'sha256'
         20        SEND_VAL                                                 '47'
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !2, $12
  170    23        NEW                                              $14     'clsPatient'
         24        SEND_VAL_EX                                              0
         25        SEND_VAR_EX                                              !2
         26        SEND_VAR_EX                                              !0
         27        SEND_VAR_EX                                              !1
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !3, $14
  176    30        INIT_METHOD_CALL                                         !3, 'addPhysician'
         31        SEND_VAL_EX                                              0
         32        SEND_VAL_EX                                              'Liana'
         33        SEND_VAL_EX                                              'Fraenkel'
         34        SEND_VAL_EX                                              '1679556815'
         35        DO_FCALL                                      0          
  182    36        INIT_METHOD_CALL                                         !3, 'addMedication'
         37        SEND_VAL_EX                                              0
         38        SEND_VAL_EX                                              'Methotrexate'
         39        SEND_VAL_EX                                              'Methotrexate'
         40        SEND_VAL_EX                                              'methotrexate'
         41        SEND_VAL_EX                                              1
         42        SEND_VAL_EX                                              1
         43        DO_FCALL                                      0          
  185    44        INIT_METHOD_CALL                                         !3, 'addMedication'
         45        SEND_VAL_EX                                              1
         46        SEND_VAL_EX                                              'etanercept'
         47        SEND_VAL_EX                                              'Enbrel'
         48        SEND_VAL_EX                                              'anti-tnfs'
         49        SEND_VAL_EX                                              1
         50        SEND_VAL_EX                                              1
         51        DO_FCALL                                      0          
  188    52        INIT_METHOD_CALL                                         !3, 'addMedication'
         53        SEND_VAL_EX                                              2
         54        SEND_VAL_EX                                              'abatacept'
         55        SEND_VAL_EX                                              'Orencia'
         56        SEND_VAL_EX                                              'abatacept'
         57        SEND_VAL_EX                                              0
         58        SEND_VAL_EX                                              1
         59        DO_FCALL                                      0          
  200    60        INIT_FCALL                                               'json_encode'
         61        SEND_VAR                                                 !3
         62        DO_ICALL                                         $21     
         63        ASSIGN                                                   !4, $21
  204    64        INIT_FCALL                                               'http_build_query'
         65        FETCH_CONSTANT                                   ~23     'API_TOKEN'
         66        INIT_ARRAY                                       ~24     ~23, 'token'
         67        ADD_ARRAY_ELEMENT                                ~24     !4, 'data'
         68        FETCH_CONSTANT                                   ~25     'API_REQUEST_IMPORT'
         69        ADD_ARRAY_ELEMENT                                ~24     ~25, 'request'
         70        SEND_VAL                                                 ~24
         71        DO_ICALL                                         $26     
         72        ASSIGN                                                   !5, $26
  205    73        INIT_FCALL                                               'print_r'
         74        SEND_VAR                                                 !5
         75        DO_ICALL                                                 
         76      > RETURN                                                   1

Class clsPhysician:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  __construct
number of ops:  13
compiled vars:  !0 = $id, !1 = $fn, !2 = $ln, !3 = $npi
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   28     4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  !0
   31     6        ASSIGN_OBJ                                               'first_name'
          7        OP_DATA                                                  !1
   34     8        ASSIGN_OBJ                                               'last_name'
          9        OP_DATA                                                  !2
   37    10        ASSIGN_OBJ                                               'npi'
         11        OP_DATA                                                  !3
   40    12      > RETURN                                                   null

End of function __construct

End of class clsPhysician.

Class clsMedication:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  __construct
number of ops:  19
compiled vars:  !0 = $id, !1 = $med_name, !2 = $med_trade_name, !3 = $med_type, !4 = $med_taking, !5 = $med_recommended
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
   64     6        ASSIGN_OBJ                                               'id'
          7        OP_DATA                                                  !0
   66     8        ASSIGN_OBJ                                               'med_name'
          9        OP_DATA                                                  !1
   68    10        ASSIGN_OBJ                                               'med_trade_name'
         11        OP_DATA                                                  !2
   70    12        ASSIGN_OBJ                                               'med_type'
         13        OP_DATA                                                  !3
   72    14        ASSIGN_OBJ                                               'med_taking'
         15        OP_DATA                                                  !4
   74    16        ASSIGN_OBJ                                               'med_recommended'
         17        OP_DATA                                                  !5
   75    18      > RETURN                                                   null

End of function __construct

End of class clsMedication.

Class clsPatient:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  __construct
number of ops:  13
compiled vars:  !0 = $id, !1 = $crt, !2 = $pid, !3 = $tkn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   95     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   97     4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  !0
   99     6        ASSIGN_OBJ                                               'collision_resolver_token'
          7        OP_DATA                                                  !1
  101     8        ASSIGN_OBJ                                               'patient_id'
          9        OP_DATA                                                  !2
  103    10        ASSIGN_OBJ                                               'record_token'
         11        OP_DATA                                                  !3
  104    12      > RETURN                                                   null

End of function __construct

Function addphysician:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  addPhysician
number of ops:  14
compiled vars:  !0 = $id, !1 = $fn, !2 = $ln, !3 = $npi
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  107     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
  110     4        NEW                                              $6      'clsPhysician'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !2
          8        SEND_VAR_EX                                              !3
          9        DO_FCALL                                      0          
         10        FETCH_OBJ_W                                      $4      'physicians'
         11        ASSIGN_DIM                                               $4
         12        OP_DATA                                                  $6
  113    13      > RETURN                                                   null

End of function addphysician

Function addmedication:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3QQX
function name:  addMedication
number of ops:  18
compiled vars:  !0 = $id, !1 = $med_name, !2 = $med_trade_name, !3 = $med_type, !4 = $med_taking, !5 = $med_recommended
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  116     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
  119     6        NEW                                              $8      'clsMedication'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !3
         11        SEND_VAR_EX                                              !4
         12        SEND_VAR_EX                                              !5
         13        DO_FCALL                                      0          
         14        FETCH_OBJ_W                                      $6      'meds'
         15        ASSIGN_DIM                                               $6
         16        OP_DATA                                                  $8
  122    17      > RETURN                                                   null

End of function addmedication

End of class clsPatient.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.06 ms | 1412 KiB | 23 Q