Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

match expression matches first expression within a function/method using apache2handler sapi #11134

Closed
@myersem2

Description

@myersem2

Description

This issue is visible onApache/2.4.52, the cli works as expected however something with the sapi (apache2handler) gives you bad results. If you run the following code you will get the correct results on the first page load however if you refresh the page you will get the document incorrect matches below.

The following code:

<test.php>

<?php// TEST-1: Functioning as expected - PASS$subj =$unset_variable ??null;$result =match ($subj) {'Some-Text' =>'Incorect-Match-1','Other-Text' =>'Incorect-Match-2',default =>'Expected-Result',};var_dump($result);// string 'Expected-Result' (length=15)// TEST-2: Incorrectly matches first expression - FAILSfunctiontestFunction1(){$subj =$unset_variable ??null;$result =match ($subj) {'Some-Text' =>'Incorect-Match-1','Other-Text' =>'Incorect-Match-2',default =>'Expected-Result',    };var_dump($result);// string 'Incorect-Match-1' (length=16)}testFunction1();// TEST-3: Incorrectly matches first expression - FAILSclass TestClass1{publicfunction__construct()    {$subj =$unset_variable ??null;$result =match ($subj) {'Some-Text' =>'Incorect-Match-1','Other-Text' =>'Incorect-Match-2',default =>'Expected-Result',        };var_dump($result);// string 'Incorect-Match-1' (length=16)    }}$test_class =newTestClass1();// TEST-4: Functioning as expected - PASSfunctiontestFunction2(){$subj =$unset_variable ??null;$result =match ($subj) {'Some-Text' =>'Incorect-Match-1',//'Other-Text' => 'Incorect-Match-2',default =>'Expected-Result',    };var_dump($result);// string 'Expected-Result' (length=15)}testFunction2();// TEST-5: Functioning as expected - PASSclass TestClass2{publicfunction__construct()    {$subj =$unset_variable ??null;$result =match ($subj) {'Some-Text' =>'Incorect-Match-1',//'Other-Text' => 'Incorect-Match-2',default =>'Expected-Result',        };var_dump($result);// string 'Expected-Result' (length=15)    }}$test_class =newTestClass2();### PHP VersionPHP8.1.2### Operating SystemUbuntu22.04.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp