3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subscription = json_decode('{ "Subscription": { "Id": 18849027, "Subscriptionstatus": 1, "NextBillingDate": "2018-07-08T15:31:08.654877", "NextBillingDateReminder": "2018-07-01T15:31:08.654877Z", "GracePeriodDays": 0, "StartIntervalDayCount": 0, "StartIntervalMonthCount": 1, "IntervalDayCount": 0, "IntervalMonthCount": 1, "CustomerId": 73771655, "CustomerReferenceId": "6kQ5CSMofkLdC0GQCn0EMgPzfAJ4ctN3F2JsAWQJ", "CustomerCurrencyId": "EUR", "CustomerReferenceNo": "", "LastIntervalNo": 22, "StartDate": "2016-08-08T15:31:08.654877", "EndDate": null, "Items": [ { "SubscriptionId": 18849027, "RunningNo": 1, "Quantity": 1, "ProductId": 82973, "ProductName": "FastBill Complete", "ProductNameExtension": "Monats-Abonnement", "RecurrenceCount": null, "Status": 1, "DeactivationDate": null, "StartDate": "2016-08-08T15:31:08.654877", "EndDate": null, "LastIntervalNo": 22, "IsCurrent": true, "Version": 1, "Couponcode": "", "PromotionId": null, "SubscriptionPurchaseItems": [ { "PurchaseId": 95742459, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 0 }, { "PurchaseId": 97512712, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 1 }, { "PurchaseId": 103064464, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 4 }, { "PurchaseId": 108481281, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 7 }, { "PurchaseId": 112016777, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 9 }, { "PurchaseId": 113701986, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 10 }, { "PurchaseId": 115302274, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 11 }, { "PurchaseId": 117286219, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 12 }, { "PurchaseId": 119449074, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 13 }, { "PurchaseId": 123308459, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 15 }, { "PurchaseId": 125233367, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 16 }, { "PurchaseId": 127322800, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 17 }, { "PurchaseId": 131151673, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 19 }, { "PurchaseId": 132734325, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 20 }, { "PurchaseId": 135749578, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 21 }, { "PurchaseId": 138141409, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 22 }, { "PurchaseId": 129265950, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 18 }, { "PurchaseId": 99299879, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 2 }, { "PurchaseId": 101140707, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 3 }, { "PurchaseId": 104979919, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 5 }, { "PurchaseId": 106823347, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 6 }, { "PurchaseId": 110335886, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 8 }, { "PurchaseId": 121485688, "PurchaseItemRunningNo": 1, "SubscriptionIntervalNo": 14 } ] } ] }, "ResultMessage": "OK" }'); function cmp($a, $b) { if ($a['SubscriptionIntervalNo'] == $b['SubscriptionIntervalNo']) { return 0; } return ($a['SubscriptionIntervalNo'] < $b['SubscriptionIntervalNo']) ? -1 : 1; } print_r($subscription->Subscription->Items[0]->SubscriptionPurchaseItems); print_r(usort($subscription->Subscription->Items[0]->SubscriptionPurchaseItems,"cmp")); print_r($subscription);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ij8ls
function name:  (null)
number of ops:  26
compiled vars:  !0 = $subscription
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A++++%22Subscription%22%3A+%7B%0A++++++++%22Id%22%3A+18849027%2C%0A++++++++%22Subscriptionstatus%22%3A+1%2C%0A++++++++%22NextBillingDate%22%3A+%222018-07-08T15%3A31%3A08.654877%22%2C%0A++++++++%22NextBillingDateReminder%22%3A+%222018-07-01T15%3A31%3A08.654877Z%22%2C%0A++++++++%22GracePeriodDays%22%3A+0%2C%0A++++++++%22StartIntervalDayCount%22%3A+0%2C%0A++++++++%22StartIntervalMonthCount%22%3A+1%2C%0A++++++++%22IntervalDayCount%22%3A+0%2C%0A++++++++%22IntervalMonthCount%22%3A+1%2C%0A++++++++%22CustomerId%22%3A+73771655%2C%0A++++++++%22CustomerReferenceId%22%3A+%226kQ5CSMofkLdC0GQCn0EMgPzfAJ4ctN3F2JsAWQJ%22%2C%0A++++++++%22CustomerCurrencyId%22%3A+%22EUR%22%2C%0A++++++++%22CustomerReferenceNo%22%3A+%22%22%2C%0A++++++++%22LastIntervalNo%22%3A+22%2C%0A++++++++%22StartDate%22%3A+%222016-08-08T15%3A31%3A08.654877%22%2C%0A++++++++%22EndDate%22%3A+null%2C%0A++++++++%22Items%22%3A+%5B%0A++++++++++++%7B%0A++++++++++++++++%22SubscriptionId%22%3A+18849027%2C%0A++++++++++++++++%22RunningNo%22%3A+1%2C%0A++++++++++++++++%22Quantity%22%3A+1%2C%0A++++++++++++++++%22ProductId%22%3A+82973%2C%0A++++++++++++++++%22ProductName%22%3A+%22FastBill+Complete%22%2C%0A++++++++++++++++%22ProductNameExtension%22%3A+%22Monats-Abonnement%22%2C%0A++++++++++++++++%22RecurrenceCount%22%3A+null%2C%0A++++++++++++++++%22Status%22%3A+1%2C%0A++++++++++++++++%22DeactivationDate%22%3A+null%2C%0A++++++++++++++++%22StartDate%22%3A+%222016-08-08T15%3A31%3A08.654877%22%2C%0A++++++++++++++++%22EndDate%22%3A+null%2C%0A++++++++++++++++%22LastIntervalNo%22%3A+22%2C%0A++++++++++++++++%22IsCurrent%22%3A+true%2C%0A++++++++++++++++%22Version%22%3A+1%2C%0A++++++++++++++++%22Couponcode%22%3A+%22%22%2C%0A++++++++++++++++%22PromotionId%22%3A+null%2C%0A++++++++++++++++%22SubscriptionPurchaseItems%22%3A+%5B%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+95742459%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+0%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+97512712%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+1%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+103064464%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+4%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+108481281%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+7%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+112016777%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+9%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+113701986%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+10%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+115302274%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+11%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+117286219%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+12%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+119449074%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+13%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+123308459%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+15%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+125233367%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+16%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+127322800%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+17%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+131151673%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+19%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+132734325%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+20%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+135749578%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+21%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+138141409%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+22%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+129265950%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+18%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+99299879%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+2%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+101140707%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+3%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+104979919%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+5%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+106823347%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+6%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+110335886%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+8%0A++++++++++++++++++++%7D%2C%0A++++++++++++++++++++%7B%0A++++++++++++++++++++++++%22PurchaseId%22%3A+121485688%2C%0A++++++++++++++++++++++++%22PurchaseItemRunningNo%22%3A+1%2C%0A++++++++++++++++++++++++%22SubscriptionIntervalNo%22%3A+14%0A++++++++++++++++++++%7D%0A++++++++++++++++%5D%0A++++++++++++%7D%0A++++++++%5D%0A++++%7D%2C%0A++++%22ResultMessage%22%3A+%22OK%22%0A%7D'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
  168     4        INIT_FCALL                                               'print_r'
          5        FETCH_OBJ_R                                      ~3      !0, 'Subscription'
          6        FETCH_OBJ_R                                      ~4      ~3, 'Items'
          7        FETCH_DIM_R                                      ~5      ~4, 0
          8        FETCH_OBJ_R                                      ~6      ~5, 'SubscriptionPurchaseItems'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
  169    11        INIT_FCALL                                               'print_r'
         12        INIT_FCALL                                               'usort'
         13        FETCH_OBJ_W                                      $8      !0, 'Subscription'
         14        FETCH_OBJ_W                                      $9      $8, 'Items'
         15        FETCH_DIM_W                                      $10     $9, 0
         16        FETCH_OBJ_W                                      $11     $10, 'SubscriptionPurchaseItems'
         17        SEND_REF                                                 $11
         18        SEND_VAL                                                 'cmp'
         19        DO_ICALL                                         $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                                 
  170    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ij8ls
function name:  cmp
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  162     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  163     2        FETCH_DIM_R                                      ~2      !0, 'SubscriptionIntervalNo'
          3        FETCH_DIM_R                                      ~3      !1, 'SubscriptionIntervalNo'
          4        IS_EQUAL                                                 ~2, ~3
          5      > JMPZ                                                     ~4, ->7
  164     6    > > RETURN                                                   0
  166     7    >   FETCH_DIM_R                                      ~5      !0, 'SubscriptionIntervalNo'
          8        FETCH_DIM_R                                      ~6      !1, 'SubscriptionIntervalNo'
          9        IS_SMALLER                                               ~5, ~6
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      -1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      1
         14    > > RETURN                                                   ~8
  167    15*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.15 ms | 955 KiB | 20 Q