PHPMatcher is a simple php library created to match values against patterns. It's mostly used for API's functional tests where response needs to be compared against patterns with placeholders for variables.

This website is a sandbox for the library, give it a try:

Value
Pattern
Reset

Programming Languages

Backtrace

#1 Matcher Coduo\PHPMatcher\Matcher matching value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#2 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (all) matching value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#3 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) can match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#4 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) matching value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#5 Matcher Coduo\PHPMatcher\Matcher\CallbackMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#6 Matcher Coduo\PHPMatcher\Matcher\ExpressionMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#7 Matcher Coduo\PHPMatcher\Matcher\NullMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#8 Matcher Coduo\PHPMatcher\Matcher\StringMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#9 Matcher Coduo\PHPMatcher\Matcher\IntegerMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#10 Matcher Coduo\PHPMatcher\Matcher\BooleanMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#11 Matcher Coduo\PHPMatcher\Matcher\DoubleMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#12 Matcher Coduo\PHPMatcher\Matcher\NumberMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#13 Matcher Coduo\PHPMatcher\Matcher\TimeMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#14 Matcher Coduo\PHPMatcher\Matcher\DateMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#15 Matcher Coduo\PHPMatcher\Matcher\DateTimeMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#16 Matcher Coduo\PHPMatcher\Matcher\TimeZoneMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#17 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher can match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#18 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher matching value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#19 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher failed to match value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#20 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher error: "{"index":1,"tags":["xyz"]}" does not match "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}".
#21 Matcher Coduo\PHPMatcher\Matcher\WildcardMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#22 Matcher Coduo\PHPMatcher\Matcher\UuidMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#23 Matcher Coduo\PHPMatcher\Matcher\JsonObjectMatcher can't match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#24 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) failed to match value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#25 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) error: "{"index":1,"tags":["xyz"]}" does not match "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}".
#26 Matcher Coduo\PHPMatcher\Matcher\JsonMatcher can match pattern "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}"
#27 Matcher Coduo\PHPMatcher\Matcher\JsonMatcher matching value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#28 Matcher Coduo\PHPMatcher\Matcher\ArrayMatcher matching value "Array(2)" with "Array(2)" pattern
#29 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) can match pattern "@integer@"
#30 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) matching value "1" with "@integer@" pattern
#31 Matcher Coduo\PHPMatcher\Matcher\OrMatcher can't match pattern "@integer@"
#32 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) can match pattern "@integer@"
#33 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) matching value "1" with "@integer@" pattern
#34 Matcher Coduo\PHPMatcher\Matcher\CallbackMatcher can't match pattern "@integer@"
#35 Matcher Coduo\PHPMatcher\Matcher\ExpressionMatcher can't match pattern "@integer@"
#36 Matcher Coduo\PHPMatcher\Matcher\NullMatcher can't match pattern "@integer@"
#37 Matcher Coduo\PHPMatcher\Matcher\StringMatcher can't match pattern "@integer@"
#38 Matcher Coduo\PHPMatcher\Matcher\IntegerMatcher can match pattern "@integer@"
#39 Matcher Coduo\PHPMatcher\Matcher\IntegerMatcher matching value "1" with "@integer@" pattern
#40 Matcher Coduo\PHPMatcher\Matcher\IntegerMatcher successfully matched value "1" with "@integer@" pattern
#41 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) successfully matched value "1" with "@integer@" pattern
#42 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) successfully matched value "1" with "@integer@" pattern
#43 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) can match pattern "@array@.repeat("@string@")"
#44 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) matching value "Array(1)" with "@array@.repeat("@string@")" pattern
#45 Matcher Coduo\PHPMatcher\Matcher\OrMatcher can't match pattern "@array@.repeat("@string@")"
#46 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) can match pattern "@array@.repeat("@string@")"
#47 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) matching value "Array(1)" with "@array@.repeat("@string@")" pattern
#48 Matcher Coduo\PHPMatcher\Matcher\CallbackMatcher can't match pattern "@array@.repeat("@string@")"
#49 Matcher Coduo\PHPMatcher\Matcher\ExpressionMatcher can't match pattern "@array@.repeat("@string@")"
#50 Matcher Coduo\PHPMatcher\Matcher\NullMatcher can't match pattern "@array@.repeat("@string@")"
#51 Matcher Coduo\PHPMatcher\Matcher\StringMatcher can't match pattern "@array@.repeat("@string@")"
#52 Matcher Coduo\PHPMatcher\Matcher\IntegerMatcher can't match pattern "@array@.repeat("@string@")"
#53 Matcher Coduo\PHPMatcher\Matcher\BooleanMatcher can't match pattern "@array@.repeat("@string@")"
#54 Matcher Coduo\PHPMatcher\Matcher\DoubleMatcher can't match pattern "@array@.repeat("@string@")"
#55 Matcher Coduo\PHPMatcher\Matcher\NumberMatcher can't match pattern "@array@.repeat("@string@")"
#56 Matcher Coduo\PHPMatcher\Matcher\TimeMatcher can't match pattern "@array@.repeat("@string@")"
#57 Matcher Coduo\PHPMatcher\Matcher\DateMatcher can't match pattern "@array@.repeat("@string@")"
#58 Matcher Coduo\PHPMatcher\Matcher\DateTimeMatcher can't match pattern "@array@.repeat("@string@")"
#59 Matcher Coduo\PHPMatcher\Matcher\TimeZoneMatcher can't match pattern "@array@.repeat("@string@")"
#60 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher can match pattern "@array@.repeat("@string@")"
#61 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher matching value "Array(1)" with "@array@.repeat("@string@")" pattern
#62 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher failed to match value "Array(1)" with "@array@.repeat("@string@")" pattern
#63 Matcher Coduo\PHPMatcher\Matcher\ScalarMatcher error: "Array(1)" does not match "@array@.repeat("@string@")".
#64 Matcher Coduo\PHPMatcher\Matcher\WildcardMatcher can't match pattern "@array@.repeat("@string@")"
#65 Matcher Coduo\PHPMatcher\Matcher\UuidMatcher can't match pattern "@array@.repeat("@string@")"
#66 Matcher Coduo\PHPMatcher\Matcher\JsonObjectMatcher can't match pattern "@array@.repeat("@string@")"
#67 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) failed to match value "Array(1)" with "@array@.repeat("@string@")" pattern
#68 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) error: "Array(1)" does not match "@array@.repeat("@string@")".
#69 Matcher Coduo\PHPMatcher\Matcher\TextMatcher can match pattern "@array@.repeat("@string@")"
#70 Matcher Coduo\PHPMatcher\Matcher\TextMatcher matching value "Array(1)" with "@array@.repeat("@string@")" pattern
#71 Matcher Coduo\PHPMatcher\Matcher\TextMatcher failed to match value "Array(1)" with "@array@.repeat("@string@")" pattern
#72 Matcher Coduo\PHPMatcher\Matcher\TextMatcher error: array "Array(1)" is not a valid string.
#73 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) failed to match value "Array(1)" with "@array@.repeat("@string@")" pattern
#74 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (array) error: array "Array(1)" is not a valid string.
#75 Expander repeat matching value "Array(1)"
#76 Matcher Coduo\PHPMatcher\Matcher matching value "xyz" with "@string@" pattern
#77 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (all) matching value "xyz" with "@string@" pattern
#78 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) can match pattern "@string@"
#79 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) matching value "xyz" with "@string@" pattern
#80 Matcher Coduo\PHPMatcher\Matcher\CallbackMatcher can't match pattern "@string@"
#81 Matcher Coduo\PHPMatcher\Matcher\ExpressionMatcher can't match pattern "@string@"
#82 Matcher Coduo\PHPMatcher\Matcher\NullMatcher can't match pattern "@string@"
#83 Matcher Coduo\PHPMatcher\Matcher\StringMatcher can match pattern "@string@"
#84 Matcher Coduo\PHPMatcher\Matcher\StringMatcher matching value "xyz" with "@string@" pattern
#85 Matcher Coduo\PHPMatcher\Matcher\StringMatcher successfully matched value "xyz" with "@string@" pattern
#86 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (scalars) successfully matched value "xyz" with "@string@" pattern
#87 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (all) successfully matched value "xyz" with "@string@" pattern
#88 Matcher Coduo\PHPMatcher\Matcher successfully matched value "xyz" with "@string@" pattern
#89 Expander repeat successfully matched value "Array(1)"
#90 Matcher Coduo\PHPMatcher\Matcher\ArrayMatcher successfully matched value "Array(1)" with "@array@.repeat("@string@")" pattern
#91 Matcher Coduo\PHPMatcher\Matcher\ArrayMatcher successfully matched value "Array(2)" with "Array(2)" pattern
#92 Matcher Coduo\PHPMatcher\Matcher\JsonMatcher successfully matched value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#93 Matcher Coduo\PHPMatcher\Matcher\ChainMatcher (all) successfully matched value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern
#94 Matcher Coduo\PHPMatcher\Matcher successfully matched value "{"index":1,"tags":["xyz"]}" with "{"index":"@integer@","tags":"@array@.repeat(\"@string@\")"}" pattern