3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Facebook\WebDriver\Remote\RemoteWebDriver; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Chrome\ChromeOptions; $capabilities = DesiredCapabilities::chrome(); $options = new ChromeOptions; $options->addArguments(["--verbose"]); /* * change this to whatever you want... */ $preferences = ["download.default_directory"=> $myDownloadDir , "directory_upgrade"=> true, "safebrowsing.enabled"=> true, "download.prompt_for_download"=> false, ]; chrome_options.add_experimental_option("prefs", $preferences); $options->setExperimentalOption($prefs, $value); $capabilities->setCapability(ChromeOptions::CAPABILITY, $options); $chromeWebDriver = RemoteWebDriver::create($mySeleniumUrl, $capabilities);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oUHjC
function name:  (null)
number of ops:  36
compiled vars:  !0 = $capabilities, !1 = $options, !2 = $preferences, !3 = $myDownloadDir, !4 = $prefs, !5 = $value, !6 = $chromeWebDriver, !7 = $mySeleniumUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'Facebook%5CWebDriver%5CRemote%5CDesiredCapabilities', 'chrome'
          1        DO_FCALL                                      0  $8      
          2        ASSIGN                                                   !0, $8
    6     3        NEW                                              $10     'Facebook%5CWebDriver%5CChrome%5CChromeOptions'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $10
    8     6        INIT_METHOD_CALL                                         !1, 'addArguments'
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
   13     9        INIT_ARRAY                                       ~14     !3, 'download.default_directory'
         10        ADD_ARRAY_ELEMENT                                ~14     <true>, 'directory_upgrade'
         11        ADD_ARRAY_ELEMENT                                ~14     <true>, 'safebrowsing.enabled'
         12        ADD_ARRAY_ELEMENT                                ~14     <false>, 'download.prompt_for_download'
         13        ASSIGN                                                   !2, ~14
   18    14        FETCH_CONSTANT                                   ~16     'chrome_options'
         15        INIT_FCALL_BY_NAME                                       'add_experimental_option'
         16        SEND_VAL_EX                                              'prefs'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $17     
         19        CONCAT                                           ~18     ~16, $17
         20        FREE                                                     ~18
   19    21        INIT_METHOD_CALL                                         !1, 'setExperimentalOption'
         22        SEND_VAR_EX                                              !4
         23        SEND_VAR_EX                                              !5
         24        DO_FCALL                                      0          
   21    25        INIT_METHOD_CALL                                         !0, 'setCapability'
         26        FETCH_CLASS_CONSTANT                             ~20     'Facebook%5CWebDriver%5CChrome%5CChromeOptions', 'CAPABILITY'
         27        SEND_VAL_EX                                              ~20
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0          
   23    30        INIT_STATIC_METHOD_CALL                                  'Facebook%5CWebDriver%5CRemote%5CRemoteWebDriver', 'create'
         31        SEND_VAR_EX                                              !7
         32        SEND_VAR_EX                                              !0
         33        DO_FCALL                                      0  $22     
         34        ASSIGN                                                   !6, $22
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.57 ms | 1395 KiB | 13 Q