3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCode($account, $domain, $sampleRate) { $result = '<script type="text/javascript">' . PHP_EOL . '(function (i, s, o, g, r, a, m) {' . PHP_EOL . 'i[\'GoogleAnalyticsObject\'] = r;' . PHP_EOL . 'i[r] = i[r] || function () {' . PHP_EOL . '(i[r].q = i[r].q || []).push(arguments)' . PHP_EOL . '}, i[r].l = 1 * new Date();' . PHP_EOL . 'a = s.createElement(o),' . PHP_EOL . 'm = s.getElementsByTagName(o)[0];' . PHP_EOL . 'a.async = 1;' . PHP_EOL . 'a.src = g;' . PHP_EOL . 'm.parentNode.insertBefore(a, m)' . PHP_EOL . '})(window, document, \'script\', \'//www.google-analytics.com/analytics.js\', \'ga\');' . PHP_EOL . 'ga(\'create\', \'' . $this->account . '\',' . PHP_EOL . '{' . PHP_EOL . '\'cookieDomain\': \'' . $this->domain . '\',' . PHP_EOL . '\'siteSpeedSampleRate\': \'' . $this->sampleRate .'\'' . PHP_EOL . '}' . PHP_EOL . ');' . PHP_EOL . 'ga(\'send\', \'pageview\');' . PHP_EOL . '</script>'; return $result; } echo getCode('1', 'livejasmin.com', 100);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LinS1
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'getcode'
          1        SEND_VAL                                                 '1'
          2        SEND_VAL                                                 'livejasmin.com'
          3        SEND_VAL                                                 100
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
          6      > RETURN                                                   1

Function getcode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LinS1
function name:  getCode
number of ops:  32
compiled vars:  !0 = $account, !1 = $domain, !2 = $sampleRate, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   16     3        FETCH_THIS                                       $4      
          4        FETCH_OBJ_R                                      ~5      $4, 'account'
          5        CONCAT                                           ~6      '%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A%28function+%28i%2C+s%2C+o%2C+g%2C+r%2C+a%2C+m%29+%7B%0Ai%5B%27GoogleAnalyticsObject%27%5D+%3D+r%3B%0Ai%5Br%5D+%3D+i%5Br%5D+%7C%7C+function+%28%29+%7B%0A%28i%5Br%5D.q+%3D+i%5Br%5D.q+%7C%7C+%5B%5D%29.push%28arguments%29%0A%7D%2C+i%5Br%5D.l+%3D+1+%2A+new+Date%28%29%3B%0Aa+%3D+s.createElement%28o%29%2C%0Am+%3D+s.getElementsByTagName%28o%29%5B0%5D%3B%0Aa.async+%3D+1%3B%0Aa.src+%3D+g%3B%0Am.parentNode.insertBefore%28a%2C+m%29%0A%7D%29%28window%2C+document%2C+%27script%27%2C+%27%2F%2Fwww.google-analytics.com%2Fanalytics.js%27%2C+%27ga%27%29%3B%0Aga%28%27create%27%2C+%27', ~5
          6        CONCAT                                           ~7      ~6, '%27%2C'
          7        CONCAT                                           ~8      ~7, '%0A'
   17     8        CONCAT                                           ~9      ~8, '%7B'
          9        CONCAT                                           ~10     ~9, '%0A'
   18    10        CONCAT                                           ~11     ~10, '%27cookieDomain%27%3A+%27'
         11        FETCH_THIS                                       $12     
         12        FETCH_OBJ_R                                      ~13     $12, 'domain'
         13        CONCAT                                           ~14     ~11, ~13
         14        CONCAT                                           ~15     ~14, '%27%2C'
         15        CONCAT                                           ~16     ~15, '%0A'
   19    16        CONCAT                                           ~17     ~16, '%27siteSpeedSampleRate%27%3A+%27'
         17        FETCH_THIS                                       $18     
         18        FETCH_OBJ_R                                      ~19     $18, 'sampleRate'
         19        CONCAT                                           ~20     ~17, ~19
         20        CONCAT                                           ~21     ~20, '%27'
         21        CONCAT                                           ~22     ~21, '%0A'
   20    22        CONCAT                                           ~23     ~22, '%7D'
         23        CONCAT                                           ~24     ~23, '%0A'
   21    24        CONCAT                                           ~25     ~24, '%29%3B'
         25        CONCAT                                           ~26     ~25, '%0A'
   22    26        CONCAT                                           ~27     ~26, 'ga%28%27send%27%2C+%27pageview%27%29%3B'
         27        CONCAT                                           ~28     ~27, '%0A'
   23    28        CONCAT                                           ~29     ~28, '%3C%2Fscript%3E'
    3    29        ASSIGN                                                   !3, ~29
   25    30      > RETURN                                                   !3
   26    31*     > RETURN                                                   null

End of function getcode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.38 ms | 1407 KiB | 14 Q