token_get_all

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Split given source into PHP tokens
<?php token_get_all(string $code, int $flags = 0): array
<?php         $originalContents = file_get_contents($parameters['viewFile']);

        $newContents = str_replace('$'.$parameters['variableName'], '$'.$parameters['variableName']." ?? ''", $originalContents);



        $originalTokens = token_get_all(Blade::compileString($originalContents));

        $newTokens = token_get_all(Blade::compileString($newContents));



        $expectedTokens = $this->generateExpectedTokens($originalTokens, $parameters['variableName']);
<?php         $newContents = str_replace('$'.$parameters['variableName'], '$'.$parameters['variableName']." ?? ''", $originalContents);



        $originalTokens = token_get_all(Blade::compileString($originalContents));

        $newTokens = token_get_all(Blade::compileString($newContents));



        $expectedTokens = $this->generateExpectedTokens($originalTokens, $parameters['variableName']);