- str_starts_with: documentation ( source)
<?php
namespace A;
$version = '10.';
if (str_starts_with($version, '10.')) {
class Comparator {
public static function test() {
echo "a";
}
}
} else {
class Comparator {
public static function test() {
echo "b";
}
}
}
Comparator::test();