3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = json_decode('{"queryNum":1,"profileName":"Bank of Hawaii 1","profileID":"3790328098","metricSetNum":1,"subQueryNum":1,"iterationNum":1,"status":"SUCCESS","sampled":false,"totalResults":17,"columnHeadersArr":{"dim1_1":"Headline 1","dim2_1":"Headline 2","dim3_1":"Description","met1_1":"Impressions","met2_1":"Clicks","met3_1":"Clicks","met3_2":"Impressions","met4_1":"Cost","met4_2":"Clicks","met5_1":"Cost","met6_1":"Conversions","met7_1":"Cost","met7_2":"Conversions","met8_1":"Conversions","met8_2":"Clicks","met_f1_1":"Clicks"},"rows":{"|BOH Checking Account|Bank on the Go|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":13573,"met2_1":3151,"met3_1":23.21520666028144,"met4_1":0.5270168200571248,"met5_1":1660.63,"met6_1":"164","met7_1":10.12579268292683,"met8_1":5.204696921612187},"|BOH Checking Account|Bank on the Go|Convenience checking plus online & mobile banking. Apply now!":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Convenience checking plus online & mobile banking. Apply now!","met1_1":3916,"met2_1":568,"met3_1":14.504596527068436,"met4_1":0.6359330985915492,"met5_1":361.21,"met6_1":"9","met7_1":40.13444444444444,"met8_1":1.584507042253521},"|Bank on the Go|BOH Checking Account|Convenience checking plus online & mobile banking.":{"dim1_1":"Bank on the Go","dim2_1":"BOH Checking Account","dim3_1":"Convenience checking plus online & mobile banking.","met1_1":"762","met2_1":"156","met3_1":20.47244094488189,"met4_1":0.5787820512820513,"met5_1":90.29,"met6_1":"11.00","met7_1":8.208181818181819,"met8_1":7.051282051282051},"|BOH Checking Account|Bank on the Go|Convenience checking plus online & mobile banking.":{"dim1_1":"BOH Checking Account","dim2_1":"Bank on the Go","dim3_1":"Convenience checking plus online & mobile banking.","met1_1":"13027","met2_1":"1376","met3_1":10.562677515928456,"met4_1":1.0944767441860466,"met5_1":1506,"met6_1":"57.00","met7_1":26.42105263157895,"met8_1":4.142441860465116},"|Bank on the Go|BOH Checking Account|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"Bank on the Go","dim2_1":"BOH Checking Account","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":454,"met2_1":97,"met3_1":21.365638766519822,"met4_1":0.34628865979381446,"met5_1":33.59,"met6_1":"1.00","met7_1":33.59,"met8_1":1.0309278350515463},"|BOH Online Checking Account|Bank on the Go|Open a new account online. It\u2019s quick & easy. Apply now!":{"dim1_1":"BOH Online Checking Account","dim2_1":"Bank on the Go","dim3_1":"Open a new account online. It\u2019s quick & easy. Apply now!","met1_1":"266","met2_1":"45","met3_1":16.917293233082706,"met4_1":0.526,"met5_1":23.67,"met6_1":"0.00","met7_1":"","met8_1":0}}}',true); $sortArr = json_decode('{"inQuerySort":{"field":"ConversionRateManyPerClick_perc","direction":"desc","fieldType":"met"},"sortOrig":{"field":"ConversionRateManyPerClick_perc_desc;2nd:Clicks_desc","direction":""},"auto":false,"secondary":{"direction":"desc","field":"Clicks","fieldType":"met","inQuerySort":{"field":"Clicks","direction":"desc","fieldType":"met"},"col":"met2_1"},"intention":"custom","field":"ConversionRateManyPerClick_perc","direction":"desc","fieldType":"met","col":"met8_1"}',true); $sortValuesArr = []; foreach ($results["rows"] as $key => &$row) { $sortValuesArr["first"][$key] = $row[$sortArr["col"]]; $sortValuesArr["second"][$key] = ($sortArr["secondary"]["col"] ? $row[$sortArr["secondary"]["col"]] : ""); } array_multisort( $sortValuesArr["first"], ($sortArr["direction"] == "desc" ? SORT_DESC : SORT_ASC), ($sortArr["fieldType"] == "dim" ? SORT_NATURAL : SORT_NUMERIC), $sortValuesArr["second"], ($sortArr["secondary"]["direction"] == "desc" ? SORT_DESC : SORT_ASC), ($sortArr["secondary"]["fieldType"] == "dim" ? SORT_NATURAL : SORT_NUMERIC), $results["rows"] ); var_dump($sortValuesArr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 13, Position 2 = 33
Branch analysis from position: 13
2 jumps found. (Code = 126) Position 1 = 14, Position 2 = 33
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
Branch analysis from position: 67
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
Branch analysis from position: 59
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
Branch analysis from position: 49
Branch analysis from position: 33
filename:       /in/mXOJg
function name:  (null)
number of ops:  76
compiled vars:  !0 = $results, !1 = $sortArr, !2 = $sortValuesArr, !3 = $row, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22queryNum%22%3A1%2C%22profileName%22%3A%22Bank+of+Hawaii+1%22%2C%22profileID%22%3A%223790328098%22%2C%22metricSetNum%22%3A1%2C%22subQueryNum%22%3A1%2C%22iterationNum%22%3A1%2C%22status%22%3A%22SUCCESS%22%2C%22sampled%22%3Afalse%2C%22totalResults%22%3A17%2C%22columnHeadersArr%22%3A%7B%22dim1_1%22%3A%22Headline+1%22%2C%22dim2_1%22%3A%22Headline+2%22%2C%22dim3_1%22%3A%22Description%22%2C%22met1_1%22%3A%22Impressions%22%2C%22met2_1%22%3A%22Clicks%22%2C%22met3_1%22%3A%22Clicks%22%2C%22met3_2%22%3A%22Impressions%22%2C%22met4_1%22%3A%22Cost%22%2C%22met4_2%22%3A%22Clicks%22%2C%22met5_1%22%3A%22Cost%22%2C%22met6_1%22%3A%22Conversions%22%2C%22met7_1%22%3A%22Cost%22%2C%22met7_2%22%3A%22Conversions%22%2C%22met8_1%22%3A%22Conversions%22%2C%22met8_2%22%3A%22Clicks%22%2C%22met_f1_1%22%3A%22Clicks%22%7D%2C%22rows%22%3A%7B%22%7CBOH+Checking+Account%7CBank+on+the+Go%7COpen+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%3A%7B%22dim1_1%22%3A%22BOH+Checking+Account%22%2C%22dim2_1%22%3A%22Bank+on+the+Go%22%2C%22dim3_1%22%3A%22Open+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%2C%22met1_1%22%3A13573%2C%22met2_1%22%3A3151%2C%22met3_1%22%3A23.21520666028144%2C%22met4_1%22%3A0.5270168200571248%2C%22met5_1%22%3A1660.63%2C%22met6_1%22%3A%22164%22%2C%22met7_1%22%3A10.12579268292683%2C%22met8_1%22%3A5.204696921612187%7D%2C%22%7CBOH+Checking+Account%7CBank+on+the+Go%7CConvenience+checking+plus+online+%26+mobile+banking.+Apply+now%21%22%3A%7B%22dim1_1%22%3A%22BOH+Checking+Account%22%2C%22dim2_1%22%3A%22Bank+on+the+Go%22%2C%22dim3_1%22%3A%22Convenience+checking+plus+online+%26+mobile+banking.+Apply+now%21%22%2C%22met1_1%22%3A3916%2C%22met2_1%22%3A568%2C%22met3_1%22%3A14.504596527068436%2C%22met4_1%22%3A0.6359330985915492%2C%22met5_1%22%3A361.21%2C%22met6_1%22%3A%229%22%2C%22met7_1%22%3A40.13444444444444%2C%22met8_1%22%3A1.584507042253521%7D%2C%22%7CBank+on+the+Go%7CBOH+Checking+Account%7CConvenience+checking+plus+online+%26+mobile+banking.%22%3A%7B%22dim1_1%22%3A%22Bank+on+the+Go%22%2C%22dim2_1%22%3A%22BOH+Checking+Account%22%2C%22dim3_1%22%3A%22Convenience+checking+plus+online+%26+mobile+banking.%22%2C%22met1_1%22%3A%22762%22%2C%22met2_1%22%3A%22156%22%2C%22met3_1%22%3A20.47244094488189%2C%22met4_1%22%3A0.5787820512820513%2C%22met5_1%22%3A90.29%2C%22met6_1%22%3A%2211.00%22%2C%22met7_1%22%3A8.208181818181819%2C%22met8_1%22%3A7.051282051282051%7D%2C%22%7CBOH+Checking+Account%7CBank+on+the+Go%7CConvenience+checking+plus+online+%26+mobile+banking.%22%3A%7B%22dim1_1%22%3A%22BOH+Checking+Account%22%2C%22dim2_1%22%3A%22Bank+on+the+Go%22%2C%22dim3_1%22%3A%22Convenience+checking+plus+online+%26+mobile+banking.%22%2C%22met1_1%22%3A%2213027%22%2C%22met2_1%22%3A%221376%22%2C%22met3_1%22%3A10.562677515928456%2C%22met4_1%22%3A1.0944767441860466%2C%22met5_1%22%3A1506%2C%22met6_1%22%3A%2257.00%22%2C%22met7_1%22%3A26.42105263157895%2C%22met8_1%22%3A4.142441860465116%7D%2C%22%7CBank+on+the+Go%7CBOH+Checking+Account%7COpen+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%3A%7B%22dim1_1%22%3A%22Bank+on+the+Go%22%2C%22dim2_1%22%3A%22BOH+Checking+Account%22%2C%22dim3_1%22%3A%22Open+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%2C%22met1_1%22%3A454%2C%22met2_1%22%3A97%2C%22met3_1%22%3A21.365638766519822%2C%22met4_1%22%3A0.34628865979381446%2C%22met5_1%22%3A33.59%2C%22met6_1%22%3A%221.00%22%2C%22met7_1%22%3A33.59%2C%22met8_1%22%3A1.0309278350515463%7D%2C%22%7CBOH+Online+Checking+Account%7CBank+on+the+Go%7COpen+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%3A%7B%22dim1_1%22%3A%22BOH+Online+Checking+Account%22%2C%22dim2_1%22%3A%22Bank+on+the+Go%22%2C%22dim3_1%22%3A%22Open+a+new+account+online.+It%5Cu2019s+quick+%26+easy.+Apply+now%21%22%2C%22met1_1%22%3A%22266%22%2C%22met2_1%22%3A%2245%22%2C%22met3_1%22%3A16.917293233082706%2C%22met4_1%22%3A0.526%2C%22met5_1%22%3A23.67%2C%22met6_1%22%3A%220.00%22%2C%22met7_1%22%3A%22%22%2C%22met8_1%22%3A0%7D%7D%7D'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !0, $5
    4     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAL                                                 '%7B%22inQuerySort%22%3A%7B%22field%22%3A%22ConversionRateManyPerClick_perc%22%2C%22direction%22%3A%22desc%22%2C%22fieldType%22%3A%22met%22%7D%2C%22sortOrig%22%3A%7B%22field%22%3A%22ConversionRateManyPerClick_perc_desc%3B2nd%3AClicks_desc%22%2C%22direction%22%3A%22%22%7D%2C%22auto%22%3Afalse%2C%22secondary%22%3A%7B%22direction%22%3A%22desc%22%2C%22field%22%3A%22Clicks%22%2C%22fieldType%22%3A%22met%22%2C%22inQuerySort%22%3A%7B%22field%22%3A%22Clicks%22%2C%22direction%22%3A%22desc%22%2C%22fieldType%22%3A%22met%22%7D%2C%22col%22%3A%22met2_1%22%7D%2C%22intention%22%3A%22custom%22%2C%22field%22%3A%22ConversionRateManyPerClick_perc%22%2C%22direction%22%3A%22desc%22%2C%22fieldType%22%3A%22met%22%2C%22col%22%3A%22met8_1%22%7D'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
    6    10        ASSIGN                                                   !2, <array>
    7    11        FETCH_DIM_W                                      $10     !0, 'rows'
         12      > FE_RESET_RW                                      $11     $10, ->33
         13    > > FE_FETCH_RW                                      ~12     $11, !3, ->33
         14    >   ASSIGN                                                   !4, ~12
    8    15        FETCH_DIM_R                                      ~16     !1, 'col'
         16        FETCH_DIM_R                                      ~17     !3, ~16
         17        FETCH_DIM_W                                      $14     !2, 'first'
         18        ASSIGN_DIM                                               $14, !4
         19        OP_DATA                                                  ~17
    9    20        FETCH_DIM_R                                      ~20     !1, 'secondary'
         21        FETCH_DIM_R                                      ~21     ~20, 'col'
         22      > JMPZ                                                     ~21, ->28
         23    >   FETCH_DIM_R                                      ~22     !1, 'secondary'
         24        FETCH_DIM_R                                      ~23     ~22, 'col'
         25        FETCH_DIM_R                                      ~24     !3, ~23
         26        QM_ASSIGN                                        ~25     ~24
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~25     ''
         29    >   FETCH_DIM_W                                      $18     !2, 'second'
         30        ASSIGN_DIM                                               $18, !4
         31        OP_DATA                                                  ~25
    7    32      > JMP                                                      ->13
         33    >   FE_FREE                                                  $11
   14    34        INIT_FCALL                                               'array_multisort'
   15    35        FETCH_DIM_W                                      $26     !2, 'first'
         36        SEND_REF                                                 $26
   16    37        FETCH_DIM_R                                      ~27     !1, 'direction'
         38        IS_EQUAL                                                 ~27, 'desc'
         39      > JMPZ                                                     ~28, ->42
         40    >   QM_ASSIGN                                        ~29     3
         41      > JMP                                                      ->43
         42    >   QM_ASSIGN                                        ~29     4
         43    >   SEND_VAL                                                 ~29
   17    44        FETCH_DIM_R                                      ~30     !1, 'fieldType'
         45        IS_EQUAL                                                 ~30, 'dim'
         46      > JMPZ                                                     ~31, ->49
         47    >   QM_ASSIGN                                        ~32     6
         48      > JMP                                                      ->50
         49    >   QM_ASSIGN                                        ~32     1
         50    >   SEND_VAL                                                 ~32
   18    51        FETCH_DIM_W                                      $33     !2, 'second'
         52        SEND_REF                                                 $33
   19    53        FETCH_DIM_R                                      ~34     !1, 'secondary'
         54        FETCH_DIM_R                                      ~35     ~34, 'direction'
         55        IS_EQUAL                                                 ~35, 'desc'
         56      > JMPZ                                                     ~36, ->59
         57    >   QM_ASSIGN                                        ~37     3
         58      > JMP                                                      ->60
         59    >   QM_ASSIGN                                        ~37     4
         60    >   SEND_VAL                                                 ~37
   20    61        FETCH_DIM_R                                      ~38     !1, 'secondary'
         62        FETCH_DIM_R                                      ~39     ~38, 'fieldType'
         63        IS_EQUAL                                                 ~39, 'dim'
         64      > JMPZ                                                     ~40, ->67
         65    >   QM_ASSIGN                                        ~41     6
         66      > JMP                                                      ->68
         67    >   QM_ASSIGN                                        ~41     1
         68    >   SEND_VAL                                                 ~41
   21    69        FETCH_DIM_W                                      $42     !0, 'rows'
         70        SEND_REF                                                 $42
         71        DO_ICALL                                                 
   24    72        INIT_FCALL                                               'var_dump'
         73        SEND_VAR                                                 !2
         74        DO_ICALL                                                 
         75      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.79 ms | 1408 KiB | 19 Q