Comments (3)
Hello,
It does not happen with an error handler correctly configured to respect error_reporting()
.
Check in your framework/application what is configuring the error handler (by calling set_error_handler
)
It should start by checking that the error needs to be reported with something like:
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
// mute-operator was used or error was explicitly set not to be reported as per the error level
if (!(error_reporting() & $errno)) {
return false;
}
// ...
Side note: the 2.66.0
version wouldn't receive a fix anyway, minor receive only security patches, features and normal bugfixes are released only on 2.x and 3.x stream for some times, then soon only on 3.x stream. It's generally not recommended to pin a minor version, you should consider updating regularly to the latest of ^2
(so 2.72.3 currently), then consider to upgrade to ^3
.
Thanks.
from carbon.
Well I don't have the ability to change error handlers or Composer settings (it's a third party app we use) but a check should be how it's done regardless; the error suppression operator has been a hacky solution for years.
from carbon.
Loggers must not ignore error_reporting()
, the code above is given in PHP documentation itself: https://www.php.net/manual/en/function.set-error-handler.php
It's meant to be handled this way.
BTW, you should call Carbon::setLocale("en_US");
(.utf8
has no meaning for Carbon locale, all our language files are UTF-8) and then you would not have any error logged. You can easily trim this encoding from the string:
$locale = "en_US.utf8";
Carbon::setLocale(preg_replace('/^([^.]+)\..*$/', '$1', $locale));
from carbon.
Related Issues (20)
- [Lang - hu] - Wrong short form (Február) HOT 1
- [Translation tool] uk_UA HOT 6
- How to get format in days hours minutes seconds in setCascadeFactors function? HOT 1
- Enable testing for Laravel 11 + Carbon 3
- [Translation tool] uk
- createFromFormat() weird output with format 'Y-m' in february HOT 1
- 3.0.0-rc2 rollback on dependency versions HOT 1
- Compile Error: Enum case value must be compile-time evaluatable -- Error v3 HOT 3
- Proposal to remove hard dependency on carbonphp/carbon-doctrine-types HOT 4
- Deprecation: Implicit conversion from float to int loses precision HOT 1
- PHPDoc on `CarbonImmutable::createFromFormat` incompatible with actual return type HOT 2
- Feature request: Support Symfony Forms HOT 4
- Carbon 3 createFromTimestamp undocumented timezone change HOT 3
- Bug: CarbonImmutable::createFromTimeString('first day of this year 00:00:00') returning February 1st instead of January 1st HOT 2
- [Translation tool] bg HOT 1
- Method isFuture returns an incorrect result HOT 3
- Wrong issue! HOT 1
- Format "2024-02-29" to Buddhist Era so to obtain "2567-02-29" HOT 4
- Taiwan is NOT the Province of China HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbon.