3v4l.org

run code in 300+ PHP versions simultaneously
<?php $js = "Morris.Donut({ element: 'piechart', data: [ {label: 'Option 1', value: ${op1}$ }, {label: 'Option 2', value: ${op2}$ }, {label: 'Option 3', value: ${op3}$ }, {label: 'Option 4', value: ${op4}$ } ], colors: [\"#3228db\", \"#34225e\", \"#1abc3c\", \"#24495e\", \"#9b51b6\", \"#15a5a6\"], formatter: function (y) { return y + \"%\" } });"; //$op1 = 25; //$op2 = 40; //$op3 = 25; //$op4 = 10; $matches = array(); $vars = array(); $i=0; while(preg_match("/\$\{([^\}]*)\}\$/", $js, $matches)){ echo $i; print_r($matches); $vars[$i++] = $matches[1]; } print_r($vars);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 14
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 14
Branch analysis from position: 28
Branch analysis from position: 14
filename:       /in/sSDZL
function name:  (null)
number of ops:  32
compiled vars:  !0 = $js, !1 = $op1, !2 = $op2, !3 = $op3, !4 = $op4, !5 = $matches, !6 = $vars, !7 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ROPE_INIT                                     9  ~9      'Morris.Donut%28%7B%0A++++element%3A+%27piechart%27%2C%0A++++data%3A+%5B%0A%7Blabel%3A+%27Option+1%27%2C+value%3A+'
    6     1        ROPE_ADD                                      1  ~9      ~9, !1
          2        ROPE_ADD                                      2  ~9      ~9, '%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+2%27%2C+value%3A+'
    7     3        ROPE_ADD                                      3  ~9      ~9, !2
          4        ROPE_ADD                                      4  ~9      ~9, '%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+3%27%2C+value%3A+'
    8     5        ROPE_ADD                                      5  ~9      ~9, !3
          6        ROPE_ADD                                      6  ~9      ~9, '%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+4%27%2C+value%3A+'
    9     7        ROPE_ADD                                      7  ~9      ~9, !4
          8        ROPE_END                                      8  ~8      ~9, '%24+%7D%0A++++%5D%2C%0A++++colors%3A+%5B%22%233228db%22%2C+%22%2334225e%22%2C+%22%231abc3c%22%2C+%22%2324495e%22%2C+%22%239b51b6%22%2C+%22%2315a5a6%22%5D%2C%0A++++formatter%3A+function+%28y%29+%7B+return+y+%2B+%22%25%22+%7D%0A+%7D%29%3B'
    3     9        ASSIGN                                                   !0, ~8
   19    10        ASSIGN                                                   !5, <array>
   20    11        ASSIGN                                                   !6, <array>
   21    12        ASSIGN                                                   !7, 0
   23    13      > JMP                                                      ->22
   24    14    >   ECHO                                                     !7
   25    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                                 
   26    18        POST_INC                                         ~19     !7
         19        FETCH_DIM_R                                      ~21     !5, 1
         20        ASSIGN_DIM                                               !6, ~19
         21        OP_DATA                                                  ~21
   23    22    >   INIT_FCALL                                               'preg_match'
         23        SEND_VAL                                                 '%2F%24%5C%7B%28%5B%5E%5C%7D%5D%2A%29%5C%7D%24%2F'
         24        SEND_VAR                                                 !0
         25        SEND_REF                                                 !5
         26        DO_ICALL                                         $22     
         27      > JMPNZ                                                    $22, ->14
   29    28    >   INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !6
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.64 ms | 1396 KiB | 17 Q