3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_data['data'] = explode("\n", 'MEL1INFA73 Confirmed. Ksh29.00 sent to Safaricom Offers for account Tunukiwa on 21/5/18 at 3:29 AM New M-PESA balance is Ksh5.50. Transaction cost, Ksh0.00. MEE6ESSVCS Confirmed. Ksh2,240.00 paid to Naivas West End Plaza. on 14/5/18 at 8:13 PM.New M-PESA balance is Ksh4,753.50. Transaction cost, Ksh0.00. MEF1EZ0MNR Confirmed.You have received Ksh10,000.00 from Barclays Bank K LTD 303031 on 15/5/18 at 9:36 AM New M-PESA balance is Ksh14,775.50. Buy goods with M-PESA'); $AllItems = implode(" ", $json_data["data"]); preg_match_all("/ksh\s*(\d+\.\d+)/i", str_replace(",","",$AllItems), $matches); $total = array_sum($matches[1]); echo $total;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pk7YT
function name:  (null)
number of ops:  29
compiled vars:  !0 = $json_data, !1 = $AllItems, !2 = $matches, !3 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '%0A'
          2        SEND_VAL                                                 'MEL1INFA73+Confirmed.+Ksh29.00+sent+to+Safaricom+Offers+for+account+Tunukiwa+on+21%2F5%2F18+at+3%3A29+AM+New+M-PESA+balance+is+Ksh5.50.+Transaction+cost%2C+Ksh0.00.%0AMEE6ESSVCS+Confirmed.+Ksh2%2C240.00+paid+to+Naivas+West+End+Plaza.+on+14%2F5%2F18+at+8%3A13+PM.New+M-PESA+balance+is+Ksh4%2C753.50.+Transaction+cost%2C+Ksh0.00.%0AMEF1EZ0MNR+Confirmed.You+have+received+Ksh10%2C000.00+from+Barclays+Bank+K+LTD+303031+on+15%2F5%2F18+at+9%3A36+AM+New+M-PESA+balance+is+Ksh14%2C775.50.+Buy+goods+with+M-PESA'
          3        DO_ICALL                                         $5      
          4        ASSIGN_DIM                                               !0, 'data'
          5        OP_DATA                                                  $5
    7     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '+'
          8        FETCH_DIM_R                                      ~6      !0, 'data'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
    8    12        INIT_FCALL                                               'preg_match_all'
         13        SEND_VAL                                                 '%2Fksh%5Cs%2A%28%5Cd%2B%5C.%5Cd%2B%29%2Fi'
         14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        SEND_REF                                                 !2
         21        DO_ICALL                                                 
    9    22        INIT_FCALL                                               'array_sum'
         23        FETCH_DIM_R                                      ~11     !2, 1
         24        SEND_VAL                                                 ~11
         25        DO_ICALL                                         $12     
         26        ASSIGN                                                   !3, $12
   11    27        ECHO                                                     !3
   12    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.91 ms | 1401 KiB | 23 Q