|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-02-24 03:57 UTC] icarosnet at gmail dot com
Description: ------------ hello any way to get highlight_string working in CLI? Test script: --------------- highlight_cli Expected result: ---------------- highlight Actual result: -------------- not exist PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 05:00:01 2025 UTC |
I have verified both the Zend engine topic and the get all token function; but when trying to implement it I get an error: Warning: token_name() expects parameter 1 to be int, string given in C:\xampp\htdocs\dev\t5\BOH-Basic-Output-Handler\src\OutputHandler.php on line 320 NULL string(1) "=" Warning: token_name() expects parameter 1 to be int, string given in C:\xampp\htdocs\dev\t5\BOH-Basic-Output-Handler\src\OutputHandler.php on line 320 NULL string(1) "[" Do you have any idea how to solve the error of these signs? The code you run to test is as follows: $test = ' <?php ' . PHP_EOL . ' $array=["data1","data2"]; ' . PHP_EOL . ' ?> '; $tokenstring = token_get_all($test); foreach ($tokenstring as $key => $arraytoken) { $tokenname = token_name($arraytoken[0]); echo '<pre>'; echo var_dump($tokenname, $arraytoken); echo '</pre>'; }