преобразовать
['a' => [11, 12], 'b' => [21, 22]]
в
[['a' => 11, 'b' => 12], ['a' =>21, 'b' => 22]]
12
из a
становится значением свойства b
, а 21
- наоборот? Опечатка? - наверное, в a
исходного массива лежат значения свойств a
результата, аналогично и с b
.array_map(fn($i) => array_combine(array_keys($arr), array_column($arr, $i)), array_keys(array_values($arr)[0]))
However, there are situations where errors can get lost in coroutines.
val unrelatedScope = MainScope() // example of a lost error suspend fun lostError() { // async without structured concurrency unrelatedScope.async { throw InAsyncNoOneCanHearYou("except") } }
Note this code is declaring an unrelated coroutine scope that will launch a new coroutine without structured concurrency. Remember at the beginning I said that structured concurrency is a combination of types and programming practices, and introducing unrelated coroutine scopes in suspend functions is not following the programming practices of structured concurrency.
The error is lost in this code because async assumes that you will eventually call await where it will rethrow the exception. However, if you never do call await, the exception will be stored forever waiting patiently waiting to be raised.
Structured concurrency guarantees that when a coroutine errors, its caller or scope is notified.
If you do use structured concurrency for the above code, the error will correctly be thrown to the caller.
suspend fun foundError() { coroutineScope { async { throw StructuredConcurrencyWill("throw") } } }
просто хотел узнать, что делали вы, после того как вы закончили основы
catch(Throwable $e)
if (!empty($_FILES['Files'])) {
$fileComponent = new fileComponent($_FILES['Files']); //Инициализируем класс
try {
$fileComponent->checkMime($mime); //$mime - атеншон!это откуда?незаметно подбросили полицаи?
..................
как я вижу, веб-разработка, в качестве ремесла, неуклонно загибается.
Работать и изучать приходится всё больше, а платят всё меньше.
Нужен какой-то ресурс, с нормальной взрослой аналитикой, на основе которого можно принять решение о том, что именно сейчас наиболее востребованно, и более-менее устойчиво.
Грубо говоря: что сейчас стоит начать учить, чтобы через полгода был вал заказов и море бабла? ))
Где сейчас бум идет, или намечается?
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RouteCollectionBuilder;
require_once __DIR__.'/../vendor/autoload.php';
$locator = new FileLocator([__DIR__.'/../data']);
$loader = new YamlFileLoader($locator);
$builder = new RouteCollectionBuilder($loader);
$builder->import('dir1/routes.yaml');
$builder->import('dir2/routes.yaml');
$routes = $builder->build();
var_dump($routes);
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Routing\Loader\GlobFileLoader;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RouteCollectionBuilder;
require_once __DIR__.'/../vendor/autoload.php';
$locator = new FileLocator([__DIR__.'/../data']);
$resolver = new LoaderResolver([
new GlobFileLoader($locator), // needs symfony/finder
new YamlFileLoader($locator),
]);
$loader = new DelegatingLoader($resolver);
$builder = new RouteCollectionBuilder($loader);
$builder->import('**/*/routes.yaml', '/', 'glob');
$routes = $builder->build();
var_dump($routes);