Dynamically typed languages still have types internally, they just look like this [0] (imagine it all implemented in assembly, without C's types, if you prefer).
[0]: https://github.com/php/php-src/blob/3709e74b5e495e210ada8039...
[0]: https://github.com/php/php-src/blob/3709e74b5e495e210ada8039...