Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax error, unexpected '?' #56

Open
sinchanroy opened this issue May 10, 2021 · 2 comments
Open

syntax error, unexpected '?' #56

sinchanroy opened this issue May 10, 2021 · 2 comments

Comments

@sinchanroy
Copy link

$ php -S localhost:8080
PHP 5.4.16 Development Server started at Mon May 10 13:23:27 2021
Listening on http://localhost:8080
Document root is /home/si.roy/simple-php-website
Press Ctrl-C to quit.
[Mon May 10 13:23:32 2021] PHP Parse error: syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36
[Mon May 10 13:23:32 2021] ::1:46572 [200]: / - syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36

From Another host :

[si.roy@jenkins ~]$ curl http://localhost:8080


Parse error: syntax error, unexpected '?' in /home/si.roy/simple-php-website/includes/functions.php on line 36

[si.roy@jenkins ~]$

PHP Version :
$ php -v
PHP 5.4.16 (cli) (built: Oct 29 2019 09:56:22)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

@Yunsang-Jeong
Copy link

Yunsang-Jeong commented Jul 3, 2021

You need to edit code like below.

[includes/functions.php: line 36]

// $query_string = str_replace('page=', '', $_SERVER['QUERY_STRING'] ?? '');
$query_string = str_replace('page=', '', isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');

Double question mark(??) in php is available after php 7.

@Samkit-shah
Copy link

Can you assign me this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants