Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower Than Pure PHP #2433

Open
mailmug opened this issue Aug 1, 2024 · 0 comments
Open

Slower Than Pure PHP #2433

mailmug opened this issue Aug 1, 2024 · 0 comments

Comments

@mailmug
Copy link

mailmug commented Aug 1, 2024

Hi
I tried with the following code. Then I tried using the xdebug. I think it is slower than pure PHP functions.
Please help me.

zep

namespace Utils;

class Greeting
{

    public static function say()
    {
        int item;
        for item in range(0, 100000) {
            string i = "abc";
            string k = str_replace("b", "--", i);
            string z = "abc";
            string m = str_replace("b", "--", z);
            string t = "rrrr";
            string g = str_replace("b", "--", t);
            string q = "rrrr";
            string u = str_replace("b", "--", q);
        }

        echo "okk";
    }

}

PHP CODE

 <?php 

noo();

Utils\Greeting::say();


function noo(){
    for ($ii=0; $ii++; $ii<= 100000) {
        $i = "abc";
        $k = str_replace("b", "--", $i);
        $z = "abc";
        $m = str_replace("b", "--", $z);
        $t = "rrrr";
        $g = str_replace("b", "--", $t);
        $q = "rrrr";
        $u = str_replace("b", "--", $q);
    }
    echo "okk";
}
@niden niden transferred this issue from zephir-lang/documentation Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant