3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "HD Alcoa Earnings Soar; Outlook Stays Upbeat BY By James R. Hagerty and Matthew Day PD 12 July 2011 LP Alcoa Inc.'s profit more than doubled in the second quarter. The giant aluminum producer managed to meet analysts' forecasts. However, profits wereless than expected TD Licence this article via our website: http://example.com"; function headerSplit($input) { static $delimsExpr = '/^(HD|BY|PD|LP|TD)/m'; static $whiteExpr = '/\s+/'; $parts = preg_split($delimsExpr, $input, -1, PREG_SPLIT_DELIM_CAPTURE); $result = array(); $i = 0; $l = count($parts); while ($i < $l) { $result[$parts[$i++]] = preg_replace($whiteExpr, ' ', trim($parts[$i++])); } return $result; } var_dump(headerSplit($string));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8JZnV
function name:  (null)
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'HD+Alcoa+Earnings+Soar%3B+Outlook+Stays+Upbeat%0ABY+By+James+R.+Hagerty+and+Matthew+Day%0APD+12+July+2011%0ALP%0A%0AAlcoa+Inc.%27s+profit+more+than+doubled+in+the+second+quarter.%0AThe+giant+aluminum+producer+managed+to+meet+analysts%27+forecasts.%0A%0AHowever%2C+profits+wereless+than+expected%0A%0ATD%0ALicence+this+article+via+our+website%3A%0A%0Ahttp%3A%2F%2Fexample.com'
   36     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'headersplit'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function headersplit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 15
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 15
Branch analysis from position: 31
Branch analysis from position: 15
filename:       /in/8JZnV
function name:  headerSplit
number of ops:  33
compiled vars:  !0 = $input, !1 = $delimsExpr, !2 = $whiteExpr, !3 = $parts, !4 = $result, !5 = $i, !6 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        BIND_STATIC                                              !1
   20     2        BIND_STATIC                                              !2
   22     3        INIT_FCALL                                               'preg_split'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 -1
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
   24    10        ASSIGN                                                   !4, <array>
   26    11        ASSIGN                                                   !5, 0
   27    12        COUNT                                            ~11     !3
         13        ASSIGN                                                   !6, ~11
   29    14      > JMP                                                      ->29
   30    15    >   POST_INC                                         ~13     !5
         16        FETCH_DIM_R                                      ~14     !3, ~13
         17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAR                                                 !2
         19        SEND_VAL                                                 '+'
         20        INIT_FCALL                                               'trim'
         21        POST_INC                                         ~16     !5
         22        FETCH_DIM_R                                      ~17     !3, ~16
         23        SEND_VAL                                                 ~17
         24        DO_ICALL                                         $18     
         25        SEND_VAR                                                 $18
         26        DO_ICALL                                         $19     
         27        ASSIGN_DIM                                               !4, ~14
         28        OP_DATA                                                  $19
   29    29    >   IS_SMALLER                                               !5, !6
         30      > JMPNZ                                                    ~20, ->15
   33    31    > > RETURN                                                   !4
   34    32*     > RETURN                                                   null

End of function headersplit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.09 ms | 1403 KiB | 22 Q