| Instrucción | Qué hace |
|---|---|
| break | Sale del bucle por completo |
| continue | Salta la iteración actual |
| Uso típico | Buscar algo y detener |
| Uso típico | Filtrar o ignorar datos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $catalog = [ | |
| ["sku" => "LP-001", "name" => "Laptop", "price" => 1200, "stock" => 3], | |
| ["sku" => "MS-002", "name" => "Mouse", "price" => 25, "stock" => 0], | |
| ["sku" => "KB-003", "name" => "Teclado", "price" => 80, "stock" => 12], | |
| ]; | |
| $usersTask = [ | |
| ["id" => 1, "name" => "Ana", "email" => "ana@email.com", "role" => "user"], | |
| ["id" => 2, "name" => "Luis", "email" => "luis@email.com", "role" => "admin"], | |
| ["id" => 3, "name" => "María", "email" => "maria@email.com", "role" => "editor"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $cart = [ | |
| ["product" => "Laptop", "price" => 1200], | |
| ["product" => "Mouse", "price" => 20], | |
| ["product" => "Teclado", "price" => 80] | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $users = [ | |
| [ | |
| "id" => 1, | |
| "name" => "Ana García", | |
| "username" => "ana.garcia", | |
| "email" => "ana.garcia@example.com", | |
| "role" => "user", | |
| "status" => "active", | |
| "last_login" => "2026-01-20 09:15" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| echo "🛒 Operadores en PHP\n\n"; | |
| $price = 120.50; | |
| $qty = 3; | |
| $stock = 2; | |
| $coupon = "DEV10"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class OrderIntegrationTests : IAsyncLifetime | |
| { | |
| private CustomWebApplicationFactory _factory = null!; | |
| private HttpClient _httpClient = null!; | |
| public async Task InitializeAsync() | |
| { | |
| _factory = new CustomWebApplicationFactory(); | |
| _httpClient = _factory.GetHttpClient(); | |
| await Task.CompletedTask; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace DevTallesShop.Api.Tests.Integration; | |
| public class ProductIntegrationTests : IAsyncLifetime | |
| { | |
| private CustomWebApplicationFactory _factory = null!; | |
| private HttpClient _httpClient = null!; | |
| public async Task InitializeAsync() | |
| { | |
| _factory = new CustomWebApplicationFactory(); | |
| _httpClient = _factory.GetHttpClient(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CustomerIntegrationTests : IAsyncLifetime | |
| { | |
| private CustomWebApplicationFactory _factory = null!; | |
| private HttpClient _httpClient = null!; | |
| public async Task InitializeAsync() | |
| { | |
| _factory = new CustomWebApplicationFactory(); | |
| _httpClient = _factory.GetHttpClient(); | |
| await Task.CompletedTask; |
NewerOlder