3v4l.org

run code in 300+ PHP versions simultaneously
<?php $contents = <<<DATA [transactionDetails] => wsTransactionDetail Object ( [sharesAmount] => [sharesNumber] => [amount] => 33450 [commerceCode] => 1234567890 [buyOrder] => 123321 ) [detailOutput] => wsTransactionDetailOutput Object ( [authorizationCode] => 001122 [paymentTypeCode] => VD [responseCode] => 0 [sharesNumber] => 0 [amount] => 33450 [commerceCode] => 1234567890 [buyOrder] => 123321 ) DATA; $pattern = "~^\h*\[detailOutput] => .*(?:\R(?!\h*\[authorizationCode]).*)*\R\h*(\[authorizationCode] => \d+)(?:\R(?!\h*\[amount]).*)*\R\h*(\[amount] => \d+)~m"; if(preg_match_all($pattern, $contents, $matches, PREG_SET_ORDER, 0)){ echo "Founds:\n"; echo implode("\n", $matches[0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/U8knt
function name:  (null)
number of ops:  18
compiled vars:  !0 = $contents, !1 = $pattern, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5BtransactionDetails%5D+%3D%3E+wsTransactionDetail+Object%0A++++%28%0A++++++++%5BsharesAmount%5D+%3D%3E+%0A++++++++%5BsharesNumber%5D+%3D%3E+%0A++++++++%5Bamount%5D+%3D%3E+33450%0A++++++++%5BcommerceCode%5D+%3D%3E+1234567890%0A++++++++%5BbuyOrder%5D+%3D%3E+123321%0A++++%29%0A%0A%5BdetailOutput%5D+%3D%3E+wsTransactionDetailOutput+Object%0A++++%28%0A++++++++%5BauthorizationCode%5D+%3D%3E+001122%0A++++++++%5BpaymentTypeCode%5D+%3D%3E+VD%0A++++++++%5BresponseCode%5D+%3D%3E+0%0A++++++++%5BsharesNumber%5D+%3D%3E+0%0A++++++++%5Bamount%5D+%3D%3E+33450%0A++++++++%5BcommerceCode%5D+%3D%3E+1234567890%0A++++++++%5BbuyOrder%5D+%3D%3E+123321%0A++++%29'
   25     1        ASSIGN                                                   !1, '%7E%5E%5Ch%2A%5C%5BdetailOutput%5D+%3D%3E+.%2A%28%3F%3A%5CR%28%3F%21%5Ch%2A%5C%5BauthorizationCode%5D%29.%2A%29%2A%5CR%5Ch%2A%28%5C%5BauthorizationCode%5D+%3D%3E+%5Cd%2B%29%28%3F%3A%5CR%28%3F%21%5Ch%2A%5C%5Bamount%5D%29.%2A%29%2A%5CR%5Ch%2A%28%5C%5Bamount%5D+%3D%3E+%5Cd%2B%29%7Em'
   27     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        SEND_VAL                                                 2
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $5      
          9      > JMPZ                                                     $5, ->17
   28    10    >   ECHO                                                     'Founds%3A%0A'
   29    11        INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '%0A'
         13        FETCH_DIM_R                                      ~6      !2, 0
         14        SEND_VAL                                                 ~6
         15        DO_ICALL                                         $7      
         16        ECHO                                                     $7
   30    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.54 ms | 1011 KiB | 15 Q