cyberRobot Posted October 31, 2019 Share Posted October 31, 2019 I have a number of PHP helper scripts that are stored outside the root directory of my websites. Those scripts may be used by one or more of my websites. Let's say I have two websites Website A uses PHP 7.0 Website B uses PHP 7.3 Will the helper scripts be potentially executed using different versions of PHP? In other words, if Website B calls a helper script using a require statement, does that helper script execute as PHP 7.3? But if Website A calls the script, it would be executed as PHP 7.0. Quote Link to comment https://forums.phpfreaks.com/topic/309442-what-version-of-php-does-code-stored-outside-the-root-use/ Share on other sites More sharing options...
Barand Posted October 31, 2019 Share Posted October 31, 2019 That is what I would expect. Easily verified with a helper function that returns the php verson. Quote Link to comment https://forums.phpfreaks.com/topic/309442-what-version-of-php-does-code-stored-outside-the-root-use/#findComment-1571138 Share on other sites More sharing options...
cyberRobot Posted October 31, 2019 Author Share Posted October 31, 2019 8 minutes ago, Barand said: Easily verified with a helper function that returns the php verson. Ah...didn't even think of that. Yep, the version of PHP is dependent on the website that calls the helper script. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/309442-what-version-of-php-does-code-stored-outside-the-root-use/#findComment-1571139 Share on other sites More sharing options...
requinix Posted October 31, 2019 Share Posted October 31, 2019 PHP scripts aren't programs. They don't execute themselves. They are interpreted. Which means how they're interpreted depends on what is doing the interpreting. Quote Link to comment https://forums.phpfreaks.com/topic/309442-what-version-of-php-does-code-stored-outside-the-root-use/#findComment-1571141 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.