PHP has seen many improvements for the last few years, especially adding the type system, which helps us to avoid runtime errors and make the debugging easier. However, the built-in type system in PHP has some missing parts; for example, we cannot have a strictly typed array, which we are going to address this issue here, and how we can solve it.

Problem with arrays

The problem with arrays in PHP is that they don’t support type systems. For example we cannot specify an array to only accept integers.

$array = [];
$array[] = 1;
$array[] = 'first';
$array[] = 'second';
foreach($array as $item){…

For the last few years, scraping websites and gathering information from different sources has become one of the industry’s primary tools. By having a scraper, companies can collect data from various websites and feed them to their AI platforms to enhance their algorithms and results.

That’s why I decided to create a tutorial on how to make a web scraper in Symfony to fetch data from different websites. This project aims to have a dynamic and extendable web scraper that works with most websites out there.


The thing we want to achieve here is a system to scrap and gather…

Saeed Moqadam

My ideas, thoughts, and tutorials about life, internet, and programming.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store