|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-11-05 15:34 UTC] sametsahindogan at gmail dot com
Description: ------------ I was using a php 7.4 version lower than php 7.4.12 on my server. When I updated to PHP version to 7.4.12, I noticed that Laravel and the preloader were not working. I can't find what is wrong with these script. But when I create new object from Laravel Eloquent Model (e.g User.php in default Laravel file), then PHP throws an interested exceptions like "using $this when not in object context". But If I disable preloader everythings work fine. Last minor version of php 7.4 there is no error like that. This is my script for preloading -> https://github.com/brendt/laravel-preload/blob/master/preload.php P.S: I tested a clean php&laravel install on two different servers, result is the same. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 19:00:02 2025 UTC |
We have currently a similar problem switching to PHP version 7.4.12, but without Laravel and on Ubuntu 18.04.5 LTS. We get the following error with enabled opcache: Call to undefined method SphinxClient::SetServer() This occurs on the following of code sample ############################################ class sphinxAPI extends SphinxClient { ... function SetServer($host, $port = null) { ... parent::SetServer($this->_servers[0][0], $this->_servers[0][1]); ... ############################################ with opcache.enable = Off everything works as expacted PHP 7.3.24 also work as expactedWe also see another problem with enabled opcache: traits not will be used correctly. Error: Call to undefined method XYZ::do_something() Sample: ################################ trait tX{ protected function do_something(){ } } //--------- abstract class Y extends Z{ use tX; } //--------- class XYZ extends Y{ function __construct(){ $this->do_something(); } } ################################ Version PHP 7.3.24 work as expected