I am new on OSx and have problem with my php installation and SPL functions. Sometimes when I'm trying to access symfony project through apache I'v got an errors showed below.
When spl_autoloader tries to load ParameterBag class:
Warning: class_implements(): Class /.[^.]+.twig$/ does not exist and could not be loaded
Stack trace:
1 in DebugClassLoader.php line 243
2 at ErrorHandler->handleError('2', 'class_implements(): Class /\.[^.]+\.twig$/ does not exist and could not be loaded', '/Users/mtertishniy/sites/dvsota/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php', '243', array('class' => 'Symfony\Component\HttpFoundation\ParameterBag', 'file' => '/Users/mtertishniy/sites/dvsota/vendor/composer/../symfony/symfony/src/Symfony/Component/HttpFoundation/ParameterBag.php', 'exists' => true, 'refl' => object(ReflectionClass), 'name' => 'Symfony\Component\HttpFoundation\ParameterBag', 'notice' => array(), 'len' => '8', 'ns' => 'Symfony\', 'parent' => false, 'parentInterfaces' => array('/\.[^.]+\.twig$/' => '1'), 'deprecatedInterfaces' => array(), 'interface' => '/\.[^.]+\.twig$/'))
3 at class_implements('/\.[^.]+\.twig$/') in DebugClassLoader.php line 243
4 at DebugClassLoader->loadClass('Symfony\Component\HttpFoundation\ParameterBag')
5 at spl_autoload_call('Symfony\Component\HttpFoundation\ParameterBag') in Request.php line 247
Other strange error:
OutOfMemoryException in DebugClassLoader.php line 243:
Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 140495632205216 bytes)
I've debugged this error and found that in this case autoloader trying to load malformed interface:
I've been installed httpd and PHP 7.1 from brew.
My php modules:
$ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmldiff
xmlreader
xmlrpc
xmlwriter
xsl
yaml
zip
zlib
[Zend Modules]
Xdebug
How to solve this problem?
I've finally figured out! This is bug in core php < 7.2. https://bugs.php.net/bug.php?id=74015
The issue is closed.