In PHP, what is the difference between the following function definitions?
function some_func(string|null $some_arg) function some_func(?string $some_arg) function some_func(string $some_arg = null) function some_func(?string $some_arg = null)
function some_func(string|null $some_arg) function some_func(?string $some_arg) function some_func(string $some_arg = null) function some_func(?string $some_arg = null)
I want to find the timezone with the country and region using geoip_time_zone_by_country_and_region() but seems it needs geoip ext to be installed which is not supported anymore and seems geoip2 just works with IP but I want to get the…
I can't figured out whats wrong with this. PHP 8.1 PHP Deprecated: Automatic conversion of false to array is deprecated $request = parse_url( $_SERVER['REQUEST_URI'] ); $request['path'] = ( ! empty( $request['path'] ) ) ? $request['path'] : '';
This works without any warnings in every version of PHP except 8 I think they have changed something with implode and I have tried all the examples to no avail. Perhaps I could get this done some other way. I…
I currently have all errors enabled for my site: error_reporting(E_ALL); However, in PHP 8.1, some functions are now deprecated: PHP Notice: Function date_sunset() is deprecated in index.php on line 14 Due to current requirements, I am unable to update the…
The below code is not printing anything in the browser. actually, It should show the header menu. if I remove ob_start(); and ob_end_clean() at least its printing menu without CSS. // Turn on output buffering HTML ob_start(); echo preg_replace( '/n|t/i',…
I want add PHP-code as text in laravel blade. (Something like adding code in stackoverflow) in blade file I have: {!! nl2br($article->body_ru) !!} in $article->body_ru I'm add huijlhgfyuhukik rfthkgjb ftygyjh <code> <?php namespace AppServices; use IlluminateSupportFacadesApp; use IlluminateSupportCollection; use stdClass;…
After upgrading to magento 2.4.5-p1 and to php 8.1 I get this error while I try to compile I tried to delete the vendor folder and did composer update but same results. any way to solve this issue? public_html$ bin/magento…
I'm trying to add pthreads extension on PHP 8.1 TS and it doesn't seem to work, It's sayin that it is not installed while in fact it is. PHP -v PHP 8.1.10 (cli) (built: Aug 30 2022 18:05:49) (ZTS Visual…
I am trying to upgrade Magento 2.4.3 Adobe Cloud version to 2.4.4 and I was successfully update the composer.json with necessary changes. Also I was able to run the di:compile command successfully. Now when I am trying to access my…