2,721 questions
1
vote
2
answers
125
views
Can I check if ReflectionType is instance of another type?
I want to check if a callable's return type is an instance of another type. For example, let's say I a have:
A class Pigeon which extends Animal.
A function addSupplier() which takes a callable ...
0
votes
0
answers
238
views
Debian 10 - Remove 2 different versions of PHP
I have a really screwed up Debian 10 system. It has about 20 years worth of customer records I have been tasked with recovering. I'm pretty sure the problem started, when someone upgraded it from ...
1
vote
0
answers
69
views
Can I persist a flag across all sessions?
I have an expensive operation that runs in my PHP application when the /api/replicate endpoint is requested. The operation takes roughly 30 seconds, so I want to prevent this endpoint from being ...
0
votes
1
answer
92
views
overwriting basic count function in laravel globally
We are upgrading our laravel project, and it includes a language upgrade from php7 to php8. Consider this code:
$a = new stdClass()
count($a)
Will result in:
// php7
==> 1
// php8
==> ...
0
votes
1
answer
91
views
Errors PHP Notice: Undefined offset:, Trying to access array offset on value of type null
I get multiples php errors in server log , the error show on 2 lines of my php code, However php script is working but it show these errors in server log.
PHP Notice: Trying to access array offset on ...
0
votes
1
answer
426
views
Drupal 7 modules appear to be php8 compatible but crashes when server changes from php7.3 to php8.1
Somewhere it said that Drupal 7.8 updated core and modules are php compatible with php8.1.
However, when I change the cpanel multiphpmanager for the Drupal 7 domain to php8.1, the site crashes.
The ...
-1
votes
2
answers
85
views
$_GET not display character like & [duplicate]
i tried to create a script to redirect link of amazon, but when pass the link in a get variable url not return Url after the character &, i tried to echo the variable $_GET['tolink'] but display a ...
2
votes
1
answer
3k
views
Why i get alert : "This page has expired" in laravel livewire upon logging back in in?
I created a step-by-step form using Laravel Livewire, following this tutorial: here.
However, I'm experiencing some issues when logging in after logging out, when I submit the form I get a alert:
&...
0
votes
0
answers
146
views
Encryption/Decryption with Sodium extension with php 5.6 not working
My Old project is on 5.6 so Sodium extension for Encryption/Decryption is not working so my system engineer set some setting that if I run file with .php7 extension it run on php 7 and normal .php ...
0
votes
0
answers
491
views
firebase/php-jwt throws Signature verification failed error on every scenario in PHP 7.4
I've installed firebase/php-jwt as described in the repo.
In composer file.
"firebase/php-jwt": "~5.5.1",
"paragonie/sodium_compat" : "~1.19.0",
In my PHP file
...
0
votes
1
answer
41
views
Under the Laravel 7 (php7) system, if I query any id of my table, there is no result
Under the Laravel 7 (php7) system, if I query any id of my table, there is no result, but if I enter the id value as a string, then there is a result.
In the table, the id column type is int(11). ...
1
vote
1
answer
82
views
Cannot access the properties inside the Closure object in php 7
I have this in my unit test code:
$data = $this->_createSfApiFindMock($cisDataCount);
var_dump($data()); die();
output:
class Closure#731 (3) {
public $static =>
array(4) {
'...
0
votes
2
answers
524
views
Prestashop 1.7: Use statement not working in module main php file
I would like to edit the kpi section on the admin orders page,in Prestashop 1.7, so i created a module, i tried to use a custom module class, in the module's main php file, but i got error
so I ...
-1
votes
2
answers
513
views
Laravel ErrorException Undefined variable in my public function
I ran into the error:
ErrorException Undefined variable: pesan
I have gone through similar problems solved here but none of the solutions have worked for me.
The error is thrown from my ...
2
votes
0
answers
364
views
Errors in PHP 7 - why set_error_handler() can't catch this type of error?
Fatal error: Uncaught TypeError...
Why is this an exception according to PHP if TypeError inherits from Error? Why can't set_error_handler() catch this type of error?
https://www.php.net/manual/en/...