Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in C:\wamp\www\advanced2021\vendor\myclabs\deep-copy\src\DeepCopy\deep_copy.php on line 5


(liway476) #1
# Time Memory Function Location
1 0.0052 137088 {main}( ) …\index.php : 0
2 0.0088 138336 require( ‘C:\wamp\www\advanced2021\vendor\autoload.php’ ) …\index.php : 5
3 0.0134 150768 ComposerAutoloaderInit499ee76167dd9547bfe98e9b05ba4d15::getLoader( ) …\autoload.php : 7
4 0.1205 623896 composerRequire499ee76167dd9547bfe98e9b05ba4d15( ) …\autoload_real.php : 56

(Eloy Gonzalez) #2

Hi @liway476;

Please paste your Line code on forum to check error syntax…

Thx!


(liway476) #3

Parse error: syntax error, unexpected ‘function’ (T_FUNCTION), expecting identifier (T_STRING) or \ (T_NS_SEPARATOR) in C:\wamp\www\advanced2021\vendor\myclabs\deep-copy\src\DeepCopy\deep_copy.php on line 5;
138336
require( ‘C:\wamp\www\advanced2021\vendor\autoload.php’ )
…\index.php:5
3
0.0094
150768
ComposerAutoloaderInit499ee76167dd9547bfe98e9b05ba4d15::getLoader( )
…\autoload.php:7
4
0.0458
623896
composerRequire499ee76167dd9547bfe98e9b05ba4d15( )
…\autoload_real.php:56

It is code in C:\wamp\www\advanced2021\vendor\myclabs\deep-copy\src\DeepCopy\deep_copy.php on line 5

“use function function_exists;”

THank you very much!


#4

You need PHP 5.6+ to use this syntax. Either upgrade your PHP or downgrade myclabs/deep-copy to version which will work with your PHP version.