bad pattern: CLIFrameworkCommandBase::offsetExists
➜ phpbrew phpbrew use php-7.4.28
results on:
PHP Deprecated: Return type of CLIFramework\CommandBase::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/CommandBase.php on line 898
PHP Deprecated: Return type of CLIFramework\CommandBase::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/CommandBase.php on line 908
PHP Deprecated: Return type of CLIFramework\CommandBase::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/phpbrew/vendor/corneltek/cliframework/src/CommandBase.php on line 903
....
PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in phar:///usr/local/bin/phpbrew/vendor/corneltek/getoptionkit/src/Option.php on line 133
....
bad pattern: CLIFrameworkCommandBase::offsetExists
Running: MacOS 12.2.1 with PHP installed first via homebrow: ➜ php -v
PHP 8.1.4 (cli) (built: Mar 18 2022 09:45:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
Same problem. I compiled and installed 7.4. Everything went through, but when we run which php it returns /usr/local/bin/php, the preinstalled PHP. Attempting to run phpbrew switch php-7.4.29 returns
/Users/mbx/.phpbrew/init:3: bad pattern: CLIFrameworkCommandBase::offsetExists(^[OB
/Users/mbx/.phpbrew/init:5: bad pattern: CLIFrameworkCommandBase::offsetGet(^[OB
/Users/mbx/.phpbrew/init:7: bad pattern: CLIFrameworkCommandBase::offsetSet(^[OB
/Users/mbx/.phpbrew/init:9: bad pattern: CLIFrameworkCommandBase::offsetUnset(^[OB
/Users/mbx/.phpbrew/init:17: unknown file attribute:
Also I got a lot of warnings when using phpbrew list and a bunch of other warnings. Isn't really playing nice with the latest MacOS 12.3.1 (21E258) as well.
It seems to be an issue with phpbrew not being compatible with PHP 8.1. I encountered this today and was able to fix it by installing (from Homebrew) an older PHP.
brew install [email protected]
brew link --force [email protected]
With that in place I was able to use any phpbrew-installed PHP up until an 8.1 release, wherein everything broke again.
@peckrob Thanks for clarification. In an attempt to get PHP7 installed I decided to go that route as well. For [email protected] you need to brew tap shivammathur/php and then you can quickly switch between versions that you don't have to compile in the first place. It's faster and more robust, since you can avoid all the necessities of building PHP by yourself.
Once I had PHP7 installed, I wasn't even bothering dealing with phpbrew anymore, I think it is a solid choice if you want to build PHP yourself.
Duplicated : #1245