3v4l.org

run code in 300+ PHP versions simultaneously
<?php $js_file_contents = <<<CONTENTS Survey .StylesManager .applyTheme("default"); var json = { questions: [ { name: "name", type: "text", title: "Please enter your name:", placeHolder: "Jon Snow", isRequired: true }, { name: "birthdate", type: "text", inputType: "date", title: "Your birthdate:", isRequired: true }, { name: "color", type: "text", inputType: "color", title: "Your favorite color:" }, { name: "email", type: "text", inputType: "email", title: "Your e-mail:", placeHolder: "jon.snow@nightwatch.org", isRequired: true, validators: [ { type: "email" } ] } ] }; window.survey = new Survey.Model(json); survey .onComplete .add(function (result) { document .querySelector('#surveyResult') .innerHTML = "result: " + JSON.stringify(result.data); }); $("#surveyElement").Survey({model: survey}); CONTENTS; if (preg_match('~^var json = \K{.*?}(?=;)~ms', $js_file_contents, $match)) { // cut away extra $json = preg_replace('~^\s*\K\w+~m', '"\0"', $match[0]); // quote-wrap the keys var_export(json_decode($json, true)); // convert json string to array and display }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/PvJM4
function name:  (null)
number of ops:  22
compiled vars:  !0 = $js_file_contents, !1 = $match, !2 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Survey%0A++++.StylesManager%0A++++.applyTheme%28%22default%22%29%3B%0A%0Avar+json+%3D+%7B%0A++++questions%3A+%5B%0A++++++++%7B%0A++++++++++++name%3A+%22name%22%2C%0A++++++++++++type%3A+%22text%22%2C%0A++++++++++++title%3A+%22Please+enter+your+name%3A%22%2C%0A++++++++++++placeHolder%3A+%22Jon+Snow%22%2C%0A++++++++++++isRequired%3A+true%0A++++++++%7D%2C+%7B%0A++++++++++++name%3A+%22birthdate%22%2C%0A++++++++++++type%3A+%22text%22%2C%0A++++++++++++inputType%3A+%22date%22%2C%0A++++++++++++title%3A+%22Your+birthdate%3A%22%2C%0A++++++++++++isRequired%3A+true%0A++++++++%7D%2C+%7B%0A++++++++++++name%3A+%22color%22%2C%0A++++++++++++type%3A+%22text%22%2C%0A++++++++++++inputType%3A+%22color%22%2C%0A++++++++++++title%3A+%22Your+favorite+color%3A%22%0A++++++++%7D%2C+%7B%0A++++++++++++name%3A+%22email%22%2C%0A++++++++++++type%3A+%22text%22%2C%0A++++++++++++inputType%3A+%22email%22%2C%0A++++++++++++title%3A+%22Your+e-mail%3A%22%2C%0A++++++++++++placeHolder%3A+%22jon.snow%40nightwatch.org%22%2C%0A++++++++++++isRequired%3A+true%2C%0A++++++++++++validators%3A+%5B%0A++++++++++++++++%7B%0A++++++++++++++++++++type%3A+%22email%22%0A++++++++++++++++%7D%0A++++++++++++%5D%0A++++++++%7D%0A++++%5D%0A%7D%3B%0A%0Awindow.survey+%3D+new+Survey.Model%28json%29%3B%0A%0Asurvey%0A++++.onComplete%0A++++.add%28function+%28result%29+%7B%0A++++++++document%0A++++++++++++.querySelector%28%27%23surveyResult%27%29%0A++++++++++++.innerHTML+%3D+%22result%3A+%22+%2B+JSON.stringify%28result.data%29%3B%0A++++%7D%29%3B%0A%0A%24%28%22%23surveyElement%22%29.Survey%28%7Bmodel%3A+survey%7D%29%3B'
   55     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%5Evar+json+%3D+%5CK%7B.%2A%3F%7D%28%3F%3D%3B%29%7Ems'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $4      
          6      > JMPZ                                                     $4, ->21
   56     7    >   INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%7E%5E%5Cs%2A%5CK%5Cw%2B%7Em'
          9        SEND_VAL                                                 '%22%5C0%22'
         10        FETCH_DIM_R                                      ~5      !1, 0
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !2, $6
   57    14        INIT_FCALL                                               'var_export'
         15        INIT_FCALL                                               'json_decode'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                                 
   58    21    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.68 ms | 1002 KiB | 17 Q