3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<INI_ISH [chorus] And all will surely agree, There's nothing like PHP. [1] It may not be the best way, But it isn't going away. [2] When you don't appear to hack it, Check for a closing bracket. [bridge] Oh, if you don't like this ode, Then please don't look at my code. INI_ISH; preg_match_all( '#^\[([^\]])[^\]]*\]\R\K(?:(?!^\[).)*$#ms', $content, $m ); $map = array_combine($m[1], $m[0]); $map[','] = "\n\n"; $sequence = '1,c,2,c,b,1,c'; echo strtr($sequence, $map);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W06CV
function name:  (null)
number of ops:  22
compiled vars:  !0 = $content, !1 = $m, !2 = $map, !3 = $sequence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Bchorus%5D%0AAnd+all+will+surely+agree%2C%0AThere%27s+nothing+like+PHP.%0A%5B1%5D%0AIt+may+not+be+the+best+way%2C%0ABut+it+isn%27t+going+away.%0A%5B2%5D%0AWhen+you+don%27t+appear+to+hack+it%2C%0ACheck+for+a+closing+bracket.%0A%5Bbridge%5D%0AOh%2C+if+you+don%27t+like+this+ode%2C%0AThen+please+don%27t+look+at+my+code.'
   18     1        INIT_FCALL                                               'preg_match_all'
   19     2        SEND_VAL                                                 '%23%5E%5C%5B%28%5B%5E%5C%5D%5D%29%5B%5E%5C%5D%5D%2A%5C%5D%5CR%5CK%28%3F%3A%28%3F%21%5E%5C%5B%29.%29%2A%24%23ms'
   20     3        SEND_VAR                                                 !0
   21     4        SEND_REF                                                 !1
   18     5        DO_ICALL                                                 
   23     6        INIT_FCALL                                               'array_combine'
          7        FETCH_DIM_R                                      ~6      !1, 1
          8        SEND_VAL                                                 ~6
          9        FETCH_DIM_R                                      ~7      !1, 0
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
   24    13        ASSIGN_DIM                                               !2, '%2C'
         14        OP_DATA                                                  '%0A%0A'
   26    15        ASSIGN                                                   !3, '1%2Cc%2C2%2Cc%2Cb%2C1%2Cc'
   28    16        INIT_FCALL                                               'strtr'
         17        SEND_VAR                                                 !3
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $12     
         20        ECHO                                                     $12
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.83 ms | 1000 KiB | 16 Q