Trufa
Trufa

Reputation: 40717

Using rename_function() in PHP (Not working)

Maybe I am not understanding the rename_function(); function or it's use correctly.

Here is my first experimentation with this function:

<?php

rename_function('count', 'contar');

$var = array(
    "one",
    "two",
    "three"
    );

$number = contar($var);
echo $number;

?>

As you can see here it doesn't work

When I use it in MAMP Chrome gives me this error:

Server error.

The website encountered an error while retrieving http://localhost:8888/translate.php. It may be down for maintenance or configured incorrectly.

Any ideas why this could be?

Thanks in advance!

BTW: sorry if it is an absolute basic question but I can't figure it out!

Upvotes: 5

Views: 2790

Answers (2)

RusAlex
RusAlex

Reputation: 8575

you need to install pecl package apd https://www.php.net/manual/en/book.apd.php

Upvotes: 1

Pentium10
Pentium10

Reputation: 207902

The APD package is not installed for your PHP configuration.

Upvotes: 4

Related Questions