3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AC { function actionClosest_AddPointsToResponse() { $points = array(); $res_pnt = 0; $timestamp = 0; $more_records = false; $matching = array( 'Payments' => 'payment2=extract(%item, %id, "DP_Payment", "dpp_id", "dpp_", array("dpp_id"), true, true, true)', /* 'dp_id_uniq' => 'id', 'dp_update' => 'update', 'dp_type' => 'point|type', 'dp_name' => 'point|name', 'dp_description' => 'point|description', 'dp_currency' => 'point|currency', 'dp_company_id' => 'point|company_id', 'dp_tariff_plan' => 'point|tariff_plan', 'PhoneNumbers' => 'point|phone_nums=get(%item, %id, "DP_Phone", "dp_id", "dp_", array("ph_id", "dp_id"), false, false, true, 0)', 'WorkingHours' => 'point|work_hours=get(%item, %id, "DP_WorkingHour", "dp_id", "dp_", array("dp_id"))', 'dp_slot_duration' => 'point|slot_duration', 'dp_slot_number' => 'point|slot_number', 'dp_latitude' => 'geo|latitude', 'dp_longitude' => 'geo|longitude', 'dp_country' => 'geo|country_id', 'dp_region' => 'geo|region', 'dp_city' => 'geo|city', 'dp_post_code' => 'geo|post_code', 'dp_street' => 'geo|street', 'dp_house_number' => 'geo|house_number', 'ServiceList' => 'service|main_service=get(%item, %id, "DP_ServicePrice", "dp_id", "sv_", array("dp_id", "sv_price", "price_schema=>price"))', 'dp_additional_service' => 'service|additional_service', 'Payments' => 'payment=extract(%item, %id, "DP_Payment", "dpp_id", "dpp_", array("dpp_id"), true, true, true)', 'PrepaidCards' => 'payment|prepaid_cards=get(%item, %id, "DP_PrepaidCard", "dp_id", "dp_", array("ppc_id", "dp_id"), false, true, false)', 'Parking' => 'parking=get(%item, %id, "DP_Parking", "parking_id", "parking_", array("parking_id"), true, true)', 'CarWash' => 'car_wash=get(%item, %id, "DP_CarWash", "cw_id", "cw_", array("cw_id", "cw_subcompact_cars", "cw_compact_cars", "cw_suv_minivans", "cw_trucks", "cw_cleaning_method"), true, true)', 'TyreFitting' => 'tyre_fitting=get(%item, %id, "DP_TyreFitting", "tf_id", "tf_", array("tf_id", "tf_install_wheel", "tf_mount_tyres", "tf_wheel_balancing", "tf_tyre_fitting_wheel", "tf_tyre_fitting_car", "tf_disc_repair", "tf_tyre_repair", "tf_inflation", "tf_run_flat_repair", "tf_tyres_recycling", "tf_tyres_storage"), true, true)', 'ParkingCapacity' => 'payment=get(%item, %id, "DP_ParkingCapacity", "parking_id", "pc_", array("parking_id"), true, true)', #'' => '', '' => '', '' => '', #'CarService' => '', */ ); $var = ''; $item = array(); $drevolpoint_id = 2; //$point->dp_id; foreach( $matching as $param => $match ) { if (!preg_match('/^(\w+)(?:\|(\w+))?(?:=(get|extract)\((.*?)\))?$/', $match, $var)) throw new Exception("Unknown DB field mappint: $match (for $param)"); if (!in_array($param, array_keys($point->attributes)) and (!isset($var[4]) or !$var[4])) throw new Exception("Unknown DB field requested: $param (matching for $match)"); $item_name = '$item[\''.$var[1].'\']'; if (isset($var[2]) and $var[2]) $item_name .= '[\''.$var[2].'\']'; print("<hr>Item name = '$item_name'<br>\n"); } } } $aco = new AC; $aco->actionClosest_AddPointsToResponse();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cMSsQ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $aco
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   NEW                                              $1      'AC'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   52     3        INIT_METHOD_CALL                                         !0, 'actionClosest_AddPointsToResponse'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class AC:
Function actionclosest_addpointstoresponse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 72
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 72
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
2 jumps found. (Code = 47) Position 1 = 40, Position 2 = 43
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 54
Branch analysis from position: 45
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 54
2 jumps found. (Code = 46) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 67
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 67
Branch analysis from position: 62
Branch analysis from position: 43
Branch analysis from position: 44
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
filename:       /in/cMSsQ
function name:  actionClosest_AddPointsToResponse
number of ops:  74
compiled vars:  !0 = $points, !1 = $res_pnt, !2 = $timestamp, !3 = $more_records, !4 = $matching, !5 = $var, !6 = $item, !7 = $drevolpoint_id, !8 = $match, !9 = $param, !10 = $point, !11 = $item_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, 0
    7     3        ASSIGN                                                   !3, <false>
    9     4        ASSIGN                                                   !4, <array>
   31     5        ASSIGN                                                   !5, ''
   32     6        ASSIGN                                                   !6, <array>
   33     7        ASSIGN                                                   !7, 2
   35     8      > FE_RESET_R                                       $20     !4, ->72
          9    > > FE_FETCH_R                                       ~21     $20, !8, ->72
         10    >   ASSIGN                                                   !9, ~21
   36    11        INIT_FCALL                                               'preg_match'
         12        SEND_VAL                                                 '%2F%5E%28%5Cw%2B%29%28%3F%3A%5C%7C%28%5Cw%2B%29%29%3F%28%3F%3A%3D%28get%7Cextract%29%5C%28%28.%2A%3F%29%5C%29%29%3F%24%2F'
         13        SEND_VAR                                                 !8
         14        SEND_REF                                                 !5
         15        DO_ICALL                                         $23     
         16        BOOL_NOT                                         ~24     $23
         17      > JMPZ                                                     ~24, ->27
   37    18    >   NEW                                              $25     'Exception'
         19        ROPE_INIT                                     5  ~27     'Unknown+DB+field+mappint%3A+'
         20        ROPE_ADD                                      1  ~27     ~27, !8
         21        ROPE_ADD                                      2  ~27     ~27, '+%28for+'
         22        ROPE_ADD                                      3  ~27     ~27, !9
         23        ROPE_END                                      4  ~26     ~27, '%29'
         24        SEND_VAL_EX                                              ~26
         25        DO_FCALL                                      0          
         26      > THROW                                         0          $25
   39    27    >   INIT_FCALL                                               'in_array'
         28        SEND_VAR                                                 !9
         29        INIT_FCALL                                               'array_keys'
         30        FETCH_OBJ_R                                      ~31     !10, 'attributes'
         31        SEND_VAL                                                 ~31
         32        DO_ICALL                                         $32     
         33        SEND_VAR                                                 $32
         34        DO_ICALL                                         $33     
         35        BOOL_NOT                                         ~34     $33
         36      > JMPZ_EX                                          ~34     ~34, ->44
         37    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~35     !5, 4
         38        BOOL_NOT                                         ~36     ~35
         39      > JMPNZ_EX                                         ~36     ~36, ->43
         40    >   FETCH_DIM_R                                      ~37     !5, 4
         41        BOOL_NOT                                         ~38     ~37
         42        BOOL                                             ~36     ~38
         43    >   BOOL                                             ~34     ~36
         44    > > JMPZ                                                     ~34, ->54
   40    45    >   NEW                                              $39     'Exception'
         46        ROPE_INIT                                     5  ~41     'Unknown+DB+field+requested%3A+'
         47        ROPE_ADD                                      1  ~41     ~41, !9
         48        ROPE_ADD                                      2  ~41     ~41, '+%28matching+for+'
         49        ROPE_ADD                                      3  ~41     ~41, !8
         50        ROPE_END                                      4  ~40     ~41, '%29'
         51        SEND_VAL_EX                                              ~40
         52        DO_FCALL                                      0          
         53      > THROW                                         0          $39
   43    54    >   FETCH_DIM_R                                      ~45     !5, 1
         55        CONCAT                                           ~46     '%24item%5B%27', ~45
         56        CONCAT                                           ~47     ~46, '%27%5D'
         57        ASSIGN                                                   !11, ~47
   44    58        ISSET_ISEMPTY_DIM_OBJ                         0  ~49     !5, 2
         59      > JMPZ_EX                                          ~49     ~49, ->62
         60    >   FETCH_DIM_R                                      ~50     !5, 2
         61        BOOL                                             ~49     ~50
         62    > > JMPZ                                                     ~49, ->67
   45    63    >   FETCH_DIM_R                                      ~51     !5, 2
         64        CONCAT                                           ~52     '%5B%27', ~51
         65        CONCAT                                           ~53     ~52, '%27%5D'
         66        ASSIGN_OP                                     8          !11, ~53
   46    67    >   ROPE_INIT                                     3  ~56     '%3Chr%3EItem+name+%3D+%27'
         68        ROPE_ADD                                      1  ~56     ~56, !11
         69        ROPE_END                                      2  ~55     ~56, '%27%3Cbr%3E%0A'
         70        ECHO                                                     ~55
   35    71      > JMP                                                      ->9
         72    >   FE_FREE                                                  $20
   48    73      > RETURN                                                   null

End of function actionclosest_addpointstoresponse

End of class AC.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.41 ms | 1404 KiB | 19 Q