3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code =<<<'EOC' <?php /* * This file is part of the Redaktilo project. * * (c) Loïc Chardonnet <loic.chardonnet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Gnugat\Redaktilo\Replace; use Gnugat\Redaktilo\Converter\LineContentConverter; use Gnugat\Redaktilo\File; /** * This strategy manipulates lines stripped of their line break character. * * @api */ class LineReplaceStrategy implements ReplaceStrategy { /** @var LineContentConverter */ private $converter; /** @param LineContentConverter */ public function __construct(LineContentConverter $converter) { $this->converter = $converter; } /** {@inheritdoc} */ public function supports($location) { return (is_int($location) && $location >= 0); } /** {@inheritdoc} */ public function removeAt(File $file, $location) { $lines = $this->converter->from($file); unset($lines[$location]); $this->converter->back($file, $lines); } /** {@inheritdoc} */ public function replaceWith(File $file, $location, $replacement) { $lines = $this->converter->from($file); $lines[$location] = $replacement; $this->converter->back($file, $lines); } /** {@inheritdoc} */ public function insertAt(File $file, $location, $addition) { $lines = $this->converter->from($file); array_splice($lines, $location, 0, $addition); $this->converter->back($file, $lines); } } EOC; var_dump(token_get_all($code));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KCNSO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fphp%0A%0A%2F%2A%0A+%2A+This+file+is+part+of+the+Redaktilo+project.%0A+%2A%0A+%2A+%28c%29+Lo%C3%AFc+Chardonnet+%3Cloic.chardonnet%40gmail.com%3E%0A+%2A%0A+%2A+For+the+full+copyright+and+license+information%2C+please+view+the+LICENSE%0A+%2A+file+that+was+distributed+with+this+source+code.%0A+%2A%2F%0A%0Anamespace+Gnugat%5CRedaktilo%5CReplace%3B%0A%0Ause+Gnugat%5CRedaktilo%5CConverter%5CLineContentConverter%3B%0Ause+Gnugat%5CRedaktilo%5CFile%3B%0A%0A%2F%2A%2A%0A+%2A+This+strategy+manipulates+lines+stripped+of+their+line+break+character.%0A+%2A%0A+%2A+%40api%0A+%2A%2F%0Aclass+LineReplaceStrategy+implements+ReplaceStrategy%0A%7B%0A++++%2F%2A%2A+%40var+LineContentConverter+%2A%2F%0A++++private+%24converter%3B%0A%0A++++%2F%2A%2A+%40param+LineContentConverter+%2A%2F%0A++++public+function+__construct%28LineContentConverter+%24converter%29%0A++++%7B%0A++++++++%24this-%3Econverter+%3D+%24converter%3B%0A++++%7D%0A%0A++++%2F%2A%2A+%7B%40inheritdoc%7D+%2A%2F%0A++++public+function+supports%28%24location%29%0A++++%7B%0A++++++++return+%28is_int%28%24location%29+%26%26+%24location+%3E%3D+0%29%3B%0A++++%7D%0A%0A++++%2F%2A%2A+%7B%40inheritdoc%7D+%2A%2F%0A++++public+function+removeAt%28File+%24file%2C+%24location%29%0A++++%7B%0A++++++++%24lines+%3D+%24this-%3Econverter-%3Efrom%28%24file%29%3B%0A++++++++unset%28%24lines%5B%24location%5D%29%3B%0A++++++++%24this-%3Econverter-%3Eback%28%24file%2C+%24lines%29%3B%0A++++%7D%0A%0A++++%2F%2A%2A+%7B%40inheritdoc%7D+%2A%2F%0A++++public+function+replaceWith%28File+%24file%2C+%24location%2C+%24replacement%29%0A++++%7B%0A++++++++%24lines+%3D+%24this-%3Econverter-%3Efrom%28%24file%29%3B%0A++++++++%24lines%5B%24location%5D+%3D+%24replacement%3B%0A++++++++%24this-%3Econverter-%3Eback%28%24file%2C+%24lines%29%3B%0A++++%7D%0A%0A++++%2F%2A%2A+%7B%40inheritdoc%7D+%2A%2F%0A++++public+function+insertAt%28File+%24file%2C+%24location%2C+%24addition%29%0A++++%7B%0A++++++++%24lines+%3D+%24this-%3Econverter-%3Efrom%28%24file%29%3B%0A++++++++array_splice%28%24lines%2C+%24location%2C+0%2C+%24addition%29%3B%0A++++++++%24this-%3Econverter-%3Eback%28%24file%2C+%24lines%29%3B%0A++++%7D%0A%7D%0A'
   69     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'token_get_all'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.84 ms | 1396 KiB | 17 Q