3v4l.org

run code in 300+ PHP versions simultaneously
<?php $replace = array("Terms of Service ID: #", "(Val: $", "Add'l fee: ", "%)"); $string = "Terms of Service ID: #928374 (Val: $2.50, Add'l fee: 10.25%)"; $result = str_replace($replace, "", $string); $pieces = explode(" ", $result); $pieces[1] = rtrim($pieces[1], ","); print_r($pieces);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MYis8
function name:  (null)
number of ops:  24
compiled vars:  !0 = $replace, !1 = $string, !2 = $result, !3 = $pieces
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'Terms+of+Service+ID%3A+%23928374+%28Val%3A+%242.50%2C+Add%27l+fee%3A+10.25%25%29'
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    6     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '+'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
    7    13        INIT_FCALL                                               'rtrim'
         14        FETCH_DIM_R                                      ~11     !3, 1
         15        SEND_VAL                                                 ~11
         16        SEND_VAL                                                 '%2C'
         17        DO_ICALL                                         $12     
         18        ASSIGN_DIM                                               !3, 1
         19        OP_DATA                                                  $12
    8    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.7 ms | 1399 KiB | 21 Q