3v4l.org

run code in 300+ PHP versions simultaneously
<?php $BRANCHING_PROFILE = "09. Reading Comprehension - Post Test"; if (preg_match('/(Reading Comprehension)/', $BRANCHING_PROFILE ) === 1) { $code='AC2'; } else if (preg_match('/(Sentence Skills)/', $BRANCHING_PROFILE) === 1) { $code='AC1'; } else if (preg_match('/(Arithmetic)/', $BRANCHING_PROFILE) === 1) { $code='AC5'; } else if (preg_match('/(Elementary Algebra/', $BRANCHING_PROFILE) === 1) { $code='AC6'; } else if (preg_match('/College Level Math/i', $BRANCHING_PROFILE) === 1) { $code='AC7'; } else if (preg_match('(Reading Comprehension - Post Test)', $BRANCHING_PROFILE) === 1) { $code='PA2'; } else if (preg_match('/Sentence Skills - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA1'; } else if (preg_match('/Arithmetic - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA5'; } else if (preg_match('/Elementary Algebra - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA6'; } else if (preg_match('/College Level Math - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA7'; } var_dump(preg_match('(Reading Comprehension - Post Test)', $BRANCHING_PROFILE)); echo "Branching Profile: " . $BRANCHING_PROFILE . "\n\r"; echo "Code: " . $code;
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
int(1) Branching Profile: 09. Reading Comprehension - Post Test Code: AC2

preferences:
100.87 ms | 408 KiB | 5 Q