Hi!
I came across very weird bug. I have PHP 7 compiled using lsws webpanel. Everything seems to work correctly while PHP files are invoked via HTTP, but using lsws php binary from shell produces strange results.
First of all I tested if __DIR__ implementation is consistent between all PHP versions: https://3v4l.org/1lRa2 - yup, it is.
Next I created file inside app catalog named test.php. Than I invoked it from outside of the app directory:
You can't event imagine how many tools got broken
PHP also thinks files are located elsewhere:
I came across very weird bug. I have PHP 7 compiled using lsws webpanel. Everything seems to work correctly while PHP files are invoked via HTTP, but using lsws php binary from shell produces strange results.
First of all I tested if __DIR__ implementation is consistent between all PHP versions: https://3v4l.org/1lRa2 - yup, it is.
Next I created file inside app catalog named test.php. Than I invoked it from outside of the app directory:
Code:
root@server:/home/[redacted]# php app/test.php
string(19) "/home/[redacted]/app"
root@server:/home/[redacted]# php7 app/test.php
string(23) "/home/[redacted]/app/app"
# php --version
PHP 5.6.11 (cli) (built: Jul 13 2015 01:48:23) (DEBUG)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
# php7 -v
PHP 7.0.0 (litespeed) (built: Dec 4 2015 10:46:45)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
PHP also thinks files are located elsewhere:
Code:
require_once(/home/[redacted]/app/app/bootstrap.php.cache): failed to open stream: No such file or directory in /home/[redacted]/app/app/console on line 10