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; //echo preg_replace("/$\{([^\}]*)\}$/", "here", $js); 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 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
Branch analysis from position: 5
filename:       /in/1sDYF
function name:  (null)
number of ops:  19
compiled vars:  !0 = $js, !1 = $matches, !2 = $vars, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Morris.Donut%28%7B%0A++++element%3A+%27piechart%27%2C%0A++++data%3A+%5B%0A%7Blabel%3A+%27Option+1%27%2C+value%3A+%24%7Bop1%7D%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+2%27%2C+value%3A+%24%7Bop2%7D%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+3%27%2C+value%3A+%24%7Bop3%7D%24+%7D%2C%0A++++++%7Blabel%3A+%27Option+4%27%2C+value%3A+%24%7Bop4%7D%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'
   19     1        ASSIGN                                                   !1, <array>
   20     2        ASSIGN                                                   !2, <array>
   21     3        ASSIGN                                                   !3, 0
   24     4      > JMP                                                      ->9
   27     5    >   POST_INC                                         ~8      !3
          6        FETCH_DIM_R                                      ~10     !1, 1
          7        ASSIGN_DIM                                               !2, ~8
          8        OP_DATA                                                  ~10
   24     9    >   INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%2F%5C%24%5C%7B%28%5B%5E%5C%7D%5D%2A%29%5C%7D%5C%24%2F'
         11        SEND_VAR                                                 !0
         12        SEND_REF                                                 !1
         13        DO_ICALL                                         $11     
         14      > JMPNZ                                                    $11, ->5
   30    15    >   INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.49 ms | 1395 KiB | 17 Q