Coder Social home page Coder Social logo

Comments (4)

krowinski avatar krowinski commented on May 24, 2024 1

Hi!

bcadd only accepts string as $left or $right https://www.php.net/manual/en/function.bcadd.php in your example you don't use
declare(strict_types=1); so php just casts null to string thats why it's working. Lib use strict types.
I don't want to jiggle types and handle null. You can fork this and remove "declare(strict_types=1)" from lib this should have the same behavior.

https://phpsandbox.io/n/patient-disk-ekez-sxkgs

from bcmath-extended.

TheLevti avatar TheLevti commented on May 24, 2024 1

Its makes no sense to support NULL for any of those relevant functions. Don't call the method if the value is null.

from bcmath-extended.

gnutix avatar gnutix commented on May 24, 2024 1

Then I guess if that's how you feel about it, that's how it'll be. I'll keep the fork, as I do need to have that null accepted and handled like it did on PHP 7.x.

PS : https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

from bcmath-extended.

gnutix avatar gnutix commented on May 24, 2024

Did you take a look at my PR ? I would much rather not have to maintain a separate package, especially for such a change that doesn't seem so extreme in philosophy.

But in the meantime, I've created a fork like you suggested, so here it is : https://packagist.org/packages/gammadia/bcmath-extended-nullable

from bcmath-extended.

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.