2

I am using this

https://github.com/raulfraile/LadybugBundle

They have three functions

ld($var1[, $var2[, ...]]): shortcut for ladybug_dump

ldd($var1[, $var2[, ...]]): shortcut for ladybug_dump_die

ldr($format, $var1[, $var2[, ...]]): shortcut for ladybug_return

First two are working but for third it says undefined function

Also i tried this to dump json then i also get error

ld(json_decode($jsonContent, true));

and i get this

UndefinedFunctionException: Attempted to call function "bccomp" from namespace "Ladybug\Type" in /var/www/html/site/Symfony/vendor/raulfraile/ladybug/src/Ladybug/Type/FloatType.php line 115

1 Answer 1

2

The bccomp() function needs the php BC Math extension.

These functions are only available if PHP was configured with --enable-bcmath .

The Windows version of PHP has built-in support for this extension

Check php -i | grep -i bcmath ...

There should be a line ...

BCMath support => enabled

... if the extension is enabled. Otherwise you'll probably need to recompile php with --enable-bcmath.

Sign up to request clarification or add additional context in comments.

7 Comments

is there any other way to fix that without recompiling php
What operating system are you using? you might be able to find a repository with a pre-compiled version that was built with the --enable-bcmath flag. then you'd just need to add the repo and invoke apt-get upgrade.
i am using centos . also beside this error why can't i access ldr function
Which version of Centos are you using? Did you manage to enable bcmath? what exception do you get when trying to invoke ldr() ? The one in the question or a different one ?
i am using centos6.4 . error i get is Function ldr is undefined in current namespace. actually i don't want to recompile php so i left that bc math. i end up using Kint
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.