3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'CPC >= $0 (Yesterday)', 'CPC (Link) > $100 (Today)' ]; foreach ($strings as $string) { list($metric, $sign, $digit, $time) = preg_match('~([\w ()]+) ([><]=?) \$(\d+) \(([^)]+)\)~', $string, $out) ? array_slice($out, 1) : ['', '', '', '']; echo "metric: $metric, sign: $sign, digit: $digit, time: $time\n"; var_export($metric); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($sign); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($digit); // notice no leading or trailing spaces / unwanted characters in the output echo "\n"; var_export($time); // notice no leading or trailing spaces / unwanted characters in the output echo "\n----------\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 52
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 52
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/pjsBE
function name:  (null)
number of ops:  54
compiled vars:  !0 = $strings, !1 = $string, !2 = $out, !3 = $metric, !4 = $sign, !5 = $digit, !6 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1      > FE_RESET_R                                       $8      !0, ->52
          2    > > FE_FETCH_R                                               $8, !1, ->52
    8     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%7E%28%5B%5Cw+%28%29%5D%2B%29+%28%5B%3E%3C%5D%3D%3F%29+%5C%24%28%5Cd%2B%29+%5C%28%28%5B%5E%29%5D%2B%29%5C%29%7E'
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $9      
          8      > JMPZ                                                     $9, ->15
          9    >   INIT_FCALL                                               'array_slice'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 1
         12        DO_ICALL                                         $10     
         13        QM_ASSIGN                                        ~11     $10
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~11     <array>
         16    >   FETCH_LIST_R                                     $12     ~11, 0
         17        ASSIGN                                                   !3, $12
         18        FETCH_LIST_R                                     $14     ~11, 1
         19        ASSIGN                                                   !4, $14
         20        FETCH_LIST_R                                     $16     ~11, 2
         21        ASSIGN                                                   !5, $16
         22        FETCH_LIST_R                                     $18     ~11, 3
         23        ASSIGN                                                   !6, $18
         24        FREE                                                     ~11
   10    25        ROPE_INIT                                     9  ~21     'metric%3A+'
         26        ROPE_ADD                                      1  ~21     ~21, !3
         27        ROPE_ADD                                      2  ~21     ~21, '%2C+sign%3A+'
         28        ROPE_ADD                                      3  ~21     ~21, !4
         29        ROPE_ADD                                      4  ~21     ~21, '%2C+digit%3A+'
         30        ROPE_ADD                                      5  ~21     ~21, !5
         31        ROPE_ADD                                      6  ~21     ~21, '%2C+time%3A+'
         32        ROPE_ADD                                      7  ~21     ~21, !6
         33        ROPE_END                                      8  ~20     ~21, '%0A'
         34        ECHO                                                     ~20
   11    35        INIT_FCALL                                               'var_export'
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                                 
   12    38        ECHO                                                     '%0A'
   13    39        INIT_FCALL                                               'var_export'
         40        SEND_VAR                                                 !4
         41        DO_ICALL                                                 
   14    42        ECHO                                                     '%0A'
   15    43        INIT_FCALL                                               'var_export'
         44        SEND_VAR                                                 !5
         45        DO_ICALL                                                 
   16    46        ECHO                                                     '%0A'
   17    47        INIT_FCALL                                               'var_export'
         48        SEND_VAR                                                 !6
         49        DO_ICALL                                                 
   18    50        ECHO                                                     '%0A----------%0A'
    7    51      > JMP                                                      ->2
         52    >   FE_FREE                                                  $8
   19    53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.98 ms | 1017 KiB | 16 Q