3v4l.org

run code in 300+ PHP versions simultaneously
<?php struct Catalogue { string $name; } struct Category { string $name; } function persist_category(Category $category) { query('INSERT INTO category .....', ['name' => $category->name]); } persist_category(Catalogue { name: 'foo' });
Output for 8.0.1 - 8.0.17, 8.1.0 - 8.1.4
Parse error: syntax error, unexpected identifier "Catalogue" in /in/rDAMZ on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.28
Parse error: syntax error, unexpected 'Catalogue' (T_STRING) in /in/rDAMZ on line 3
Process exited with code 255.

preferences:
154.76 ms | 1288 KiB | 6 Q