docs: function transpileJavaScriptToPHP ({ js, variables }) {
  
      // match all local variables (let, const or var)
      let localVariablesRegex = /[^a-zA-Z0-9_](?:let|const|var)\s+(?:\[([^\]]+)\]|([a-zA-Z0-9_]+))/g // local variables
  
      let allVariables = (variables || []).map (x => x); // clone the array
      // process the variables created in destructuring assignments as well
      let localVariablesMatches
      while (localVariablesMatches = localVariablesRegex.exec (js)) {
          if (localVariablesMatches[1]) {
              // this is a destructuring assignment like
              // let [ a, b, c ] = 'a-b-c'.split ('-')
              let matches = localVariablesMatches[1].trim ().split (', ') // split the destructuring assignment by comma
              matches.forEach (x => allVariables.push (x.trim ())) // trim each variable name
          } else {
              // this is a single variable assignment
              allVariables.push (localVariablesMatches[2].trim ()) // add it to the list of local variables
          }
      }
  
      // match all variables instantiated in the catch()-block of a try-catch clause
      let catchClauseRegex = /catch \(([^)]+)\)/g
      let catchClauseMatches
      while (catchClauseMatches = catchClauseRegex.exec (js)) {
          allVariables.push (catchClauseMatches[1])
      }
  
      // append $ to all variables in the method (PHP syntax demands $ at the beginning of a variable name)
      let phpVariablesRegexes = allVariables.map (x => [ "([^$$a-zA-Z0-9\\.\\>'_/])" + x + "([^a-zA-Z0-9'_/])", '$1$$' + x + '$2' ])
  
      // support for php syntax for object-pointer dereference
      // convert all $variable.property to $variable->property
      let variablePropertiesRegexes = allVariables.map (x => [ "([^a-zA-Z0-9\\.\\>'_])" + x + '\\.', '$1' + x + '->' ])
  
      // transpile JS → PHP
      let phpBody = regexAll (js, phpRegexes.concat (phpVariablesRegexes).concat (variablePropertiesRegexes))
  
      return phpBody
  }