Coder Social home page Coder Social logo

Comments (3)

kylekatarnls avatar kylekatarnls commented on July 4, 2024

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.

miken32 avatar miken32 commented on July 4, 2024

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.

kylekatarnls avatar kylekatarnls commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.