3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = ' /** * * @param string $script The PHP script * @param string $class The full qualified class name with namespace * @param string $alias An optional alias for the class */ protected function addUseStatement(&$script, $class, $alias = null) { if (isset($this->getTable()->useStatements) && in_array($class, $this->getTable()->useStatements)) { return; } if ($alias) { $script = "use $class as $alias;\n$script"; } else { $script = "use $class;\n$script"; } if (!isset($this->getTable()->useStatements)) { $this->getTable()->useStatements = array(); } $this->getTable()->useStatements[] = $class; } '; print_r(token_get_all("<?php\n$code"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ConXg
function name:  (null)
number of ops:  10
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A++%2F%2A%2A%0A+++%2A%0A+++%2A+%40param+string+%24script+The+PHP+script%0A+++%2A+%40param+string+%24class+The+full+qualified+class+name+with+namespace%0A+++%2A+%40param+string+%24alias+An+optional+alias+for+the+class%0A+++%2A%2F%0A++protected+function+addUseStatement%28%26%24script%2C+%24class%2C+%24alias+%3D+null%29%0A++%7B%0A++++if+%28isset%28%24this-%3EgetTable%28%29-%3EuseStatements%29+%26%26+in_array%28%24class%2C+%24this-%3EgetTable%28%29-%3EuseStatements%29%29+%7B%0A++++++++return%3B%0A++++%7D%0A%0A++++if+%28%24alias%29%0A++++%7B%0A++++++%24script+%3D+%22use+%24class+as+%24alias%3B%5Cn%24script%22%3B%0A++++%7D%0A++++else%0A++++%7B%0A++++++%24script+%3D+%22use+%24class%3B%5Cn%24script%22%3B%0A++++%7D%0A%0A++++if+%28%21isset%28%24this-%3EgetTable%28%29-%3EuseStatements%29%29+%7B%0A++++++++%24this-%3EgetTable%28%29-%3EuseStatements+%3D+array%28%29%3B%0A++++%7D%0A++++%24this-%3EgetTable%28%29-%3EuseStatements%5B%5D+%3D+%24class%3B%0A++%7D%0A'
   32     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'token_get_all'
          3        NOP                                                      
          4        FAST_CONCAT                                      ~2      '%3C%3Fphp%0A', !0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1395 KiB | 17 Q